-
Notifications
You must be signed in to change notification settings - Fork 1
/
Inputs.xml
414 lines (277 loc) · 17.2 KB
/
Inputs.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<Lems xmlns="http://www.neuroml.org/lems/0.7.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.neuroml.org/lems/0.7.1 ../../LEMS/Schemas/LEMS/LEMS_v0.7.1.xsd"
description="A number of ComponentTypes for providing spiking and current inputs to other ComponentTypes">
<Include file="NeuroMLCoreDimensions.xml"/>
<ComponentType name="basePointCurrent"
description="Base type for all ComponentTypes which produce a current _i (with dimension current)">
<Exposure name="i" dimension="current" description="The total (time varying) current produced by this ComponentType"/>
</ComponentType>
<ComponentType name="baseVoltageDepPointCurrent"
extends="basePointCurrent"
description="Base type for all ComponentTypes which produce a current _i (with dimension current) and require a membrane potential _v exposed on the parent Component">
<Requirement name="v" dimension="voltage" description="The current may vary with the voltage exposed by the ComponentType on which this is placed"/>
</ComponentType>
<ComponentType name="basePointCurrentDL"
description="Base type for all ComponentTypes which produce a dimensionless current _I. There will eventually be dimensionless equivalents of all the core current producing ComponentTypes such as _pulseGenerator_, _sineGenerator_ and _rampGenerator_">
<Exposure name="I" dimension="none" description="The total (time varying) current produced by this ComponentType"/>
</ComponentType>
<ComponentType name="baseVoltageDepPointCurrentDL"
extends="basePointCurrentDL"
description="Base type for all ComponentTypes which produce a dimensionless current _I and require a dimensionless membrane potential _V exposed on the parent Component">
<Requirement name="V" dimension="none" description="The current may vary with the voltage exposed by the ComponentType on which this is placed"/>
</ComponentType>
<ComponentType name="baseSpikeSource"
description="Base for any ComponentType whose main purpose is to emit spikes. The exposed variable _tsince can be used for plotting the time since the Component has spiked last">
<EventPort name="spike"
direction="out"
description="Port on which spikes are emitted"/>
<Exposure name="tsince"
dimension="time"
description="Time since the last spike was emitted"/>
</ComponentType>
<ComponentType name="spikeGenerator"
extends="baseSpikeSource"
description="Simple generator of spikes at a regular interval set by _period.">
<Parameter name="period" dimension="time" description="Time between spikes. First spike will be emitted after this time."/>
<Dynamics>
<StateVariable name="tsince" dimension="time" exposure="tsince"/>
<TimeDerivative variable="tsince" value="1"/>
<OnStart>
<StateAssignment variable="tsince" value="0"/>
</OnStart>
<OnCondition test="tsince .gt. period">
<StateAssignment variable="tsince" value="0"/>
<EventOut port="spike"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="spikeGeneratorRandom" extends="baseSpikeSource"
description="Generator of spikes with a random interspike interval of at least _minISI and at most _maxISI">
<Parameter name="maxISI" dimension="time" description="Maximum interspike interval"/>
<Parameter name="minISI" dimension="time" description="Minimum interspike interval"/>
<Constant name="MSEC" dimension="time" value="1ms"/>
<Exposure name="isi" dimension="time" description="The interval until the next spike"/>
<Dynamics>
<StateVariable name="tsince" dimension="time" exposure="tsince"/>
<StateVariable name="isi" dimension="time" exposure="isi"/>
<TimeDerivative variable="tsince" value="1"/>
<OnStart>
<StateAssignment variable="tsince" value="0"/>
<StateAssignment variable="isi" value="minISI + MSEC * random((maxISI - minISI) / MSEC)"/>
</OnStart>
<OnCondition test="tsince .geq. isi">
<StateAssignment variable="isi" value="minISI + MSEC * random((maxISI - minISI) / MSEC)"/>
<StateAssignment variable="tsince" value="0"/>
<EventOut port="spike"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="spikeGeneratorPoisson" extends="baseSpikeSource"
description="Generator of spikes whose ISI is distributed according to an exponential pdf with scale 1/_averageRate">
<Parameter name="averageRate" dimension="per_time"/>
<DerivedParameter name="averageIsi" dimension="time" value="1 / averageRate"/>
<Dynamics>
<StateVariable name="tsince" dimension="time" exposure="tsince"/>
<StateVariable name="isi" dimension="time"/>
<TimeDerivative variable="tsince" value="1"/>
<OnStart>
<StateAssignment variable="tsince" value="0"/>
<StateAssignment variable="isi" value="- averageIsi * log(1 - random(1))"/>
</OnStart>
<OnCondition test="tsince .geq. isi">
<StateAssignment variable="tsince" value="0"/>
<StateAssignment variable="isi" value="- averageIsi * log(1 - random(1))"/>
<EventOut port="spike"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="pulseGenerator" extends="basePointCurrent"
description="Generates a constant current pulse of a certain _amplitude for a specified _duration after a _delay"> <!-- Note: a synpase also extends basePointCurrent -->
<Parameter name="delay" dimension="time" description="Delay before change in current. Current is zero prior to this."/>
<Parameter name="duration" dimension="time" description="Duration for holding current at amplitude. Current is zero after delay + duration."/>
<Parameter name="amplitude" dimension="current" description="Amplitude of current pulse"/>
<!--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>
<StateVariable name="i" exposure="i" dimension="current"/>
<OnEvent port="in"><!--TODO: remove, see above...
<StateAssignment variable="i" value="0"/>-->
</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"/>
</OnCondition>
<OnCondition test="t .geq. duration + delay">
<StateAssignment variable="i" value="0"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="pulseGeneratorDL" extends="basePointCurrentDL"
description="Dimensionless equivalent of _pulseGenerator_. Generates a constant current pulse of a certain _amplitude for a specified _duration after a _delay"> <!-- Note: a synpase also extends basePointCurrent -->
<Parameter name="delay" dimension="time" description="Delay before change in current. Current is zero prior to this."/>
<Parameter name="duration" dimension="time" description="Duration for holding current at amplitude. Current is zero after delay + duration."/>
<Parameter name="amplitude" dimension="none" description="Amplitude of current pulse"/>
<!--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>
<StateVariable name="I" exposure="I" dimension="none"/>
<OnEvent port="in"><!--TODO: remove, see above...-->
</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"/>
</OnCondition>
<OnCondition test="t .geq. duration + delay">
<StateAssignment variable="I" value="0"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="sineGenerator" extends="basePointCurrent"
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="current"/>
<Parameter name="period" dimension="time"/>
<EventPort name="in" direction="in"/>
<Dynamics>
<StateVariable name="i" exposure="i" dimension="current"/>
<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.">
<Parameter name="delay" dimension="time"/>
<Parameter name="duration" dimension="time"/>
<Parameter name="startAmplitude" dimension="current"/>
<Parameter name="finishAmplitude" dimension="current"/>
<Parameter name="baselineAmplitude" dimension="current"/>
<EventPort name="in" direction="in"/>
<Dynamics>
<StateVariable name="i" exposure="i" dimension="current"/>
<OnStart>
<StateAssignment variable="i" value="baselineAmplitude"/>
</OnStart>
<OnEvent port="in"><!--TODO: remove-->
</OnEvent>
<OnCondition test="t .lt. delay">
<StateAssignment variable="i" value="baselineAmplitude"/>
</OnCondition>
<OnCondition test="t .geq. delay .and. t .lt. duration+delay">
<StateAssignment variable="i" value="startAmplitude + (finishAmplitude - startAmplitude) * (t - delay) / (duration)"/>
</OnCondition>
<OnCondition test="t .geq. duration+delay">
<StateAssignment variable="i" value="baselineAmplitude"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="rampGeneratorDL" extends="basePointCurrentDL"
description="Generates a ramping current after a time _delay, for a fixed _duration. During this time the dimensionless current steadily changes from _startAmplitude to _finishAmplitude.">
<Parameter name="delay" dimension="time"/>
<Parameter name="duration" dimension="time"/>
<Parameter name="startAmplitude" dimension="none"/>
<Parameter name="finishAmplitude" dimension="none"/>
<Parameter name="baselineAmplitude" dimension="none"/>
<EventPort name="in" direction="in"/>
<Dynamics>
<StateVariable name="I" exposure="I" dimension="none"/>
<OnStart>
<StateAssignment variable="I" value="baselineAmplitude"/>
</OnStart>
<OnEvent port="in"><!--TODO: remove-->
</OnEvent>
<OnCondition test="t .lt. delay">
<StateAssignment variable="I" value="baselineAmplitude"/>
</OnCondition>
<OnCondition test="t .geq. delay .and. t .lt. duration+delay">
<StateAssignment variable="I" value="startAmplitude + (finishAmplitude - startAmplitude) * (t - delay) / (duration)"/>
</OnCondition>
<OnCondition test="t .geq. duration+delay">
<StateAssignment variable="I" value="baselineAmplitude"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="voltageClamp" extends="baseVoltageDepPointCurrent"
description="Voltage clamp. Applies a variable current _i to try to keep parent at _targetVoltage. Not yet fully tested!!!">
<Parameter name="delay" dimension="time" description="Delay before change in current. Current is zero prior to this."/>
<Parameter name="duration" dimension="time" description="Duration for attempting to keep parent at targetVoltage. Current is zero after delay + duration."/>
<Parameter name="targetVoltage" dimension="voltage" description="Current will be applied to try to get parent to this target voltage"/>
<!-- seriesResistance renamed to simpleSeriesResistance & factor of 1e-5 removed from calculation of current. Still being tested... -->
<Parameter name="simpleSeriesResistance" dimension="resistance" description="Current will be calculated by the difference in voltage between the target and parent, divided by this value"/>
<!--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>
<StateVariable name="i" exposure="i" dimension="current"/>
<OnEvent port="in"><!--TODO: remove, see above...
<StateAssignment variable="i" value="0"/>-->
</OnEvent>
<OnCondition test="t .lt. delay">
<StateAssignment variable="i" value="0"/>
</OnCondition>
<OnCondition test="t .geq. delay">
<!-- seriesResistance renamed to simpleSeriesResistance & factor of 1e-5 removed from calculation of current. Still being tested... -->
<StateAssignment variable="i" value="(targetVoltage - v) / simpleSeriesResistance"/>
</OnCondition>
<OnCondition test="t .gt. duration + delay">
<StateAssignment variable="i" value="0"/>
</OnCondition>
</Dynamics>
</ComponentType>
<ComponentType name="spikeArray" extends="baseSpikeSource"
description="Set of spike ComponentTypes, each emitting one spike at a certain time. Can be used to feed a predetermined spike train into a cell">
<Children name="spikes" type="spike"/>
<EventPort name="in" direction="in" description="This will receive events from the children"/>
<Dynamics>
<StateVariable name="tsince" dimension="time" exposure="tsince"/>
<TimeDerivative variable="tsince" value="1"/>
<OnStart>
<StateAssignment variable="tsince" value="0"/>
</OnStart>
<OnEvent port="in">
<StateAssignment variable="tsince" value="0"/>
<EventOut port="spike"/>
</OnEvent>
</Dynamics>
</ComponentType>
<ComponentType name="spike" extends="baseSpikeSource"
description="Emits a single spike at the specified time">
<Parameter name="time" dimension="time" description="Time at which to emit one spike event"/>
<Exposure name="spiked" dimension="none" description="0 signals not yet spiked, 1 signals has spiked"/>
<Dynamics>
<StateVariable name="tsince" dimension="time" exposure="tsince"/>
<StateVariable name="spiked" dimension="none" exposure="spiked"/>
<TimeDerivative variable="tsince" value="1"/>
<OnStart>
<StateAssignment variable="tsince" value="0"/>
</OnStart>
<OnCondition test="(t .geq. time) .and. (spiked .eq. 0)">
<StateAssignment variable="spiked" value="1"/>
<StateAssignment variable="tsince" value="0"/>
<EventOut port="spike"/>
</OnCondition>
</Dynamics>
<Structure>
<With instance="this" as="a"/>
<With instance="parent" as="b"/>
<EventConnection from="a" to="b"/>
</Structure>
</ComponentType>
</Lems>