ams.opt.omodel.Constraint#

class ams.opt.omodel.Constraint(name: str | None = None, e_str: str | None = None, info: str | None = None, type: str | None = 'uq')[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.

typestr, optional

The type of constraint, which determines the mathematical relationship. Possible values include 'uq' (inequality, default) and 'eq' (equality).

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, type: str | None = 'uq')[source]#

Methods

parse([no_code])

Parse the constraint.

Attributes

class_name

Return the class name

n

Return the number of elements.

shape

Return the shape.

size

Return the size.

v

Return the CVXPY constraint LHS value.

v2

Return the calculated constraint LHS value.