ams.opt.omodel.Constraint#
- class ams.opt.omodel.Constraint(name: str | None = None, e_str: str | None = None, info: str | None = None, is_eq: str | None = False)[source]#
Base class for constraints.
This class is used as a template for defining constraints. Each instance of this class represents a single constraint.
- Parameters:
- namestr, optional
A user-defined name for the constraint.
- e_strstr, optional
A mathematical expression representing the constraint.
- infostr, optional
Additional informational text about the constraint.
- is_eqstr, optional
Flag indicating if the constraint is an equality constraint. False indicates an inequality constraint in the form of <= 0.
- Attributes:
- is_disabledbool
Flag indicating if the constraint is disabled, False by default.
- rtnams.routines.Routine
The owner routine instance.
- __init__(name: str | None = None, e_str: str | None = None, info: str | None = None, is_eq: str | None = False)[source]#
Methods
parse
([no_code])Parse the constraint.
Attributes
Return the class name
Return the number of elements.
Return the shape.
Return the size.
Return the CVXPY constraint LHS value.
Return the calculated constraint LHS value.