AttachedDecisionVariable#
- class AttachedDecisionVariable#
Attached decision variable — a write-through handle bound to a host (
InstanceorParametricInstance).AttachedDecisionVariableis returned byadd_decision_variable(v)(insertion),attached_decision_variable(id)(lookup), and thedecision_variablesgetter on both hosts. Reads pull live data from the parent host's SoA store and metadata setters write back through to it. Handles also participate in arithmetic (x + y,2 * xetc.) viaToFunction— only the id is consumed for that, no host borrow is taken, so arithmetic works even while the host is mutably borrowed elsewhere. Calldetach()for an independentDecisionVariablesnapshot.DecisionVariableMetadatahas noprovenancefield, so the write-through surface omits the corresponding getter.- __add__(rhs: ScalarLike | LinearLike | Parameter) Linear#
- __add__(rhs: Quadratic) Quadratic
- __add__(rhs: Polynomial) Polynomial
- __add__(rhs: Function) Function
- __copy__() AttachedDecisionVariable#
- __eq__(other: ToFunction) Constraint#
Create an equality constraint:
self == other→ConstraintwithEqualToZero.
- __ge__(other: ToFunction) Constraint#
Create a greater-than-or-equal constraint.
- __le__(other: ToFunction) Constraint#
Create a less-than-or-equal constraint.
- __mul__(rhs: ScalarLike) Linear#
- __mul__(rhs: LinearLike | Parameter) Quadratic
- __mul__(rhs: Quadratic | Polynomial) Polynomial
- __mul__(rhs: Function) Function
- __neg__() Linear#
Negation operator:
-x→Linear(-1 * x).
- __radd__(lhs: ScalarLike | LinearLike | Parameter) Linear#
- __radd__(lhs: Quadratic) Quadratic
- __radd__(lhs: Polynomial) Polynomial
- __radd__(lhs: Function) Function
- __repr__() str#
- __rmul__(lhs: ScalarLike) Linear#
- __rmul__(lhs: LinearLike | Parameter) Quadratic
- __rmul__(lhs: Quadratic | Polynomial) Polynomial
- __rmul__(lhs: Function) Function
- __rsub__(lhs: ScalarLike | LinearLike | Parameter) Linear#
- __rsub__(lhs: Quadratic) Quadratic
- __rsub__(lhs: Polynomial) Polynomial
- __rsub__(lhs: Function) Function
- __sub__(rhs: ScalarLike | LinearLike | Parameter) Linear#
- __sub__(rhs: Quadratic) Quadratic
- __sub__(rhs: Polynomial) Polynomial
- __sub__(rhs: Function) Function
- add_description(description: str) None#
- add_name(name: str) None#
- add_parameter(key: str, value: str) None#
- detach() DecisionVariable#
Return a
DecisionVariablesnapshot of the current state. Mutations on the returned object do not propagate back.
- set_description(description: str) None#
- set_name(name: str) None#
Set the name. Writes through to the parent host's SoA metadata store.
- property bound: Bound#
Read-only property.
- property description: str#
Read-only property.
- property id: int#
Read-only property.
The id this handle points at.
- property kind: int#
Read-only property.
- property name: str#
Read-only property.
- property parameters: dict[str, str]#
Read-only property.
- property subscripts: list[int]#
Read-only property.