A ComponentClass object represents a component in NineML.
Todo
For more information, see
Constructs a ComponentClass
| Parameters: |
|
|---|
Examples:
>>> a = ComponentClass(name='MyComponent1')
Todo
Point this towards and example of constructing ComponentClasses. This can’t be here, because we also need to know about dynamics. For examples
Methods
| __init__(name[, parameters, analog_ports, ...]) | Constructs a ComponentClass |
| accept_visitor(visitor, **kwargs) | link to something about visitation. |
| backsub_all() | Expand all alias definitions in local equations. |
| connect_ports(src, sink) | Connects the ports of 2 subcomponents. |
| get_node_addr() | Get the namespace address of this component |
| get_parent_model() | Gets the parent component for this component |
| get_subnode(addr) | Gets a subnode from this component recursively. |
| insert_subnode(namespace, subnode) | Insert a subnode into this component |
| is_flat() | Is this component flat or does it have subcomponents? |
| set_flattener(flattener) | Specifies the flattening object used to create this component, if |
| set_parent_model(parentmodel) | Sets the parent component for this component |
| was_flattened() | Returns True if this component was created by flattening another |
| write(file[, flatten]) | Export this model to an XML file. |
Attributes
| aliases | Forwarding function to self.dynamics.aliases |
| aliases_map | Forwarding function to self.dynamics.alias_map |
| analog_ports | Returns an iterator over the local AnalogPort objects |
| dynamics | Returns the local Dynamics object |
| event_ports | Returns an iterator over the local EventPort objects |
| flattener | If this component was made by flattening other components, return the |
| name | Returns the name of the component |
| parameters | Returns an iterator over the local Parameter objects |
| portconnections | |
| query | Returns the ComponentQuery object associated with this class |
| regimes | Forwarding function to self.dynamics.regimes |
| regimes_map | Forwarding function to self.dynamics.regimes_map |
| state_variables | Forwarding function to self.dynamics.state_variables |
| state_variables_map | Forwarding function to self.dynamics.state_variables_map |
| transitions | Forwarding function to self.dynamics.transitions |
link to something about visitation.
Expand all alias definitions in local equations.
This function finds Aliases, TimeDerivatives, send AnalogPorts, StateAssignments and Conditions which are defined in terms of other Aliases, and expands them, such that each only has Parameters, StateVariables and recv/reduce AnalogPorts on the RHS.
Connects the ports of 2 subcomponents.
The ports can be specified as string s or NamespaceAddresses.
| Parameters: |
|
|---|
Get the namespace address of this component
Gets the parent component for this component
Gets a subnode from this component recursively.
Insert a subnode into this component
| Parameters: |
|
|---|---|
| Raises : | NineMLRuntimeException if there is already a subcomponent at the same namespace location |
Note
This method will clone the subnode.
Is this component flat or does it have subcomponents?
Returns a Boolean specifying whether this component is flat; i.e. has no subcomponent
Specifies the flattening object used to create this component, if this component was flattened from a hierarchical component
Sets the parent component for this component
Returns True if this component was created by flattening another component
Export this model to an XML file.
| Params file: | A filename or fileobject |
|---|---|
| Params flatten: | Boolean specifying whether the component should be flattened before saving |
Forwarding function to self.dynamics.aliases
Forwarding function to self.dynamics.alias_map
Returns an iterator over the local AnalogPort objects
If this component was made by flattening other components, return the ComponentFlattener object. This is useful for finding initial-regimes
Returns the name of the component
Returns the ComponentQuery object associated with this class
Forwarding function to self.dynamics.regimes
Forwarding function to self.dynamics.regimes_map
Forwarding function to self.dynamics.state_variables
Forwarding function to self.dynamics.state_variables_map
Forwarding function to self.dynamics.transitions