systemelement

class sysdynpy.systemelement.SubclassOnlyABC(*args, **kwargs)[source]

Bases: object

Helper class to prevent instantiation. The class SystemElement is declared as abstract and should not be instantiated. However, if there are no abstract methods present, it could be instantiated.

By deriving SystemElement from this class we ensure that no instances can be created. This is done by overriding the __new__ method.

__init__()

Initialize self. See help(type(self)) for accurate signature.

class sysdynpy.systemelement.SystemElement(*args, **kwargs)[source]

Bases: sysdynpy.systemelement.SubclassOnlyABC

An abstract class for generic system elements. Concrete system elements like stacks or flows are derived from this class.

__init__(name, system, var_name)[source]

Constructor method.

As this is an abstract class this constructor can not be called directly. But it provides a way to bundle code that needs to run when a subclass instance is created.

Parameters
  • name (str) – The element name. Can not be empty. Must be unique within the system.

  • system (System) – The system that this element shall be part of.

  • var_name (str) – The name of the variable this element will be assigned to, once it is constructed. This is needed because the variable name has to be known in other modules to execute the lambda expression that defines the calculation rule.

property name

see __init__()

property system

see __init__()

property value

The numeric value that is used in calculations.

Type

int or float

property var_name

see __init__()