Structure#

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.


Structure#

By default, each Component in a model gives rise to a single instance of its state variables when the model is executed. The state variables are then governed by the dynamics definition in the associated ComponentType. Elements in the Structure declaration can be used to change this behavior, for example to make multiple instances of the state variables, or to instantiate a different component. A typical application for the latter would be a Component that defines a population of cells. The population Component might define the number of cells it contains but would refer to a Component defined elsewhere for the actual cell model to use.

buildElements

BuildElement

<xs:complexType name="Structure">
  <xs:sequence>
    <xs:element name="ChildInstance" type="ChildInstance" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="MultiInstantiate" type="MultiInstantiate" minOccurs="0" maxOccurs="1"/>
    <xs:element name="ForEach" type="ForEach" minOccurs="0" maxOccurs="1"/>
    <xs:element name="With" type="With" minOccurs="0" maxOccurs="unbounded"/>
    <xs:element name="Tunnel" type="Tunnel" minOccurs="0" maxOccurs="1"/>
    <xs:element name="EventConnection" type="EventConnection" minOccurs="0" maxOccurs="unbounded"/>
  </xs:sequence>
</xs:complexType>
<Structure>
    <MultiInstantiate number="size" component="component"/>
</Structure>
<Structure>
    <ForEach instances="../source" as="a">
        <ForEach instances="../target" as="b">
            <EventConnection from="a" to="b"/>
        </ForEach>
    </ForEach>
</Structure>
<Structure>
    <ChildInstance component="channel"/>
</Structure>
<Structure>
    <With instance="from" as="a"/>
    <With instance="to" as="b"/>
    <EventConnection from="a" to="b" receiver="synapse" receiverContainer="destination" sourcePort="sourcePort" targetPort="targetPort"/>
</Structure>
<Structure>
    <MultiInstantiate number="size" component="component"/>
</Structure>

BuildElement#

Base class for elements that can be used in Structures

buildElements

BuildElement

MultiInstantiate#

assigns

Assign

buildElements

BuildElement

<xs:complexType name="MultiInstantiate">
  <xs:attribute name="component" type="xs:string" use="required"/>
  <xs:attribute name="number" type="xs:string" use="required"/>
</xs:complexType>
<MultiInstantiate number="size" component="component"/>
<MultiInstantiate number="size" component="component"/>
<MultiInstantiate number="size" component="component"/>
<MultiInstantiate number="size" component="component"/>

CoInstantiate#

assigns

Assign

buildElements

BuildElement

Assign#

<xs:complexType name="Assign">
  <xs:attribute name="property" type="xs:string" use="required"/>
  <xs:attribute name="value" type="xs:string" use="required"/>
</xs:complexType>

Choose#

buildElements

BuildElement

ChildInstance#

assigns

Assign

buildElements

BuildElement

<xs:complexType name="ChildInstance">
  <xs:attribute name="component" type="xs:string" use="required"/>
</xs:complexType>
<ChildInstance component="channel"/>
<ChildInstance component="channel"/>
<ChildInstance component="channel"/>
<ChildInstance component="channel"/>

ForEach#

buildElements

BuildElement

<xs:complexType name="ForEach">
  <xs:sequence>
    <xs:element name="MultiInstantiate" type="MultiInstantiate" minOccurs="0" maxOccurs="1"/>
  </xs:sequence>
  <xs:attribute name="instances" type="xs:string" use="required"/>
  <xs:attribute name="as" type="xs:string" use="required"/>
</xs:complexType>
<ForEach instances="../source" as="a">
    <ForEach instances="../target" as="b">
        <EventConnection from="a" to="b"/>
    </ForEach>
</ForEach>
<ForEach instances="../target" as="b">
    <EventConnection from="a" to="b"/>
</ForEach>
<ForEach instances="../source" as="a">
    <ForEach instances="../target" as="b">
        <EventConnection from="a" to="b"/>
    </ForEach>
</ForEach>
<ForEach instances="../target" as="b">
    <EventConnection from="a" to="b"/>
</ForEach>
<ForEach instances="../source" as="a">
    <ForEach instances="../target" as="b">
        <EventConnection from="a" to="b"/>
    </ForEach>
</ForEach>

EventConnection#

assigns

Assign

buildElements

BuildElement

<xs:complexType name="EventConnection">
  <xs:sequence>
    <xs:element name="Assign" type="Assign" minOccurs="0" maxOccurs="1"/>
  </xs:sequence>
  <xs:attribute name="from" type="xs:string" use="required"/>
  <xs:attribute name="to" type="xs:string" use="required"/>
  <xs:attribute name="sourcePort" type="xs:string" use="optional"/>
  <xs:attribute name="targetPort" type="xs:string" use="optional"/>
  <xs:attribute name="receiver" type="xs:string" use="optional"/>
  <xs:attribute name="receiverContainer" type="xs:string" use="optional"/>
  <xs:attribute name="delay" type="xs:string" use="optional"/>
</xs:complexType>
<EventConnection from="a" to="b"/>
<EventConnection from="a" to="b" receiver="synapse" receiverContainer="destination" sourcePort="sourcePort" targetPort="targetPort"/>
<EventConnection from="a" to="b"/>
<EventConnection from="a" to="b"/>

Tunnel#

assigns

Assign

buildElements

BuildElement

<xs:complexType name="Tunnel">
  <xs:sequence>
    <xs:element name="Assign" type="Assign" minOccurs="0" maxOccurs="1"/>
  </xs:sequence>
  <xs:attribute name="name" type="xs:string" use="required"/>
  <xs:attribute name="endA" type="xs:string" use="required"/>
  <xs:attribute name="endB" type="xs:string" use="required"/>
  <xs:attribute name="componentA" type="xs:string" use="required"/>
  <xs:attribute name="componentB" type="xs:string" use="required"/>
</xs:complexType>

PairsEventConnection#

buildElements

BuildElement

PairFilter#

buildElements

BuildElement

IncludePair#

buildElements

BuildElement

With#

buildElements

BuildElement

<xs:complexType name="With">
  <xs:attribute name="instance" type="xs:string" use="optional"/>
  <xs:attribute name="list" type="xs:string" use="optional"/>
  <xs:attribute name="index" type="xs:string" use="optional"/>
  <xs:attribute name="as" type="xs:string" use="required"/>
</xs:complexType>
<With instance="from" as="a"/>
<With instance="to" as="b"/>

If#

buildElements

BuildElement

Apply#

buildElements

BuildElement

Gather#

buildElements

BuildElement

GatherPairs#

buildElements

BuildElement