-
Notifications
You must be signed in to change notification settings - Fork 6
/
metadata.tex
120 lines (115 loc) · 5.35 KB
/
metadata.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
\section{Metadata Tables}
\label{sec-meta-tbl}
\begin{table}
\caption{Special State Variable Annotations}
\begin{tabular}[h!tbc]{|p{0.2\linewidth}|p{0.75\linewidth}|}
\hline
\textbf{key} & \textbf{meaning} \\
\hline
\code{type} & The C++ type. \emph{Read-only}.\\
\hline
\code{index} & State variable order-of-appearence, 0-indexed. \emph{Read-only}.\\
\hline
\texttt{default} & The default value for this variable that is used if otherwise
unspecified by the user. The type of the value must match the
type of the variable.\\
\hline
\code{shape} & The shape of the data type. If present this must
be a list of integers of a given length (rank).
Specifying positive values will, depending on the
backend, render this a fixed-length data type
of the provided length. A value of \code{-1}
will retain the variable-length along that axis.
Fixed-length variables are normally more performant and thus it is
often better practice to specify a shape if possible. For
example, a length-5 string would have a shape of \code{[5]} and
a length-10 vector of variable-length strings would have a
shape of \code{[10, -1]}.\\
\hline
\code{doc} & Documentation string.\\
\hline
\code{tooltip} & Brief documentation string for user interfaces.\\
\hline
\code{units} & The physical units, if any, as a string.\\
\hline
\code{userlevel} & Integer (0 - 10) representing ease (0) or difficulty (10)
in using this variable, default 0.\\
\hline
\code{schematype} & The data type that is used in the schema for input file
validation. This enables the user to supply just the data type
rather than having to overwrite the full schema for this state
variable. In most cases - when the shape is rank 0 or 1 such
as for scalars or vectors - this is simply a string. In cases
where the rank is 2+ this is a list of strings. Please refer to
the \gls{XML} Schema Datatypes \cite{xml-datatypes}
for more information.\\
\hline
\code{initfromcopy} & Code string to use in the \code{InitFrom(Agent* m)}
function for the state variable instead of automatic code
generation.\\
\hline
\code{initfromdb} & Code string to use in the
\code{InitFrom(QueryableBackend* b)}
function for this state variable instead of automatic code
generation.\\
\hline
\code{infiletodb} & Code strings to use in the \code{InfileToDb()} function
for this state variable instead of automatic code generation.
This is a dictionary of string values with the keys `read'
and `write' that represent reading values from the input file
writing them out to the database, respectively.\\
\hline
\code{schema} & Code string to use in the \code{schema()} function for
this state variable instead of automatic code generation.
This is an \gls{RNG} string. This is usually coupled with
\code{infiletodb} to ensure the custom
schema is read into the database correctly.\\
\hline
\code{snapshot} & Code string to use in the \code{Snapshot()} function for
this state variable instead of automatic code generation.\\
\hline
\code{snapshotinv} & Code string to use in the \code{SnapshotInv()} function
for this state variable instead of automatic code generation.\\
\hline
\code{initinv} & Code string to use in the \code{InitInv()} function for
this state variable instead of automatic code generation.\\
\hline
\end{tabular}
\label{sv-anno}
\end{table}
\begin{table}
\caption{Special Agent Archetype Annotations}
\begin{tabular}[h!tbc]{|p{0.2\linewidth}|p{0.75\linewidth}|}
\hline
\textbf{key} & \textbf{meaning}\\
\hline
\code{vars} & The state variable annotations. \emph{Read-only}.\\
\hline
\code{name} & C++ class name (string) of the archetype. \emph{Read-only}.\\
\hline
\code{entity} & String of the type of archetype based on which class it
inherits from; \code{cyclus::Region},
\code{cyclus::Institution}, or \code{cyclus::Facility}are
given by `region', `institution', or `facility',
respectively. If the class inherits from \code{cyclus::Agent} but
not the previous three
the string `archetype' is used. The string 'unknown' is used
if the class does not inherit from \code{cyclus::Agent}.
\emph{Read-only}.\\
\hline
\code{parents} & List of string class names of the direct super-classes of this
archetype. \emph{Read-only}.\\
\hline
\code{all_parents} & List of string class names of all the super-classes of this
archetype. \emph{Read-only}.\\
\hline
\code{doc} & Documentation string.\\
\hline
\code{tooltip} & Brief documentation string for user interfaces.\\
\hline
\code{userlevel} & Integer (0 - 10) representing ease (0) or
difficulty (10) in using this variable, default 0.\\
\hline
\end{tabular}
\label{ag-anno}
\end{table}