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¶
property
  
¶
term_type: TermType
Retrieves the type of the term.
| RETURNS | DESCRIPTION | 
|---|---|
| TermType | A TermType enumeration. | 
property
  
¶
value_type: ValueType
Retrieves the type of the term's value.
| RETURNS | DESCRIPTION | 
|---|---|
| ValueType | A ValueType enumeration | 
property
  
¶
    Determines whether the term is a variable or not.
| RETURNS | DESCRIPTION | 
|---|---|
| bool | 
 | 
property
  
¶
    Determines whether the term is a constant or not.
| RETURNS | DESCRIPTION | 
|---|---|
| bool | 
 | 
Functions¶
__add__(other: Any) -> Element
Addition operation.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(other: Any) -> Element
Subtraction operation.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(other: Any) -> Element
Multiplication operation.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(other: Any) -> Element
Division operation.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(other: Any) -> Element
Floor division operation.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(other: Any) -> Element
Modulo operation.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(other: Any) -> Element
Exponentiation operation.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__() -> Element
Negation operation.
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
__pos__() -> Element
Positive operation.
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
__abs__() -> Element
Absolute value operation.
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
__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__(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__(other: Any) -> Element
Less than comparison.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(other: Any) -> Element
Greater than comparison.
| PARAMETER | DESCRIPTION | 
|---|---|
| other | The  
                  
                    TYPE:
                       | 
| RETURNS | DESCRIPTION | 
|---|---|
| Element | A new  | 
Source code in pyorlib/algebra/element.py
              
__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__(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:
                       |