Bounds ¶
Represents bounds for a variable (only supported for real and integer variables).
A Bounds
object defines the valid interval for a variable. Bounds are inclusive,
and can be partially specified by providing only a lower or upper limit. If neither
is specified, the variable is considered unbounded.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
lower
|
float
|
Lower bound of the variable. Defaults to negative infinity if not specified. |
...
|
upper
|
float
|
Upper bound of the variable. Defaults to positive infinity if not specified. |
...
|
Examples:
Notes
- Bounds are only meaningful for variables of type
Vtype.Real
orVtype.Integer
. - If both bounds are omitted, the variable is unbounded.
__init__ ¶
__init__(
lower: float | type[Unbounded] | None = ...,
upper: float | type[Unbounded] | None = ...,
) -> None
Create bounds for a variable.
See class-level docstring for full documentation.