blob: 17a6a5b5c072f272d002f7b932a5017f37c32255 [file] [log] [blame]
<!DOCTYPE html><html lang="en-us" >
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="generator" content="Source Themes Academic 4.8.0">
<meta name="author" content="Fraunhofer FOKUS">
<meta name="description" content="">
<link rel="alternate" hreflang="en-us" href="https://www.eclipse.org/mosaic/docs/building_scenarios/">
<meta name="theme-color" content="#68145C">
<script src="/mosaic/js/mathjax-config.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/academicons/1.8.6/css/academicons.min.css" integrity="sha512-MCWBwPSput2UWNwyznVFLbD2iUc1e5VsdD1zahsWVzkDSUzyHhMZ4kCS3wgYSRm0mU+glwD/Q9lSJrDPwbUL2A==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-1/css/all.min.css" integrity="sha512-ZYg+hQvLlM0W9C3P6vTpes5LmJ66G2EsroxDNzwD6qiulckldb29eD9I672HL2X+LH5nRhY1sQqZLJGB+aUUPg==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.css" integrity="sha512-H9jrZiiopUdsLpg94A333EfumgUBpO9MdbxStdeITo+KEIMaNfHNvwyjjDJb+ERPaRS6DpyRlKbvPUasNItRyw==" crossorigin="anonymous">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-light.min.css" crossorigin="anonymous" title="hl-light">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/styles/atom-one-light.min.css" crossorigin="anonymous" title="hl-dark" disabled>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.css" integrity="sha512-xwE/Az9zrjBIphAcBb3F6JVqxf46+CDLwfLMHloNu6KEQCAWi6HcDUbeOfBIptF7tcCzusKFjFw2yuvEpDL9wQ==" crossorigin="anonymous">
<script src="https://cdnjs.cloudflare.com/ajax/libs/lazysizes/5.2.2/lazysizes.min.js" integrity="sha512-TmDwFLhg3UA4ZG0Eb4MIyT1O1Mb+Oww5kFG0uHqXsdbyZz9DcvYQhKpGgNkamAI6h2lGGZq2X8ftOJvF/XjTUg==" crossorigin="anonymous" async></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/3.1.0/es5/tex-chtml.min.js" integrity="sha512-uwL1UtpYdWra2iqJlAW8Ts0s9Os6IxWLDJDF/BnWdhDmT7DEMFba3GPsFwmV3QiTNcUyl2GB5vsgycB/MOvo9g==" crossorigin="anonymous" async></script>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Lato:400,400i,700,700i%7CRoboto+Mono&display=swap">
<link rel="stylesheet" href="/mosaic/css/academic.css">
<link rel="alternate" href="/mosaic/docs/building_scenarios/index.xml" type="application/rss+xml" title="Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility">
<link rel="manifest" href="/mosaic/index.webmanifest">
<link rel="icon" type="image/png" href="/mosaic/images/icon_hu6bdfb97c7e23190c70e41ca0e15a9fce_30436_32x32_fill_lanczos_center_2.png">
<link rel="apple-touch-icon" type="image/png" href="/mosaic/images/icon_hu6bdfb97c7e23190c70e41ca0e15a9fce_30436_192x192_fill_lanczos_center_2.png">
<link rel="canonical" href="https://www.eclipse.org/mosaic/docs/building_scenarios/">
<meta property="twitter:card" content="summary">
<meta property="og:site_name" content="Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility">
<meta property="og:url" content="https://www.eclipse.org/mosaic/docs/building_scenarios/">
<meta property="og:title" content="Simulation Scenarios | Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility">
<meta property="og:description" content=""><meta property="og:image" content="https://www.eclipse.org/mosaic/images/logo.svg">
<meta property="twitter:image" content="https://www.eclipse.org/mosaic/images/logo.svg"><meta property="og:locale" content="en-us">
<meta property="og:updated_time" content="2019-05-05T00:00:00&#43;01:00">
<title>Simulation Scenarios | Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility</title>
</head>
<body id="top" data-spy="scroll" data-offset="70" data-target="#TableOfContents" class=" page-mosaic page-docs page-building_scenarios ">
<aside class="search-results" id="search">
<div class="container">
<section class="search-header">
<div class="row no-gutters justify-content-between mb-3">
<div class="col-10 col-md-3">
<div class="logo" style="background-image: url(/mosaic/img/logos/mosaic/EclipseMOSAIC-Logo-RGB-positiv.svg)"></div>
</div>
<div class="col-2 col-md-4 col-search-close">
<a class="js-search" href="#"><i class="fas fa-times-circle text-muted" aria-hidden="true"></i></a>
</div>
</div>
<div id="search-box">
<input name="q" id="search-query" placeholder="Search..." autocapitalize="off"
autocomplete="off" autocorrect="off" spellcheck="false" type="search">
</div>
</section>
<section class="section-search-results">
<div id="search-hits">
</div>
</section>
</div>
</aside>
<nav class="navbar navbar-expand-lg navbar-light compensate-for-scrollbar" id="navbar-main">
<div class="container">
<div class="d-none d-lg-inline-flex">
<a style="visibility:visible;" class="navbar-brand" href="/mosaic/"><img src="/mosaic/images/logo.svg" alt="Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility"></a>
</div>
<button type="button" class="navbar-toggler" data-bs-toggle="collapse" data-bs-target="#navbar-content-mobile" aria-controls="navbar" aria-expanded="false" aria-label="Toggle navigation">
<span><i class="fas fa-bars"></i></span>
</button>
<div class="navbar-brand-mobile-wrapper d-inline-flex d-lg-none">
<a class="navbar-brand" href="/mosaic/"><img src="/mosaic/images/logo.svg" alt="Eclipse MOSAIC – A Multi-Domain and Multi-Scale Simulation Framework for Connected and Automated Mobility"></a>
</div>
<div id="navbar-content" class="navbar-collapse main-menu-item collapse justify-content-start">
<ul class="navbar-nav d-md-inline-flex">
<li class="nav-item">
<a class="nav-link " href="/mosaic/about/"><span>About</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/news/"><span>News</span></a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/mosaic/docs/"><span>Documentation</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/tutorials/"><span>Tutorials</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/download/"><span>Download</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/community/"><span>Community</span></a>
</li>
</ul>
</div>
<ul class="nav-icons navbar-nav flex-row ml-auto d-flex pl-md-2">
<li class="nav-item">
<a class="nav-link js-search" href="#" aria-label="Search"><i class="fas fa-search" aria-hidden="true"></i></a>
</li>
<li class="nav-item ">
<a href="https://github.com/eclipse/mosaic" target="blank">
<i class="fab fa-github" aria-hidden="true"></i>
</a>
</li>
</ul>
<div id="navbar-content-mobile" class="navbar-collapse main-menu-item collapse justify-content-start d-lg-none">
<ul class="navbar-nav d-inline-flex">
<li class="nav-item">
<a class="nav-link " href="/mosaic/about/"><span>About</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/news/"><span>News</span></a>
</li>
<li class="nav-item">
<a class="nav-link active" href="/mosaic/docs/"><span>Documentation</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/tutorials/"><span>Tutorials</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/download/"><span>Download</span></a>
</li>
<li class="nav-item">
<a class="nav-link " href="/mosaic/community/"><span>Community</span></a>
</li>
</ul>
</div>
</div>
</nav>
<div class="docs container">
<div class="row flex-xl-nowrap">
<div class="docs-sidebar col-12 col-md-3 col-xl-3">
<div class="docs-version">
<a class="" data-bs-toggle="tooltip" data-bs-placement="bottom" title="The documentation corresponds to the latest version of Eclipse MOSAIC 21.1-SNAPSHOT." href="https://github.com/eclipse/mosaic">
<i class="fab fa-github"></i>&nbsp;Eclipse MOSAIC 21.1-SNAPSHOT
</a>
</div>
<form class="docs-search d-flex align-items-center">
<button class="btn docs-toggle d-md-none p-0 mr-3" type="button" data-bs-toggle="collapse" data-bs-target="#docs-nav" aria-controls="docs-nav" aria-expanded="false" aria-label="Toggle section navigation">
<span><i class="fas fa-bars"></i></span>
</button>
<input name="q" type="search" class="form-control" placeholder="Search..." autocomplete="off">
</form>
<nav class="collapse docs-links" id="docs-nav">
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/getting_started/">Getting Started</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/getting_started/">Download</a>
</li>
<li >
<a href="/mosaic/docs/getting_started/run_mosaic/">Run Eclipse MOSAIC</a>
</li>
<li >
<a href="/mosaic/docs/getting_started/results/">Simulation Results</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/visualization/">Visualization</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/visualization/">WebSocket Visualizer</a>
</li>
<li >
<a href="/mosaic/docs/visualization/filevis/">File Output</a>
</li>
<li >
<a href="/mosaic/docs/visualization/statistics/">Statistics Output</a>
</li>
<li >
<a href="/mosaic/docs/visualization/itef/">ITEF</a>
</li>
<li >
<a href="/mosaic/docs/visualization/phabmap/">PHABMap</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/simulators/">Simulators</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/simulators/">Overview</a>
</li>
<li >
<a href="/mosaic/docs/simulators/application_simulator/">Application - Simulator</a>
</li>
<li >
<a href="/mosaic/docs/simulators/application_mapping/">Application - Mapping</a>
</li>
<li >
<a href="/mosaic/docs/simulators/traffic_simulator_sumo/">Traffic - Eclipse SUMO</a>
</li>
<li >
<a href="/mosaic/docs/simulators/network_simulator_omnetpp/">Network - OMNeT&#43;&#43;</a>
</li>
<li >
<a href="/mosaic/docs/simulators/network_simulator_ns3/">Network - ns-3</a>
</li>
<li >
<a href="/mosaic/docs/simulators/network_simulator_sns/">Network - SNS</a>
</li>
<li >
<a href="/mosaic/docs/simulators/network_simulator_cell/">Network - Cell</a>
</li>
<li >
<a href="/mosaic/docs/simulators/environment_simulator/">Environment Simulator</a>
</li>
<li >
<a href="/mosaic/docs/simulators/battery_simulator/">Battery Simulator</a>
</li>
<li >
<a href="/mosaic/docs/simulators/vms_simulator/">VMS Simulator</a>
</li>
</ul>
</div>
<div class="docs-toc-item active">
<a class="docs-toc-link" href="/mosaic/docs/building_scenarios/">Building Scenarios</a>
<ul class="nav docs-sidenav">
<li class="active">
<a href="/mosaic/docs/building_scenarios/">Simulation Scenarios</a>
</li>
<li >
<a href="/mosaic/docs/building_scenarios/scenario_convert/">Scenario Convert</a>
</li>
<li >
<a href="/mosaic/docs/building_scenarios/scenario_configuration/">Additional Scenario Configuration</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/develop_applications/">Create Applications</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/develop_applications/">Basics</a>
</li>
<li >
<a href="/mosaic/docs/develop_applications/communication/">V2X Communication</a>
</li>
<li >
<a href="/mosaic/docs/develop_applications/event_scheduler/">Event Scheduling</a>
</li>
<li >
<a href="/mosaic/docs/develop_applications/road_traffic/">Scenario Database</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/mosaic_configuration/">MOSAIC Configuration</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/mosaic_configuration/">Configuration Files</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/scenario_config/">Scenario Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/mapping_ambassador_config/">Mapping Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/environment_config/">Environment Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/sns_config/">SNS Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/cell_config/">Cell Basic Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/cell_network_config/">Cell Network Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/cell_region_config/">Cell Region Configuration</a>
</li>
<li >
<a href="/mosaic/docs/mosaic_configuration/sumo_config/">SUMO Configuration</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/extending_mosaic/">Extending Eclipse MOSAIC</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/extending_mosaic/">Core Concepts</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/simulator_coupling/">Simulator Coupling</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/interactions/">Interactions</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/application_ambassador_details/">Application Ambassador</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/sumo_ambassador_details/">Sumo Ambassador</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/omnetpp_details/">OMNeT&#43;&#43; Federate</a>
</li>
<li >
<a href="/mosaic/docs/extending_mosaic/delay_models/">Delay Models</a>
</li>
</ul>
</div>
<div class="docs-toc-item">
<a class="docs-toc-link" href="/mosaic/docs/api_docs/">API Documentation</a>
<ul class="nav docs-sidenav">
<li >
<a href="/mosaic/docs/api_docs/">Javadoc</a>
</li>
</ul>
</div>
<div class="nav-bottom">
<img src="/mosaic/img/logos/mosaic/EclipseMOSAIC-Medallion-RGB-single-navy.svg">
</div>
</nav>
</div>
<div class="docs-toc d-none d-xl-block col-xl-2">
<ul class="nav toc-top">
<li><a href="#" id="back_to_top" class="docs-toc-title">Contents</a></li>
</ul>
<nav id="TableOfContents">
<ul>
<li><a href="#main-configuration">Main Configuration</a></li>
<li><a href="#traffic-simulator-configuration">Traffic Simulator Configuration</a></li>
<li><a href="#applications-and-mapping">Applications and Mapping</a>
<ul>
<li><a href="#vehicles">Vehicles</a></li>
<li><a href="#traffic-lights">Traffic lights</a></li>
</ul>
</li>
<li><a href="#communication-simulator">Communication Simulator</a></li>
</ul>
</nav>
</div>
<style>
@media (min-width:1140px) {
.docs-sidebar {
flex: 0 1 320px;
}
.docs-toc {
flex: 0 1 280px;
}
main.docs-content.no-docs-toc {
padding-bottom: 0 !important;
max-width: calc(100% - 320px) !important;
flex: 0 1 calc(100% - 320px);
width: 100%;
}
main.docs-content {
padding-bottom: 0 !important;
max-width: calc(100% - 600px) !important;
flex: 0 1 calc(100% - 600px);
width: 100%;
}
}
@media (max-width: 770px) {
main.docs-content {
max-width: 100% !important;
width: 100%;
}
}
@media (min-width: 771px) and(max-width: 1139px) {
main.docs-content.no-docs-toc {
padding-bottom: 0 !important;
max-width: calc(100% - 320px) !important;
width: 100%;
}
}
</style>
<main class="docs-content col-12 col-md-9 col-xl-auto py-md-3 pl-md-4" role="main">
<article class="article">
<div class="docs-article-container">
<h1>Simulation Scenarios</h1>
<div class="article-style">
<p>This section provides information on creating own simulation scenarios. A scenario is generally a
folder structure that reflects the different components usually found in a simulation. Each of the folders
contains various configuration files which in total describe the simulation setup, including
the movements of the vehicles, the definition of the road network, communication properties, and the like.</p>
<p>The following file structure shows the minimum setup of a typical simulation scenario in Eclipse MOSAIC:</p>
<pre><code class="language-plaintext">└─ &lt;scenarioName&gt;
├─ application
| └─ &lt;scenarioName&gt;.db................ Scenario database file
├─ mapping
| └─ mapping_config.json ............. Mapping configuration file
├─ sumo
| └─ &lt;scenarioName&gt;.net.xml .......... SUMO network file
| └─ &lt;scenarioName&gt;.sumocfg .......... SUMO configuration file
└─ scenario_config.json ............... Basic configuration of the simulation scenario
</code></pre>
<p>In addition to those files, each simulator need to be provided with their custom configuration files.</p>
<h2 id="main-configuration">Main Configuration</h2>
<p>The main configuration file of a scenario is <code>scenario_config.json</code>. In this file basic properties are configured, such as the name of the scenario, the random seed, and activated simulators. Such a file looks like the following:</p>
<pre><code class="language-json">{
&quot;simulation&quot;: {
&quot;id&quot;: &quot;Barnim&quot;,
&quot;duration&quot;: &quot;1000s&quot;,
&quot;randomSeed&quot;: 268965854,
&quot;projection&quot;: {
&quot;centerCoordinates&quot;: {
&quot;latitude&quot;: 52.511289,
&quot;longitude&quot;: 13.3167457
},
&quot;cartesianOffset&quot;: {
&quot;x&quot;: -385769.05,
&quot;y&quot;: -5819239.29
}
},
&quot;network&quot;: {
&quot;netMask&quot;: &quot;255.255.0.0&quot;,
&quot;vehicleNet&quot;: &quot;10.1.0.0&quot;,
&quot;rsuNet&quot;: &quot;10.2.0.0&quot;,
&quot;tlNet&quot;: &quot;10.3.0.0&quot;,
&quot;csNet&quot;: &quot;10.4.0.0&quot;,
&quot;serverNet&quot;: &quot;10.5.0.0&quot;,
&quot;tmcNet&quot;: &quot;10.6.0.0&quot;
}
},
&quot;federates&quot;: {
&quot;application&quot;: true,
&quot;environment&quot;: false,
&quot;cell&quot;: false,
&quot;ns3&quot;: false,
&quot;omnetpp&quot;: false,
&quot;sns&quot;: false,
&quot;sumo&quot;: true,
&quot;visualizer&quot;: true
}
}
</code></pre>
<p>The following fields needs to be configured:</p>
<ul>
<li><strong><code>id</code></strong> - The name of the scenario</li>
<li><strong><code>duration</code></strong> - The duration of the simulation in seconds.</li>
<li><strong><code>randomSeed</code></strong> - The seed to initialze the random number generator with in order to have deterministic results. If not set, a random seed is taken.</li>
<li><strong><code>projection</code></strong> - Configures the coordinate transformation from geographic coordinates to cartesian coordinates. Having a correct setting
here is crucial to get correct results that map to real world coordinates so the simulation results can be visualized in some way.
The center coordinate will be used to determine the correct UTM zone, the <code>cartesianOffset</code> can be determined by having a look at the traffic simulators network file,
e.g. SUMOs <code>*.net.xml</code> contains this information in the <code>netOffset</code> attribute of the location tag.</li>
<li><strong><code>network</code></strong> - Within this config the address resolution scheme is specified. The subnets for all unit types are described here.
Usually, default configuration should be sufficient. However, if you have many vehicles in your scenario the IP address
space would be to small to provide enough addresses. In such cases, the <code>netMask</code> and all <code>subnets</code> have to be configured accordingly.</li>
<li>Last but not least, the <strong><code>federate</code></strong> tags define which simulators are active in the simulation.</li>
</ul>
<h2 id="traffic-simulator-configuration">Traffic Simulator Configuration</h2>
<p>The generated files for the used traffic simulator are placed into the folder named after that simulator, e. g. <code>sumo</code> .
For example, the <code>&lt;scenarioName&gt;.sumocfg</code> describes the main configuration of the SUMO simulator, which should refer to a network file and a route file:</p>
<pre><code class="language-xml">&lt;configuration&gt;
&lt;input&gt;
&lt;net-file value=&quot;MyScenario.net.xml&quot; /&gt;
&lt;route-files value=&quot;MyScenario.rou.xml&quot; /&gt;
&lt;/input&gt;
&lt;/configuration&gt;
</code></pre>
<p>While the <code>*.net.xml</code> is a mandatory file to be placed within the <code>sumo</code> directory, the <code>*.rou.xml</code> is automatically generated
by the SumoAmbassador when the simulation is started. More information about the configuration of SUMO can be found
<a href="/mosaic/docs/simulators/application_simulator/#configuration">
here
</a>
.</p>
<h2 id="applications-and-mapping">Applications and Mapping</h2>
<div class="alert alert-tip">
<div>
<p>Read the detailed documentation of the
<a href="/mosaic/docs/mosaic_configuration/mapping_ambassador_config/">
Mapping Configuration
</a>
.</p>
</div>
</div>
<h3 id="vehicles">Vehicles</h3>
<p>Usually you want the simulated vehicles to be equipped with some kind of applications that influence the
vehicle&rsquo;s behavior. To do that you copy the jar files of your applications to the folder <code>&lt;scenarioName&gt;/application</code> .
Having the applications in place you will have to create a <code>mapping_config.json</code> file in the folder <code>&lt;scenarioName&gt;/mapping</code> .</p>
<p>The following file would spawn 1 vehicle every five seconds (720 veh/hour divided by 3600 sec) until it reaches the max number of vehicles: 500. All the vehicles would be equipped with an application sending CA-messages periodically.</p>
<pre><code class="language-json">{
&quot;prototypes&quot;:[
{
&quot;name&quot;: &quot;Car&quot;,
&quot;accel&quot;: 2.6,
&quot;decel&quot;: 4.5,
&quot;maxSpeed&quot;: 80.0,
&quot;applications&quot;: [
&quot;org.eclipse.mosaic.fed.application.app.etsi.VehicleCamSendingApp&quot;
]
}
],
&quot;vehicles&quot;:[
{
&quot;startingTime&quot;: 0.0,
&quot;targetFlow&quot;: 720,
&quot;maxNumberVehicles&quot;: 500,
&quot;route&quot;: &quot;3&quot;,
&quot;types&quot;: [ { &quot;name&quot;: &quot;Car&quot; } ]
}
]
}
</code></pre>
<h3 id="traffic-lights">Traffic lights</h3>
<p>If you want to simulate traffic lights equipped with applications, traffic lights should be defined in the simulator specific configuration file and also added to the mapping configuration file. The applications can be equipped by explicitly specifying them as &ldquo;applications&rdquo;</p>
<pre><code class="language-json">{
&quot;trafficLights&quot;: [
{
&quot;tlGroupId&quot;: &quot;Bismarkstr_Krummestr&quot;,
&quot;applications&quot;: [
&quot;org.eclipse.mosaic.app.tutorial.TrafficLightApp&quot;
]
}
]
}
</code></pre>
<p>or by referring to previously defined prototypes:</p>
<pre><code class="language-json">{
&quot;prototypes&quot;:[
{
&quot;name&quot;: &quot;Car&quot;,
&quot;accel&quot;: 2.6,
&quot;decel&quot;: 4.5,
&quot;maxSpeed&quot;: 80.0,
&quot;applications&quot;: [
&quot;org.eclipse.mosaic.fed.application.app.etsi.VehicleCamSendingApp&quot;
]
},
{
&quot;name&quot;: &quot;TrafficLight&quot;,
&quot;applications&quot;: [
&quot;org.eclipse.mosaic.app.tutorial.TrafficLightApp&quot;
]
}
],
&quot;vehicles&quot;:[
{
&quot;startingTime&quot;: 0.0,
&quot;targetFlow&quot;: 720,
&quot;maxNumberVehicles&quot;: 500,
&quot;route&quot;: &quot;3&quot;,
&quot;types&quot;: [ { &quot;name&quot;: &quot;Car&quot; } ]
}
],
&quot;trafficLights&quot;: [
{
&quot;tlGroupId&quot;: &quot;Bismarkstr_Krummestr&quot;,
&quot;name&quot;: &quot;TrafficLight&quot;
}
]
}
</code></pre>
<p>Please note that traffic light name and traffic light itself in the mapping file stand for a traffic light group controlling a whole junction. Traffic light group can consist of many individual traffic lights controlling an exact lane. The value of the &ldquo;tlGroupId&rdquo; key MUST coincide with the name of the traffic light group in the traffic simulator related configuration file (with tlLogic id for SUMO and with junction id for Phabmacs).</p>
<p>For SUMO, the description of traffic light groups and their programs can be found in <code>&lt;scenarioname&gt;.net.xml</code>:</p>
<pre><code class="language-xml">&lt;tlLogic id=&quot;26704448&quot; type=&quot;static&quot; programID=&quot;1&quot; offset=&quot;0&quot;&gt;
&lt;phase duration=&quot;39&quot; state=&quot;GGrG&quot;/&gt;
&lt;phase duration=&quot;6&quot; state=&quot;yyry&quot;/&gt;
&lt;phase duration=&quot;39&quot; state=&quot;rrGG&quot;/&gt;
&lt;phase duration=&quot;6&quot; state=&quot;rryy&quot;/&gt;
&lt;/tlLogic&gt;
</code></pre>
<p>Corresponding <code>mapping_config.json</code>:</p>
<pre><code class="language-json">{
...
&quot;trafficLights&quot;: [
{
&quot;tlGroupId&quot;: &quot;26704448&quot;,
&quot;name&quot;: &quot;TrafficLight&quot;
}
]
}
</code></pre>
<p>More information on the mapping configuration can be found (
<a href="/mosaic/docs/simulators/application_simulator/#configuration">
here
</a>
.</p>
<p>For more information about how SUMO traffic lights work please refer to
<a href="https://sumo.dlr.de/docs/Simulation/Traffic_Lights.html" target="_blank" rel="noopener">
SUMO Traffic Lights
</a>
.</p>
<!--
For Phabmacs, one should create a separate configuration file containing the description of traffic light groups and traffic light programs.
mapping_config.json:
```json
{
...
"trafficLights": [
{
"tlGroupId": "Bismarkstr_Krummestr",
"name": "TrafficLight"
}
]
}
```
phabmacs_config.json:
```json
{
...
"ttlFile":"berlinTrafficLights.ttl.json",
...
}
```
An example of how the traffic light configuration can look like in berlinTrafficLights.ttl.json:
```json
{
"programs": [
{
"id": "default",
"phases": [
{
"id": "0",
"duration": 10,
"groupStates": [
"green", "red", "green", "red"
]
},
{
"id": "1",
"duration": 15,
"groupStates": [
"red", "green", "red", "green"
]
}
],
"transitions": [
{
"from": "0",
"to": "1",
"yellowPhaseDuration": 3,
"allRedPhaseDuration": 3,
"redYellowPhaseDuration": 1
},
{
"from": "1",
"to": "0",
"yellowPhaseDuration": 3,
"allRedPhaseDuration": 6,
"redYellowPhaseDuration": 1
}
]
}
],
"junctions": [
{
"id": "Bismarkstr_Krummestr",
"signalGroups": [
{
"id": "K1",
"tlLocation":{
"latitude": 52.51187173469569,
"longitude": 13.309426296977083
}
},
{
"id": "K2",
"tlLocation":{
"latitude": 52.511666041314484,
"longitude": 13.3092408198885
}
},
{
"id": "K3",
"tlLocation":{
"latitude": 52.51155112036543,
"longitude": 13.30933672655086
}
},
{
"id": "K4",
"tlLocation":{
"latitude": 52.51200251720905,
"longitude": 13.30936414260184,
"heading": 180.0
},
"lanes": [ 0 ]
}
],
"availablePrograms": [
"default"
]
}
]
}
```
-->
<p>The <code>application</code> folder furthermore needs a generated database file <code>&lt;scenarioName&gt;.db</code> . This database file
contains information about the road network (road topology) and all routes the vehicles can drive on. This file
is usually generated by the tool <code>scenario-convert</code>, which is described
<a href="/mosaic/docs/building_scenarios/scenario_convert/">
here
</a>
in detail.</p>
<h2 id="communication-simulator">Communication Simulator</h2>
<p>The configuration of the communication parameters are usually not dependent from the location of the road network. Therefore,
most of the required files can be extracted from other scenarios, such
<a href="/mosaic/tutorials/barnim_basic/">
Barnim
</a>
or
<a href="/mosaic/tutorials/tiergarten/">
Tiergarten
</a>
.
Depending on the simulator you will need to configure the geographic extend of the simulation
area. You can find that data in the traffic simulators network file, e.g. SUMOs <code>*.net.xml</code> contains this
information in the <code>convBoundary</code> attribute of the location tag.</p>
<ul>
<li>For <strong>OMNeT++</strong>, it concerns the values of <code>constraintArea</code> in the <code>omnetpp.ini</code></li>
<li>For the <strong>Eclipse MOSAIC Cell</strong> simulator, the expansions do not need to be configured directly. However, the areas
of the configured regions (in <code>regions.json</code>) have to be in line with the scenario location.</li>
<li>The <strong>SNS</strong> also comes without an additional expansion definition.</li>
</ul>
<p>Further information on the communication simulators can be found in:
<br>
<a href="/mosaic/docs/simulators/network_simulator_sns/">
Eclipse MOSAIC SNS
</a>
<br>
<a href="/mosaic/docs/simulators/network_simulator_cell/">
Eclipse MOSAIC Cell
</a>
<br>
<a href="/mosaic/docs/simulators/network_simulator_omnetpp/">
OMNeT++
</a>
<br>
<a href="/mosaic/docs/simulators/network_simulator_ns3/">
ns-3
</a>
</p>
</div>
<div class="article-widget">
<div class="post-nav prev-next-pages col-12">
<div class="row">
<div class="post-nav-item col-6">
</div>
<div class="post-nav-item col-6 align-self-end">
<div class="meta-nav">Next</div>
<a href="/mosaic/docs/building_scenarios/scenario_convert/" rel="prev">Scenario Convert</a>
</div>
</div>
</div>
</div>
</div>
<footer class="site-footer">
<div class="row">
<div class="col-sm-4 mb-3 mb-md-0">
<b>Eclipse MOSAIC</b>
<ul>
<li>
<a href="/mosaic/download/" title="Download Eclipse MOSAIC" >
Download Eclipse MOSAIC
</a>
</li>
<li>
<a href="/mosaic/docs/" title="Documentation" >
Documentation
</a>
</li>
<li>
<a href="/mosaic/tutorials/" title="Tutorials" >
Tutorials
</a>
</li>
<li>
<a href="/mosaic/community/#projects" title="Projects" >
Projects
</a>
</li>
<li>
<a href="/mosaic/publications/" title="Publications" >
Publications
</a>
</li>
</ul>
</div>
<div class="col-sm-4 mb-3 mb-md-0">
<b>Community</b>
<ul>
<li>
<a href="/mosaic/community/" title="Eclipse MOSAIC Community" >
Eclipse MOSAIC Community
</a>
</li>
<li>
<a href="/mosaic/contribution/" title="How to contribute" >
How to contribute
</a>
</li>
<li>
<a href="https://github.com/eclipse/mosaic" title="Github" target="_blank" rel="noopener">
Github
</a>
</li>
<li>
<a href="/mosaic/get_in_contact/" title="Contact &amp; Mailing list" >
Contact & Mailing list
</a>
</li>
</ul>
</div>
<div class="col-sm-4 mb-3 mb-md-0">
<b>Eclipse Foundation</b>
<ul>
<li>
<a href="https://www.eclipse.org/" title="About Eclipse Foundation" target="_blank" rel="noopener">
About Eclipse Foundation
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal/privacy.php" title="Privacy Policy" target="_blank" rel="noopener">
Privacy Policy
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal/termsofuse.php" title="Website terms of use" target="_blank" rel="noopener">
Website terms of use
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal/copyright.php" title="Copyright" target="_blank" rel="noopener">
Copyright
</a>
</li>
<li>
<a href="https://www.eclipse.org/legal" title="Legal" target="_blank" rel="noopener">
Legal
</a>
</li>
</ul>
</div>
</div>
<div class="row justify-content-center mt-3 position-relative">
<p class="powered-by text-center font-italic mb-0 pb-0">
Powered by the
<a href="https://sourcethemes.com/academic/" target="_blank" rel="noopener">Academic theme</a> for
<a href="https://gohugo.io" target="_blank" rel="noopener">Hugo</a>.
<br>
Header image &#169; fanjianhua/ iStock
</p>
</div>
</footer>
</article>
</main>
</div>
</div>
<script src="https://code.jquery.com/jquery-3.4.1.min.js" integrity="sha384-vk5WoKIaW/vJyUAd9n/wmopsmNhiy+L2Z+SBxGYnUkunIxVxAv/UtMOhba/xskxh" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/2.6.0/umd/popper.min.js" integrity="sha512-BmM0/BQlqh02wuK5Gz9yrbe7VyIVwOzD1o40yi1IsTjriX/NGF37NyXHfmFzIlMmoSIBXgqDiG1VNU6kB5dBbA==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.imagesloaded/4.1.4/imagesloaded.pkgd.min.js" integrity="sha512-S5PZ9GxJZO16tT9r3WJp/Safn31eu8uWrzglMahDT4dsmgqWonRY9grk3j+3tfuPr9WJNsfooOR7Gi7HL5W2jw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.isotope/3.0.6/isotope.pkgd.min.js" integrity="sha512-Zq2BOxyhvnRFXu0+WE6ojpZLOU2jdnqbrM1hmVdGzyeCa1DgM3X5Q4A/Is9xA1IkbUeDd7755dNNI/PzSf2Pew==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.5.7/jquery.fancybox.min.js" integrity="sha512-uURl+ZXMBrF4AwGaWmEetzrd+J5/8NRkWAvJx5sbPSSuOb0bZLqf+tOzniObO00BjHa/dD7gub9oCGMLPQHtQA==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mermaid/8.4.8/mermaid.min.js" integrity="sha512-1tS1YUns336Mtxl+vkaLcADPwE1CPNVy3WEf7nrI7DGMMb6/FAVBgL2IzAWVBkB6vVuK94s2zVoiXcw1QZ9S1g==" crossorigin="anonymous" title="mermaid"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/highlight.min.js" integrity="sha512-1LdB3V708w6G4QRl7NsVdTr7MDibyRXr9stQZ+EGjEE0ZPMZkA//ir7kCWmFyxdAJNIRXdR/ZeJmCV0boyiCXw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/java.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/json.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/xml.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/shell.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.18.1/languages/dos.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.5.1/leaflet.js" integrity="sha512-GffPMF3RvMeYyc1LWMHtK8EbPv0iNZ8/oTtHPx9/cc2ILxQ+u905qIwdpULaqDkyBKgOaB57QTMg7ztg8Jm2Og==" crossorigin="anonymous"></script>
<script>const code_highlighting = true;</script>
<script>const isSiteThemeDark = false;</script>
<script>
const search_config = {"indexURI":"/mosaic/index.json","minLength":1,"threshold":0.3};
const i18n = {"no_results":"No results found","placeholder":"Search...","results":"results found"};
const content_type = {
'post': "Posts",
'project': "Projects",
'publication' : "Publications",
'talk' : "Talks"
};
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.1/anchor.min.js" integrity="sha512-aZotBPy6dqn8yVaLJwSrkJ+QxuxV695A4dgodAMvTU5JyNi5mhrr+LeaD3GSS+lx1SMFKNs0tu5ZMJEgNZQP2Q==" crossorigin="anonymous"></script>
<script>
anchors.add();
</script>
<script id="search-hit-fuse-template" type="text/x-template">
<div class="search-hit" id="summary-{{key}}">
<div class="search-hit-content">
<div class="search-hit-name">
<a href="{{relpermalink}}">{{title}}</a>
<div class="article-metadata search-hit-type">{{type}}</div>
<p class="search-hit-description">{{snippet}}</p>
</div>
</div>
</div>
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fuse.js/3.2.1/fuse.min.js" integrity="sha512-o38bmzBGX+hD3JHWUFCDA09btWaqrNmoJ3RXLlrysA7PP01Kgs4UlE4MhelE1v5dJR3+cxlR4qQlotsW7jKsnw==" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/mark.js/8.11.1/jquery.mark.min.js" integrity="sha512-mhbv5DqBMgrWL+32MmsDOt/OAvqr/cHimk6B8y/bx/xS88MVkYGPiVv2ixKVrkywF2qHplNRUvFsAHUdxZ3Krg==" crossorigin="anonymous"></script>
<script type="application/javascript" src="/mosaic/js/academic.min.0992ad8b8d033c3858bb90b03966346a.js"></script>
<script type="application/javascript" src="/mosaic/js/mosaic-wg-cards.js"></script>
<script>
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'))
tooltipTriggerList.map(function (tooltipTriggerEl) {
return new window.bootstrap.Tooltip(tooltipTriggerEl)
})
</script>
<div id="modal" class="modal fade" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Cite</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<pre><code class="tex hljs"></code></pre>
</div>
<div class="modal-footer">
<a class="btn btn-outline-primary my-1 js-copy-cite" href="#" target="_blank">
<i class="fas fa-copy"></i> Copy
</a>
<a class="btn btn-outline-primary my-1 js-download-cite" href="#" target="_blank">
<i class="fas fa-download"></i> Download
</a>
<div id="modal-error"></div>
</div>
</div>
</div>
</div>
</body>
</html>