Defining component types#
Schema against which LEMS based on these should be valid: LEMS_v0.7.6.xsd. Generated on 18/06/24 from this commit. Please file any issues or questions at the issue tracker here.
ComponentType#
Root element for defining LEMS Component Types.
name |
String |
The name of the component type. This can be uses as an XML element name in the shorthand form whendefining components. |
eXtends |
String |
The component type that this type inherits field definitions for, if any |
parameters |
|
indexParameters |
|
derivedParameters |
|
pathParameters |
|
requirements |
|
componentRequirements |
|
instanceRequirements |
|
exposures |
|
childs |
|
childrens |
|
links |
|
componentReferences |
|
componentTypeReferences |
|
locations |
|
propertys |
|
dynamicses |
|
structures |
|
simulations |
|
equilibriums |
|
procedures |
|
geometrys |
|
fixeds |
|
constants |
|
attachmentses |
|
eventPorts |
|
paths |
|
texts |
|
collections |
|
pairCollections |
|
abouts |
|
metas |
<xs:complexType name="ComponentType">
<xs:sequence>
<xs:element name="Property" type="Property" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Parameter" type="Parameter" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="DerivedParameter" type="DerivedParameter" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="IndexParameter" type="IndexParameter" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Constant" type="Constant" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Child" type="Child" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Children" type="Children" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Fixed" type="Fixed" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Link" type="Link" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="ComponentReference" type="ComponentReference" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Attachments" type="Attachments" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="EventPort" type="EventPort" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Exposure" type="Exposure" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Requirement" type="Requirement" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="ComponentRequirement" type="ComponentRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="InstanceRequirement" type="InstanceRequirement" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Path" type="Path" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Text" type="Text" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Dynamics" type="Dynamics" minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="Structure" type="Structure" minOccurs="0" maxOccurs="1"/>
<xs:element name="Simulation" type="Simulation" minOccurs="0" maxOccurs="1"/>
</xs:sequence>
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="extends" type="xs:string" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<ComponentType name="Population">
<ComponentReference name="component" type="Component"/>
<Parameter name="size" dimension="none"/>
<Structure>
<MultiInstantiate number="size" component="component"/>
</Structure>
</ComponentType>
<ComponentType name="EventConnectivity">
<Link name="source" type="Population"/>
<Link name="target" type="Population"/>
<Child name="Connections" type="ConnectionPattern"/>
</ComponentType>
<ComponentType name="Network">
<Children name="populations" type="Population"/>
<Children name="connectivities" type="EventConnectivity"/>
</ComponentType>
<ComponentType name="AllAll" extends="ConnectionPattern">
<Structure>
<ForEach instances="../source" as="a">
<ForEach instances="../target" as="b">
<EventConnection from="a" to="b"/>
</ForEach>
</ForEach>
</Structure>
</ComponentType>
<ComponentType name="ConnectionPattern"/>
Parameter#
A quantity, defined by name and dimension, that must be supplied when a Component of the enclosing ComponentType is defined
name |
String |
The name of the parameter. This is the name of the attribute to be used when the parameter is supplied in a component definition |
dimension |
String |
The dimension, or ‘none’. This should be the name of an already defined dimension element |
description |
String |
An optional description of the parameter |
<xs:complexType name="Parameter">
<xs:complexContent>
<xs:extension base="NamedDimensionalType"/>
</xs:complexContent>
</xs:complexType>
<Parameter name="size" dimension="none"/>
<Parameter name="xmin" dimension="none"/>
<Parameter name="xmax" dimension="none"/>
<Parameter name="ymin" dimension="none"/>
<Parameter name="ymax" dimension="none"/>
PathParameter#
A parameter of which the value is a path expression. When a ComponentType declares a PathParameter, a corresponding Component definition should have an attibute with that name whose value is a path expression that evaluates within the instance tree of the built model. This is used, for example, in the definition of a group component class, where the coresponding component specifies a path over the instance tree which selectesthe items that should go in the group.
name |
String |
Name of the parameter |
Property#
An property on an instance of a component. Unlike a Parameter, a Property can very from instance to instance. It should be set with an Assign element within the build specification.
name |
String |
|
dimension |
String |
|
defaultValue |
String |
The defaultValue for the property must be a plain number (no units) giving the SI magnitude of the quantity. |
<xs:complexType name="Property">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="dimension" type="xs:string" use="optional" default="none"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
<xs:attribute name="defaultValue" type="xs:double" use="optional"/>
</xs:complexType>
DerivedParameter#
A parameter that is a function of the Component’s Parameters, which does not change with time. Its value can be supplied either with the ‘value’ attribute that evaluates within the scope of the definition, or with the ‘select’ attribute which gives a path to ‘primary’ version of the parameter. For example, setting select=‘//MembranePotential[species=channel/species]/reversal’ within the appropriate context allows a channel’s reversal potential to taken from a single global setting according to its permeant ion, rather than explicitly supplied locally.
name |
String |
The name of the derived parameter |
dimension |
String |
The dimension, or ‘none’. This should be the name of an already defined dimension element |
description |
String |
An optional description of the derived parameter |
select |
String |
Path to the parameter that supplies the value. Exactly one of ‘select’ and ‘value’ is required. |
value |
String |
A string defining the value of the element |
<xs:complexType name="DerivedParameter">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="dimension" type="xs:string" use="optional" default="none"/>
<xs:attribute name="value" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<DerivedParameter name="erev" dimension="voltage" select="//MembranePotential[species=channel/species]/reversal"/>
Fixed#
Fixes the value of a parameter in the parent class, so that it does not have to be supplied separately in component definitions.
parameter |
String |
|
value |
String |
<xs:complexType name="Fixed">
<xs:attribute name="parameter" type="xs:string" use="required"/>
<xs:attribute name="value" type="PhysicalQuantity" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Fixed parameter="threshold" value="-45mV"/>
<Fixed parameter="relativeConductance" value="0"/>
<Fixed parameter="relativeConductance" value="1"/>
<Fixed parameter="relativeConductance" value="0"/>
<Fixed parameter="relativeConductance" value="1"/>
Requirement#
A Requirement gives the name and dimension of a quantity (parameter or variable) that should be accessible within the scope of a model component. This is only applicable for elements that can be included as children of other elements, where the scope comprises its own parameters and those in the scope of its enclosing element. Once a requirement has been declared, then the quantity can be used within the Dynamics definition of the component. It is the responsibility of an implementation to check that the component is only used in a context in which the requirement is met. A typical example is in defining membrand bound components which require access to the membrane potential but where the variable that holds the potential itself is defined in the top level component.
name |
String |
name |
dimension |
String |
The dimension, or ‘none’. This should be the name of an already defined dimension element |
description |
String |
An optional description of the requirement |
<xs:complexType name="Requirement">
<xs:complexContent>
<xs:extension base="NamedDimensionalType"/>
</xs:complexContent>
</xs:complexType>
<Requirement name="v" dimension="voltage"/>
<Requirement name="v" dimension="voltage"/>
<Requirement name="v" dimension="voltage"/>
<Requirement name="v" dimension="voltage"/>
<Requirement name="v" dimension="voltage"/>
ComponentRequirement#
The name of a component or component reference that must exist in the component hierarchy
name |
String |
name |
<xs:complexType name="ComponentRequirement">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
InstanceRequirement#
An instance that must be supplied at build time. Expressions can contain references to quantities in the instance
name |
String |
name |
<xs:complexType name="InstanceRequirement">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
</xs:complexType>
Exposure#
A quantity that is made available to other components in the simulation. Note that all variables in a Dynamics definition are private. If other components need access to them, then the definition should explicitly link them to an exposure defined in the component class
name |
String |
Name of the exposure element |
dimension |
String |
The dimension, or ‘none’. This should be the name of an already defined dimension element |
description |
String |
An optional description of the element |
<xs:complexType name="Exposure">
<xs:complexContent>
<xs:extension base="NamedDimensionalType"/>
</xs:complexContent>
</xs:complexType>
<Exposure name="v" dimension="voltage"/>
<Exposure name="tsince" dimension="time"/>
<Exposure name="r" dimension="per_time"/>
<Exposure name="fcond" dimension="none"/>
<Exposure name="fcond" dimension="none"/>
Child#
Specifies that a component can have a child of a particular type. The name supplied here can be used in path expressions to access the component. This is useful, for example, where a component can have multiple children of the same type but with different roles, such as the forward and reverse transition rates in a channel.
name |
String |
Name of the child |
type |
String |
Reference to a component class, the value should be the name of the target class. |
description |
String |
An optional description of the child |
<xs:complexType name="Child">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Child name="Connections" type="ConnectionPattern"/>
<Child name="Forward" type="HHRate"/>
<Child name="Reverse" type="HHRate"/>
<Child name="Forward" type="HHRate"/>
<Child name="Reverse" type="HHRate"/>
Children#
Specifies that a component can have children of a particular class. The class may refer to an extendedtype, in which case components of any class that extends the specified target class should be valid as child components
name |
String |
Name of the children |
type |
String |
The class of component allowed as children. |
<xs:complexType name="Children">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="optional"/>
<xs:attribute name="min" type="xs:integer" use="optional"/>
<xs:attribute name="max" type="xs:integer" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Children name="populations" type="Population"/>
<Children name="connectivities" type="EventConnectivity"/>
<Children name="lines" type="Line"/>
<Children name="outputColumn" type="OutputColumn"/>
<Children name="displays" type="Display"/>
Link#
Like a ComponentRef, but resolved relative to the enclosing object so the target must already be in the model. One or the other should be deprecated. The Link element has the same properties as ComponentRef. The Link element just establishes a connection with the target component, but leaves it in its existing place in the hierarchy. Variables in the target component can be accessed via the name of the link element.
name |
String |
A name for the ComponentReference |
type |
String |
The type of the target Component |
description |
String |
An optional description of the ComponentReference |
<xs:complexType name="Link">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Link name="source" type="Population"/>
<Link name="target" type="Population"/>
<Link name="from" type="KSState"/>
<Link name="to" type="KSState"/>
<Link name="from" type="KSState"/>
ComponentReference#
A reference to another component. The target component can be accessed with path expressions in the same way as a child component, but can be defined independently
name |
String |
A name for the ComponentReference |
type |
String |
The type of the target Component |
description |
String |
An optional description of the ComponentReference |
<xs:complexType name="ComponentReference">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="local" type="xs:string" use="optional"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<ComponentReference name="component" type="Component"/>
<ComponentReference name="target" type="Component"/>
<ComponentReference name="channel" type="HHChannel"/>
<ComponentReference name="component" type="Component"/>
<ComponentReference name="synapse" type="Synapse"/>
ComponentTypeReference#
This is used in conjunction with PathParameter elements to specify the target class of selections defined within components operating over the instance tree.
name |
String |
Collection#
Specifies that instances of components based on this class can containe a named collection of other instances. This provides for containers for oprating on groups of instances with path and filter expressions defined in components to operate over the instance tree.
name |
String |
PairCollection#
Defines a named collection of paris of instances, similar to the Collection element.
name |
String |
EventPort#
A port on a component that can send or receive events, depending on the direction specified
name |
String |
Name of the EventPort |
direction |
String |
‘IN’ or ‘OUT’ |
description |
String |
An optional description of the EventPort |
<xs:complexType name="EventPort">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="direction" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<EventPort name="spikes-in" direction="in"/>
<EventPort name="a" direction="out"/>
<EventPort name="in" direction="in"/>
<EventPort name="out" direction="out"/>
<EventPort name="in" direction="in"/>
Text#
Holds textual information that does not change the model but is needed for other purposes such as labelling graphs.
name |
String |
The textual content |
description |
String |
An optional description of the element |
<xs:complexType name="Text">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Text name="title"/>
<Text name="color"/>
<Text name="path"/>
<Text name="fileName"/>
<Text name="destination"/>
Path#
Duplicates some functionality of PathParameter - the two should be merged.
name |
String |
<xs:complexType name="Path">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Path name="quantity"/>
<Path name="quantity"/>
<Path name="from"/>
<Path name="to"/>
<Path name="quantity"/>
Attachments#
Specifies that a component can accept attached components of a particular class. Attached components can be added at build time dependent on other events. For scoping and access purposes they are like child components. The cannonical use of attachments is in adding synapses to a cell when a network connection is made.
name |
String |
A name for the Attachments |
type |
String |
The type of the Attachments |
<xs:complexType name="Attachments">
<xs:attribute name="name" type="xs:string" use="required"/>
<xs:attribute name="type" type="xs:string" use="required"/>
<xs:attribute name="description" type="xs:string" use="optional"/>
</xs:complexType>
<Attachments name="synapses" type="Synapse"/>
Insertion#
IntegerParameter#
name |
String |
The name of the parameter. This is the name of the attribute to be used when the parameter is supplied in a component definition |
dimension |
String |
The dimension, or ‘none’. This should be the name of an already defined dimension element |
description |
String |
An optional description of the parameter |
IndexParameter#
name |
String |
The name of the parameter. This is the name of the attribute to be used when the parameter is supplied in a component definition |
dimension |
String |
The dimension, or ‘none’. This should be the name of an already defined dimension element |
description |
String |
An optional description of the parameter |
<xs:complexType name="IndexParameter">
<xs:attribute name="name" type="xs:string" use="required"/>
</xs:complexType>
About#
Meta#
Meta element to provide arbitrary metadata to LEMS simulations. Note that this is not processed by the LEMS interpreter.
<xs:complexType name="Meta">
<xs:sequence>
<xs:any minOccurs="0" maxOccurs="unbounded" processContents="lax"/>
</xs:sequence>
<xs:anyAttribute processContents="skip"/>
</xs:complexType>