Variation
The variation tool makes use of the road-generation library and generates several variations of an OpenDRIVE road network that is provided by a template file. The main goal was to create an easy to use syntax while allowing the user to specify constraints for the output scenarios.
Usage
The tool can be accessed via the command line:
On Liunx:
variation -fname <filename>
python -m variation -fname <filename>
A variety of parameters and flaggs can be specified:
-fname<input file path>input template file-n<integer>number of generated outputs-o<string>output file name-e<file path>generate an example template file to location-h --helpdisplay the help message-kkeep.xmlfiles with the logical road description-ssuppress most console output
Template File
The variation tool takes a template file as an input which extends the
syntax of the road-generation library input
scheme. Additionally, a <vars> ... </vars> tag
declares variables that will be drawn from a random distribution. The
variables are provided in a <var> ... </var> tag and use attributes
to define the distribution from which these variables will be drawn. The
random variables can then be referenced in the description of the road
network.
Examples for the definition of stochastic variabes:
<vars>
<var id="transDepVar" type="lindep" dp="depVar/2" />
<var id="depVar" type="lindep" dp="uniformVar*0.3 + normalVar" />
<var id="uniformVar" type="uniform" min="100" max="150" />
<var id="normalVar" type="normal" mu="1.57" sd="0.12" />
</vars>
These variables can then be referenced by their name, surrounded by
${...}, e.g.:
<referenceLine>
<line length="${uniformVar}"/>
</referenceLine>
An example template file can be generated by using the -e flag.
variation -e
Variable Types
For each variable we need to specify an id and type attribute.
There are three types of variables that require different attributes:
normaldistribution with mean valuemuand standard deviationsd.uniformdistribution with aminand amaxvalue.lindepa linearly dependent variable that uses an equation string asdpattribute. The equation can reference other variables transitively.