nineml.abstraction_layer.component.Transition

class nineml.abstraction_layer.component.Transition(state_assignments=None, event_outputs=None, target_regime_name=None)
__init__(state_assignments=None, event_outputs=None, target_regime_name=None)

Abstract class representing a transition from one |Regime| to another.

|Transition| objects are not created directly, but via the subclasses |OnEvent| and |OnCondition|.

Parameters:
  • state_assignments – A list of the state-assignments performed when this transition occurs. Objects in this list are either string (e.g A = A+13) or StateAssignment objects.
  • event_outputs – A list of |OutputEvent| objects emitted when this transition occurs.
  • target_regime_name – The name of the regime to go into after this transition. None implies staying in the same regime. This has to be specified as a string, not the object, because in general the |Regime| object is not yet constructed. This is automatically resolved by the ComponentClass in _ResolveTransitionRegimeNames() during construction.

Todo

For more information about what happens at a regime transition, see here: XXXXXXX

Methods

__init__([state_assignments, event_outputs, ...]) Abstract class representing a transition from one |Regime| to
set_source_regime(source_regime) Internal method, used during component construction.
set_target_regime(target_regime) Internal method, used during component construction.

Attributes

event_outputs |Events| that happen when this transitions occurs
source_regime Returns the source regime of this transition.
source_regime_name DO NOT USE: Internal function. Use source_regime.name instead.
state_assignments An ordered list of StateAssignments that happen when this
target_regime Returns the target regime of this transition.
target_regime_name DO NOT USE: Internal function. Use target_regime.name instead.
set_source_regime(source_regime)

Internal method, used during component construction.

Used internally by the ComponentClass objects after all objects have be constructed, in the _ResolveTransitionRegimeNames() method. This is because when we build Transitions, the Regimes that they refer to generally are not build yet, so are referred to by strings. This method is used to set the source Regime object. We check that the name of the object set is the same as that previously expected.

set_target_regime(target_regime)

Internal method, used during component construction.

See set_source_regime

event_outputs

|Events| that happen when this transitions occurs

source_regime

Returns the source regime of this transition.

Note

This method will only be available after the ComponentClass containing this transition has been built. See set_source_regime

source_regime_name

DO NOT USE: Internal function. Use source_regime.name instead.

state_assignments

An ordered list of StateAssignments that happen when this transitions occurs

target_regime

Returns the target regime of this transition.

Note

This method will only be available after the ComponentClass containing this transition has been built. See set_source_regime

target_regime_name

DO NOT USE: Internal function. Use target_regime.name instead.