| <?xml version="1.0" encoding="utf-8" standalone="yes" ?> |
| <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"> |
| <channel> |
| <title>Simulation Scenarios | Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility</title> |
| <link>https://www.eclipse.org/mosaic/docs/building_scenarios/</link> |
| <atom:link href="https://www.eclipse.org/mosaic/docs/building_scenarios/index.xml" rel="self" type="application/rss+xml" /> |
| <description>Simulation Scenarios</description> |
| <generator>Source Themes Academic (https://sourcethemes.com/academic/)</generator><language>en-us</language><lastBuildDate>Sun, 05 May 2019 00:00:00 +0100</lastBuildDate> |
| <image> |
| <url>https://www.eclipse.org/mosaic/images/logo.svg</url> |
| <title>Simulation Scenarios</title> |
| <link>https://www.eclipse.org/mosaic/docs/building_scenarios/</link> |
| </image> |
| |
| <item> |
| <title>Scenario Convert</title> |
| <link>https://www.eclipse.org/mosaic/docs/building_scenarios/scenario_convert/</link> |
| <pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate> |
| <guid>https://www.eclipse.org/mosaic/docs/building_scenarios/scenario_convert/</guid> |
| <description><div class="alert alert-extended"> |
| <span class="extended-icon" style="background-image: url(/mosaic/img/alert-extended.svg)"></span> |
| <div> |
| <p>The tool <strong>scenario-convert</strong> is part of <strong><a href="https://www.eclipse.org/mosaic/download#overview">MOSAIC Extended</a></strong>.</p> |
| <p>However, you can use scenario-convert <strong>for free</strong> to generate scenarios which are executable with Eclipse MOSAIC. <strong><a href="https://www.dcaiti.tu-berlin.de/research/simulation/download/">Get it here</a>.</strong></p> |
| </div> |
| </div> |
| <div style="text-align: center;"> |
| |
| |
| |
| |
| <a class="mosaic-btn mosaic-btn-primary" href="https://www.dcaiti.tu-berlin.de/research/simulation/download/" title="Download scenario-convert from DCAITI mirror"><i class="fas fa-download"></i>Download scenario-convert from DCAITI mirror</a> |
| |
| </div> |
| <p><strong>scenario-convert</strong> is a useful tool, which can be used to create new scenarios or import and export data from |
| external sources like OpenStreetMap, SUMO etc into your existing scenarios.<br> |
| It will create a database, which is the basis for all map-related tasks performed by Eclipse MOSAIC (e.g. navigation, |
| route calculation&hellip;).<br> |
| Based on a MOSAIC database, scenario-convert can export the data to SUMO-conform formats. |
| Furthermore one can choose, whether to use routes generated by <code>scenario-convert</code>, use existing |
| routes or build own routes via route generation tools (e.g. DUAROUTER by SUMO).</p> |
| <p>This chapter intends to highlight the most common workflows for the work with <code>scenario-convert</code>. |
| We will be using |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/files/steglitz.osm" target="_blank" rel="noopener"> |
| steglitz.osm |
| </a> |
| OSM-file for most of the |
| use cases So feel free to follow along with the steps to get a better understanding on how the <code>scenario-convert</code>-script functions.</p> |
| <div class="alert alert-note"> |
| <div> |
| <p><a href="#reference-documentation-for-scenario-convert">Here</a> you can find a complete reference to all options scenario-convert offers.</p> |
| </div> |
| </div> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <figure id="figure-osm-file-of-steglitz"> |
| |
| |
| <a data-fancybox="" href="../images/osm_uncleaned.png" data-caption="OSM-File of Steglitz"> |
| |
| |
| <img src="../images/osm_uncleaned.png" alt="" > |
| </a> |
| |
| |
| |
| |
| <figcaption data-pre="Figure " data-post=":" class="numbered"> |
| OSM-File of Steglitz |
| </figcaption> |
| |
| |
| </figure> |
| |
| <h2 id="creating-a-complete-eclipse-mosaic-scenario-from-an-osm-file-with-one-command">Creating a complete Eclipse MOSAIC-scenario from an OSM-file with one command</h2> |
| <p>This is the most straight forward way to create a scenario from your OSM-file. |
| We will use the option <code>--osm2mosaic</code>, which is a combination of the options <code>--osm2db</code> |
| and <code>--db2mosaic</code>.<br> |
| Let&rsquo;s start off by showing you how a complete call could look like:</p> |
| <pre><code class="language-bash">java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm |
| </code></pre> |
| <div class="alert alert-note"> |
| <div> |
| <p>In this section we use the scenario name <code>steglitz.<em></code> as synonym for <code>path/to/steglitz.</em></code>.</p> |
| </div> |
| </div> |
| <p>This achieves a couple of things. First off the script is going to create a SQLite-database, |
| which is used by Eclipse MOSAIC. Furthermore, a directory will be created, which should look like this:</p> |
| <pre><code class="language-plaintext">└─ &lt;working-directory&gt; |
| └─ steglitz |
| ├─ steglitz.osm |
| ├─ application |
| | └─ steglitz.db |
| ├─ cell |
| | ├─ cell_config.json |
| | ├─ network.json |
| | └─ regions.json |
| ├─ environment |
| | └─ environment_config.json |
| ├─ mapping |
| | └─ mapping_config.json |
| ├─ ns3 |
| | ├─ ns3_config.json |
| | └─ ns3_federate_config.xml |
| ├─ omnetpp |
| | ├─ omnetpp_config.json |
| | └─ omnetpp.ini |
| ├─ output |
| | └─ output_config.xml |
| ├─ sns |
| | └─ sns_config.json |
| ├─ sumo |
| | ├─ steglitz.net.xml |
| | └─ steglitz.sumocfg |
| └─ scenario_config.json .................. Basic configuration of the simulation scenario |
| </code></pre> |
| <p>Let&rsquo;s walk through all these files:</p> |
| <ol> |
| <li>First the <code>steglitz.db</code> will be created using the <code>steglitz.osm</code>-file.</li> |
| <li>The <code>steglitz.db</code> will be used to create <code>steglitz.con.xml</code>, <code>steglitz.edg.xml</code> and <code>steglitz.nod.xml</code>, which are files used by SUMO.</li> |
| <li> |
| |
| |
| |
| |
| <a href="https://sumo.dlr.de/wiki/NETCONVERT" target="_blank" rel="noopener"> |
| SUMO Netconvert |
| </a> |
| is used to create <code>steglitz.net.xml</code>, which is a |
| |
| |
| |
| |
| <a href="https://sumo.dlr.de/wiki/Networks/SUMO_Road_Networks" target="_blank" rel="noopener"> |
| network representation |
| </a> |
| in SUMO.</li> |
| <li>Now the SUMO-configuration <code>steglitz.sumo.cfg</code> is written.</li> |
| <li>Afterwards the <code>mapping_config.json</code> and <code>scenario_config.json</code> are created and all files are moved to the right place. |
| In the <code>scenario_config.json</code> values like the center coordinate will automatically be set using data from the SUMO related files.</li> |
| </ol> |
| <p>While this is technically sufficient to start working on your scenario there are a couple of other things |
| you can do to achieve better results.</p> |
| <p><strong>Clean the OSM-file using Osmosis</strong><br> |
| Osmosis will automatically be used to create a new OSM-file with the suffix <code>_cleaned</code>. The created |
| file will contain much less clutter and usually is better suited for simulation purposes. |
| Check the images below to see the difference the clean-up process can make.</p> |
| <pre><code class="language-bash">java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm |
| </code></pre> |
| <div class="row"> |
| <div class="col-6"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <figure id="figure-uncleaned-osm-file"> |
| |
| |
| <a data-fancybox="" href="../images/osm_uncleaned.png" data-caption="Uncleaned OSM-file"> |
| |
| |
| <img src="../images/osm_uncleaned.png" alt="" > |
| </a> |
| |
| |
| |
| |
| <figcaption data-pre="Figure " data-post=":" class="numbered"> |
| Uncleaned OSM-file |
| </figcaption> |
| |
| |
| </figure> |
| |
| </div> |
| <div class="col-6"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <figure id="figure-cleaned-osm-file"> |
| |
| |
| <a data-fancybox="" href="../images/osm_cleaned.png" data-caption="Cleaned OSM-file"> |
| |
| |
| <img src="../images/osm_cleaned.png" alt="" > |
| </a> |
| |
| |
| |
| |
| <figcaption data-pre="Figure " data-post=":" class="numbered"> |
| Cleaned OSM-file |
| </figcaption> |
| |
| |
| </figure> |
| |
| </div> |
| </div> |
| <div class="row"> |
| <div class="col-6"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <figure id="figure-uncleaned-net-file"> |
| |
| |
| <a data-fancybox="" href="../images/netfile_uncleaned.png" data-caption="Uncleaned Net-file"> |
| |
| |
| <img src="../images/netfile_uncleaned.png" alt="" > |
| </a> |
| |
| |
| |
| |
| <figcaption data-pre="Figure " data-post=":" class="numbered"> |
| Uncleaned Net-file |
| </figcaption> |
| |
| |
| </figure> |
| |
| </div> |
| <div class="col-6"> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <figure id="figure-cleaned-net-file"> |
| |
| |
| <a data-fancybox="" href="../images/netfile_cleaned.png" data-caption="Cleaned Net-file"> |
| |
| |
| <img src="../images/netfile_cleaned.png" alt="" > |
| </a> |
| |
| |
| |
| |
| <figcaption data-pre="Figure " data-post=":" class="numbered"> |
| Cleaned Net-file |
| </figcaption> |
| |
| |
| </figure> |
| |
| </div> |
| </div> |
| <p>To avoid &ldquo;cleaning&rdquo; the OSM-file, please use the option &ldquo;skip-osm-filter&rdquo;.</p> |
| <pre><code class="language-bash">java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm --skip-osm-filter |
| </code></pre> |
| <p><strong>Generating Routes</strong><br> |
| The scenario-convert also offers the option <code>--generate-routes</code>, which will generate |
| a route-file, given some additional information. For example purposes we will run the |
| following command:</p> |
| <pre><code class="language-bash">java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm --generate-routes |
| --route-begin-latlon 52.4551693,13.3193474 --route-end-latlon 52.4643101,13.3206834 --number-of-routes 3 |
| </code></pre> |
| <p>This will calculate three routes between the two given coordinates.</p> |
| <p>Alternatively you can use the following command in order to generate routes with node-id&rsquo;s as start and end point, which can be found in the <code>steglitz.nod.xml</code> file.</p> |
| <pre><code class="language-bash">java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm -o --generate-routes |
| --route-begin-node-id 267350668 --route-end-node-id 313139970 --number-of-routes 3 |
| </code></pre> |
| <p>See |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="#reference-documentation-for-scenario-convert"> |
| below |
| </a> |
| for all command line options.</p> |
| <p><strong>Conlusion</strong><br> |
| This wraps up one of the main workflows with the scenario-convert-script. |
| A quick reminder on what we achieved:</p> |
| <ul> |
| <li>Cleaned up an OSM-file to only contain relevant data.</li> |
| <li>Converted that OSM-file to formats that Eclipse MOSAIC/SUMO can handle.</li> |
| <li>Created the project structure for a scenario.</li> |
| <li>Calculated routes between two coordinates.</li> |
| </ul> |
| <p>With all of this you can now start further developing your scenario. For a more detailed description on the next steps |
| please have a look |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/"> |
| here (Simulation Scenarios) |
| </a> |
| and |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/develop_applications/"> |
| here (Application Development) |
| </a> |
| .<br> |
| While this is the &lsquo;happy world&rsquo; workflow it is often necessary to manually adapt routes and |
| insert them into your scenario. The following workflow |
| will explain how that is done and you will also get a more detailed overview of the scenario-convert-functions.</p> |
| <h2 id="importing-routes-to-your-scenario">Importing Routes to your scenario</h2> |
| <p>As mentioned above your routes won&rsquo;t always be created by the scenario-convert script. We generated some routes |
| for the steglitz-scenario using SUMO&rsquo;s |
| |
| |
| |
| |
| <a href="http://sumo.dlr.de/wiki/DUAROUTER" target="_blank" rel="noopener"> |
| duarouter |
| </a> |
| , which you can find |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/files/steglitz.rou.xml" target="_blank" rel="noopener"> |
| here |
| </a> |
| . We&rsquo;ll start with only the <code>steglitz.osm</code> and |
| <code>steglitz.rou.xml</code> files:</p> |
| <pre><code class="language-plaintext">└─ &lt;working-directory&gt; |
| ├─ steglitz.osm |
| └─ steglitz.rou.xml |
| </code></pre> |
| <p><strong>Creating the database</strong><br> |
| We&rsquo;ll start off by solely creating the database and applying OSMOSIS with the following command:</p> |
| <pre><code class="language-bash">java -jar scenario-convert.jar --osm2db -i steglitz.osm |
| </code></pre> |
| <p>The directory should look like this:</p> |
| <pre><code class="language-plaintext">└─ &lt;working-directory&gt; |
| ├─ steglitz.db |
| ├─ steglitz.osm |
| ├─ steglitz.rou.xml |
| └─ steglitz_cleaned.osm |
| </code></pre> |
| <p><strong>Importing the route-file</strong></p> |
| <p>Let&rsquo;s import our routes into the database.<br> |
| We achieve this by calling:</p> |
| <pre><code>java -jar scenario-convert.jar --sumo2db -i steglitz.rou.xml -d .\steglitz.db |
| </code></pre> |
| <p>Now all new routes are imported into our database. The following image shows a visualization of one of |
| the created routes.</p> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <figure id="figure-visualization-of-one-of-the-routes"> |
| |
| |
| <a data-fancybox="" href="../images/steglitz_route.png" data-caption="Visualization of one of the routes"> |
| |
| |
| <img src="../images/steglitz_route.png" alt="" > |
| </a> |
| |
| |
| |
| |
| <figcaption data-pre="Figure " data-post=":" class="numbered"> |
| Visualization of one of the routes |
| </figcaption> |
| |
| |
| </figure> |
| |
| <p><strong>Creating the scenario</strong><br> |
| The final step is to create the scenario from the files we created so far.</p> |
| <pre><code>java -jar scenario-convert.jar --db2mosaic -d .\steglitz.db |
| </code></pre> |
| <p>Instead of copying our SUMO-files this will generate all necessary files and move them into a Eclipse MOSAIC-conform |
| folder structure:</p> |
| <pre><code class="language-plaintext">└─ &lt;working-directory&gt; |
| ├─ steglitz.osm |
| └─ steglitz |
| ├─ application |
| | └─ steglitz.db |
| ├─ mapping |
| | └─ mapping_config.json |
| ├─ sumo |
| | ├─ steglitz.net.xml |
| | └─ steglitz.sumocfg |
| └─ scenario_config.json |
| </code></pre> |
| <p>As you can see the resulting folder structure looks just like the final output from the first workflow described.</p> |
| <p><strong>Conclusion</strong><br> |
| You should now know how you can manually add routes to your scenario and have a deeper understanding of the way that |
| some of the script parameters work.</p> |
| <h3 id="attached-files">Attached Files</h3> |
| <p>A list of all attached files in this chapter:</p> |
| <ul> |
| <li> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/files/steglitz.osm" target="_blank" rel="noopener"> |
| Steglitz OSM-file |
| </a> |
| </li> |
| <li> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/files/steglitz.rou.xml" target="_blank" rel="noopener"> |
| Steglitz Route-file |
| </a> |
| </li> |
| </ul> |
| <h2 id="reference-documentation-for-scenario-convert">Reference documentation for scenario-convert</h2> |
| <h3 id="usage-of-scenario-convert">Usage of scenario-convert</h3> |
| <p>The following listing shows an overview for the usage of scenario-convert:</p> |
| <pre><code>usage: scenario-convert [OPERATION] [OPTIONS] |
| |
| Examples: |
| 1. Import an osm file and write data into database |
| &gt; scenario-convert --osm2db -i &lt;OSMFILE&gt; [-d &lt;DATABASE&gt;] |
| 2. Export database content to SUMO-readable files |
| &gt; scenario-convert --db2sumo -d &lt;DATABASE&gt; [-s &lt;SUMOPREFIX&gt;] |
| 3. Import a SUMO routefile into a database |
| &gt; scenario-convert --sumo2db -d &lt;DATABASE&gt; -i &lt;ROUTEFILE&gt;.rou.xml |
| 4. Combine steps 1 and 2 |
| &gt; scenario-convert --osm2sumo -d &lt;DATABASE&gt; -i &lt;OSMFILE&gt; [-s &lt;SUMOPREFIX&gt;] |
| 5. Export db content to Shapefile format |
| &gt; scenario-convert --db2shp -d &lt;DATABASE&gt; |
| 6. Import an srtm file and write elevation data to nodes of an existing database |
| &gt; scenario-convert --srtm2db -i &lt;SRTMFILE&gt; -d &lt;DATABASE&gt; |
| 7. Create a complete MOSAIC scenario from an osm file |
| &gt; scenario-convert --osm2mosaic -i &lt;OSMFILE&gt; |
| 8. Create a scenario database from an SUMO net file |
| &gt; scenario-convert --sumo2db -i &lt;NETFILE&gt;.net.xml |
| 9. Calculate a route from node 123 to node 456 |
| &gt; scenario-convert --generate-routes -d &lt;DATABASE&gt; --route-begin-node-id 123 --route-end-node-id 456 |
| |
| The following arguments are available: |
| -h,--help Prints this help screen. |
| |
| -c,--config-file &lt;PATH&gt; Optional, refers to a configuration file which contains all parameters in |
| JSON format. |
| --osm2db Converts a OpenStreetMap file to a new scenario database. |
| --sumo2db Imports a SUMO Network/Routefile. Be aware that you may have to re-export an |
| imported network. |
| --srtm2db Imports an SRTM file and writes elevation data to nodes. |
| --db2sumo Exports the network to SUMO node and edge files. |
| --db2shp Exports the database into Shapefile format. |
| --db2mosaic Creates directory structure for a MOSAIC scenario based on the database |
| contents. |
| --osm2sumo Combination of osm2db and db2sumo. |
| --osm2mosaic Combination of osm2db and db2mosaic. |
| --update Updates the database to the current scheme. |
| |
| -d,--database &lt;PATH&gt; The path to the database. |
| For import: File to import to. If not given, a new file is created. |
| For export: File to load from. |
| For update operations: file to update. |
| -i,--input &lt;PATH&gt; Defines an input file to use in an import. File type depends on the import |
| operation (OSM File/Database file/SUMO net file/SUMO rou file). |
| -s,--sumo-prefix &lt;STRING&gt; Prefix for the generated sumo files (uses database name when not defined). |
| -f,--force Force overwrite of existing files instead of incrementing file names. |
| -m,--mapping-file &lt;PATH&gt; Uses the given mapping configuration to export existing vehicleTypes and |
| vehicles data to *.rou.xml. |
| --import-lat &lt;DOUBLE&gt; Center latitude of imported region to project coordinates. |
| --import-lon &lt;DOUBLE&gt; Center longitude of imported region to project coordinates. |
| --import-zone &lt;STRING&gt; UTM zone of location for projecting coords in default format (e.g. 32n). |
| |
| -g,--generate-routes Generates route(s) from one point to another. The begin and end for the route |
| must be known (see below options). |
| --route-begin-lat &lt;DOUBLE&gt; Latitude of the starting point, needs --route-begin-lon as well. |
| --route-begin-lon &lt;DOUBLE&gt; Longitude of the starting point, needs --route-begin-lat as well. |
| --route-begin-latlon &lt;DOUBLE,DOUBLE&gt; [latitude],[longitude] of the starting point. |
| --route-begin-node-id &lt;STRING&gt; OSM node id of the starting point (use instead of lat/lon). |
| --route-end-lat &lt;DOUBLE&gt; Latitude of the starting point, needs --route-end-lon as well. |
| --route-end-lon &lt;DOUBLE&gt; Longitude of the starting point, needs --route-end-lat as well. |
| --route-end-latlon &lt;DOUBLE,DOUBLE&gt; [latitude],[longitude] of the ending point. |
| --route-end-node-id &lt;STRING&gt; OSM node id of the ending point (use instead of lat/lon). |
| --route-matrix &lt;STRING,STRING,...&gt; Calculates all possible routes starting and ending at the given nodes, given |
| as comma-separated list (e.g. 12345,87123,89123) |
| --number-of-routes &lt;INTEGER&gt; Defines the number of alternative routes to be calculated (default=1). |
| |
| --skip-osm-filter Skips automatic filtering of the OSM file (only with osm2xxx). |
| --skip-turn-restrictions Ignore all defined turn restrictions on OSM import. |
| --skip-graph-cleanup Turns off the removal of unconnected parts from the main traffic network |
| graph . Since several components of VSimRTI require one main graph without |
| disconnected ways and nodes, this option should be used only if the cleanup |
| procedure is faulty. |
| --skip-netconvert Skips starting sumo netconvert for creating netfile (only with xxx2sumo). |
| --skip-traffic-lights-export Skips exporting traffic light information for nodes (only with xxx2sumo). |
| --osm-speeds-file &lt;PATH&gt; Define a property file which contains speed information which are used to set |
| the speed for OSM ways without a max speed tag (only with osm2xxx). |
| --osm-speeds-overwrite If set to true , the maxspeed tags of ways are ignored and replaced by either |
| default values , or by speed information defined via the --osm-speeds-file |
| option (only with osm2xxx). |
| |
| </code></pre> |
| <h3 id="configuration-files-for-scenario-convert">Configuration-files for scenario-convert</h3> |
| <p>Scenario-convert offers a way to safe your conversion-parameters in a <code>JSON</code> configuration file using |
| the option <code>-c</code> or <code>--config-file</code>.<br> |
| The following listing shows how to save the options used in the example above:</p> |
| <pre><code>{ |
| &#34;operatingMode&#34;: &#34;osm2mosaic&#34;, |
| &#34;inputFile&#34;: &#34;steglitz.osm&#34;, |
| &#34;executeOsmosis&#34;: true, |
| &#34;generateRoutes&#34;: true, |
| &#34;routeBeginLatLon&#34;: &#34;52.457616,13.318392&#34;, |
| &#34;routeEndLatLon&#34;: &#34;52.454774,13.333554&#34;, |
| &#34;numberOfRoutes&#34;: 3 |
| } |
| </code></pre> |
| <h3 id="speed-files">Speed-files</h3> |
| <p>Below you can find a properties file which can be used during the import of OSM data |
| in order to define speeds for ways, which do not have a maxspeeds-tag defined. For this purpose use the |
| option <code>--osm-speeds-file &lt;FILE&gt;</code>. In the speed properties file, for each way type a speed value can |
| be defined, according to the OSM |
| |
| |
| |
| |
| <a href="http://wiki.openstreetmap.org/wiki/Key:highway" target="_blank" rel="noopener"> |
| <code>highway</code> |
| </a> |
| key.</p> |
| <pre><code># the unit the speed values are defined in [kmh, ms] |
| speed.unit = kmh |
| |
| # the default speed for all way types which are not defined here |
| speed.default = 30 |
| |
| # autobahn |
| highway.motorway = 130 |
| highway.motorway_link = 70 |
| |
| # bundesstrasse (germany) |
| highway.trunk = 70 |
| highway.trunk_link = 65 |
| |
| # linking bigger town |
| highway.primary = 65 |
| highway.primary_link = 60 |
| |
| # linking towns &#43; villages |
| highway.secondary = 60 |
| highway.secondary_link = 50 |
| |
| #streets without middle line separation |
| highway.tertiary = 50 |
| highway.tertiary_link = 40 |
| highway.residential = 30 |
| |
| #special roads |
| highway.living_street = 5 |
| highway.service = 20 |
| |
| # unclassified roads |
| highway.unclassified = 30 |
| highway.road = 20 |
| |
| # forest tracks |
| highway.track 15 |
| </code></pre> |
| </description> |
| </item> |
| |
| <item> |
| <title>Additional Scenario Configuration</title> |
| <link>https://www.eclipse.org/mosaic/docs/building_scenarios/scenario_configuration/</link> |
| <pubDate>Sun, 05 May 2019 00:00:00 +0100</pubDate> |
| <guid>https://www.eclipse.org/mosaic/docs/building_scenarios/scenario_configuration/</guid> |
| <description><p>This chapter aims to give you a brief overview of additional simulators and visualizers that can be used with Eclipse MOSAIC. |
| We will continue with the tutorial-style explanations following up on the Steglitz-example from the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/scenario_convert/"> |
| previous chapter |
| </a> |
| . For more detailed explanations of the configurations have a |
| look at |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/"> |
| this chapter |
| </a> |
| .<br> |
| If you already played with the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/tutorials/barnim_basic/"> |
| Barnim |
| </a> |
| -tutorial you probably noticed, that it contains far |
| more folders in the scenario structure compared to the Steglitz example. Those additional directories contain |
| configurations for various simulators.</p> |
| <pre><code class="language-plaintext">└─ Barnim |
| ├─ application |
| ├─ cell |
| ├─ environment |
| ├─ mapping |
| ├─ ns3 |
| ├─ output |
| ├─ sns |
| ├─ sumo |
| └─ scenario_config.json .................. Basic configuration of the simulation scenario |
| </code></pre> |
| <h2 id="let-the-cars-loose">Let the cars loose</h2> |
| <p>As a starting point we&rsquo;ll look at the scenario that we created using this command:</p> |
| <pre><code>java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm -o --generate-routes |
| --route-begin-latlon 52.4551693,13.3193474 --route-end-latlon 52.4643101,13.3206834 --number-of-routes 3 |
| </code></pre> |
| <p>We&rsquo;ll end up with a folder looking like this:</p> |
| <pre><code class="language-plaintext">└─ steglitz |
| ├─ application |
| | └─ steglitz.db |
| ├─ mapping |
| | └─ mapping_config.json |
| ├─ sumo |
| | ├─ steglitz.net.xml |
| | └─ steglitz.sumocfg |
| └─ scenario_config.json .................. Basic configuration of the simulation scenario |
| </code></pre> |
| <p>If you have a look in the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/files/steglitz_mapping_config.json" target="_blank" rel="noopener"> |
| mapping_config.json |
| </a> |
| , |
| you can see that the scenario-convert script automatically assigns cars to the three routes created. You can use this |
| file as a blueprint for your own scenario, have a look |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/#applications-and-mapping"> |
| here |
| </a> |
| |
| to get more details on possible adaptions.<br> |
| Below is a short video of the scenario displayed in the SUMO-GUI. We marked the three different routes the cars |
| follow.</p> |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <video controls > |
| <source src="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/images/steglitz_routes.mp4" type="video/mp4"> |
| </video> |
| <h2 id="communication-simulators-cell-ns3-omnetpp-sns">Communication Simulators (cell, ns3, omnetpp, sns)</h2> |
| <p>We won&rsquo;t implement any functionality for the steglitz example here but rather have a look at the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/tutorials/barnim_basic/"> |
| Barnim |
| </a> |
| -tutorial. In the <code>scenario_config.json</code> of the Barnim scenario you can see where the |
| communication simulators are activated:</p> |
| <pre><code class="language-json">&quot;federates&quot;: { |
| &quot;cell&quot;: false, |
| &quot;omnetpp&quot;: false, |
| &quot;ns3&quot;: false, |
| &quot;sns&quot;: true |
| } |
| </code></pre> |
| <p>Our |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/tutorials/"> |
| tutorials |
| </a> |
| and |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/tutorials/additional_examples/"> |
| additional examples |
| </a> |
| demonstrate use cases for |
| communication usages and you should have a look at them if you are uncertain where to start. Furthermore we |
| recommend copying the configuration-files for the simulator you are going to use from the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/tutorials/barnim_basic/"> |
| Barnim scenario |
| </a> |
| . It |
| contains the most complete configurations and is well maintained.<br> |
| If you are an expert with one of the external network simulators ( |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/simulators/network_simulator_ns3/"> |
| ns3 |
| </a> |
| , |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/simulators/network_simulator_omnetpp/"> |
| OMNeT++ |
| </a> |
| ) the Barnim scenario will also give |
| you an overview on how to configure those.</p> |
| <h2 id="other-simulators">Other Simulators</h2> |
| <p>Here we&rsquo;ll discuss two simulators integrated with Eclipse MOSAIC and their use-cases, namely the <code>Event Server</code> and the |
| <code>Battery Simulator</code>.</p> |
| <h3 id="event-server">Event server</h3> |
| <p>The event server can be used to emit events to vehicles inside it&rsquo;s predefined borders. In the Barnim scenario |
| an event server is used to simulate an icy area, which is then noticed by the sensor of a weather server RSU.<br> |
| Every defined event requires a type, a defined geographical area (e.g. circular, rectangular), the strength and a time frame. Have a look |
| at the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/files/eventserver_config.json" target="_blank" rel="noopener"> |
| eventserver_config.json |
| </a> |
| to see how this can be |
| configured. If you want to use the event server make sure to have it enabled in the <code>scenario_config.json</code>.</p> |
| <h3 id="battery">Battery</h3> |
| <p>The battery simulator is used to simulate electric vehicles. It offers a lot of customization, because you can |
| dynamically load your own battery, vehicle and environment models. Have a look a the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/building_scenarios/files/battery_config.json" target="_blank" rel="noopener"> |
| battery_config.json |
| </a> |
| , taken from the Barnim scenario. |
| The three models used are included with Eclipse MOSAIC and you can freely use them.</p> |
| <h2 id="output">Output</h2> |
| <p>There are various options to generate output results of your simulations (see the |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| <a href="https://www.eclipse.org/mosaic/mosaic/docs/visualization/filevis/"> |
| visualization chapter |
| </a> |
| ).</p> |
| <p>The first step is to create a file called <code>output_config.xml</code> in a new directory called <code>output</code>. |
| If you used the scenario-convert tool the file should be generated automatically.</p> |
| <pre><code class="language-plaintext">└─ steglitz |
| ├─ application |
| | └─ steglitz.db |
| ├─ mapping |
| | └─ mapping_config.json |
| ├─ output |
| | └─ output_config.xml |
| ├─ sumo |
| | ├─ steglitz.net.xml |
| | └─ steglitz.sumocfg |
| └─ scenario_config.json .................. Basic configuration of the simulation scenario |
| </code></pre> |
| <p>Example configuration for output generation can be taken from the example scenarios from the tutorials section.</p> |
| <p>Next make sure the visualization federate is activated in the <code>scenario_config.json</code>.</p> |
| <!-- |
| ```xml |
| <!-- Visualization -- > |
| <federate id="output" active="true"/> |
| ``` |
| |
| Now we have to configure the statistics visualizer itself. This [visualizer_config.xml](/docs/building_scenarios/files/steglitz_visualizer_config.xml) contains the basic |
| configuration in order to calculate the average travel times for the vehicles. If you want to make adaptions, please |
| refer to [statistics visualizer](/docs/visualization/statistics). |
| Go ahead and run the simulation one more time. Afterwards the log-directory should contain a file called |
| `AverageVehicleTravelTime.csv` in a directory called `StatisticsVisualizer`: |
| ```csv |
| group;group-value;total; |
| Car;186.369;336; |
| ``` |
| This tells us that there was a total amount of 336 vehicles of the type `Car` in the simulation, which traveled |
| for 186.369 seconds on average. |
| --> |
| <p><strong>Conclusion</strong><br> |
| After this small, hands-on introduction to visualizers you should know where to configure them and after some additional |
| reading, you should be able to configure different types of visualizers for your use-cases.</p> |
| </description> |
| </item> |
| |
| </channel> |
| </rss> |