Skip to content

Latest commit

 

History

History

variation

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Variation Tool

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>
On Windows:
Note: we strongly recommend to use a Linux system. Windows support is experimental.
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

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:

  • normal distribution with mean value mu and standard deviation sd.
  • uniform distribution with a min and a max value.
  • lindep a linearly dependent variable that uses an equation string as dp attribute. The equation can reference other variables transitively.