nineml.abstraction_layer.component.StateAssignment

class nineml.abstraction_layer.component.StateAssignment(lhs, rhs)

Assignments represent a change that happens to the value of a StateVariable during a transition between regimes.

For example, in an integrate-and-fire neuron, we may want to reset the voltage back to zero, after it has reached a certain threshold. In this case, we would have an OnCondition object, that is triggered when v>vthres. Attached to this OnCondition transition, we would attach an StateAssignment which sets v=vreset.

The left-hand-side symbol must be a state-variable of the component.

__init__(lhs, rhs)

StateAssignment Constructor

Parameters:
  • lhs – A string, which must be a state-variable of the component.
  • rhs – A string, representing the new value of the state after this assignment.

Methods

__init__(lhs, rhs) StateAssignment Constructor
accept_visitor(visitor, **kwargs) link to something about visitation.
lhs_name_transform_inplace(name_map)
name_transform_inplace(name_map)
rhs_as_python_func([namespace]) Returns a python callable which evaluates the expression in
rhs_has_missing_functions() returns True if at least 1 function on the RHS is not in the math
rhs_name_transform_inplace(name_map) Replace atoms on the RHS with values in the name_map

Attributes

atoms Returns a list of the atoms in the LHS and RHS of this expression
lhs
lhs_atoms
rhs
rhs_atoms Returns an iterator over all the variable names and mathematical
rhs_funcs
rhs_missing_functions yield names of functions in the RHS which are not in the math
rhs_names
accept_visitor(visitor, **kwargs)

link to something about visitation.

lhs_name_transform_inplace(name_map)
name_transform_inplace(name_map)
rhs_as_python_func(namespace=None)

Returns a python callable which evaluates the expression in namespace and returns the result

rhs_has_missing_functions()

returns True if at least 1 function on the RHS is not in the math namespace

rhs_name_transform_inplace(name_map)

Replace atoms on the RHS with values in the name_map

atoms

Returns a list of the atoms in the LHS and RHS of this expression

lhs
lhs_atoms
rhs
rhs_atoms

Returns an iterator over all the variable names and mathematical functions on the RHS function. This does not include defined mathematical symbols such as pi and e, but does include functions such as sin and log

rhs_funcs
rhs_missing_functions

yield names of functions in the RHS which are not in the math namespace

rhs_names