1
0
mirror of https://github.com/gsi-upm/soil synced 2025-08-23 19:52:19 +00:00

All settings as JSON and documentation updated

This commit is contained in:
Tasio Mendez
2017-05-16 14:02:50 +02:00
parent 23fc9671c3
commit a643735ddb
20 changed files with 90 additions and 81 deletions

View File

@@ -50,17 +50,18 @@
<h2>Simulation Settings<a class="headerlink" href="#simulation-settings" title="Permalink to this headline"></a></h2>
<p>Once installed, before running a simulation, you need to configure it.</p>
<ul>
<li><p class="first">In the settings.py file you will find the configuration of the network.</p>
<div class="code python highlight-default"><div class="highlight"><pre><span></span><span class="c1"># Network settings</span>
<span class="n">network_type</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">number_of_nodes</span> <span class="o">=</span> <span class="mi">1000</span>
<span class="n">max_time</span> <span class="o">=</span> <span class="mi">50</span>
<span class="n">num_trials</span> <span class="o">=</span> <span class="mi">1</span>
<span class="n">timeout</span> <span class="o">=</span> <span class="mi">2</span>
<li><p class="first">In the Settings JSON file you will find the configuration of the network.</p>
<div class="code python highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;network_type&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="s2">&quot;number_of_nodes&quot;</span><span class="p">:</span> <span class="mi">1000</span><span class="p">,</span>
<span class="s2">&quot;max_time&quot;</span><span class="p">:</span> <span class="mi">50</span><span class="p">,</span>
<span class="s2">&quot;num_trials&quot;</span><span class="p">:</span> <span class="mi">1</span><span class="p">,</span>
<span class="s2">&quot;timeout&quot;</span><span class="p">:</span> <span class="mi">2</span>
<span class="p">}</span>
</pre></div>
</div>
</li>
<li><p class="first">In the Simulation Settings JSON file, you will find the configuration of the models.</p>
<li><p class="first">In the Settings JSON file, you will also find the configuration of the models.</p>
</li>
</ul>
</div>
@@ -80,7 +81,7 @@
<div class="section" id="models-settings">
<h2>Models Settings<a class="headerlink" href="#models-settings" title="Permalink to this headline"></a></h2>
<p>After having configured the simulation, the next step is setting up the variables of the models.
For this, you will need to modify the Simulation Settings JSON file.</p>
For this, you will need to modify the Settings JSON file again.</p>
<div class="code json highlight-default"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="s2">&quot;agent&quot;</span><span class="p">:</span> <span class="p">[</span><span class="s2">&quot;SISaModel&quot;</span><span class="p">,</span><span class="s2">&quot;ControlModelM2&quot;</span><span class="p">],</span>
@@ -114,7 +115,7 @@ For this, you will need to modify the Simulation Settings JSON file.</p>
</pre></div>
</div>
<p>In this file you will define the different models you are going to simulate. You can simulate as many models
as you want.</p>
as you want. Each model will be simulated separately.</p>
<p>After setting up the models, you have to initialize the parameters of each one. You will find the parameters needed
in the documentation of each model.</p>
<p>Parameter validation will fail if a required parameter without a default has not been provided.</p>
@@ -122,7 +123,7 @@ in the documentation of each model.</p>
<div class="section" id="running-the-simulation">
<h2>Running the Simulation<a class="headerlink" href="#running-the-simulation" title="Permalink to this headline"></a></h2>
<p>After setting all the configuration, you will be able to run the simulation. All you need to do is execute:</p>
<div class="code bash highlight-default"><div class="highlight"><pre><span></span><span class="n">python</span> <span class="n">soil</span><span class="o">.</span><span class="n">py</span>
<div class="code bash highlight-default"><div class="highlight"><pre><span></span><span class="n">python3</span> <span class="n">soil</span><span class="o">.</span><span class="n">py</span>
</pre></div>
</div>
<p>The simulation will return a dynamic graph .gexf file which could be visualized with