Skip to content

Commit

Permalink
Merge pull request #1 from NeuroML/development
Browse files Browse the repository at this point in the history
Development
  • Loading branch information
RokasSt committed Feb 5, 2016
2 parents 9bb89f3 + 9cfa7b8 commit 4422c96
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 14 deletions.
24 changes: 18 additions & 6 deletions LEMSexamples/LEMS_NML2_Ex16_Inputs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<Include file="../examples/NML2_Inputs.nml"/>

<network id="net1">
<population id="izhPop" component="RS" size="9"/>
<population id="izhPop" component="RS" size="11"/>

<population id="spikeArrPop" component="spkArr" size="1"/>
<population id="spikeGenRegularPop" component="spikeGenRegular" size="1"/>
Expand All @@ -41,6 +41,8 @@
<explicitInput target="izhPop[2]" input="rg0" destination="synapses"/>
<explicitInput target="izhPop[3]" input="vClamp0" destination="synapses"/>
<explicitInput target="izhPop[8]" input="poissonFiringSyn" destination="synapses"/>
<explicitInput target="izhPop[9]" input="ci0" destination="synapses"/>
<!--<explicitInput target="izhPop[10]" input="transPoissonFiringSyn" destination="synapses"/>-->

<synapticConnection from="spikeArrPop[0]" to="izhPop[4]" synapse="syn1" destination="synapses"/>
<synapticConnection from="spikeGenRegularPop[0]" to="izhPop[5]" synapse="syn1" destination="synapses"/>
Expand Down Expand Up @@ -77,6 +79,7 @@
<Line id ="Regular spike gen t since" quantity="spikeGenRegularPop[0]/tsince" scale="1ms" color="#3fffaa" timeScale="1ms"/>
<Line id ="Poisson spike gen t since" quantity="spikeGenRandomPop[0]/tsince" scale="1ms" color="#3ff9999" timeScale="1ms"/>
<Line id ="Spike array t since" quantity="spikeArrPop[0]/tsince" scale="1ms" color="#3faa99" timeScale="1ms"/>
<!--<Line id ="Transient poisson spike gen" quantity="izhPop[10]/transPoissonFiringSyn/tsince" scale="1ms" color="#000000" timeScale="1ms"/>-->
</Display>

<Display id="d4" title="Ex16: Izhikevich cell, spiking inputs" timeScale="1ms" xmin="-20" xmax="320" ymin="-61" ymax="-56">
Expand All @@ -88,6 +91,8 @@
color="#01A9DB" timeScale="1ms"/>
<Line id="poisson spike gen" quantity="izhPop[7]/v" scale="1mV"
color="#8000FF" timeScale="1ms"/>
<!--<Line id="transient poisson spike gen" quantity="izhPop[10]/v" scale="1mV"
color="#ff00FF" timeScale="1ms"/>-->
</Display>

<Display id="d5" title="Ex16: Izhikevich cell, poison firing synapse" timeScale="1ms" xmin="-20" xmax="320" ymin="-80" ymax="45">
Expand All @@ -97,6 +102,11 @@
<Line id ="poison firing synapse time since" quantity="izhPop[8]/poissonFiringSyn/tsince" scale="1ms" color="#3fffaa" timeScale="1ms"/>
</Display>

<!--<Display id="d6" title="Ex16: Izhikevich cell, compound input" timeScale="1ms" xmin="-20" xmax="320" ymin="-110" ymax="45">
<Line id ="izh9 v (mV)" quantity="izhPop[9]/v" scale="1mV" color="#ee40FF" timeScale="1ms"/>
<Line id ="compound i (nA)" quantity="izhPop[9]/ci0/i" scale="1nA" color="#333333" timeScale="1ms"/>
</Display>-->


<!-- <OutputFile id="of1" fileName="results/ex16_g.dat">
<OutputColumn id="syn1exp_g" quantity="izhPop[8]/poissonFiringSyn/synInput/g" />
Expand All @@ -106,11 +116,13 @@
<OutputColumn id="v0" quantity="izhPop[0]/v" />
<OutputColumn id="v1" quantity="izhPop[1]/v" />
<OutputColumn id="v2" quantity="izhPop[2]/v" />
<OutputColumn id="v2" quantity="izhPop[3]/v" />
<OutputColumn id="v2" quantity="izhPop[4]/v" />
<OutputColumn id="v2" quantity="izhPop[5]/v" />
<OutputColumn id="v2" quantity="izhPop[6]/v" />
<OutputColumn id="v2" quantity="izhPop[7]/v" />
<OutputColumn id="v3" quantity="izhPop[3]/v" />
<OutputColumn id="v4" quantity="izhPop[4]/v" />
<OutputColumn id="v5" quantity="izhPop[5]/v" />
<OutputColumn id="v6" quantity="izhPop[6]/v" />
<OutputColumn id="v7" quantity="izhPop[7]/v" />
<OutputColumn id="v8" quantity="izhPop[8]/v" />
<OutputColumn id="v9" quantity="izhPop[9]/v" />
</OutputFile>

