Constraint

class Constraint

Methods

__init__

__init__

is_satisfied

is_satisfied

Attributes

conditional

conditional property

label

label property

penalty

penalty property

weight

weight property

__add__(self, arg: Constraint, /) ConstraintList

__add__

Parameters:

arg (Constraint)

Return type:

ConstraintList

__eq__(self, arg: object, /) bool

__eq__

Parameters:

arg (object)

Return type:

bool

__imul__(self, arg: float, /) Constraint

__imul__

Parameters:

arg (float)

Return type:

Constraint

__init__(self, left: Poly, bounds: tuple[float | None, float | None], penalty: Poly, label: str = '') None
__init__(self, left: Poly, eq: float, penalty: Poly, label: str = '') None
__init__(self, left: Poly, le: float, penalty: Poly, label: str = '') None
__init__(self, left: Poly, ge: float, penalty: Poly, label: str = '') None

__init__

Overload 1.

Args:
  • left (amplify.Poly)

  • bounds (tuple[float | None, float | None])

  • penalty (amplify.Poly)

  • label (str): Defaults to ''.

Overload 2.

Args:
  • left (amplify.Poly)

  • eq (float)

  • penalty (amplify.Poly)

  • label (str): Defaults to ''.

Overload 3.

Args:
  • left (amplify.Poly)

  • le (float)

  • penalty (amplify.Poly)

  • label (str): Defaults to ''.

Overload 4.

Args:
  • left (amplify.Poly)

  • ge (float)

  • penalty (amplify.Poly)

  • label (str): Defaults to ''.

__itruediv__(self, arg: float, /) Constraint

__itruediv__

Parameters:

arg (float)

Return type:

Constraint

__mul__(self, arg: float, /) Constraint

__mul__

Parameters:

arg (float)

Return type:

Constraint

__ne__(self, arg: object, /) bool

__ne__

Parameters:

arg (object)

Return type:

bool

__radd__(self, arg: int, /) Constraint

__radd__

Parameters:

arg (int)

Return type:

Constraint

__repr__(self) str

__repr__

Return type:

str

__rmul__(self, arg: float, /) Constraint

__rmul__

Parameters:

arg (float)

Return type:

Constraint

__str__(self) str

__str__

Return type:

str

__truediv__(self, arg: float, /) Constraint

__truediv__

Parameters:

arg (float)

Return type:

Constraint

is_satisfied(self, values: Values) bool
is_satisfied(
self,
mapping: Mapping[Poly, float | int] | Mapping[Variable, float | int],
) bool

is_satisfied

Overload 1.

Args:
  • values (amplify.Values)

Returns:

bool:

Overload 2.

Args:
  • mapping (collections.abc.Mapping[amplify.Poly, float | int] | collections.abc.Mapping[amplify.Variable, float | int])

Returns:

bool:

property conditional

conditional property

Return type:

tuple[Poly, Literal[‘EQ’, ‘GE’, ‘GT’, ‘LE’, ‘LT’, ‘BW’], float | tuple[float, float]]

property label

label property

Return type:

str

property penalty

penalty property

Return type:

Poly

property weight

weight property

Return type:

float