StopCondition¶
- class StopCondition(sensor: SensorBase, threshold: UnitBase, operator: OperatorBase)¶
Bases:
objectStopConditionobject.Attributes¶
sensorSensorBaseThe sensor to be monitored to check if the stop condition is valid.
thresholdUnitBaseThe threshold value that triggers the stop condition.
operatorOperatorBaseThe comparison operator to use to check if the stop condition is valid.
Methods¶
check_condition()It applies the comparison
operatorto thesensorvalue and thethresholdvalue to check if the stop condition is valid.
- check_condition() bool¶
It applies the comparison
operatorto thesensorvalue and thethresholdvalue to check if the stop condition is valid.If the stop condition is valid, then the
Solverstops the computation even if it is not completed to the final simulation time.Returns¶
boolWhether stop condition is valid.
- property operator: OperatorBase¶
The comparison operator to use to check if the stop condition is valid.
The available operators are:
StopCondition.greater_thanto check if thesensorvalue is greater than thethresholdvalue,StopCondition.greater_than_or_equal_toto check if thesensorvalue is greater than or equal to thethresholdvalue,StopCondition.equal_toto check if thesensorvalue is equal to thethresholdvalue,StopCondition.less_thanto check if thesensorvalue is less than thethresholdvalue,StopCondition.less_than_or_equal_toto check if thesensorvalue is less than or equal to thethresholdvalue.
Returns¶
OperatorBaseThe comparison operator to use to check if the stop condition is valid.
Raises
TypeErrorIf
operatoris not an instance ofOperatorBase.
- property sensor: SensorBase¶
The sensor to be monitored to check if the stop condition is valid.
Returns¶
SensorBaseThe sensor to be monitored to check if the stop condition is valid.
Raises
TypeErrorIf
sensoris not an instance ofSensorBase.