StopCondition

class StopCondition(sensor: SensorBase, threshold: UnitBase, operator: OperatorBase)

Bases: object

StopCondition object.

Attributes

sensorSensorBase

The sensor to be monitored to check if the stop condition is valid.

thresholdUnitBase

The threshold value that triggers the stop condition.

operatorOperatorBase

The comparison operator to use to check if the stop condition is valid.

Methods

check_condition()

It applies the comparison operator to the sensor value and the threshold value to check if the stop condition is valid.

check_condition() bool

It applies the comparison operator to the sensor value and the threshold value to check if the stop condition is valid.

If the stop condition is valid, then the Solver stops the computation even if it is not completed to the final simulation time.

Returns

bool

Whether stop condition is valid.

property operator: OperatorBase

The comparison operator to use to check if the stop condition is valid.

The available operators are:

Returns

OperatorBase

The comparison operator to use to check if the stop condition is valid.

Raises

TypeError

If operator is not an instance of OperatorBase.

property sensor: SensorBase

The sensor to be monitored to check if the stop condition is valid.

Returns

SensorBase

The sensor to be monitored to check if the stop condition is valid.

Raises

TypeError

If sensor is not an instance of SensorBase.

property threshold: UnitBase

The threshold value that triggers the stop condition.

Returns

UnitBase

The threshold value that triggers the stop condition.

Raises

TypeError

If threshold is not an instance of UnitBase.