blob: d811e6a375d6308601243f350856b27cc7a5c269 [file] [log] [blame]
<?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</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>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>&lt;p&gt;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
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/scenario_convert&#34;&gt;previous chapter&lt;/a&gt;. For more detailed explanations of the configurations have a
look at
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/scenarios&#34;&gt;this chapter&lt;/a&gt;.&lt;br&gt;
If you already played with the
&lt;a href=&#34;https://www.eclipse.org/mosaic/tutorials/barnim_basic&#34;&gt;Barnim&lt;/a&gt;-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.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-FOLDER&#34;&gt;└─ Barnim
├─ application
├─ cell
├─ environment
├─ mapping
├─ ns3
├─ output
├─ sns
├─ sumo
└─ scenario_config.json .................. Basic configuration of the simulation scenario
&lt;/code&gt;&lt;/pre&gt;
&lt;h2 id=&#34;let-the-cars-loose&#34;&gt;Let the cars loose&lt;/h2&gt;
&lt;p&gt;As a starting point we&amp;rsquo;ll look at the scenario that we created using this command:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;We&amp;rsquo;ll end up with a folder looking like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-FOLDER&#34;&gt;└─ steglitz
├─ application
| └─ steglitz.db
├─ mapping
| └─ mapping_config.json
├─ sumo
| ├─ steglitz.net.xml
| └─ steglitz.sumocfg
└─ scenario_config.json .................. Basic configuration of the simulation scenario
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If you have a look in the &lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/steglitz_mapping_config.json&#34; download&gt;&lt;code&gt;mapping_config.json&lt;/code&gt;&lt;/a&gt;,
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
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/scenarios/#applications-and-mapping&#34;&gt;here&lt;/a&gt;
to get more details on possible adaptions.&lt;br&gt;
Below is a short video of the scenario displayed in the SUMO-GUI. We marked the three different routes the cars
follow.&lt;/p&gt;
&lt;p&gt;
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/images/steglitz_routes.mp4&#34;&gt;Watch scenario&lt;/a&gt;&lt;/p&gt;
&lt;h2 id=&#34;communication-simulators-cell-ns3-omnetpp-sns&#34;&gt;Communication Simulators (cell, ns3, omnetpp, sns)&lt;/h2&gt;
&lt;p&gt;We won&amp;rsquo;t implement any functionality for the steglitz example here but rather have a look at the
&lt;a href=&#34;https://www.eclipse.org/mosaic/tutorials/barnim_basic&#34;&gt;Barnim&lt;/a&gt;-tutorial. In the &amp;lt;a href=&amp;quot;/docs/building_scenarios/files/barnim_mosaic_config.xml&amp;quot; download&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;scenario_config.json&lt;/code&gt;
.xml`&lt;/a&gt; of the Barnim scenario you can
see where the communication simulators are activated.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;pre&gt;&lt;code class=&#34;language-json&#34;&gt;&amp;quot;federates&amp;quot;: {
&amp;quot;cell&amp;quot;: false,
&amp;quot;omnetpp&amp;quot;: false,
&amp;quot;ns3&amp;quot;: false,
&amp;quot;sns&amp;quot;: true
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Our
&lt;a href=&#34;https://www.eclipse.org/mosaic/tutorials&#34;&gt;tutorials&lt;/a&gt; and
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/simulators/application_simulator/#additional-examples&#34;&gt;additional examples&lt;/a&gt;
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
&lt;a href=&#34;https://www.eclipse.org/mosaic/tutorials/barnim_basic/&#34;&gt;Barnim scenario&lt;/a&gt;. It
contains the most complete configurations and is well maintained.&lt;br&gt;
If you are an expert with one of the external network simulators (
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/simulators/network_simulator_ns3&#34;&gt;ns3&lt;/a&gt;,
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/simulators/network_simulator_omnetpp&#34;&gt;OMNeT++&lt;/a&gt;) the Barnim scenario will also give
you an overview on how to configure those.&lt;/p&gt;
&lt;h2 id=&#34;other-simulators&#34;&gt;Other Simulators&lt;/h2&gt;
&lt;p&gt;Here we&amp;rsquo;ll discuss two simulators integrated with Eclipse MOSAIC and their use-cases, namely the &lt;code&gt;Event Server&lt;/code&gt; and the
&lt;code&gt;Battery Simulator&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;event-server&#34;&gt;Event server&lt;/h3&gt;
&lt;p&gt;The event server can be used to emit events to vehicles inside it&amp;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.&lt;br&gt;
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 &lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/eventserver_config.json&#34; download&gt;&lt;code&gt;eventserver_config.json&lt;/code&gt;&lt;/a&gt; to see how this can be
configured. If you want to use the event server make sure to have it enabled in the &lt;code&gt;scenario_config.json&lt;/code&gt;.&lt;/p&gt;
&lt;h3 id=&#34;battery&#34;&gt;Battery&lt;/h3&gt;
&lt;p&gt;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 &lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/battery_config.json&#34; download&gt;&lt;code&gt;battery_config.json&lt;/code&gt;&lt;/a&gt;, taken from the Barnim scenario.
The three models used are included with Eclipse MOSAIC and you can freely use them.&lt;/p&gt;
&lt;h2 id=&#34;output&#34;&gt;Output&lt;/h2&gt;
&lt;p&gt;There are various options to generate output results of your simulations (see the
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/visualization/filevis&#34;&gt;visualization chapter&lt;/a&gt;). Visualizing doesn&amp;rsquo;t necessarily mean you
will end up with moving pictures of cars driving along your predefined routes.&lt;br&gt;
Let&amp;rsquo;s get back to the steglitz-scenario and try to calculate the average travel time of our vehicles.
The first step is to create a file called &lt;code&gt;visualizer_config.xml&lt;/code&gt; in a new directory called &lt;code&gt;visualizer&lt;/code&gt;.
If you used the scenario-convert tool the file should be generated automatically.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-FOLDER&#34;&gt;└─ 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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Next make sure the visualization federate is activated in the &lt;code&gt;scenario_config.json&lt;/code&gt;.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;lt;!-- Visualization --&amp;gt;
&amp;lt;federate id=&amp;quot;visualizer&amp;quot; active=&amp;quot;true&amp;quot;/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now we have to configure the statistics visualizer itself. This &lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/steglitz_visualizer_config.xml&#34; download&gt;&lt;code&gt;visualizer_config.xml&lt;/code&gt;&lt;/a&gt; contains the basic
configuration in order to calculate the average travel times for the vehicles. If you want to make adaptions, please
refer to
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/visualization/statistics&#34;&gt;statistics visualizer&lt;/a&gt;.&lt;br&gt;
Go ahead and run the simulation one more time. Afterwards the log-directory should contain a file called
&lt;code&gt;AverageVehicleTravelTime.csv&lt;/code&gt; in a directory called &lt;code&gt;StatisticsVisualizer&lt;/code&gt;:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;group;group-value;total;
Car;186.369;336;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This tells us that there was a total amount of 336 vehicles of the type &lt;code&gt;car&lt;/code&gt; in the simulation, which traveled
for 186.369 seconds on average.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
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.&lt;/p&gt;
</description>
</item>
<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>&lt;div class=&#34;alert alert-note&#34;&gt;
&lt;div&gt;
The tool &lt;strong&gt;scenario-convert&lt;/strong&gt; is available in MOSAIC Extended and can be used for free for research and academical purposes.
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;Scenario-convert 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.&lt;br&gt;
It will create a database, which is the basis for all map-related tasks performed by Eclipse MOSAIC (e.g. navigation,
route calculation&amp;hellip;).&lt;br&gt;
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 &lt;code&gt;scenario-convert&lt;/code&gt;, use existing
routes or build own routes via route generation tools (e.g. DUAROUTER by SUMO).&lt;/p&gt;
&lt;p&gt;This chapter intends to highlight the most common workflows for the work with &lt;code&gt;scenario-convert&lt;/code&gt;.
We will be using &lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/steglitz.osm&#34; download&gt;&lt;code&gt;this&lt;/code&gt;&lt;/a&gt; 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 &lt;code&gt;scenario-convert&lt;/code&gt;-script functions.
For a complete reference of the script please check
&lt;a href=&#34;#reference-documentation-for-scenario-convert&#34;&gt;here&lt;/a&gt;.&lt;/p&gt;
&lt;figure id=&#34;figure-osm-file-of-steglitz&#34;&gt;
&lt;a data-fancybox=&#34;&#34; href=&#34;../images/osm_uncleaned.png&#34; data-caption=&#34;OSM-File of Steglitz&#34;&gt;
&lt;img src=&#34;../images/osm_uncleaned.png&#34; alt=&#34;&#34; &gt;
&lt;/a&gt;
&lt;figcaption data-pre=&#34;Figure &#34; data-post=&#34;:&#34; class=&#34;numbered&#34;&gt;
OSM-File of Steglitz
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;h2 id=&#34;creating-a-complete-eclipse-mosaic-scenario-from-an-osm-file-with-one-command&#34;&gt;Creating a complete Eclipse MOSAIC-scenario from an OSM-file with one command&lt;/h2&gt;
&lt;p&gt;This is the most straight forward way to create a scenario from your OSM-file.
We will use the option &lt;code&gt;--osm2mosaic&lt;/code&gt;, which is a combination of the options &lt;code&gt;--osm2db&lt;/code&gt;
and &lt;code&gt;--db2mosaic&lt;/code&gt;.&lt;br&gt;
Let&amp;rsquo;s start off by showing you how a complete call could look like:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;alert alert-note&#34;&gt;
&lt;div&gt;
Change &lt;code&gt;mosaic.version&lt;/code&gt; to the current version you are using.&lt;br&gt;
In this section we use the scenario name &lt;code&gt;steglitz.*&lt;/code&gt; as synonym for &lt;code&gt;path/to/steglitz.*&lt;/code&gt;.
&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;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:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-FOLDER&#34;&gt;└─ &amp;lt;working-directory&amp;gt;
├─ steglitz.osm
├─ application
| └─ steglitz.db
├─ cell2
| ├─ cell2_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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let&amp;rsquo;s walk through all these files:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;First the &lt;code&gt;steglitz.db&lt;/code&gt; will be created using the &lt;code&gt;steglitz.osm&lt;/code&gt;-file.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;steglitz.db&lt;/code&gt; will be used to create &lt;code&gt;steglitz.con.xml&lt;/code&gt;, &lt;code&gt;steglitz.edg.xml&lt;/code&gt; and &lt;code&gt;steglitz.nod.xml&lt;/code&gt;, which are files used by SUMO.&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;https://sumo.dlr.de/wiki/NETCONVERT&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;SUMO Netconvert&lt;/a&gt; is used to create &lt;code&gt;steglitz.net.xml&lt;/code&gt;, which is a
&lt;a href=&#34;https://sumo.dlr.de/wiki/Networks/SUMO_Road_Networks&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;network representation&lt;/a&gt; in SUMO.&lt;/li&gt;
&lt;li&gt;Now the SUMO-configuration &lt;code&gt;steglitz.sumo.cfg&lt;/code&gt; is written.&lt;/li&gt;
&lt;li&gt;Afterwards the &lt;code&gt;mapping_config.json&lt;/code&gt; and &lt;code&gt;scenario_config.json&lt;/code&gt; are created and all files are moved to the right place.
In the &lt;code&gt;scenario_config.json&lt;/code&gt; values like the center coordinate will automatically be set using data from the SUMO related files.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Clean the OSM-file using Osmosis&lt;/strong&gt;&lt;br&gt;
Osmosis will automatically be used to create a new OSM-file with the suffix &lt;code&gt;_cleaned&lt;/code&gt;. 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.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm
&lt;/code&gt;&lt;/pre&gt;
&lt;div class=&#34;row&#34;&gt;
&lt;figure id=&#34;figure-uncleaned-osm-file&#34;&gt;
&lt;a data-fancybox=&#34;&#34; href=&#34;../images/osm_uncleaned.png&#34; data-caption=&#34;Uncleaned OSM-file&#34;&gt;
&lt;img src=&#34;../images/osm_uncleaned.png&#34; alt=&#34;&#34; &gt;
&lt;/a&gt;
&lt;figcaption data-pre=&#34;Figure &#34; data-post=&#34;:&#34; class=&#34;numbered&#34;&gt;
Uncleaned OSM-file
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure id=&#34;figure-cleaned-osm-file&#34;&gt;
&lt;a data-fancybox=&#34;&#34; href=&#34;../images/osm_cleaned.png&#34; data-caption=&#34;Cleaned OSM-file&#34;&gt;
&lt;img src=&#34;../images/osm_cleaned.png&#34; alt=&#34;&#34; &gt;
&lt;/a&gt;
&lt;figcaption data-pre=&#34;Figure &#34; data-post=&#34;:&#34; class=&#34;numbered&#34;&gt;
Cleaned OSM-file
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/div&gt;
&lt;div class=&#34;row&#34;&gt;
&lt;figure id=&#34;figure-uncleaned-net-file&#34;&gt;
&lt;a data-fancybox=&#34;&#34; href=&#34;../images/netfile_uncleaned.png&#34; data-caption=&#34;Uncleaned Net-file&#34;&gt;
&lt;img src=&#34;../images/netfile_uncleaned.png&#34; alt=&#34;&#34; &gt;
&lt;/a&gt;
&lt;figcaption data-pre=&#34;Figure &#34; data-post=&#34;:&#34; class=&#34;numbered&#34;&gt;
Uncleaned Net-file
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;figure id=&#34;figure-cleaned-net-file&#34;&gt;
&lt;a data-fancybox=&#34;&#34; href=&#34;../images/netfile_cleaned.png&#34; data-caption=&#34;Cleaned Net-file&#34;&gt;
&lt;img src=&#34;../images/netfile_cleaned.png&#34; alt=&#34;&#34; &gt;
&lt;/a&gt;
&lt;figcaption data-pre=&#34;Figure &#34; data-post=&#34;:&#34; class=&#34;numbered&#34;&gt;
Cleaned Net-file
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;div class=&#34;gallery&#34;&gt;
&lt;a data-fancybox=&#34;gallery-gallery&#34; data-caption=&#34;Uncleaned OSM-file&#34; href=&#34;https://www.eclipse.org/mosaic/mosaic/img/osm_uncleaned.png&#34;&gt;
&lt;img data-src=&#34;https://www.eclipse.org/mosaic/mosaic/img/osm_uncleaned.png&#34; alt=&#34;&#34;&gt;
&lt;/a&gt;
&lt;a data-fancybox=&#34;gallery-gallery&#34; data-caption=&#34;Cleaned OSM-File&#34; href=&#34;https://www.eclipse.org/mosaic/mosaic/img/osm_cleaned.png&#34;&gt;
&lt;img data-src=&#34;https://www.eclipse.org/mosaic/mosaic/img/osm_cleaned.png&#34; alt=&#34;&#34;&gt;
&lt;/a&gt;
&lt;/div&gt;
To avoid &amp;ldquo;cleaning&amp;rdquo; the OSM-file, please use the option &amp;ldquo;skip-osm-filter&amp;rdquo;.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;java -jar scenario-convert.jar --osm2mosaic -i steglitz.osm --skip-osm-filter
&lt;/code&gt;&lt;/pre&gt;
&lt;span class=&#34;todo&#34;&gt;
Modify &amp;lsquo;gallery&amp;rsquo; shortcode to display images correctly
&lt;/span&gt;
&lt;div class=&#34;gallery&#34;&gt;
&lt;/div&gt;
&lt;p&gt;&lt;strong&gt;Generating Routes&lt;/strong&gt;&lt;br&gt;
The scenario-convert also offers the option &lt;code&gt;--generate-routes&lt;/code&gt;, which will generate
a route-file, given some additional information. For example purposes we will run the
following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;This will calculate three routes between the two given coordinates.&lt;/p&gt;
&lt;p&gt;Alternatively you can use the following command in order to generate routes with node-id&amp;rsquo;s as start and end point, which can be found in the &lt;code&gt;steglitz.nod.xml&lt;/code&gt; file.&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;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
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;see
&lt;a href=&#34;#reference-documentation-for-scenario-convert&#34;&gt;below&lt;/a&gt; for all command
line options.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Exporting Traffic Lights&lt;/strong&gt;&lt;br&gt;
Another feature of the scenario-convert script is the ability to export traffic lights from the osm-file to
be used by SUMOs netconvert. The extended call would look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;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
--export-traffic-lights
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Conlusion&lt;/strong&gt;&lt;br&gt;
This wraps up one of the main workflows with the scenario-convert-script.
A quick reminder on what we achieved:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Cleaned up an OSM-file to only contain relevant data.&lt;/li&gt;
&lt;li&gt;Converted that OSM-file to formats that Eclipse MOSAIC/SUMO can handle.&lt;/li&gt;
&lt;li&gt;Created the project structure for a scenario.&lt;/li&gt;
&lt;li&gt;Calculated routes between two coordinates.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;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
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/scenarios/&#34;&gt;here (Simulation Scenarios)&lt;/a&gt; and
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/application_development/&#34;&gt;here (Application Development)&lt;/a&gt;.&lt;br&gt;
While this is the &amp;lsquo;happy world&amp;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.&lt;/p&gt;
&lt;h2 id=&#34;importing-routes-to-your-scenario&#34;&gt;Importing Routes to your scenario&lt;/h2&gt;
&lt;p&gt;As mentioned above your routes won&amp;rsquo;t always be created by the scenario-convert script. We generated some routes
for the steglitz-scenario using SUMO&amp;rsquo;s
&lt;a href=&#34;http://sumo.dlr.de/wiki/DUAROUTER&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;duarouter&lt;/a&gt;, which you can find
&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/steglitz.rou.xml&#34;&gt;here&lt;/a&gt;. We&amp;rsquo;ll start with only the &lt;code&gt;steglitz.osm&lt;/code&gt; and
&lt;code&gt;steglitz.rou.xml&lt;/code&gt; files:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-FOLDER&#34;&gt;└─ &amp;lt;working-directory&amp;gt;
├─ steglitz.osm
└─ steglitz.rou.xml
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Creating the database&lt;/strong&gt;&lt;br&gt;
We&amp;rsquo;ll start off by solely creating the database and applying OSMOSIS with the following command:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-bash&#34;&gt;java -jar scenario-convert.jar --osm2db -i steglitz.osm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The directory should look like this:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-FOLDER&#34;&gt;└─ &amp;lt;working-directory&amp;gt;
├─ steglitz.db
├─ steglitz.osm
├─ steglitz.rou.xml
└─ steglitz_cleaned.osm
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Importing the route-file&lt;/strong&gt;&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;This is the interesting part of this workflow. 👍&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;Let&amp;rsquo;s import our routes into the database.&lt;br&gt;
We achieve this by calling:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;java -jar scenario-convert.jar --sumo2db -i steglitz.rou.xml -d .\steglitz.db
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Now all new routes are imported into our database. The following image shows a visualization of one of
the created routes.&lt;/p&gt;
&lt;figure id=&#34;figure-visualization-of-one-of-the-routes&#34;&gt;
&lt;a data-fancybox=&#34;&#34; href=&#34;../images/steglitz_route.png&#34; data-caption=&#34;Visualization of one of the routes&#34;&gt;
&lt;img src=&#34;../images/steglitz_route.png&#34; alt=&#34;&#34; &gt;
&lt;/a&gt;
&lt;figcaption data-pre=&#34;Figure &#34; data-post=&#34;:&#34; class=&#34;numbered&#34;&gt;
Visualization of one of the routes
&lt;/figcaption&gt;
&lt;/figure&gt;
&lt;p&gt;&lt;strong&gt;Creating the scenario&lt;/strong&gt;&lt;br&gt;
The final step is to create the scenario from the files we created so far.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;java -jar scenario-convert.jar --db2mosaic -d .\steglitz.db
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Instead of copying our SUMO-files this will generate all necessary files and move them into a Eclipse MOSAIC-conform
folder structure:&lt;/p&gt;
&lt;pre&gt;&lt;code class=&#34;language-FOLDER&#34;&gt;└─ &amp;lt;working-directory&amp;gt;
├─ steglitz.osm
└─ steglitz
├─ application
| └─ steglitz.db
├─ mapping
| └─ mapping_config.json
├─ sumo
| ├─ steglitz.net.xml
| └─ steglitz.sumocfg
└─ scenario_config.json
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;As you can see the resulting folder structure looks just like the final output from the first workflow described.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;br&gt;
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.&lt;/p&gt;
&lt;h3 id=&#34;attached-files&#34;&gt;Attached Files&lt;/h3&gt;
&lt;p&gt;A list of all attached files in this chapter:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/steglitz.osm&#34; download&gt;Steglitz OSM-file&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/steglitz.rou.xml&#34; download&gt;Steglitz Route-file&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;reference-documentation-for-scenario-convert&#34;&gt;Reference documentation for scenario-convert&lt;/h2&gt;
&lt;h3 id=&#34;usage-of-scenario-convert&#34;&gt;Usage of scenario-convert&lt;/h3&gt;
&lt;p&gt;The following listing shows an overview for the usage of scenario-convert:&lt;/p&gt;
&lt;span class=&#34;todo&#34;&gt;
New shortcode for embedding documents
&lt;/span&gt;
&lt;p&gt;&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/ScenarioConvertFunctions.txt&#34; download&gt;scenarioConvertFunctions&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;configuration-files-for-scenario-convert&#34;&gt;Configuration-files for scenario-convert&lt;/h3&gt;
&lt;p&gt;Scenario-convert offers a way to safe your conversion-parameters in a &lt;code&gt;JSON&lt;/code&gt; configuration file using
the option &lt;code&gt;-c&lt;/code&gt; or &lt;code&gt;--config-file&lt;/code&gt;.&lt;br&gt;
The following listing shows how to save the options used in the example above:&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/steglitz_config.json&#34; download&gt;steglitzConfigFile&lt;/a&gt;&lt;/p&gt;
&lt;h3 id=&#34;speed-files&#34;&gt;Speed-files&lt;/h3&gt;
&lt;p&gt;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 &lt;code&gt;--osm-speeds-file &amp;lt;FILE&amp;gt;&lt;/code&gt;. In the speed properties file, for each way type a speed value can
be defined, according to the OSM
&lt;a href=&#34;http://wiki.openstreetmap.org/wiki/Key:highway&#34; target=&#34;_blank&#34; rel=&#34;noopener&#34;&gt;&lt;code&gt;highway&lt;/code&gt;&lt;/a&gt; key.&lt;/p&gt;
&lt;p&gt;&lt;a href=&#34;https://www.eclipse.org/mosaic/docs/building_scenarios/files/car-speeds.properties&#34; download&gt;speed-properties&lt;/a&gt;&lt;/p&gt;
</description>
</item>
</channel>
</rss>