relentless.model.Constant#
- class relentless.model.Constant(value, name=None)#
Constant value.
The value of a constant-value variable cannot be changed after it is initialized. This distinguishes it from the
IndependentVariable.- Parameters:
Examples
Create a constant variable:
>>> x = ConstantVariable(2.0) >>> print(x.value) 2.0 >>> print(x.name) '__x[0]'
Create a constant variable with a name:
>>> y = ConstantVariable(3.0, name='y') >>> print(y.name) 'y'
- Raises:
ValueError – If
nameis already used.
Methods
Attributes
countnamesValue of the variable.