Variable¶
- class Variable¶
Class for variable information. Instances are typically obtained via
as_variable()orvariables.Methods
Attributes
Variable ID number.
Lower bound of the variable.
Variable name.
Variable type.
Upper bound of the variable.
- __eq__(self, arg: object, /) bool¶
- パラメータ:
arg (object)
- 戻り値の型:
bool
- __init__(*args, **kwargs)¶
- __ne__(self, arg: object, /) bool¶
- パラメータ:
arg (object)
- 戻り値の型:
bool
- __repr__(self) str¶
Return a developer-friendly string representation of the variable.
- 戻り値の型:
str
- __str__(self) str¶
Return a human-readable string representation of the variable.
- 戻り値の型:
str
- property id¶
Variable ID number.
An integer assigned starting from
0in order of issuance.- 戻り値の型:
int
- property lower_bound¶
Lower bound of the variable.
This property is valid for Integer or Real variables.
Noneand-infboth mean \(-\infty\).infleaves no value, so it raises aValueError. A Binary or an Ising variable holds no bound. It accepts a value that keeps every value of its set, such as0for Binary, and it raises aValueErrorfor a value that narrows that set. Useequal_to()to fix a variable to one value.- 戻り値の型:
float | None
- property name¶
Variable name.
- 戻り値の型:
str
- property type¶
Variable type.
- 戻り値:
Corresponding value in
VariableType.- 戻り値の型:
- property upper_bound¶
Upper bound of the variable.
This property is valid for Integer or Real variables.
Noneandinfboth mean \(+\infty\).-infleaves no value, so it raises aValueError. A Binary or an Ising variable holds no bound. It accepts a value that keeps every value of its set, such as1for Binary, and it raises aValueErrorfor a value that narrows that set. Useequal_to()to fix a variable to one value.- 戻り値の型:
float | None