nineml.abstraction_layer.component.Regime

class nineml.abstraction_layer.component.Regime(*args, **kwargs)

A Regime is something that contains TimeDerivatives, has temporal extent, defines a set of |Transitions| which occur based on Conditions, and can be join the Regimes to other Regimes.

__init__(*args, **kwargs)

Regime constructor

Parameters:
  • name – The name of the constructor. If none, then a name will be automatically generated.
  • time_derivatives – A list of time derivatives, as either ``string``s (e.g ‘dg/dt = g/gtau’) or as TimeDerivative objects.
  • transitions – A list containing either |OnEvent| or |OnCondition| objects, which will automatically be sorted into the appropriate classes automatically.
  • *args

    Any non-keyword arguments will be treated as time_derivatives.

Methods

__init__(*args, **kwargs) Regime constructor
accept_visitor(visitor, **kwargs) link to something about visitation.
add_on_condition(on_condition) Add an |OnCondition| transition which leaves this regime
add_on_event(on_event) Add an |OnEvent| transition which leaves this regime
get_next_name() Return the next distinct autogenerated name

Attributes

name
on_conditions Returns all the transitions out of this regime trigger by
on_events Returns all the transitions out of this regime trigger by events
time_derivatives Returns the state-variable time-derivatives in this regime.
transitions Returns all the transitions leaving this regime.
accept_visitor(visitor, **kwargs)

link to something about visitation.

add_on_condition(on_condition)

Add an |OnCondition| transition which leaves this regime

If the on_condition object has not had its target regime name set in the constructor, or by calling its set_target_regime_name(), then the target is assumed to be this regime, and will be set appropriately.

The source regime for this transition will be set as this regime.

add_on_event(on_event)

Add an |OnEvent| transition which leaves this regime

If the on_event object has not had its target regime name set in the constructor, or by calling its set_target_regime_name(), then the target is assumed to be this regime, and will be set appropriately.

The source regime for this transition will be set as this regime.

classmethod get_next_name()

Return the next distinct autogenerated name

name
on_conditions

Returns all the transitions out of this regime trigger by conditions

on_events

Returns all the transitions out of this regime trigger by events

time_derivatives

Returns the state-variable time-derivatives in this regime.

Note

This is not guaranteed to contain the time derivatives for all the state-variables specified in the component. If they are not defined, they are assumed to be zero in this regime.

transitions

Returns all the transitions leaving this regime.

Returns an iterator over both the on_events and on_conditions of this regime