1 core.expressions.Variable
core.expressions.Variable(
name,
lb=None,
ub=None,
domain='continuous',
obj=0.0,
sort_key=None,
metadata_callback=None,
)A decision variable in an optimization problem.
1.1 Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| name | str | Unique identifier for this variable. | required |
| lb | float | None | Lower bound (None for unbounded). | None |
| ub | float | None | Upper bound (None for unbounded). | None |
| domain | Literal['continuous', 'integer', 'binary'] | Variable type - ‘continuous’, ‘integer’, or ‘binary’. | 'continuous' |
| obj | float | int | Mutable linear objective coefficient. Changes are applied on the next solve, including when solver data has already been cached. | 0.0 |
1.2 Example
x = Variable(“x”, lb=0, ub=10) y = Variable(“y”, domain=“binary”) x.evaluate({“x”: 5.0}) 5.0