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 (None | str, optional) – Name of the variable
Default: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- Return type
str
- property value: Any
Value of the attribute
- Setter
just defined in
PassiveVariable- Getter
returns/computes the value of the instance
- Return type
Any