SimulationConfig

This file describes the high level parameters of a simulation invocation (i.e. an experiment). It contains the basic experiment settings like number of runs and random seed, the environment definition, the parametrization of the output (more precisely the observation modules) and the definition of the spawners. The path to the SimulationConfig is given as command line argument (or defaulted) and all other configs are directly or indirectly refered to in the SimulationConfig. Several parameters depend on probabilities. Each invocation then rolls for said probabilities. All probabilities need to add up to 1.0.

The simulationConfig.xml consists of the following sections:

ProfilesCatalog

Specifies the ProfilesCatalog for the experiment.

  <ProfilesCatalog>ProfilesCatalog.xml</ProfilesCatalog>

Experiment

Specifies the general experiment setup, not specific to a single invocation.

Tag

Description

Mandatory

ExperimentId

Id of the experiment

yes

NumberOfInvocations

Number of invocation in the experiment. For each invocation probabilities are rerolled.

yes

RandomSeed

Random seed for the entire experiment. Must be within the bounds of an unsigned integer.

yes

Libraries

Name of the core module Libraries to use. If not specified the default name is assumed.

yes

  <Experiment>
    <ExperimentID>123</ExperimentID>
    <NumberOfInvocations>1</NumberOfInvocations>
    <RandomSeed>532725206</RandomSeed>
    <Libraries>
      <WorldLibrary>World_OSI</WorldLibrary>
    </Libraries>
  </Experiment>

Scenario

This section contains information about the scenario setup for the experiment. This information does not change between invocations.

Tag

Description

Mandatory

OpenScenarioFile

Name of the scenario file

yes

Example

This experiment uses the “HighwayScenario.xosc” scenario file.

  <Scenario>
    <OpenScenarioFile>Scenario.xosc</OpenScenarioFile>
  </Scenario>

Environment

This section contains information about the world and the general environment inside the simulation. Every invocation re-rolls the environment probabilities. All probabilities need to add up to 1.0.

Tag

Description

Mandatory

TimeOfDay

Currently unused. Time of day ranging from 1-24 [h].

1+ entry

VisibilityDistance

Defines how far a human driver can see [m].

1+ entry

Friction

Friction on the road. Used by DynamicsRegularDriving and LimiterAccelerationVehicleComponents.

1+ entry

Weather

Currently unused. Weather as string

1+ entry

TrafficRules

Defines which set of TrafficRules to use from the ProfilesCatalog

yes

Example

Every invocation has the time set to 15:00. In 70% of all invocation drivers can see 125 meter and for the other 30% of invocations the drivers can see 250 meter. Every invocation has a friction of 0.3. Every invocation has sunny weather.

  <Environment>
    <TimeOfDays>
      <TimeOfDay Probability="0.4" Value="15"/>
      <TimeOfDay Probability="0.6" Value="18"/>
    </TimeOfDays>
    <VisibilityDistances>
      <VisibilityDistance Probability="0.7" Value="300"/>
      <VisibilityDistance Probability="0.3" Value="400"/>
    </VisibilityDistances>
    <Frictions>
      <Friction Probability="1.0" Value="1.0"/>
    </Frictions>
    <Weathers>
      <Weather Probability="0.5" Value="Rainy"/>
      <Weather Probability="0.5" Value="Snowy"/>
    </Weathers>
    <TrafficRules>Germany</TrafficRules>
  </Environment>

Observations

In this section all observation libraries are defined with their parameters. A specific library is loaded by adding an entry to the Observations tag:

<Observations>
  <!-- first observer -->
  <Observation>
    <Library>THE_OBSERVATION_LIBRARY</Library>
    <!-- observer specific parameter -->
    <Parameters>
      <String Key="THE_KEY" Value="THE_VALUE"/>
      <Bool Key="ANOTHER_KEY" Value="false"/>
      ...
    </Parameters>
  </Observation>
  <!-- second observer -->
  <Observation>
     ...
  </Observation>
</Observations>

Here, the Library tag contains the name of the library, and Parameters contain an optional list of key/value pairs, specific for each observer.

Please refer to the documentation of the individual observers for available parameters:

Spawners

In this section the spawners are defined with their Profile (defined in the ProfilesCatalog). The same library can be loaded multiple times with different profiles. A spawner is either of type “PreRun”, meaning it is triggered only once at the start of the simulation, or “Runtime”, meaning it is triggered in every timestep. If different spawners are to be triggered at the same time the spawner with the highest priority is triggered first.

  <Spawners>
    <Spawner>
      <Library>SpawnerScenario</Library>
      <Type>PreRun</Type>
      <Priority>1</Priority>
    </Spawner>
    <Spawner>
      <Library>SpawnerPreRunCommon</Library>
      <Type>PreRun</Type>
      <Priority>0</Priority>
      <Profile>DefaultPreRunCommon</Profile>
    </Spawner>
    <Spawner>
      <Library>SpawnerRuntimeCommon</Library>
      <Type>Runtime</Type>
      <Priority>0</Priority>
      <Profile>DefaultRuntimeCommon</Profile>
    </Spawner>
  </Spawners>

