EvaluatedConstraint

EvaluatedConstraint#

class EvaluatedConstraint#
__eq__(other: object, /) → bool#
is_feasible(*, atol: float) → bool#

Check feasibility using the supplied absolute tolerance.

The query compares the stored violation with atol. It does not re-evaluate the function or canonicalize the input state.

violation() → float#

Calculate the violation (constraint breach) value for this constraint

Returns the amount by which this constraint is violated:

  • For \(f(x) = 0\): returns \(|f(x)|\)

  • For \(f(x) \leq 0\): returns \(\max(0, f(x))\)

Zero implies feasibility. A small positive violation may also be feasible within the supplied query tolerance; the residual is not rounded to zero.

property description: Optional[str]#

Read-only property.

Modeling description, if supplied.

property dual_variable: Optional[float]#

Get the dual variable value

property equality: Equality#

Read-only property.

Get the constraint equality type

property evaluated_value: float#

Read-only property.

Get the evaluated constraint value

property name: Optional[str]#

Read-only property.

Modeling name, if supplied.

property parameters: dict[str, str]#

Read-only property.

Modeling parameters.

property provenance: list[Provenance]#

Read-only property.

Transformation lineage, preserving the source constraint family.

property removed_reason: Optional[str]#

Read-only property.

Reason this constraint was removed before evaluation, or None.

property removed_reason_parameters: dict[str, str]#

Read-only property.

Parameters of the removal reason; empty for an active constraint.

property subscripts: list[int]#

Read-only property.

Modeling subscripts.

property used_decision_variable_ids: set[int]#

Read-only property.

Get the used decision variable IDs