Constant
class¶
Bases: Term
Represents a constant value in an optimization model.
The Constant
class is a subclass of Term
and represents a fixed value that remains constant
throughout the optimization process. It is typically used to represent known values or
parameters in an optimization model.
Source code in pyorlib/algebra/terms/constants/constant.py
Attributes¶
term_type
property
¶
term_type: TermType
Retrieves the type of the term.
RETURNS | DESCRIPTION |
---|---|
TermType
|
A TermType enumeration. |
value_type
property
¶
value_type: ValueType
Retrieves the type of the term's value.
RETURNS | DESCRIPTION |
---|---|
ValueType
|
A ValueType enumeration |
is_variable
property
¶
Determines whether the term is a variable or not.
RETURNS | DESCRIPTION |
---|---|
bool
|
|
is_constant
property
¶
Determines whether the term is a constant or not.
RETURNS | DESCRIPTION |
---|---|
bool
|
|
Functions¶
__add__
¶
__add__(other: Any) -> Element
Addition operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__radd__
¶
__radd__(other: Any) -> Element
Right addition operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__sub__
¶
__sub__(other: Any) -> Element
Subtraction operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rsub__
¶
__rsub__(other: Any) -> Element
Right subtraction operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__mul__
¶
__mul__(other: Any) -> Element
Multiplication operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rmul__
¶
__rmul__(other: Any) -> Element
Right multiplication operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__truediv__
¶
__truediv__(other: Any) -> Element
Division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rtruediv__
¶
__rtruediv__(other: Any) -> Element
Right division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__floordiv__
¶
__floordiv__(other: Any) -> Element
Floor division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rfloordiv__
¶
__rfloordiv__(other: Any) -> Element
Right floor division operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__mod__
¶
__mod__(other: Any) -> Element
Modulo operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rmod__
¶
__rmod__(other: Any) -> Element
Right modulo operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__pow__
¶
__pow__(other: Any) -> Element
Exponentiation operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__rpow__
¶
__rpow__(other: Any) -> Element
Right exponentiation operation.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__neg__
¶
__neg__() -> Element
Negation operation.
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
__pos__
¶
__pos__() -> Element
Positive operation.
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
__abs__
¶
__abs__() -> Element
Absolute value operation.
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
__eq__
¶
__eq__(other: Any) -> Element
Equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__ne__
¶
__ne__(other: Any) -> Element
Not equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__lt__
¶
__lt__(other: Any) -> Element
Less than comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__le__
¶
__le__(other: Any) -> Element
Less than or equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__gt__
¶
__gt__(other: Any) -> Element
Greater than comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__ge__
¶
__ge__(other: Any) -> Element
Greater than or equal to comparison.
PARAMETER | DESCRIPTION |
---|---|
other |
The
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
Element
|
A new |
Source code in pyorlib/algebra/element.py
__init__
¶
__init__(name: str, value_type: ValueType, value: float)
Initializes a new instance of the Constant class.
PARAMETER | DESCRIPTION |
---|---|
name |
A string representing the name of the constant.
TYPE:
|
value_type |
A ValueType enumeration representing the type of value the constant can assume.
TYPE:
|
value |
A float representing the value of the constant.
TYPE:
|