</Simulation>
Expand Down
91 changes: 83 additions & 8 deletions NeuroML2CoreTypes/Inputs.xml
Original file line number Diff line number Diff line change
Expand Up @@ -187,13 +187,13 @@
<StateAssignment variable="tsince" value="0"/>
<StateAssignment variable="isi" value="- averageIsi * log(1 - random(1))"/>
</OnStart>

<OnCondition test="tsince .gt. isi">
<StateAssignment variable="tsince" value="0"/>
<StateAssignment variable="isi" value="- averageIsi * log(1 - random(1))"/>
<EventOut port="spike"/>
</OnCondition>

<OnCondition test="tsince .gt. isi">
<StateAssignment variable="tsince" value="0"/>
<StateAssignment variable="isi" value="- averageIsi * log(1 - random(1))"/>
<EventOut port="spike"/>
</OnCondition>

</Dynamics>
<Structure>
<ChildInstance component="synapse"/>
Expand All @@ -208,8 +208,8 @@


<ComponentType name="transientPoissonFiringSynapse"
description="Poisson spike generator with delay and duration connected to single synapse providing an input current
.Similar to ComponentType poissonFiringSynapse."
description="Poisson spike generator with delay and duration connected to single synapse providing an input current.
Similar to ComponentType poissonFiringSynapse."
extends="baseVoltageDepPointCurrentSpiking">

<Parameter name="averageRate" dimension="per_time"/>
Expand Down Expand Up @@ -298,6 +298,48 @@

</Dynamics>
</ComponentType>



<ComponentType name="compoundInput" extends="basePointCurrent"
description="Generates a current which is the sum of all its child _basePointCurrent_ elements">

<Children name="currents" type="basePointCurrent"/>

<!--TODO: remove! Only required as EventConnection is used in explicitInput to
connect inputs to cells. Events aren't passed! ... -->
<EventPort name="in" direction="in" description="Note this is not used here. Will be removed in future"/>

<Dynamics>

<DerivedVariable name="i" dimension="current" exposure="i" select="currents[*]/i" reduce="add"/>

<OnEvent port="in"><!--TODO: remove, see above... -->
</OnEvent>


</Dynamics>
</ComponentType>

<ComponentType name="compoundInputDL" extends="basePointCurrentDL"
description="Generates a current which is the sum of all its child _basePointCurrentDL_ elements">

<Children name="currents" type="basePointCurrentDL"/>

<!--TODO: remove! Only required as EventConnection is used in explicitInput to
connect inputs to cells. Events aren't passed! ... -->
<EventPort name="in" direction="in" description="Note this is not used here. Will be removed in future"/>

<Dynamics>

<DerivedVariable name="I" dimension="none" exposure="I" select="currents[*]/I" reduce="add"/>

<OnEvent port="in"><!--TODO: remove, see above... -->
</OnEvent>


</Dynamics>
</ComponentType>


<ComponentType name="pulseGeneratorDL" extends="basePointCurrentDL"
Expand Down Expand Up @@ -367,6 +409,39 @@
</Dynamics>
</ComponentType>

<ComponentType name="sineGeneratorDL" extends="basePointCurrentDL"
description="Generates a sinusoidally varying current after a time _delay, for a fixed _duration. The _period and maximum _amplitude of the current can be set as well as the _phase at which to start.">

<Parameter name="phase" dimension="none"/>
<Parameter name="delay" dimension="time"/>
<Parameter name="duration" dimension="time"/>
<Parameter name="amplitude" dimension="none"/>
<Parameter name="period" dimension="time"/>

<EventPort name="in" direction="in"/>

<Dynamics>

<StateVariable name="I" exposure="I" dimension="none"/>

<OnEvent port="in"><!--TODO: remove-->
</OnEvent>

<OnCondition test="t .lt. delay">
<StateAssignment variable="I" value="0"/>
</OnCondition>

<OnCondition test="t .geq. delay .and. t .lt. duration+delay">
<StateAssignment variable="I" value="amplitude * sin(phase + (2 * 3.14159265 * (t-delay)/period) )"/>
</OnCondition>

<OnCondition test="t .geq. duration+delay">
<StateAssignment variable="I" value="0"/>
</OnCondition>

</Dynamics>
</ComponentType>


