BaseVariable
- class osaft.core.variable.BaseVariable(name=None)[source]
Bases:
ABCBaseVariable class defining basic methods and attributes shared between active and passive attributes.
This class and its children are based on the Observer Design Pattern. In the present context value changes shall be tracked so
ActiveVariableknow when their dependencies changed, and they need to recompute their underlying value.- Parameters:
name (
Optional[str], optional) – Name of the variableDefault:None- Raises:
TypeError if
nameis of wrong typePublic Methods:
notify()Notifies all items in
BaseVariable._variables_to_notifythat a dependent value changed.
- notify()[source]
Notifies all items in
BaseVariable._variables_to_notifythat a dependent value changed. Just the information of a changed dependency is passed.- Return type:
None
- property name: str
Returns name of the variable.
- Setter:
sets
_name
- property value: Any
Value of the attribute
- Setter:
just defined in
PassiveVariable- Getter:
returns/computes the value of the instance