The Higher Education and Research forge

Home My Page Projects Code Snippets Project Openings EMULSION public releases
Summary Activity Surveys SCM Listes Sympa

SCM Repository

2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
3   "">
5 <html xmlns="" lang="en">
6   <head>
7     <meta http-equiv="X-UA-Compatible" content="IE=Edge" />
8     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9     <title>Modelling language (advanced) &#8212; EMULSION (Epidemiological Multi-Level Simulation framework)</title>
10     <link rel="stylesheet" href="../_static/alabaster.css" type="text/css" />
11     <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
12     <link rel="stylesheet" href="../_static/css/custom.css" type="text/css" />
13     <script type="text/javascript" id="documentation_options" data-url_root="../" src="../_static/documentation_options.js"></script>
14     <script type="text/javascript" src="../_static/jquery.js"></script>
15     <script type="text/javascript" src="../_static/underscore.js"></script>
16     <script type="text/javascript" src="../_static/doctools.js"></script>
17     <script type="text/javascript" src=""></script>
18     <link rel="shortcut icon" href="../_static/STEMAH-favicon.png"/>
19     <link rel="index" title="Index" href="../genindex.html" />
20     <link rel="search" title="Search" href="../search.html" />
21     <link rel="next" title="Feature examples" href="Feature_examples.html" />
22     <link rel="prev" title="Modelling language (basics)" href="Modelling_language_basics.html" />
24   <link rel="stylesheet" href="../_static/custom.css" type="text/css" />
27   <meta name="viewport" content="width=device-width, initial-scale=0.9, maximum-scale=0.9" />
29   </head><body>
30   <div class="document">
32       <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
33         <div class="sphinxsidebarwrapper">
34 <h1 class="logo"><a href="../index.html">EMULSION</a></h1>
38 <p class="blurb">Epidemiological Multi-Level Simulation Framework</p>
45 <h3>Navigation</h3>
46 <ul class="current">
47 <li class="toctree-l1"><a class="reference internal" href="Install.html">Installation</a></li>
48 <li class="toctree-l1"><a class="reference internal" href="Getting_started.html">Getting started with EMULSION</a></li>
49 <li class="toctree-l1"><a class="reference internal" href="Modelling_principles.html">Modelling principles</a></li>
50 <li class="toctree-l1"><a class="reference internal" href="Modelling_language_basics.html">Modelling language (basics)</a></li>
51 <li class="toctree-l1 current"><a class="current reference internal" href="#">Modelling language (advanced)</a><ul>
52 <li class="toctree-l2"><a class="reference internal" href="#compartments-ibm-or-hybrid-models">Compartments, IBM or hybrid models?</a></li>
53 <li class="toctree-l2"><a class="reference internal" href="#master-state-machines">Master state machines</a><ul>
54 <li class="toctree-l3"><a class="reference internal" href="#set-states-attributes">Set states attributes</a></li>
55 <li class="toctree-l3"><a class="reference internal" href="#customize-transitions">Customize transitions</a></li>
56 <li class="toctree-l3"><a class="reference internal" href="#produce-new-individuals">Produce new individuals</a></li>
57 <li class="toctree-l3"><a class="reference internal" href="#remove-transitions">Remove transitions</a></li>
58 </ul>
59 </li>
60 <li class="toctree-l2"><a class="reference internal" href="#regulate-time">Regulate time</a></li>
61 <li class="toctree-l2"><a class="reference internal" href="#complexify-grouping">Complexify grouping</a></li>
62 <li class="toctree-l2"><a class="reference internal" href="#aggregate-variables">Aggregate variables</a></li>
63 <li class="toctree-l2"><a class="reference internal" href="#automatic-variables">Automatic variables</a></li>
64 <li class="toctree-l2"><a class="reference internal" href="#built-in-functions">Built-in functions</a></li>
65 <li class="toctree-l2"><a class="reference internal" href="#built-in-actions">Built-in actions</a></li>
66 <li class="toctree-l2"><a class="reference internal" href="#changing-scale-metapopulations">Changing scale: metapopulations</a></li>
67 <li class="toctree-l2"><a class="reference internal" href="#connecting-to-python-code-add-ons">Connecting to Python code add-ons</a></li>
68 </ul>
69 </li>
70 <li class="toctree-l1"><a class="reference internal" href="Feature_examples.html">Feature examples</a></li>
71 <li class="toctree-l1"><a class="reference internal" href="Information.html">Information</a></li>
72 <li class="toctree-l1"><a class="reference internal" href="License.html">License</a></li>
73 <li class="toctree-l1"><a class="reference internal" href="../emulsion_for_modellers.html">High-level functions for model designers</a></li>
74 <li class="toctree-l1"><a class="reference internal" href="../emulsion.html">emulsion package</a></li>
75 </ul>
77 <div class="relations">
78 <h3>Related Topics</h3>
79 <ul>
80   <li><a href="../index.html">Documentation overview</a><ul>
81       <li>Previous: <a href="Modelling_language_basics.html" title="previous chapter">Modelling language (basics)</a></li>
82       <li>Next: <a href="Feature_examples.html" title="next chapter">Feature examples</a></li>
83   </ul></li>
84 </ul>
85 </div>
86 <div id="searchbox" style="display: none" role="search">
87   <h3>Quick search</h3>
88     <div class="searchformwrapper">
89     <form class="search" action="../search.html" method="get">
90       <input type="text" name="q" />
91       <input type="submit" value="Go" />
92       <input type="hidden" name="check_keywords" value="yes" />
93       <input type="hidden" name="area" value="default" />
94     </form>
95     </div>
96 </div>
97 <script type="text/javascript">$('#searchbox').show(0);</script>
98         </div>
99       </div>
100       <div class="documentwrapper">
101         <div class="bodywrapper">
102           <div class="body" role="main">
104   <div class="section" id="modelling-language-advanced">
105 <h1>Modelling language (advanced)<a class="headerlink" href="#modelling-language-advanced" title="Permalink to this headline">¶</a></h1>
106 <p>EMULSION modelling language allows model designers to specify complex
107 assumptions in a readable way, to foster interactions with other
108 scientists and facilitate model revision throughout the design process
109 without having to dive into the simulation code.</p>
110 <p>Most language features documented below are associated with example
111 files, located in the <code class="docutils literal notranslate"><span class="pre">models/features</span></code> directory.</p>
112 <div class="section" id="compartments-ibm-or-hybrid-models">
113 <h2>Compartments, IBM or hybrid models?<a class="headerlink" href="#compartments-ibm-or-hybrid-models" title="Permalink to this headline">¶</a></h2>
114 <p>EMULSION helps to transform compartment-based models into
115 invidual-based models (or vice-versa, assuming the individual-based
116 model can get rid of individual specificities). An intermediate
117 approach is the hybrid model, which preserves individual
118 characteristics but drives system evolution through compartment-like
119 groupings (see: <a class="reference internal" href="Modelling_principles.html#individuals-populations-metapopulations"><span class="std std-ref">Individuals, populations, metapopulations</span></a>).</p>
120 <p>The table below summarises the main differences between each kind of
121 models, regarding the sections and keywords to modify in an EMULSION
122 model file.</p>
123 <table border="1" class="docutils">
124 <colgroup>
125 <col width="26%" />
126 <col width="24%" />
127 <col width="18%" />
128 <col width="13%" />
129 <col width="19%" />
130 </colgroup>
131 <thead valign="bottom">
132 <tr class="row-odd"><th class="head" rowspan="2">EMULSION section</th>
133 <th class="head" rowspan="2">section keyword</th>
134 <th class="head" colspan="3">Modelling paradigm</th>
135 </tr>
136 <tr class="row-even"><th class="head">compartment</th>
137 <th class="head">hybrid</th>
138 <th class="head">IBM</th>
139 </tr>
140 </thead>
141 <tbody valign="top">
142 <tr class="row-odd"><td rowspan="2"><code class="docutils literal notranslate"><span class="pre">levels</span></code></td>
143 <td><code class="docutils literal notranslate"><span class="pre">aggregation_type</span></code></td>
144 <td><code class="docutils literal notranslate"><span class="pre">compartment</span></code></td>
145 <td><code class="docutils literal notranslate"><span class="pre">hybrid</span></code></td>
146 <td><code class="docutils literal notranslate"><span class="pre">IBM</span></code></td>
147 </tr>
148 <tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">contains</span></code></td>
149 <td><em>not used</em></td>
150 <td colspan="2"><em>sublevels</em></td>
151 </tr>
152 <tr class="row-odd"><td rowspan="2"><code class="docutils literal notranslate"><span class="pre">grouping</span></code></td>
153 <td><code class="docutils literal notranslate"><span class="pre">key_variables</span></code></td>
154 <td colspan="2"><em>list of variables</em></td>
155 <td rowspan="2"><em>not used</em></td>
156 </tr>
157 <tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">state_machine</span></code></td>
158 <td colspan="2"><em>machine name</em> (optional)</td>
159 </tr>
160 <tr class="row-odd"><td rowspan="2"><code class="docutils literal notranslate"><span class="pre">processes</span></code></td>
161 <td><em>level</em></td>
162 <td colspan="2"><em>population</em></td>
163 <td><em>individuals</em></td>
164 </tr>
165 <tr class="row-even"><td><em>list of processes</em></td>
166 <td colspan="2"><em>names of groupings</em></td>
167 <td><em>machine name</em></td>
168 </tr>
169 <tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">state_machines</span></code></td>
170 <td><code class="docutils literal notranslate"><span class="pre">productions</span></code></td>
171 <td>&#160;</td>
172 <td colspan="2"><em>based on prototypes</em></td>
173 </tr>
174 <tr class="row-even"><td><code class="docutils literal notranslate"><span class="pre">prototypes</span></code></td>
175 <td>&#160;</td>
176 <td><em>not used</em></td>
177 <td colspan="2"><em>for individuals/populations</em></td>
178 </tr>
179 <tr class="row-odd"><td><code class="docutils literal notranslate"><span class="pre">initial_conditions</span></code></td>
180 <td>&#160;</td>
181 <td><em>per state</em></td>
182 <td colspan="2"><em>based on prototypes</em></td>
183 </tr>
184 </tbody>
185 </table>
186 <div class="admonition seealso">
187 <p class="first admonition-title">See also</p>
188 <p>Also, in <code class="docutils literal notranslate"><span class="pre">model/features</span></code>, many examples are provided with the
189 three modelling paradigms when possible, especially the simplest
190 SIR model (<code class="docutils literal notranslate"><span class="pre">compart_SIR.yaml</span></code>, <code class="docutils literal notranslate"><span class="pre">hybrid_SIR.yaml</span></code>,
191 <code class="docutils literal notranslate"><span class="pre">IBM_SIR.yaml</span></code>) and the corresponding version with demographic
192 processes (<code class="docutils literal notranslate"><span class="pre">compart_SIR_demo.yaml</span></code>, <code class="docutils literal notranslate"><span class="pre">hybrid_SIR_demo.yaml</span></code>,
193 <code class="docutils literal notranslate"><span class="pre">IBM_SIR_demo.yaml</span></code>).</p>
194 <p class="last">See <a class="reference internal" href="Feature_examples.html#sir-model"><span class="std std-ref">SIR model</span></a>, <a class="reference internal" href="Feature_examples.html#seirs-model"><span class="std std-ref">SEIRS model</span></a>, <a class="reference internal" href="Feature_examples.html#sir-model-with-basic-demography-births-deaths"><span class="std std-ref">SIR model with basic demography (births/deaths)</span></a> and many others in <a class="reference internal" href="Feature_examples.html#feature-examples"><span class="std std-ref">Feature examples</span></a>.</p>
195 </div>
196 </div>
197 <div class="section" id="master-state-machines">
198 <h2>Master state machines<a class="headerlink" href="#master-state-machines" title="Permalink to this headline">¶</a></h2>
199 <div class="section" id="set-states-attributes">
200 <h3>Set states attributes<a class="headerlink" href="#set-states-attributes" title="Permalink to this headline">¶</a></h3>
201 <p>States can be endowed with <em>attributes</em>. For instance, <code class="docutils literal notranslate"><span class="pre">fillcolor</span></code>
202 defines the color of the boxes on state machine diagrams, which is the
203 same than the color of plots in outputs.</p>
204 <p>A state can define three main properties:</p>
205 <dl class="docutils">
206 <dt><code class="docutils literal notranslate"><span class="pre">autoremove:</span> <span class="pre">yes</span></code></dt>
207 <dd><p class="first">Autoremove states are intended as “sink”, so that all individuals
208 that reach such a state are removed from the system. This is a
209 very convenient way to represent deaths or outgoing commercial
210 movements.</p>
211 <div class="last admonition seealso">
212 <p class="first admonition-title">See also</p>
213 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-basic-demography-births-deaths"><span class="std std-ref">SIR model with basic demography (births/deaths)</span></a></p>
214 </div>
215 </dd>
216 <dt><code class="docutils literal notranslate"><span class="pre">default:</span> <span class="pre">yes</span></code></dt>
217 <dd><p class="first">A state can be labelled as “default state”. Default state plays
218 the same role but the way to use them differs in compartment-based
219 models and in others:</p>
220 <ul class="last">
221 <li><p class="first">in compartment-based models, when no indication is provided in
222 initial conditions or production links regarding new
223 individuals, they will be put in the default state for each of
224 their state machines</p>
225 </li>
226 <li><p class="first">in IBM/hybrid models and metapopulations, <code class="docutils literal notranslate"><span class="pre">default</span></code> is a valid
227 value for prototypes definition. For instance, writing
228 <code class="docutils literal notranslate"><span class="pre">health_state:</span> <span class="pre">default</span></code> in a prototype will set the health
229 state to the default state of the <code class="docutils literal notranslate"><span class="pre">health_state</span></code> state machine</p>
230 <div class="admonition seealso">
231 <p class="first admonition-title">See also</p>
232 <p class="last"><span class="xref std std-ref">Default state</span>, <a class="reference internal" href="Feature_examples.html#sir-model-with-age-groups"><span class="std std-ref">SIR model with age groups</span></a></p>
233 </div>
234 </li>
235 </ul>
236 </dd>
237 <dt><code class="docutils literal notranslate"><span class="pre">duration</span></code> (valid for <strong>IBM</strong>/<strong>hybrid</strong> models)</dt>
238 <dd><p class="first">This keyword allows to assign a specific duration to a
239 state. Durations can be constant values or arbitrary expressions,
240 including a random distribution. When an individual enters the
241 state, it receives a value calculated from this expression
242 (possibly involving a random sample) and cannot leave this state
243 until the duration is over (with the exception of <a class="reference internal" href="#escape-conditions"><span class="std std-ref">escape
244 conditions</span></a>).</p>
245 <div class="last admonition seealso">
246 <p class="first admonition-title">See also</p>
247 <p class="last"><a class="reference internal" href="Feature_examples.html#custom-state-durations"><span class="std std-ref">Custom state durations</span></a></p>
248 </div>
249 </dd>
250 <dt><code class="docutils literal notranslate"><span class="pre">on_enter</span></code>, <code class="docutils literal notranslate"><span class="pre">on_stay</span></code>, <code class="docutils literal notranslate"><span class="pre">on_exit</span></code> (valid for <strong>IBM</strong>/<strong>hybrid</strong> models)</dt>
251 <dd><p class="first">These keywords are used to specify lists of <strong>actions</strong> that
252 individuals have to perform when, respectively, entering, staying
253 in, or leaving the state.</p>
254 <p>Actions can be either built-in actions (listed <a class="reference internal" href="#built-in-actions"><span class="std std-ref">there</span></a>) or the name of a function provided in a code
255 add-on (e.g. <code class="docutils literal notranslate"><span class="pre">action:</span> <span class="pre">my_custom_function</span></code>).</p>
256 <div class="last admonition seealso">
257 <p class="first admonition-title">See also</p>
258 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-individual-actions-and-variable-aggregation"><span class="std std-ref">SIR model with individual actions and variable aggregation</span></a></p>
259 </div>
260 </dd>
261 </dl>
262 </div>
263 <div class="section" id="customize-transitions">
264 <h3>Customize transitions<a class="headerlink" href="#customize-transitions" title="Permalink to this headline">¶</a></h3>
265 <p>In state machines, transitions are composed of at least three items:</p>
266 <ul class="simple" id="quantifiers">
267 <li><code class="docutils literal notranslate"><span class="pre">from</span></code> followed by the origin state</li>
268 <li><code class="docutils literal notranslate"><span class="pre">to</span></code> followed by the destination state</li>
269 <li>a <strong>quantifier</strong> to indicate the flow from origin to destination
270 state, which can be:<ul>
271 <li><code class="docutils literal notranslate"><span class="pre">rate</span></code> with a transition rate per individual i.e. a number per
272 time unit. In stochastic models , rates are automatically
273 converted into probabilities, assuming that durations in the
274 origin state follow an exponential distribution</li>
275 <li><code class="docutils literal notranslate"><span class="pre">proba</span></code> with the probabiliy that, during <em>one time unit</em>, an
276 individual moves from origin to destination state</li>
277 <li><code class="docutils literal notranslate"><span class="pre">amount</span></code> which indicates an absolute number of individuals,
278 (bounded by the number of individuals actually in origin state)</li>
279 <li><code class="docutils literal notranslate"><span class="pre">amount-all-but</span></code> which indicates an absolute number of
280 individuals which have to <em>stay</em> in origin state while the others
281 move to destination state. Hence, writing <code class="docutils literal notranslate"><span class="pre">amount-all-but:</span> <span class="pre">0</span></code>
282 means “all individuals in origin state”</li>
283 </ul>
284 </li>
285 </ul>
286 <div class="admonition warning">
287 <p class="first admonition-title">Warning</p>
288 <p class="last">In a state machine, all quantifiers may be used. However, from a
289 given origin state, all transitions that can be used simultaneously
290 must have the same quantifiers (i.e. only <code class="docutils literal notranslate"><span class="pre">rate</span></code>, or only
291 <code class="docutils literal notranslate"><span class="pre">proba</span></code>, or only <code class="docutils literal notranslate"><span class="pre">amount</span></code>/<code class="docutils literal notranslate"><span class="pre">amount-all-but</span></code>).</p>
292 </div>
293 <p>Transitions can also incorporate additional elements:</p>
294 <ul class="simple" id="escape-conditions">
295 <li><code class="docutils literal notranslate"><span class="pre">cond</span></code> followed with a expression (logical or numeric, non-zero
296 values being considered true) specifies which individuals are
297 allowed to cross the transition</li>
298 <li><code class="docutils literal notranslate"><span class="pre">escape</span></code> is a special condition for origin states endowed with a
299 specific duration, which allows individuals that fulfil the
300 expression to exit their state <em>before</em> the normal term. For
301 instance, a gestating state has a duration before which individuals should
302 not be able to leave the state, but if abortions are possible, the
303 corresponding condition can be used as escape condition to permit a
304 premature exit of gestation.</li>
305 <li><code class="docutils literal notranslate"><span class="pre">when</span></code> is a special condition which refers to <em>events</em> from a
306 <a class="reference internal" href="#regulate-time"><span class="std std-ref">calendar</span></a> (useful to handle seasonality)</li>
307 <li><code class="docutils literal notranslate"><span class="pre">on_cross</span></code> is used to specify a list of actions that indivuals
308 moving from origin state to destination state through this
309 transition have to perform</li>
310 </ul>
311 </div>
312 <div class="section" id="produce-new-individuals">
313 <h3>Produce new individuals<a class="headerlink" href="#produce-new-individuals" title="Permalink to this headline">¶</a></h3>
314 <ul>
315 <li><p class="first">Section <code class="docutils literal notranslate"><span class="pre">productions</span></code> in state machines allow to define how some
316 states can produce new individuals. Production links are very
317 similar to transitions in their syntax, except that:</p>
318 <ul class="simple">
319 <li><code class="docutils literal notranslate"><span class="pre">escape</span></code> conditions and <code class="docutils literal notranslate"><span class="pre">amount-all-but</span></code> quantifier are not allowed</li>
320 <li>in IBM/hybrid models, a <code class="docutils literal notranslate"><span class="pre">prototype</span></code> must be specified for the new
321 individuals</li>
322 </ul>
323 <div class="admonition seealso">
324 <p class="first admonition-title">See also</p>
325 <dl class="last docutils">
326 <dt><a class="reference internal" href="Feature_examples.html#sir-model-with-basic-demography-births-deaths"><span class="std std-ref">SIR model with basic demography (births/deaths)</span></a>, :ref:<a href="#id1"><span class="problematic" id="id2">`</span></a>SIR</dt>
327 <dd><p class="first last">model with age groups`</p>
328 </dd>
329 </dl>
330 </div>
331 </li>
332 <li><p class="first">Another way to produce new individuals is using an action: <code class="docutils literal notranslate"><span class="pre">clone</span></code>
333 (aka <code class="docutils literal notranslate"><span class="pre">produce_offspring</span></code>) associated with a transition or
334 with a state (see <a class="reference internal" href="#set-states-attributes"><span class="std std-ref">Set states attributes</span></a> and <a class="reference internal" href="#built-in-actions"><span class="std std-ref">Built-in actions</span></a>).</p>
335 <div class="admonition seealso">
336 <p class="first admonition-title">See also</p>
337 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-explicit-gestation"><span class="std std-ref">SIR model with explicit gestation</span></a></p>
338 </div>
339 </li>
340 </ul>
341 </div>
342 <div class="section" id="remove-transitions">
343 <h3>Remove transitions<a class="headerlink" href="#remove-transitions" title="Permalink to this headline">¶</a></h3>
344 <p>State machines can also be used only for states, e.g. to differentiate
345 male/female individuals. In that case, the state machine does not
346 require any transition at all.</p>
347 <div class="admonition seealso">
348 <p class="first admonition-title">See also</p>
349 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-explicit-gestation"><span class="std std-ref">SIR model with explicit gestation</span></a></p>
350 </div>
351 </div>
352 </div>
353 <div class="section" id="regulate-time">
354 <h2>Regulate time<a class="headerlink" href="#regulate-time" title="Permalink to this headline">¶</a></h2>
355 <ul>
356 <li><p class="first">The simulation time step can be changed either in the model file
357 (section <code class="docutils literal notranslate"><span class="pre">time_info</span></code>), or at runtime with option <code class="docutils literal notranslate"><span class="pre">-p</span>
358 <span class="pre">delta_t=value</span></code></p>
359 </li>
360 <li><p class="first">Section <code class="docutils literal notranslate"><span class="pre">time_info</span></code> allows the definition of calendars with
361 events, for instance a pasture period:</p>
362 <div class="admonition-example admonition">
363 <p class="first admonition-title">Example</p>
364 <blockquote>
365 <div><div class="highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">calendars</span><span class="p p-Indicator">:</span>
366   <span class="l l-Scalar l-Scalar-Plain">pasture</span><span class="p p-Indicator">:</span>
367     <span class="l l-Scalar l-Scalar-Plain">period</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{</span><span class="nv">days</span><span class="p p-Indicator">:</span> <span class="nv">365</span><span class="p p-Indicator">}</span>
368   <span class="l l-Scalar l-Scalar-Plain">events</span><span class="p p-Indicator">:</span>
369     <span class="l l-Scalar l-Scalar-Plain">pasture_period</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{</span><span class="nv">begin</span><span class="p p-Indicator">:</span> <span class="s">&#39;April</span><span class="nv"> </span><span class="s">1&#39;</span><span class="p p-Indicator">,</span> <span class="nv">end</span><span class="p p-Indicator">:</span> <span class="s">&#39;October</span><span class="nv"> </span><span class="s">1&#39;</span><span class="p p-Indicator">}</span>
370     <span class="l l-Scalar l-Scalar-Plain">open_days</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">{</span><span class="nv">date</span><span class="p p-Indicator">:</span> <span class="s">&#39;May</span><span class="nv"> </span><span class="s">1&#39;</span><span class="p p-Indicator">}</span>
371 </pre></div>
372 </div>
373 </div></blockquote>
374 <p>A calendar can be periodic or not, and define events that span from
375 a <code class="docutils literal notranslate"><span class="pre">begin</span></code> date to and <code class="docutils literal notranslate"><span class="pre">end</span></code> date, or that take place at a
376 specific <code class="docutils literal notranslate"><span class="pre">date</span></code>. Each event (here <code class="docutils literal notranslate"><span class="pre">pasture_period</span></code> and
377 <code class="docutils literal notranslate"><span class="pre">open_days</span></code>) can be used in conditions, especially in the
378 <code class="docutils literal notranslate"><span class="pre">when</span></code> clause of transition or productions. A transition with
379 e.g. <code class="docutils literal notranslate"><span class="pre">Not(pasture_period)</span></code> will not be considered at all when the
380 condition is not fulfilled.</p>
381 <p>Besides, events with a begin and an end date automatically generate
382 two other events, here for instance <code class="docutils literal notranslate"><span class="pre">begin_pasture_period</span></code> and
383 <code class="docutils literal notranslate"><span class="pre">end_pasture_period</span></code>.</p>
384 <div class="last admonition seealso">
385 <p class="first admonition-title">See also</p>
386 <p class="last">model <a class="reference internal" href="Install.html#test-your-installation"><span class="std std-ref">Quickstart</span></a> provided to test
387 EMULSION installation</p>
388 </div>
389 </div>
390 </li>
391 </ul>
392 </div>
393 <div class="section" id="complexify-grouping">
394 <h2>Complexify grouping<a class="headerlink" href="#complexify-grouping" title="Permalink to this headline">¶</a></h2>
395 <p>Grouping can be based on several variables, especially when the
396 dynamics of one process is affected by another one. For instance, if
397 infection is driven by age groups, the grouping section should be
398 rewritten as follows:</p>
399 <div class="admonition-example admonition">
400 <p class="first admonition-title">Example</p>
401 <div class="last highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">grouping</span><span class="p p-Indicator">:</span>
402   <span class="l l-Scalar l-Scalar-Plain">herd</span><span class="p p-Indicator">:</span>
403     <span class="l l-Scalar l-Scalar-Plain">infection</span><span class="p p-Indicator">:</span>
404       <span class="l l-Scalar l-Scalar-Plain">state_machine</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">health_state</span>
405       <span class="l l-Scalar l-Scalar-Plain">key_variables</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">[</span><span class="nv">health_state</span><span class="p p-Indicator">,</span> <span class="nv">age_group</span><span class="p p-Indicator">]</span>
406     <span class="l l-Scalar l-Scalar-Plain">age_group</span><span class="p p-Indicator">:</span>
407       <span class="l l-Scalar l-Scalar-Plain">state_machine</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">age_group</span>
408       <span class="l l-Scalar l-Scalar-Plain">key_variables</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">[</span><span class="nv">age_group</span><span class="p p-Indicator">]</span>
409 </pre></div>
410 </div>
411 </div>
412 <div class="admonition seealso">
413 <p class="first admonition-title">See also</p>
414 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-structured-population"><span class="std std-ref">SIR model with structured population</span></a></p>
415 </div>
416 <p>Grouping are especially useful in hybrid models, either to accelerate
417 simulation time, or to benefit from <a class="reference internal" href="#automatic-variables"><span class="std std-ref">automatic variables</span></a>.</p>
418 <p>A grouping can also be designed just to have access to specific
419 subgroups in the population, and thus indicate no state machine, nor
420 rely on variables related to state machines.</p>
421 <div class="admonition warning">
422 <p class="first admonition-title">Warning</p>
423 <p class="last">In any case, the name of the grouping must appear in the list of
424 processes: otherwise the grouping is not updated at each time step
425 (individuals are not distributed in the proper groups).</p>
426 </div>
427 </div>
428 <div class="section" id="aggregate-variables">
429 <h2>Aggregate variables<a class="headerlink" href="#aggregate-variables" title="Permalink to this headline">¶</a></h2>
430 <p>When defining levels, variables that aggregate other variables from a
431 sublevel can be defined, for instance:</p>
432 <div class="admonition-example admonition">
433 <p class="first admonition-title">Example</p>
434 <div class="last highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="l l-Scalar l-Scalar-Plain">levels</span><span class="p p-Indicator">:</span>
435   <span class="l l-Scalar l-Scalar-Plain">herd</span><span class="p p-Indicator">:</span>
436     <span class="l l-Scalar l-Scalar-Plain">...</span>
437     <span class="l l-Scalar l-Scalar-Plain">aggregate_vars</span><span class="p p-Indicator">:</span>
438       <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">pop_affected_over_time</span>
439         <span class="l l-Scalar l-Scalar-Plain">collect</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">nb_episodes</span>
440         <span class="l l-Scalar l-Scalar-Plain">operator</span><span class="p p-Indicator">:</span> <span class="s">&#39;sum&#39;</span>
441       <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">name</span><span class="p p-Indicator">:</span> <span class="s">&#39;avg_inf_duration&#39;</span>
442         <span class="l l-Scalar l-Scalar-Plain">collect</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">duration_infected</span>
443         <span class="l l-Scalar l-Scalar-Plain">operator</span><span class="p p-Indicator">:</span> <span class="s">&#39;mean&#39;</span>
444 </pre></div>
445 </div>
446 </div>
447 <p>Aggregated variables (here, <code class="docutils literal notranslate"><span class="pre">pop_affected_over_time</span></code> and
448 <code class="docutils literal notranslate"><span class="pre">avg_inf_duration</span></code>) defined by a level (here, <code class="docutils literal notranslate"><span class="pre">herd</span></code>) consist in
449 collecting the values of other variables (<code class="docutils literal notranslate"><span class="pre">nb_episodes</span></code>,
450 <code class="docutils literal notranslate"><span class="pre">duration_infected</span></code>) in the sublevels (<code class="docutils literal notranslate"><span class="pre">individuals</span></code>) and applying
451 an operator (<code class="docutils literal notranslate"><span class="pre">sum</span></code>, <code class="docutils literal notranslate"><span class="pre">mean</span></code>) to compute the resulting value.</p>
452 <p>Operators can be any classical usual operation operating on lists:
453 sum, prod, min, max, mean, var, std, median, all, any. Shortcuts have
454 been defined so that e.g. <code class="docutils literal notranslate"><span class="pre">percentile20</span></code> computes the 20th
455 percentile.</p>
456 <div class="admonition seealso">
457 <p class="first admonition-title">See also</p>
458 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-individual-actions-and-variable-aggregation"><span class="std std-ref">SIR model with individual actions and variable aggregation</span></a></p>
459 </div>
460 </div>
461 <div class="section" id="automatic-variables">
462 <h2>Automatic variables<a class="headerlink" href="#automatic-variables" title="Permalink to this headline">¶</a></h2>
463 <p>EMULSION automatically provides variables in relation to model
464 components.</p>
465 <ul class="simple">
466 <li><code class="docutils literal notranslate"><span class="pre">step</span></code> represents the current time step, <code class="docutils literal notranslate"><span class="pre">delta_t</span></code> the duration
467 of one time step (in time units), and <code class="docutils literal notranslate"><span class="pre">time</span></code> the time elapsed
468 since the beginning of simulation (in time units)</li>
469 <li>When defining a level, e.g. <code class="docutils literal notranslate"><span class="pre">herd</span></code>: <code class="docutils literal notranslate"><span class="pre">total_herd</span></code> gives the total
470 population of this level.</li>
471 <li>When defining a state machine, e.g. <code class="docutils literal notranslate"><span class="pre">health_state</span></code>, and its
472 states, e.g. <code class="docutils literal notranslate"><span class="pre">S</span></code>:<ul>
473 <li><code class="docutils literal notranslate"><span class="pre">is_S</span></code> tests whether or not an individual is in state <code class="docutils literal notranslate"><span class="pre">S</span></code></li>
474 <li><code class="docutils literal notranslate"><span class="pre">duration_in_health_state</span></code> contains the duration elapsed since
475 the individual entered the current state of state machine
476 <code class="docutils literal notranslate"><span class="pre">health_state</span></code></li>
477 <li><code class="docutils literal notranslate"><span class="pre">total_S</span></code> is the number of individuals in state <code class="docutils literal notranslate"><span class="pre">S</span></code></li>
478 </ul>
479 </li>
480 <li>When defining complex groupings, e.g. <code class="docutils literal notranslate"><span class="pre">[age_group,</span> <span class="pre">health_state]</span></code>:<ul>
481 <li><code class="docutils literal notranslate"><span class="pre">total_J_I</span></code> is the number of individuals in age group <code class="docutils literal notranslate"><span class="pre">J</span></code> and
482 in health state <code class="docutils literal notranslate"><span class="pre">I</span></code></li>
483 <li>if aggregated variables (e.g. <code class="docutils literal notranslate"><span class="pre">mean_age</span></code>) were also defined,
484 their counterpart is automatically defined for the grouping
485 (e.g. <code class="docutils literal notranslate"><span class="pre">mean_age_J_I</span></code> etc.)</li>
486 </ul>
487 </li>
488 </ul>
489 <div class="admonition seealso">
490 <p class="first admonition-title">See also</p>
491 <p class="last"><a class="reference internal" href="Feature_examples.html#sirs-model-with-periodic-external-risk"><span class="std std-ref">SIRS model with periodic external risk</span></a>,
492 <a class="reference internal" href="Feature_examples.html#sir-model-with-structured-population"><span class="std std-ref">SIR model with structured population</span></a></p>
493 </div>
494 </div>
495 <div class="section" id="built-in-functions">
496 <h2>Built-in functions<a class="headerlink" href="#built-in-functions" title="Permalink to this headline">¶</a></h2>
497 <p>Expressions used in EMULSION models can refer to classical Python
498 mathematical operators (<code class="docutils literal notranslate"><span class="pre">+</span></code>, <code class="docutils literal notranslate"><span class="pre">-</span></code>, <code class="docutils literal notranslate"><span class="pre">*</span></code>, <code class="docutils literal notranslate"><span class="pre">/</span></code>, <code class="docutils literal notranslate"><span class="pre">**</span></code> for
499 exponentiation, etc. ) and functions (e.g. <code class="docutils literal notranslate"><span class="pre">sqrt</span></code>, <code class="docutils literal notranslate"><span class="pre">cos</span></code>, <code class="docutils literal notranslate"><span class="pre">sin</span></code>,
500 <code class="docutils literal notranslate"><span class="pre">exp</span></code>, <code class="docutils literal notranslate"><span class="pre">log</span></code>, <code class="docutils literal notranslate"><span class="pre">log10</span></code>, etc.).</p>
501 <p>The following functions are also available:</p>
502 <dl class="docutils">
503 <dt><code class="docutils literal notranslate"><span class="pre">AND(cond1,</span> <span class="pre">cond2)</span></code></dt>
504 <dd>Logical conjunction: return true (1) if <code class="docutils literal notranslate"><span class="pre">cond1</span></code> and <code class="docutils literal notranslate"><span class="pre">cond2</span></code> are
505 both true, false (0) otherwise</dd>
506 <dt><code class="docutils literal notranslate"><span class="pre">OR(cond1,</span> <span class="pre">cond2)</span></code></dt>
507 <dd>Logical disjunction: return true (1) if <code class="docutils literal notranslate"><span class="pre">cond1</span></code> is true or
508 <code class="docutils literal notranslate"><span class="pre">cond2</span></code> is true, false (0) otherwise</dd>
509 <dt><code class="docutils literal notranslate"><span class="pre">Not(cond)</span></code></dt>
510 <dd>Logical negation: return true (1) if <code class="docutils literal notranslate"><span class="pre">cond1</span></code> and <code class="docutils literal notranslate"><span class="pre">cond2</span></code> are
511 both true, false (0) otherwise</dd>
512 <dt><code class="docutils literal notranslate"><span class="pre">IfThenElse(condition,</span> <span class="pre">val_if_true,</span> <span class="pre">val_if_false)</span></code></dt>
513 <dd>Ternary conditional function: return either <code class="docutils literal notranslate"><span class="pre">val_if_true</span></code> or
514 <code class="docutils literal notranslate"><span class="pre">val_if_false</span></code> depending on <code class="docutils literal notranslate"><span class="pre">condition</span></code>.</dd>
515 <dt><code class="docutils literal notranslate"><span class="pre">random_bool(proba_success)</span></code></dt>
516 <dd>Return a random boolean value (0 or 1) depending on
517 <code class="docutils literal notranslate"><span class="pre">proba_success</span></code></dd>
518 </dl>
519 <p>Shortcuts to distributions from package <code class="docutils literal notranslate"><span class="pre">numpy.random</span></code> are also
520 available:</p>
521 <div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">random_uniform</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
522 <span class="n">random_integers</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
523 <span class="n">random_exponential</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>
524 <span class="n">random_poisson</span><span class="p">(</span><span class="n">m</span><span class="p">)</span>
525 <span class="n">random_beta</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
526 <span class="n">random_normal</span><span class="p">(</span><span class="n">m</span><span class="p">,</span> <span class="n">sd</span><span class="p">)</span>
527 <span class="n">random_gamma</span> <span class="o">=</span> <span class="n">np</span><span class="o">.</span><span class="n">random</span><span class="o">.</span><span class="n">gamma</span><span class="p">(</span><span class="n">a</span><span class="p">,</span> <span class="n">b</span><span class="p">)</span>
528 </pre></div>
529 </div>
530 <div class="admonition seealso">
531 <p class="first admonition-title">See also</p>
532 <p class="last"><a class="reference internal" href="Feature_examples.html#custom-state-durations"><span class="std std-ref">Custom state durations</span></a>,
533 <a class="reference internal" href="Feature_examples.html#sirs-model-with-periodic-external-risk"><span class="std std-ref">SIRS model with periodic external risk</span></a></p>
534 </div>
535 </div>
536 <div class="section" id="built-in-actions">
537 <h2>Built-in actions<a class="headerlink" href="#built-in-actions" title="Permalink to this headline">¶</a></h2>
538 <dl class="docutils">
539 <dt><code class="docutils literal notranslate"><span class="pre">{action:</span> <span class="pre">action_name,</span> <span class="pre">d_params:</span> <span class="pre">dict_of_parameters}</span></code></dt>
540 <dd><p class="first">The generic keyword to call an external actions, requires Python code.</p>
541 <ul>
542 <li><p class="first"><code class="docutils literal notranslate"><span class="pre">action_name</span></code> has to be described (<code class="docutils literal notranslate"><span class="pre">desc:</span> <span class="pre">...</span></code>) explicitly in
543 main section <code class="docutils literal notranslate"><span class="pre">actions</span></code></p>
544 </li>
545 <li><p class="first"><code class="docutils literal notranslate"><span class="pre">action_name</span></code> must be provided in a separate Python file, as a
546 <em>method</em> in a class associated with the level at which the action
547 will be performed. This method will look as (assuming that
548 <code class="docutils literal notranslate"><span class="pre">d_params</span></code> contains two keys, <code class="docutils literal notranslate"><span class="pre">param1</span></code> and <code class="docutils literal notranslate"><span class="pre">param2</span></code>):</p>
549 <div class="admonition-example admonition">
550 <p class="first admonition-title">Example</p>
551 <div class="last highlight-python notranslate"><div class="highlight"><pre><span></span><span class="k">def</span> <span class="nf">action_name</span><span class="p">(</span><span class="bp">self</span><span class="p">,</span> <span class="n">param1</span><span class="p">,</span> <span class="n">param2</span><span class="p">):</span>
552     <span class="sd">&quot;&quot;&quot;Do somethin with *param1* and *param2* as specified in</span>
553 <span class="sd">    section ``actions``&quot;&quot;&quot;</span>
554     <span class="c1"># here the Python code for the action</span>
555 </pre></div>
556 </div>
557 </div>
558 </li>
559 </ul>
560 <p class="last">Whenever possible, prefer other built-in actions described below.</p>
561 </dd>
562 <dt><code class="docutils literal notranslate"><span class="pre">{message:</span> <span class="pre">'Some</span> <span class="pre">important</span> <span class="pre">information'}</span></code></dt>
563 <dd>Print the specified character string on the standard output while
564 running the model, preceded by the time step and the identifier of
565 the individual.</dd>
566 <dt><code class="docutils literal notranslate"><span class="pre">{set_var:</span> <span class="pre">varname,</span> <span class="pre">value:</span> <span class="pre">expression}</span></code></dt>
567 <dd><p class="first">Change the value of <code class="docutils literal notranslate"><span class="pre">varname</span></code> according to what is calculated in
568 <code class="docutils literal notranslate"><span class="pre">expression</span></code>.</p>
569 <div class="last admonition seealso">
570 <p class="first admonition-title">See also</p>
571 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-individual-actions-and-variable-aggregation"><span class="std std-ref">SIR model with individual actions and variable aggregation</span></a></p>
572 </div>
573 </dd>
574 </dl>
575 <dl class="docutils" id="clone-action">
576 <dt><code class="docutils literal notranslate"><span class="pre">{clone:</span> <span class="pre">a_prototype_or_list,</span> <span class="pre">amount:</span> <span class="pre">value,</span> <span class="pre">proba:</span> <span class="pre">value_or_list}</span></code></dt>
577 <dd><p class="first">Clone the individual into new ones. The newly produced individuals
578 follow the specified prototypes, according the given amount and
579 probabilities.</p>
580 <ul class="simple">
581 <li>default amount is 1</li>
582 <li>if no probabilities are given, prototypes are considered
583 equiprobable</li>
584 <li>a single prototype can be given as a single value instead of a
585 list</li>
586 <li>the list or probabilites must be of same size of prototypes
587 list, only the last value may be omitted to ensure that the sum
588 of probabilities is 1. When N prototypes are associated with N
589 probability values which sum to S &lt; 1, then there is a
590 probability 1-S to produce no offspring. Once probabilies are
591 actualized, a multinomial sampling is performed to determine the
592 number of new individuals in each category</li>
593 </ul>
594 <div class="admonition-example admonition">
595 <p class="first admonition-title">Example</p>
596 <p>A model with explicit gestation states and possibly vertical disease
597 transmission:</p>
598 <div class="last highlight-yaml notranslate"><div class="highlight"><pre><span></span><span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">from</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">G</span>
599   <span class="l l-Scalar l-Scalar-Plain">to</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">NG</span>
600   <span class="l l-Scalar l-Scalar-Plain">proba</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">1</span>
601   <span class="l l-Scalar l-Scalar-Plain">on_cross</span><span class="p p-Indicator">:</span>
602     <span class="p p-Indicator">-</span> <span class="l l-Scalar l-Scalar-Plain">clone</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">[</span><span class="nv">infected</span><span class="p p-Indicator">,</span> <span class="nv">healthy</span><span class="p p-Indicator">]</span>
603       <span class="l l-Scalar l-Scalar-Plain">amount</span><span class="p p-Indicator">:</span> <span class="l l-Scalar l-Scalar-Plain">1</span>
604       <span class="l l-Scalar l-Scalar-Plain">proba</span><span class="p p-Indicator">:</span> <span class="p p-Indicator">[</span><span class="nv">proba_vertical_transmission</span><span class="p p-Indicator">]</span>
605       <span class="c1"># prototype &#39;healthy&#39; has proba: 1-proba_vertical_transmission</span>
606 </pre></div>
607 </div>
608 </div>
609 <p>..seealso:</p>
610 <div class="last highlight-default notranslate"><div class="highlight"><pre><span></span>:ref:`SIR model with explicit gestation`
611 </pre></div>
612 </div>
613 </dd>
614 <dt><code class="docutils literal notranslate"><span class="pre">{produce_offspring:</span> <span class="pre">a_prototype_or_list,</span> <span class="pre">amount:</span> <span class="pre">value,</span> <span class="pre">proba:</span> <span class="pre">value_or_list}</span></code></dt>
615 <dd>Synonym of <code class="docutils literal notranslate"><span class="pre">clone</span></code>.</dd>
616 <dt><code class="docutils literal notranslate"><span class="pre">{become:</span> <span class="pre">a_prototype}</span></code></dt>
617 <dd>Force the individual to adopt the specified prototype. Useful to
618 couple states from distinct state machines.</dd>
619 </dl>
620 </div>
621 <div class="section" id="changing-scale-metapopulations">
622 <h2>Changing scale: metapopulations<a class="headerlink" href="#changing-scale-metapopulations" title="Permalink to this headline">¶</a></h2>
623 <p>In EMULSION, <code class="docutils literal notranslate"><span class="pre">metapopulation</span></code> is an aggregation type which allows to
624 handle multiple populations without regard to how this population is
625 built (compartment-based/hybrid/IBM).</p>
626 <p>It consists in defining a new level and completing initial conditions
627 through new population prototypes.</p>
628 <p>It may be also necessary to transform within-population parameters
629 into variables to allow for heterogeneous populations.</p>
630 <div class="admonition seealso">
631 <p class="first admonition-title">See also</p>
632 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-metapopulation"><span class="std std-ref">SIR model with metapopulation</span></a></p>
633 </div>
634 </div>
635 <div class="section" id="connecting-to-python-code-add-ons">
636 <h2>Connecting to Python code add-ons<a class="headerlink" href="#connecting-to-python-code-add-ons" title="Permalink to this headline">¶</a></h2>
637 <p>EMULSION is aimed at providing <em>generic</em> features required for
638 designing epidemiological models. Thus, some very specific operations
639 are not available in the generic engine. In such cases, a small code
640 add-on is required to provide additional functionalities.</p>
641 <p>Code add-ons are mainly used for specific requirements regarding:</p>
642 <ul class="simple">
643 <li>variables which are complicated to change through expressions and
644 actions</li>
645 <li>actions which are not realizable through built-in ones</li>
646 <li>processes which are not realizable through state machines</li>
647 <li>complex intial conditions</li>
648 <li>data loading</li>
649 </ul>
650 <p>To link a level with a code add-on, two elements are required:</p>
651 <ul class="simple">
652 <li><code class="docutils literal notranslate"><span class="pre">file:</span> <span class="pre"></span></code> which specified the Python source code to use</li>
653 <li><code class="docutils literal notranslate"><span class="pre">class_name:</span> <span class="pre">AClassName</span></code> which defines the name of the Python
654 class associated with the level</li>
655 </ul>
656 <p>EMULSION provides an (experimental) code generator (<code class="docutils literal notranslate"><span class="pre">emulsion</span>
657 <span class="pre">generate</span> <span class="pre">MODEL.yaml</span></code>) which builds a code skeletton for files and
658 classes mentioned in the level definition. All actions and variables
659 listed respectively in <code class="docutils literal notranslate"><span class="pre">actions</span></code> and <code class="docutils literal notranslate"><span class="pre">statevars</span></code> sections, as well
660 as processes not associated with state machines or groupings, are
661 assumed to be defined in the Python file. All you need then is to fill
662 the relevant methods with the corresponding code, or remove
663 unnecessary parts.</p>
664 <div class="admonition seealso">
665 <p class="first admonition-title">See also</p>
666 <p class="last"><a class="reference internal" href="Feature_examples.html#sir-model-with-metapopulation-and-data-driven-movements"><span class="std std-ref">SIR model with metapopulation and data-driven movements</span></a></p>
667 </div>
668 </div>
669 </div>
672           </div>
673         </div>
674       </div>
675     <div class="clearer"></div>
676   </div>
677     <div class="footer">
678       &copy;2016, INRA and Univ. Lille.
680       |
681       Powered by <a href="">Sphinx 1.7.5</a>
682       &amp; <a href="">Alabaster 0.7.10</a>
684       |
685       <a href="../_sources/pages/Modelling_language_advanced.rst.txt"
686           rel="nofollow">Page source</a>
687     </div>
692   </body>
693 </html>