-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathspecification.tex
2476 lines (2044 loc) · 114 KB
/
specification.tex
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
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
\documentclass[draftspec]{ninemlspec}
\usepackage{microtype}
\usepackage{pbox}
\usepackage{multirow}
\usepackage{float}
%% ============================================================================
%% Description: Documentation for \lq\lq{}The NineML Specification Document\rq\rq{}
%% Authors: Thomas G. Close <[email protected]>, Ivan Raikov <[email protected]>, Andrew P. Davison <[email protected]>
%% Organization: Okinawa Institute of Science and Technology Graduate University, Centre National de la Recherche Scientifique
%% Date created: October 2014 <---- should probably be some date in 2010, 2011 or so...
%% https://github.com/INCF/nineml/master/spec/specification.tex
%%
%% Copyright (C) 2014 Okinawa Institute of Science and Technology Graduate University, Centre National de la Recherche Scientifique
%%
%% ============================================================================
% Define misc. references
\newcommand{\identifier}{\typeDefRef{identifier\xspace}{sec:identifier}}
\newcommand{\URL}{\href{http://en.wikipedia.org/wiki/Uniform_resource_locator}{URL}\xspace}
% Define Abstraction Layer element references
\newcommand{\Unit}{\defRef{\textbf{\class{Unit}}\xspace}{sec:Unit}}
\newcommand{\Dimension}{\defRef{\textbf{\class{Dimension}}\xspace}{sec:Dimension}}
\newcommand{\ComponentClass}{\defRef{\textbf{\class{ComponentClass}}\xspace}{sec:ComponentClass}}
\newcommand{\Dynamics}{\defRef{\defRef{\textbf{\class{Dynamics}}\xspace}{sec:Dynamics}}{sec:Dynamics}}
\newcommand{\RandomDistribution}{\defRef{\textbf{\class{RandomDistribution}}\xspace}{sec:RandomDistribution}}
\newcommand{\BuiltInDistribution}{\defRef{\textbf{\class{BuiltInDistribution}}\xspace}{sec:BuiltInDistribution}}
\newcommand{\ConnectionRule}{\defRef{\textbf{\class{ConnectionRule}}\xspace}{sec:ConnectionRule}}
\newcommand{\AllToAll}{\defRef{\textbf{\class{AllToAll}}\xspace}{sec:AllToAll}}
\newcommand{\OneToOne}{\defRef{\textbf{\class{OneToOne}}\xspace}{sec:OneToOne}}
\newcommand{\ProbabilisticConnectivity}{\defRef{\textbf{\class{ProbabilisticConnectivity}}\xspace}{sec:ProbabilisticConnectivity}}
\newcommand{\ConnectionProbability}{\defRef{\textbf{\class{ConnectionProbability}}\xspace}{sec:ConnectionProbability}}
\newcommand{\ExplicitConnectionList}{\defRef{\textbf{\class{ExplicitConnectionList}}\xspace}{sec:ExplicitConnectionList}}
\newcommand{\MathInline}{\defRef{\textbf{\class{MathInline}}\xspace}{sec:MathInline}}
\newcommand{\StateVariable}{\defRef{\textbf{\class{StateVariable}}\xspace}{sec:StateVariable}}
\newcommand{\StateAssignment}{\defRef{\textbf{\class{StateAssignment}}\xspace}{sec:StateAssignment}}
\newcommand{\TimeDerivative}{\defRef{\textbf{\class{TimeDerivative}}\xspace}{sec:TimeDerivative}}
\newcommand{\Alias}{\defRef{\textbf{\class{Alias}}\xspace}{sec:Alias}}
\newcommand{\Constant}{\defRef{\textbf{\class{Constant}}\xspace}{sec:Constant}}
\newcommand{\StandardLibrary}{\defRef{\textbf{\class{StandardLibrary}}\xspace}{sec:StandardLibrary}}
\newcommand{\Regime}{\defRef{\textbf{\class{Regime}}\xspace}{sec:Regime}}
\newcommand{\Trigger}{\defRef{\textbf{\class{Trigger}}\xspace}{sec:Trigger}}
\newcommand{\OutputEvent}{\defRef{\textbf{\class{OutputEvent}}\xspace}{sec:OutputEvent}}
\newcommand{\OnEvent}{\defRef{\textbf{\class{OnEvent}}\xspace}{sec:OnEvent}}
\newcommand{\OnCondition}{\defRef{\textbf{\class{OnCondition}}\xspace}{sec:OnCondition}}
\newcommand{\Parameter}{\defRef{\textbf{\class{Parameter}}\xspace}{sec:Parameter}}
\newcommand{\AnalogSendPort}{\defRef{\textbf{\class{AnalogSendPort}}\xspace}{sec:AnalogSendPort}}
\newcommand{\EventSendPort}{\defRef{\textbf{\class{EventSendPort}}\xspace}{sec:EventSendPort}}
\newcommand{\AnalogReceivePort}{\defRef{\textbf{\class{AnalogReceivePort}}\xspace}{sec:AnalogReceivePort}}
\newcommand{\AnalogReducePort}{\defRef{\textbf{\class{AnalogReducePort}}\xspace}{sec:AnalogReducePort}}
\newcommand{\EventReceivePort}{\defRef{\textbf{\class{EventReceivePort}}\xspace}{sec:EventReceivePort}}
\newcommand{\Annotations}{\defRef{\textbf{\class{Annotations}}\xspace}{sec:Annotations}}
% Define User Layer element references
\newcommand{\Component}{\defRef{\textbf{\class{Component}}\xspace}{sec:Component}}
\newcommand{\Property}{\defRef{\textbf{\class{Property}}\xspace}{sec:Property}}
\newcommand{\Quantity}{\defRef{\textbf{\class{Quantity}}\xspace}{sec:Quantity}}
\newcommand{\SingleValue}{\defRef{\textbf{\class{SingleValue}}\xspace}{sec:SingleValue}}
\newcommand{\ExternalArrayValue}{\defRef{\textbf{\class{ExternalArrayValue}}\xspace}{sec:ExternalArrayValue}}
\newcommand{\ComponentValue}{\defRef{\textbf{\class{ComponentValue}}\xspace}{sec:ComponentValue}}
\newcommand{\ArrayValue}{\defRef{\textbf{\class{ArrayValue}}\xspace}{sec:ArrayValue}}
\newcommand{\ArrayValueRow}{\defRef{\textbf{\class{ArrayValueRow}}\xspace}{sec:ArrayValueRow}}
\newcommand{\ListColumn}{\defRef{\textbf{\class{ListColumn}}\xspace}{sec:ListColumn}}
\newcommand{\Definition}{\defRef{\textbf{\class{Definition}}\xspace}{sec:Definition}}
\newcommand{\Prototype}{\defRef{\textbf{\class{Prototype}}\xspace}{sec:Prototype}}
\newcommand{\Reference}{\defRef{\textbf{\class{Reference}}\xspace}{sec:Reference}}
\newcommand{\Population}{\defRef{\textbf{\class{Population}}\xspace}{sec:Population}}
\newcommand{\Cell}{\defRef{\textbf{\class{Cell}}\xspace}{sec:Cell}}
\newcommand{\Number}{\defRef{\textbf{\class{Number}}\xspace}{sec:Number}}
\newcommand{\Projection}{\defRef{\textbf{\class{Projection}}\xspace}{sec:Projection}}
\newcommand{\Source}{\defRef{\textbf{\class{Source}}\xspace}{sec:Source}}
\newcommand{\Destination}{\defRef{\textbf{\class{Destination}}\xspace}{sec:Destination}}
\newcommand{\Connectivity}{\defRef{\textbf{\class{Connectivity}}\xspace}{sec:Connectivity}}
\newcommand{\Response}{\defRef{\textbf{\class{Response}}\xspace}{sec:Response}}
\newcommand{\Plasticity}{\defRef{\textbf{\class{Plasticity}}\xspace}{sec:Plasticity}}
\newcommand{\Delay}{\defRef{\textbf{\class{Delay}}\xspace}{sec:Delay}}
\newcommand{\FromSource}{\defRef{\textbf{\class{FromSource}}\xspace}{sec:FromSource}}
\newcommand{\FromDestination}{\defRef{\textbf{\class{FromDestination}}\xspace}{sec:FromDestination}}
\newcommand{\FromPlasticity}{\defRef{\textbf{\class{FromPlasticity}}\xspace}{sec:FromPlasticity}}
\newcommand{\FromResponse}{\defRef{\textbf{\class{FromResponse}}\xspace}{sec:FromResponse}}
\newcommand{\Selection}{\defRef{\textbf{\class{Selection}}\xspace}{sec:Selection}}
\newcommand{\Concatenate}{\defRef{\textbf{\class{Concatenate}}\xspace}{sec:Concatenate}}
\newcommand{\Item}{\defRef{\textbf{\class{Item}}\xspace}{sec:Item}}
% Macros just for this document:
\newcommand{\ninemlpkg}{\texorpdfstring{%
\textls[-25]{\textsc{NineMLSpec}}}{%
\textsc{NineMLSpec}}\xspace}
\newcommand{\ninemlpkghead}{\texorpdfstring{%
\textls[-50]{\textsc{NineMLSpec}}}{%
\textsc{NineMLSpec}}\xspace}
\newcommand{\distURL}{https://github.com/INCF/nineml/tree/master/spec/specification.pdf}
\newcommand{\srcURL}{https://github.com/INCF/nineml/tree/master/spec/specification.tex}
\newcommand{\webURL}{https://github.com/INCF/nineml/tree/master/spec/specification.pdf}
% Custom latex listing style, for use with the listings package. The default
% highlights far too many things, IMHO. This keeps it simple and only adjusts
% the appearance of comments within listings.
\lstdefinelanguage{mylatex}{
morekeywords={},%
sensitive,%
alsoother={0123456789$_},%$
morecomment=[l]\%%
}[keywords,tex,comments]
\lstdefinestyle{latex}{language=mylatex}
% -----------------------------------------------------------------------------
% Start of document
% -----------------------------------------------------------------------------
\begin{document}
\packageTitle{NineML (9ML) Specification}
\packageVersion{Version 1.0}
\packageVersionDate{ \today}
\pagestyle{empty}
\begin{center}
{\includegraphics[width=0.7\columnwidth]{figures/incf_new.png}}
\end{center}
\vspace*{0.5cm}
\noindent\rule{\columnwidth}{2pt}
\vspace*{0.75cm}
\begin{center}
\noindent{\Huge \bf Network Interchange for Neuroscience Modeling Language
(NineML)}\\
\vspace{0.5cm}
\noindent{\LARGE \bf Specification}\\
\vspace{0.5cm}
\noindent{\large NineML Standardization Committee}\\
\vspace{0.5cm}
\noindent{\large Version: 1.0}
\end{center}
\vspace*{0.5cm}
\noindent\rule{\columnwidth}{2pt}
\vspace*{0.25cm}
\noindent{
{\Large\bf Editors: }
\begin{itemize}
\item Alex Cope
\item Andrew P. Davison
\item Erik De Schutter
\item Ivan Raikov
\item Paul Richmond
\item Thomas G. Close
\end{itemize}
\vspace*{0.25cm}
\begin{normalsize}
\noindent \textbf{Acknowledgments:}\\\\
\noindent
We would like to thank the former INCF NineML Task Force members for their contributions to the text and the concepts presented in this document. In particular:
A. Gorchetchnikov, M. Hull, Y. Le Franc, P. Gleeson, E. Muller, R. Cannon, Birgit Kriener, Subhasis Ray and S. Hill.
\vspace*{0.5cm}
This document is under the Common Creative license BY-NC-SA:\\ http://creativecommons.org/licenses/by-nc-sa/3.0/
\vspace*{0.25cm}
{\flushright \includegraphics[width=3cm]{figures/by-nc-sa.png}}
\vspace*{0.5cm}
\noindent {\bf Date:} \today
\end{normalsize}
}
\title{NineML (9ML) Specification}
\newpage
\pagestyle{plain}
%\maketitlepage
\maketableofcontents
% -----------------------------------------------------------------------------
\section{Introduction}
% -----------------------------------------------------------------------------
\vspace{-12.5pc} % A bit of a hack to reverse the vspace added by the Appendix name
The increasing diversity of neuronal network models and the software/hardware platforms used to simulate them,
presents a significant challenge for sharing, replicability and reusability of models in computational neuroscience.
To address this problem, we propose a common description language to facilitate the exchange neuronal network models between researchers and simulator platforms.
This description language is based on a
common object model describing the different elements of network
models. This work, initiated and supported by the International
Neuroinformatics Coordinating Facility as part of the Multiscale Modeling
Program, involve computational neuroscientists, simulator developers and
developers of simulator-independent languages (NeuroML, PyNN). The name of the
proposed language is NineML (Network Interchange for Neuroscience Modeling
Language).
\subsection{Scope}
The purpose of NineML is to provide a computer language for
succinct and unambiguous description of computational neuroscience models of neuronal networks.
NineML is intended to describe the network architecture, parameters
and equations that govern the dynamics of a neuronal network, without
taking into account model implementation details such as numerical integration
methods.
As of version 1.0, the following neuronal
network objects can be described in NineML:
\begin{enumerate}
\item spiking and non-spiking neurons
\item synapses
\begin{enumerate}
\item Post-synaptic membrane current mechanisms
\item Short-term synaptic dynamics (depression, facilitation)
\item Long-term synaptic modifications (STDP, learning, etc.)
\item Gap-junctions
\end{enumerate}
\end{enumerate}
\subsection{Design considerations}
\label{sec:design_considerations}
As one of the goals of NineML is to provide a means to exchange models between simulator platforms,
it is important to maintain a clear distinction
between the role of NineML and the role of a simulator. Therefore, NineML only
contains the necessary information to describe the model
not how to simulate it, although suggestions can be supplied in annotations to the model (see \ref{sec:AnnotationsSection}).
For example, NineML should specify the neuron membrane equation to solve,
but not how to solve it. In addition, for implementation and performance
reasons, it is important to keep the language layer ``close'' to the simulator
-- such that the language layer is not responsible for maintaining separate
representations of all the instantiated elements in the network.
A NineML object model representation can take multiple forms. A
program can employ a concrete representation of the NineML objects in
a specific programming language, convert an internal model
representation to and from the NineML XML schema, or use code generation
to produce a model representation for a target simulation environment.
It is important to note that the NineML XML schema is isomorphic to the NineML
object model.
The design of NineML is divided into two semantic layers:
\begin {enumerate}
\item An {\bf Abstraction Layer} that provides the core concepts and
mathematical descriptions with which model variables and state update
rules are explicitly described in {\em parametrized} form, and
\item A {\bf User Layer} that provides a syntax to specify the
instantiation and the value of parameters of all these components of a network
model.
\end {enumerate}
Since the User Layer provides the instantiation and
parametrization of model elements that have been defined in the
Abstraction Layer, the two layers should share
a complementary and compatible design philosophy. Which aspects of a model
are defined in the Abtraction Layer and which are in the User Layer
Layer are clearly defined (each element type belongs to either one).
In order to simplify their interpretation and maintain compatibility with a wide
range of data formats (e.g. JSON, Python objects), NineML documents are
not sensitive to the order that objects appear in.
\subsection{Identifiers}
\label{sec:identifier}
Elements are identified by \emph{names}, which are unique in the scope they are enclosed by (either within a component class or in the global scope of the file). For a name to be a valid NineML identifier, it must meet the requirements for a \href{http://msdn.microsoft.com/en-us/library/e7f8y25b.aspx}{ANSI C89 identifiers}. Additionally, identifiers are not permitted to begin or end with an underscore character (i.e. `\_') to allow special variables to be defined in the same scope as identified variables/objects in generated code.
NineML identifiers are case-sensitive in the sense that they must be referred to with the same case as they are defined. However, two identifiers that are identical with the exception of case, e.g. `v\_threshold' and `v\_Threshold', are not permitted within the same scope. Identifiers used within component classes also cannot be the same (case-sensitive) as one of the built-in symbols or functions (see \MathInline).
\subsection{Extensions}
\label{sec:extensions}
``Extensions'' increase the descriptive power of NineML by providing syntax for compact, high-level descriptions of models that can also be expressed in ``Core'' NineML (i.e. syntactic sugar). Envisaged examples include concise forms for kinetic equations and multi-component/compartment dynamic models.
Core NineML is everything defined by this document, except those parts specifically described as Extensions. To be classified as a NineML Extension, a modelling language must meet the following requirements.
\begin{itemize}
\item Models written in the Extension format (or part thereof) must be collapsible to Core NineML without change in behaviour.
\item The flattened (to Core NineML) descriptions must be convertible back to their original form (the additional information required to perform the reverse conversion can be stored in \Annotations).
\item Stand-alone tools that perform the two-way conversion between the extended and core forms (preferably written in commonly used languages such as XSLT, Python, Java, etc...) must be downloadable from a publicly available \URL (a section of the NineML website, \href{http://nineml.net}{http://nineml.net}, is available for this purpose).
\item Non-standard extensions must be defined within a unique namespace
\item Detailed specifications, preferably in the same format as this document (see the `ninemlspec.cls' latex class), must be made publicly available along with the conversion tools.
\label{item:collapsible}
\end{itemize}
One of the rationales behind the division between core and extended NineML is to minimise the set of features that a tool needs to support to be NineML compliant, i.e. as long as the core is supported all extensions should also be supported via flattening to core NineML. However, tool builders may want to take advantage of the additional structure provided by the extensions to optimise the implementation of the model or provide more intuitive interfaces to the user.
\note{To facilitate the reverse conversion from core to extended formats, NineML compliant tools must preserve all annotations during reading, writing and transformation, with the exception of when the return conversion is no longer possible due to the applied transformation or the annotations are explicitly added/deleted by the user.}
\clearpage
\part{Abstraction Layer}
\section{Component Classes and Parameters}
The main building block of the Abstraction Layer is the \ComponentClass.
The \ComponentClass is intended to package together a collection of
objects that relate to the definition of a model (e.g. cells, synapses, synaptic
plasticity rules, random spike trains, inputs).
All equations and event declarations that are part of particular entity
model, such as neuron model, belong in a single \ComponentClass.
A \ComponentClass can be used to represent either a specific model of a neuron or a
composite model, including synaptic mechanisms.
The interface is the \emph{external} view of the \ComponentClass that defines
what inputs and outputs the component exposes to other {\ComponentClass} elements and the
parameters that can be set for the \ComponentClass. The interface consists of
instances of ports and \Parameter (see \ref{fig:component_class_overview}).
\begin{figure}[htb]
\center
\includegraphics[width=8cm]{figures/component_simple.pdf}
\protect\caption{ComponentClass Overview}
\label{fig:component_class_overview}
\end{figure}
As well as being able to specify the communication of continuous values,
{\ComponentClass} elements are also able to specify the emission and the reception
of events. Events are discrete notifications
that are transmitted over event ports. Since
Event ports have names, saying that we transmit `event1' for example
would mean transmitting an event on the EventPort called `event1'. Events
can be used for example to signal action potential firing.
\subsection{ComponentClass}
\label{sec:ComponentClass}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{ComponentClass Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
\midrule
\em{Element type} & \em{Multiplicity} & \em{Required} \\
\midrule
\Parameter & set & no \\
\AnalogSendPort & set & no\\
\AnalogReceivePort & set & no\\
\AnalogReducePort & set & no \\
\EventSendPort & set & no\\
\EventReceivePort & set & no\\
\Dynamics | \ConnectionRule | \RandomDistribution & singleton & yes \\
\bottomrule
\end{edtable}
\end{table}
A \ComponentClass is composed of:
\begin{itemize}
\item {\Parameter} objects for the \ComponentClass, which specify which values are required to be provided in the User Layer.
\item An unordered collection of port objects, which either publish or read state variables or derived values published from other components in the case of analog send and receive ports, or emit events or listen for events emitted from components. \EventSendPort and \EventReceivePort objects raise and listen for events passed between dynamic components.
\item {A `main' block, which specifies the nature of the component class:
\begin{itemize}
\item \Dynamics, the component class defines a dynamic element such as neutron or post-synaptic response.
\item \ConnectionRule, the component class defines a rule by which populations are connected in projections.
\item \RandomDistribution, the component class defines random distribution.
\end{itemize}}
\end{itemize}
\subsubsection{Name attribute}
Each \ComponentClass requires a \textit{name} attribute, which should be a valid \identifier and uniquely identify the {\ComponentClass} in the global scope.
\subsection{Parameter}
\label{sec:Parameter}
\draftnote{On reading through the old specs it is pretty clear that requiring dimensions for parameters and properties, including dimensionless ones, was deemed pretty important. I have also realised that it makes them easier to handle as you don't have to test for the case when they are not there.}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{Parameter Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
dimension & \Dimension{}@name & yes\\
\bottomrule
\end{edtable}
\end{table}
\Parameter objects are placeholders for numerical values within a \ComponentClass.
They define particular qualities of the model,
such as the firing threshold, reset voltage or the
decay time constant of a synapse model. By definition, Parameters are set at the
start of the simulation, and remain constant throughout.
\subsubsection{Name attribute}
Each \Parameter requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \Parameter within the \ComponentClass.
\subsubsection{Dimension attribute}
\Parameter elements must have a \textit{dimension} attribute. This attribute specifies the dimension of the units of the quantity that is expected to be passed to the \Parameter and should refer to the name of a \Dimension element in the global scope. For a dimensionless parameters a \Dimension with all attributes of power 0 can be used.
\section{Units and Dimensions}
Dimensions are associated with parameters, analog ports and state variables in component class
definitions. Each dimension can give rise to a family of unit declarations, each of
which has the same dimensionality but a different multiplier. For example,
typical units for a quantity with dimensionality voltage include
millivolts (multiplier = $10^{-3}$), microvolts (multiplier = $10^{-6}$)
and volts (multiplier = 1). To express a dimensional quantity both a
numerical factor and a unit are required.
Except where physical constants are required, abstraction layer definitions
generally only contain references to dimensions and are independent of any
particular choice of units. Conversely, the user layer only refers to units.
Internally, dimensional quantities are to be understood
as rich types with a numerical factor and exponents for each of the
base dimensions. They are independent of the particular choice of
units by which they are assigned.
\note{The format for units and dimensions is the same as is used for LEMS/NeuroML v2.0 (\href{http://www.neuroml.org}{http://www.neuroml.org}) \citep{Cannon2014}.}
\subsection{Dimension}
\label{sec:Dimension}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{Dimension Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
m & \primtype{integer} & no\\
l & \primtype{integer} & no\\
t & \primtype{integer} & no\\
i & \primtype{integer} & no\\
n & \primtype{integer} & no\\
k & \primtype{integer} & no\\
j & \primtype{integer} & no\\
\bottomrule
\end{edtable}
\end{table}
\Dimension objects are constructed values from the powers for each of the seven SI base
units: length (\emph{l}), mass (\emph{m}), time (\emph{t}), electric current (\emph{i}), temperature (\emph{k}), luminous intensity (\emph{l}) and amount of substance (\emph{n}).
For example, acceleration has dimension $lt^{-2}$ and voltage is
$ml^2t^3i^{-1}$. \Dimension objects must be declared in the top-level scope of the NineML document where they are referenced.
\subsubsection{Name attribute}
Each \Dimension requires a \textit{name} attribute, which should be a valid \identifier and uniquely identify the {\Dimension} in current the scope.
\subsubsection{M attribute}
The \textit{m} attribute specifies the power of the mass dimension in the \Dimension. If omitted the power is zero.
\subsubsection{L attribute}
The \textit{l} attribute specifies the power of the length dimension in the \Dimension. If omitted the power is zero.
\subsubsection{T attribute}
The \textit{t} attribute specifies the power of the time dimension in the \Dimension. If omitted the power is zero.
\subsubsection{I attribute}
The \textit{i} attribute specifies the power of the current dimension in the \Dimension. If omitted the power is zero.
\subsubsection{N attribute}
The \textit{n} attribute specifies the power of the amount-of-substance dimension in the \Dimension. If omitted the power is zero.
\subsubsection{K attribute}
The \textit{k} attribute specifies the power of the temperature dimension in the \Dimension. If omitted the power is zero.
\subsubsection{J attribute}
The \textit{j} attribute specifies the power of the luminous-intensity dimension in the \Dimension. If omitted the power is zero.
\subsection{Unit}
\label{sec:Unit}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{Unit Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
symbol & \identifier & yes\\
dimension & \Dimension{}@name & yes\\
power & \primtype{integer} & no\\
offset & \primtype{real number} & no\\
\bottomrule
\end{edtable}
\end{table}
\Unit objects specify the dimension multiplier and the offset of a unit with respect to a defined \Dimension object. \Unit objects must be declared in the top-level scope of the NineML documents where they are referenced.
\subsubsection{Symbol attribute}
Each \Unit requires a \textit{symbol} attribute, which should be a valid \identifier and uniquely identify the {\Unit} in current the scope.
\subsubsection{Dimension attribute}
Each \Unit requires a \textit{dimension} attribute. This attribute specifies the dimension of the units and should refer to the name of a \Dimension element in the global scope.
\subsubsection{Power attribute}
Each \Unit requires a \textit{power} attribute. This attribute specifies the relative scale of the units compared to the equivalent SI units in powers of ten. If omitted the power is zero.
\subsubsection{Offset attribute}
A \Unit can optionally have an \textit{offset} attribute. This attribute specifies the zero offset of the unit scale. For example,
\begin{lstlisting}
<Unit name="degC" dimension="temperature" power="0" offset="273.15"/>
\end{lstlisting}
If omitted, the offset is zero.
\section{Mathematical Expressions}
As of NineML version 1.0, only inline mathematical expressions, which have similar syntax to the ANSI C89 standard, are supported. In future versions it is envisaged that inline expressions will be either augmented or replaced with MathML (\href{http://mathml.org}{http://mathml.org}) expressions.
\subsection{MathInline}
\label{sec:MathInline}
\begin{table}[H]
\begin{edtable}{tabular}{lr}
\toprule
\multicolumn{2}{c}{\parbox{0.55\linewidth}{\center\textbf{MathInline Structure}}}\\
\toprule
\em{Description of text} & \em{Required} \\
\midrule
Inline mathematical expression & yes\\
\bottomrule
\end{edtable}
\end{table}
\MathInline blocks are used to specify mathematical expressions. Depending on the context, \MathInline blocks should return an expression that
evaluates to either a \primtype{bool} (when used as the trigger for
{\OnCondition} objects) or a \primtype{real number} (when used as a
right-hand-side for {\Alias}, {\TimeDerivative} and {\StateAssignment} objects). All numbers/variables in inline maths expressions are assumed to be \primtype{real numbers}.
The following operators are supported in inline maths expressions,
\draftnote{I have added exponent operator since it is commonly used in neutron models and is quite convenient but it is not ANSI C89 so I am not sure whether you guys think this is a good idea}
\begin{itemize}
\item Arithmetic operators
\begin{itemize}
\item Addition \verb|+|
\item Subtraction \verb|-|
\item Division \verb|/|
\item Multiplication \verb|*|
\item Exponent \verb|^|
\end{itemize}
The `\verb|+|', `\verb|-|', `\verb|/|' and `\verb|*|' operators have the same interpretation and precedence levels as in the ANSI C89 standard. `\verb|^|', which is not part of the ANSI C89 standard, is the exponent operator e.g.
\begin{lstlisting}
a^3 = a*a*a
\end{lstlisting}
and has the highest level of precedence.
\item Inequality operators
\begin{itemize}
\item Greater than \verb|>|
\item Lesser than \verb|<|
\end{itemize}
\item Logical operators
\begin{itemize}
\item Logical And: \verb|&&|
\item Logical Or: \verb+||+
\item Logical Not: \verb|!|
\end{itemize}
\end{itemize}
The following functions are built in and are defined as per ANSI C89:
\begin{itemize}
\item \verb|exp(x)|
\item \verb|sin(x)|
\item \verb|cos(x)|
\item \verb|log(x)|
\item \verb|log10(x)|
\item \verb|pow(x, p)|
\item \verb|sinh(x)|
\item \verb|cosh(x)|
\item \verb|tanh(x)|
\item \verb|sqrt(x)|
\item \verb|atan(x)|
\item \verb|asin(x)|
\item \verb|acos(x)|
\item \verb|asinh(x)|
\item \verb|acosh(x)|
\item \verb|atanh(x)|
\item \verb|atan2(x)|
\item \verb|ceil(x)|
\item \verb|floor(x)|
\end{itemize}
\draftnote{I removed the "random" namespace since it was proving difficult to parse and it is made redundant by adding the \RandomDistribution elements to standard?}
The following symbols are built in, and cannot be redefined,
\begin{itemize}
\item pi
\item t
\end{itemize}
where $pi$ is the mathematical constant $\pi$, and $t$ is the elapsed simulation time within a \Dynamics block.
\subsection{Alias}
\label{sec:Alias}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{Alias Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
\midrule
\em{Element type} & \em{Multiplicity} & \em{Required} \\
\midrule
\MathInline & singleton & yes \\
\bottomrule
\end{edtable}
\end{table}
An alias corresponds to an alternative name for a variable or part of an expression.
\textbf{Aliases} are motivated by two use cases:
\begin{itemize}
\item {\bf substitution}: rather than writing long expressions for functions of
state variables, we can split the expressions into a chain of \Alias objects, e.g.
\begin{lstlisting}
m_alpha = (alphaA + alphaB * V)/(alphaC + exp((alphaD + V / alphaE)))
m_beta = (betaA + betaB * V)/(betaC + exp((betaD + V / betaE)))
minf = m_alpha / (m_alpha + m_beta)
mtau = 1.0 / (m_alpha + m_beta)
dm/dt = (1 / C) * (minf - m) / mtau
\end{lstlisting}
In this case, \lstinline|m_alpha|, \lstinline|m_beta|, \lstinline|minf| and \lstinline|mtau| are all
alias definitions. There is no reason we couldn't expand our $\mathrm{d}m/\mathrm{d}t$
description out to eliminate these intermediate {\Alias} objects, but the expression
would be very long and difficult to read.
\item {\bf Accessing intermediate variables}: if we would like to communicate a
value other than a simple \StateVariable to another \ComponentClass. For
example, if we have a component representing a
neuron, which has an internal \StateVariable, `V', we may be interested in
transmitting a current, for example $i=g*(E-V)$.
\end{itemize}
\subsubsection{Name attribute}
Each \Alias requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \Alias from all other elements in the \ComponentClass.
\draftnote{Was tossing up whether `Constant' was a better name for this or not. Was thinking that this could also be used to remove `pi' from the list of built-in symbols and maybe provide some `standardLibrary' attributes.}
\subsection{Constant}
\label{sec:Constant}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{Constant Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
units & \Unit@name & yes\\
\midrule
\em{Text format} & \; & \em{Required} \\
\midrule
\primtype{real number} & \; & yes \\
\bottomrule
\end{edtable}
\end{table}
\Constant objects are used to specify physical constants such as the Ideal Gas Constant (i.e. 8.314462175 JK$^{-1}$mol$^{-1}$) or Avogadro's number (i.e. 6.0221412927$\times$10$^{23}$mol$^{-1}$).
\subsubsection{Name attribute}
Each \Constant requires a \textit{name} attribute, which should be a valid \identifier and uniquely identify the {\Dimension} in current the scope.
\subsubsection{Units attribute}
Each \Constant requires a \textit{units} attribute. The \textit{units} attribute specifies the units of the property and should refer to the name of a \Unit element in the global scope.
\subsubsection{Text format}
Any valid numeric value, including shorthand scientific notation e.g. 1e-5 ($1\times10^{-5}$).
\section{Ports}
\label{sec:Ports}
Ports allow components to communicate with each
other during a simulation. Ports can either transmit discrete events or continuous streams of analog data. Events are typically used to transmit and receive spikes between neutron model, whereas analog ports can be used to model injected current and gap junctions between neuron models.
Ports are divided into sending, \EventSendPort and \AnalogSendPort, and receiving objects, \EventReceivePort, \AnalogReceivePort and \AnalogReducePort. With the exception of \AnalogReducePort objects, each receive port must be connected to exactly one send port, where as a send port can be connected any number of receive ports. \AnalogReducePort objects can be connected to any number of \AnalogSendPort objects; the values of the connected ports are then ``reduced'' to a single data stream.
\subsection{AnalogSendPort}
\label{sec:AnalogSendPort}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{AnalogSendPort Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & [\StateVariable | \Alias{}]@name & yes\\
dimension & \Dimension{}@name & yes\\
\bottomrule
\end{edtable}
\end{table}
{\AnalogSendPort} objects allow variables from the current component to be published externally to be read by other {\ComponentClass} objects. Each {\AnalogSendPort} can be connected to multiple {\AnalogReceivePort} and {\AnalogReducePort} objects.
\subsubsection{Name attribute}
Each \AnalogSendPort requires a \textit{name} attribute, which should refer to a \StateVariable or \Alias within the current \ComponentClass.
\subsubsection{Dimension attribute}
Each \AnalogSendPort requires a \textit{dimension} attribute. This attribute specifies the dimension of the units of the quantity that is expected to be passed through the \AnalogSendPort and should refer to the name of a \Dimension element in the global scope.
\note{"Dimensionless" parameters can be defined by referring to an empty \Dimension object, i.e. one without any \textit{power} or offset attributes}
\subsection{AnalogReceivePort}
\label{sec:AnalogReceivePort}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{AnalogReceivePort Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
dimension & \Dimension{}@name & yes\\
\bottomrule
\end{edtable}
\end{table}
{\AnalogReceivePort}s allow variables that have been published externally to be used within the current component. Each \AnalogReceivePort must be connected to exactly \emph{one} \AnalogSendPort.
\subsubsection{Name attribute}
Each \AnalogReceivePort requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \AnalogReceivePort from all other elements in the \ComponentClass.
\subsubsection{Dimension attribute}
Each \AnalogReceivePort requires a \textit{dimension} attribute. This attribute specifies the dimension of the units of the quantity that is expected to be passed through the \AnalogReceivePort and should refer to the name of a \Dimension element in the global scope.
\subsection{AnalogReducePort}
\label{sec:AnalogReducePort}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{AnalogReducePort Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
dimension & \Dimension{}@name & yes\\
operator & \textit{+} & yes \\
\bottomrule
\end{edtable}
\end{table}
Reduce ports can receive data from any number of {\AnalogSendPort} objects (including none). An \AnalogReducePort takes an additional operator compared to an \AnalogReceivePort,
{\tt operator}, which specifies how the data from multiple analog send ports
should be combined to produce a single value. Currently, the
only supported operation is \lq\lq{}$+$\rq\rq{}, which calculates the sum of the incoming port values.
The motivation for \AnalogReducePort is that it allows us to make our
\ComponentClass definitions more general. For example, if we are defining a
neuron, we would define an \AnalogReducePort called \emph{InjectedCurrent}.
This allows us to write the membrane equation for that neuron as
$\mathrm{d}V/\mathrm{d}t = (1/C) * InjectedCurrent$.
Then, when we connect this neuron to synapses, current-clamps, etc, we
simply need to connect the send ports containing the currents of these
{\ComponentClass}es to the \emph{InjectedCurrent} reduce port, without having
to change our original \ComponentClass definitions.
\subsubsection{Name attribute}
Each \AnalogReducePort requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \AnalogReducePort from all other elements in the \ComponentClass.
\subsubsection{Dimension attribute}
Each \AnalogReducePort requires a \textit{dimension} attribute. This attribute specifies the dimension of the units of the quantity that is expected to be communicated through the \AnalogReducePort and should refer to the name of a \Dimension element in the global scope.
\subsubsection{Operator attribute}
Each \AnalogReducePort requires an \textit{operator} attribute. The operator \lq\lq{}reduces\rq\rq{} the connected inputs to a single value at each time point. For example the following port,
\begin{lstlisting}
<AnalogReducePort name="total_membrane_current" dimension="current" operator="+"/>
\end{lstlisting}
will take all of the electrical currents that have been connected to it via {\AnalogSendPort}s and sum them to get the total current passing through the membrane.
\subsection{EventSendPort}
\label{sec:EventSendPort}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{EventSendPort Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
\bottomrule
\end{edtable}
\end{table}
An \EventSendPort specifies a channel over which events can be transmitted from a component. Each \EventSendPort can be connected any number of \EventReceivePort objects.
\subsubsection{Name attribute}
Each \EventSendPort requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \EventSendPort from all other elements in the \ComponentClass.
\subsection{EventReceivePort}
\label{sec:EventReceivePort}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{EventReceivePort Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
\bottomrule
\end{edtable}
\end{table}
An \EventReceivePort specifies a channel over which events can be received by a component. Each \EventReceivePort must be connected to exactly \emph{one} \EventSendPort.
\subsubsection{Name attribute}
Each \EventReceivePort requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \EventReceivePort from all other elements in the \ComponentClass.
\section{Dynamic Regimes}
Component classes that contain a \Dynamics block define dynamic models such as neurons, post-synaptic responses or the plasticity of synaptic weights. In these components, state variables are evolved by sets of ordinary differential equations (ODE), which describe the behaviour of the model. The state of the model can transition between distinct regimes, which define different sets of differential equations, via `transitions'. Multiple regimes can be used to model qualitatively distinct behaviour by neuron models, such as sub-threshold, spiking and refractory periods of an abstract neuron model for example.
\ref{fig:simple_regime_graph} illustrates a hypothetical transition graph for a system with three state variables, $X$, $Y$ and $Z$, which transitions between three ODE regimes, \emph{regime1}, \emph{regime2} and \emph{regime3}. At any time, the model will be in one and only one of these regimes, and the state variables will evolve according to the ODE of that regime.
\begin{figure}[htb!]
\center
\includegraphics[width=14cm]{images/SimpleRegimeGraph.png}
\protect\caption{The dynamics block for an example component.}
\label{fig:simple_regime_graph}
\end{figure}
\subsection{Dynamics}
\label{sec:Dynamics}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{Dynamics Structure}}}\\
\toprule
\em{Element type} & \em{Multiplicity} & \em{Required} \\
\midrule
\StateVariable & set & no \\
\Regime & set & yes\\
\Alias & set & no\\
\Constant & set & no\\
\bottomrule
\end{edtable}
\end{table}
The \Dynamics block represents the \emph{internal} mechanisms
governing the behaviour of the component. These dynamics are based on ordinary differential equations (ODE) but may contain non-linear transitions between
different ODE regimes. The regime graph (e.g. \ref{fig:simple_regime_graph}) must contain at least one \Regime element, and contain no regime islands. At any given time, a component will be in a single regime, and can change which regime it is in through transitions.
\note{\Alias objects are defined in Dynamics blocks, \emph{not} \Regime blocks. This means that aliases are the same across all regimes.}
\subsection{StateVariable}
\label{sec:StateVariable}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{StateVariable Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
dimension & \Dimension{}@name & yes\\
\bottomrule
\end{edtable}
\end{table}
The internal state of a component is defined by a set of state variables
-- variables that can change either continuously or discontinuously as a
function of time.
The value of a \StateVariable can change in two ways:
\begin{quote}
\begin{itemize}
\item continuously through \TimeDerivative elements (in {\Regime} elements),
which define how the {\StateVariable} evolves over time, e.g.
$dX/dt=1-X$.
\item discretely through \StateAssignment (in \OnCondition or \OnEvent transition elements),
which make discrete changes to a \StateVariable value, e.g. $X = X + 1$.
\end{itemize}
\end{quote}
\subsubsection{Name attribute}
Each \StateVariable requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \StateVariable from all other elements in the \ComponentClass.
\subsubsection{Dimension attribute}
Each \StateVariable requires a \textit{dimension} attribute. This attribute specifies the dimension of the units of the quantities that \StateVariable is expected to be initialised and updated with and should refer to the name of a \Dimension element in the global scope.
\subsection{Regime}
\label{sec:Regime}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{Regime Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
name & \identifier & yes\\
\midrule
\em{Element type} & \em{Multiplicity} & \em{Required} \\
\midrule
\TimeDerivative & set & no \\
\OnCondition & set & no\\
\OnEvent & set & no\\
\bottomrule
\end{edtable}
\end{table}
A \Regime element represents a system of ODEs in time
on \StateVariable. As such, \Regime defines how the state variables
change (propagate in time) between subsequent transitions. \Regime is
must have non-vanishing temporal extent. Once construction of
the \Regime is complete, it should have defined the following
properties:
\subsubsection{Name attribute}
Each \Regime requires a \textit{name} attribute, which is a valid \identifier and uniquely identifies the \Regime from all other elements in the \ComponentClass.
\subsection{TimeDerivative}
\label{sec:TimeDerivative}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{TimeDerivative Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule
variable & \StateVariable{}@name & yes\\
\midrule
\em{Element type} & \em{Multiplicity} & \em{Required} \\
\midrule
\MathInline & singleton & yes \\
\bottomrule
\end{edtable}
\end{table}
\TimeDerivative elements contain a mathematical expression for the right-hand side of the ODE
\begin{equation}
\frac{\mathrm{d} variable}{\mathrm{d} t} = expression
\end{equation}
which can contain of references to any combination of \StateVariable, \Parameter, \AnalogReceivePort, \AnalogReducePort and \Alias elements with the exception of aliases that are derived from \RandomDistribution components. Therefore, only one \TimeDerivative element is allowed per \StateVariable per \Regime. If a {\TimeDerivative} for a \StateVariable is not defined in a \Regime, it is assumed to be zero.
\subsubsection{Variable attribute}
Each \TimeDerivative requires a \textit{variable} attribute. This should refer to the name of a \StateVariable in the \ComponentClass. Only one \TimeDerivative is allowed per \textit{variable} in each \Regime.
\section{Transitions}
\label{sec:Transition}
Movements between dynamic regimes occurs via transitions, and have vanishing temporal extents (i.e. they are event-like). There are two types of transitions, condition-triggered transitions (see \OnCondition), which are evoked when an associated trigger expression becomes true, or event-triggered transitions (see \OnEvent), which are evoked when an associated event port receives an event from an external component.
\draftnote{Should \OnEvent transitions be able to emit new events or would this be unnecessarily complex to handle?}
During either type of transition three instantaneous actions will/can occur:
\begin{itemize}
\item The component transitions to a target regime (can be the same as the current regime)
\item State variables can be assigned new values (see \StateAssignment)
\item The component can send events (see \OutputEvent).
\end{itemize}
Multiple state assignments can be sent and multiple events can be sent within a single transition block
(for more on the resolution of transitions see Appendix~\ref{resolution}).
\subsection{OnCondition}
\label{sec:OnCondition}
\begin{table}[H]
\begin{edtable}{tabular}{llr}
\toprule
\multicolumn{3}{c}{\parbox{0.55\linewidth}{\center\textbf{OnCondition Structure}}}\\
\toprule
\em{Attribute name} & \em{Type/Format} & \em{Required} \\
\midrule