gana.sets.constraint#
General Constraint Class
Functions
|
Deep copy operation on arbitrary Python objects. |
|
Display a Python object in all frontends. |
Classes
|
Represents a relationship between Parameters, Variables, or Expressions. |
|
function cases |
|
- class C(function: F | V, leq: bool = False, parent: C = None, pos: int = None, nn: bool = False, category: str = 'General')[source]#
Bases:
objectRepresents a relationship between Parameters, Variables, or Expressions.
This class is not intended to be used directly. It is constructed based on relationships between parameter sets, variable sets, or function sets.
- Parameters:
function (F) – Function set
leq (bool, optional) – If the constraint is less than or equal to. Defaults to False.
parent (C, optional) – Parent constraint set. Defaults to None.
pos (int, optional) – Position of the constraint in the set. Defaults to None.
nn (bool, optional) – If the constraint is non-negative. Defaults to False.
- Variables:
_ (list[Cons]) – List of constraints
function (F) – Function set
leq (bool) – If the constraint is less than or equal to
binding (bool) – If the constraint is binding
nn (bool) – If the constraint is non-negative
index (P) – Index of the constraint set (product of all indices)
eq (bool) – If the constraint is an equality constraint
name (str) – Name of the constraint (shows the operation)
n (int) – Number of the set in the program
pname (str) – Name given by user in program
- Raises:
ValueError – Adding constraints of different types (leq and eq)
ValueError – Subtracting constraints of different types (leq and eq)
ValueError – Cannot multiply constraints
ValueError – Cannot divide constraints
- property name: str#
- categorize(category: str)[source]#
Categorizes the constraint
- Parameters:
category (str) – Category name
- property A: list[float | None]#
Variable Coefficients
- property P: list[None | int]#
Variables
- property B: float | None#
Constant
- property F: float | None#
- property Z: float | None#
- property matrix: dict#
Matrix as dict
- property eq#
Equality Constraint
- property one#
element one in function
- property two#
element two in function
- property longname: str#
Long name