<ComponentType name="rampGenerator" extends="basePointCurrent"
description="Generates a ramping current after a time _delay, for a fixed _duration. During this time the current steadily changes from _startAmplitude to _finishAmplitude.">
Expand Down
80 changes: 80 additions & 0 deletions Schemas/NeuroML2/NeuroML_v2beta4.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -531,8 +531,16 @@
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="sineGenerator" type="SineGenerator"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="sineGeneratorDL" type="SineGeneratorDL"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="rampGenerator" type="RampGenerator"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="rampGeneratorDL" type="RampGeneratorDL"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="compoundInput" type="CompoundInput"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="compoundInputDL" type="CompoundInputDL"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="voltageClamp" type="VoltageClamp"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="spikeArray" type="SpikeArray" minOccurs="0"
Expand All @@ -545,6 +553,8 @@
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="poissonFiringSynapse" type="PoissonFiringSynapse"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="transientPoissonFiringSynapse" type="TransientPoissonFiringSynapse"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:group>

Expand Down Expand Up @@ -2025,6 +2035,24 @@
</xs:complexContent>
</xs:complexType>

<xs:complexType name="SineGeneratorDL">
<xs:complexContent>
<xs:extension base="Standalone">
<xs:attribute name="delay" type="Nml2Quantity_time"
use="required"/>
<xs:attribute name="phase" type="Nml2Quantity_none"
use="required"/>
<xs:attribute name="duration" type="Nml2Quantity_time"
use="required"/>
<xs:attribute name="amplitude"
type="Nml2Quantity_none"
use="required"/>
<xs:attribute name="period" type="Nml2Quantity_time"
use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>


<xs:complexType name="RampGenerator">
<xs:complexContent>
Expand All @@ -2046,6 +2074,58 @@
</xs:complexContent>
</xs:complexType>

<xs:complexType name="RampGeneratorDL">
<xs:complexContent>
<xs:extension base="Standalone">
<xs:attribute name="delay" type="Nml2Quantity_time"
use="required"/>
<xs:attribute name="duration" type="Nml2Quantity_time"
use="required"/>
<xs:attribute name="startAmplitude"
type="Nml2Quantity_none"
use="required"/>
<xs:attribute name="finishAmplitude"
type="Nml2Quantity_none"
use="required"/>
<xs:attribute name="baselineAmplitude"
type="Nml2Quantity_none"
use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>


<xs:complexType name="CompoundInput">
<xs:complexContent>
<xs:extension base="Standalone">
<xs:sequence>
<xs:element name="pulseGenerator" type="PulseGenerator"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="sineGenerator" type="SineGenerator"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="rampGenerator" type="RampGenerator"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>


<xs:complexType name="CompoundInputDL">
<xs:complexContent>
<xs:extension base="Standalone">
<xs:sequence>
<xs:element name="pulseGeneratorDL" type="PulseGeneratorDL"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="sineGeneratorDL" type="SineGeneratorDL"
minOccurs="0" maxOccurs="unbounded"/>
<xs:element name="rampGeneratorDL" type="RampGeneratorDL"
minOccurs="0" maxOccurs="unbounded"/>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>


<xs:complexType name="VoltageClamp">
<xs:complexContent>
Expand Down
9 changes: 9 additions & 0 deletions examples/NML2_Inputs.nml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,19 @@
<!-- Some examples of the currently supported input types -->

<expTwoSynapse id="synInput" gbase="8nS" erev="20mV" tauRise="1ms" tauDecay="5ms"/><!-- Will be used below... -->
<expTwoSynapse id="synInputFast" gbase="1nS" erev="20mV" tauRise="0.2ms" tauDecay="1ms"/><!-- Will be used below... -->

<pulseGenerator id="pulseGen0" delay="50ms" duration="200ms" amplitude="1 nA" />

<sineGenerator id="sg0" phase="0" delay="50ms" duration="200ms" amplitude="1.4nA" period="50ms"/>

<rampGenerator id="rg0" delay="50ms" duration="200ms" startAmplitude="0.5nA" finishAmplitude="4nA" baselineAmplitude="0nA"/>

<compoundInput id="ci0">
<pulseGenerator id="pg1" delay="50ms" duration="200ms" amplitude="1 nA" />
<pulseGenerator id="pg2" delay="100ms" duration="100ms" amplitude="1 nA" />
<sineGenerator id="sg0" phase="0" delay="125ms" duration="50ms" amplitude="1nA" period="25ms"/>
</compoundInput>

<voltageClamp id="vClamp0" delay="50ms" duration="200ms"
targetVoltage="-50mV" simpleSeriesResistance="1e6ohm"/>
Expand All @@ -34,5 +41,7 @@
<spikeGeneratorPoisson id="spikeGenPoisson" averageRate="50 Hz"/>

<poissonFiringSynapse id="poissonFiringSyn" averageRate="10 Hz" synapse="synInput" spikeTarget="./synInput"/>

<transientPoissonFiringSynapse id="transPoissonFiringSyn" delay="50ms" duration="50ms" averageRate="300 Hz" synapse="synInputFast" spikeTarget="./synInputFast"/>

</neuroml>

0 comments on commit 4422c96

Please sign in to comment.