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.
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 --help
display the help message-k
keep.xml
files with the logical road description-v
print console output
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
For each variable we need to specify an id
and type
attribute.
There are three types of variables that require different attributes:
normal
distribution with mean valuemu
and standard deviationsd
.uniform
distribution with amin
and amax
value.lindep
a linearly dependent variable that uses an equation string asdp
attribute. The equation can reference other variables transitively.