Full Example

simulationConfig.xml
 1<simulationConfig SchemaVersion="0.8.2">
 2  <ProfilesCatalog>ProfilesCatalog.xml</ProfilesCatalog>
 3  <Experiment>
 4    <ExperimentID>123</ExperimentID>
 5    <NumberOfInvocations>1</NumberOfInvocations>
 6    <RandomSeed>532725206</RandomSeed>
 7    <Libraries>
 8      <WorldLibrary>World_OSI</WorldLibrary>
 9    </Libraries>
10  </Experiment>
11  <Scenario>
12    <OpenScenarioFile>Scenario.xosc</OpenScenarioFile>
13  </Scenario>
14  <Environment>
15    <TimeOfDays>
16      <TimeOfDay Probability="0.4" Value="15"/>
17      <TimeOfDay Probability="0.6" Value="18"/>
18    </TimeOfDays>
19    <VisibilityDistances>
20      <VisibilityDistance Probability="0.7" Value="300"/>
21      <VisibilityDistance Probability="0.3" Value="400"/>
22    </VisibilityDistances>
23    <Frictions>
24      <Friction Probability="1.0" Value="1.0"/>
25    </Frictions>
26    <Weathers>
27      <Weather Probability="0.5" Value="Rainy"/>
28      <Weather Probability="0.5" Value="Snowy"/>
29    </Weathers>
30    <TrafficRules>Germany</TrafficRules>
31  </Environment>
32  <Observations>
33    <Observation>
34      <Library>Observation_Log</Library>
35      <Parameters>
36        <String Key="OutputFilename" Value="simulationOutput.xml"/>
37        <Bool Key="LoggingCyclicsToCsv" Value="false"/>
38        <StringVector Key="LoggingGroup_Trace" Value="XPosition,YPosition,YawAngle"/>
39        <StringVector Key="LoggingGroup_RoadPosition" Value="AgentInFront,Lane,PositionRoute,Road,TCoordinate"/>
40        <StringVector Key="LoggingGroup_RoadPositionExtended" Value="SecondaryLanes"/>
41        <StringVector Key="LoggingGroup_Sensor" Value="Sensor*_DetectedAgents,Sensor*_VisibleAgents"/>
42        <StringVector Key="LoggingGroup_Vehicle" Value="AccelerationPedalPosition,BrakePedalPosition,EngineMoment,Gear,SteeringAngle,TotalDistanceTraveled,YawRate"/>
43        <StringVector Key="LoggingGroup_Visualization" Value="AccelerationEgo,BrakeLight,IndicatorState,LightStatus,VelocityEgo"/>
44        <StringVector Key="LoggingGroups" Value="Trace,Visualization,RoadPosition,Sensor"/>
45      </Parameters>
46    </Observation>
47    <Observation>
48      <Library>Observation_EntityRepository</Library>
49      <Parameters>
50        <!-- If "FilenamePrefix" is skipped, defaults to Value="Repository" -->
51        <String Key="FilenamePrefix" Value="Repository"/>
52        <!-- If "WritePersistentEntities" is skipped, defaults to Value="Consolidated"
53             Options: 
54             - Consolidated: Concatenate with {FilenamePrefix}_Run_###.csv for each run
55             - Separate: Write to {FilenamePrefix}_Persistent.csv
56             - Skip: No output for persistent entities
57        -->
58        <String Key="WritePersistentEntities" Value="Consolidated"/>
59      </Parameters>
60    </Observation>
61  </Observations>
62  <Spawners>
63    <Spawner>
64      <Library>SpawnerScenario</Library>
65      <Type>PreRun</Type>
66      <Priority>1</Priority>
67    </Spawner>
68    <Spawner>
69      <Library>SpawnerPreRunCommon</Library>
70      <Type>PreRun</Type>
71      <Priority>0</Priority>
72      <Profile>DefaultPreRunCommon</Profile>
73    </Spawner>
74    <Spawner>
75      <Library>SpawnerRuntimeCommon</Library>
76      <Type>Runtime</Type>
77      <Priority>0</Priority>
78      <Profile>DefaultRuntimeCommon</Profile>
79    </Spawner>
80  </Spawners>
81</simulationConfig>