3. Autodoc

This is a complete but unstructured dump of the autodoc that was generated by doxygen.

struct busStops
#include <settings.h>

bus stop settings

Public Members

double length = 20
double widening = 7.5
struct connection
#include <interface.h>

connection between two lanes

Public Functions

inline string to_string()

Public Members

int id = -1
int from = -1
int to = -1
contactPointType contactPoint = noneType
int fromLane = -1
int toLane = -1
struct control
#include <interface.h>

control to define a controller with several signals

Public Members

int id = -1
vector<sign> signs
struct geometry
#include <interface.h>

geometry holds all properties of a geometry on the reference line

Public Members

geometryType type
double s = -1
double x = -1
double y = -1
double hdg = -1
double length = -1
double c = -1
double c1 = -1
double c2 = -1
struct junction
#include <interface.h>

junction holding several connections

Public Functions

inline string to_string()

Public Members

int id = -1
vector<connection> connections
struct junctionGroup

Public Functions

inline junctionGroup()
inline ~junctionGroup()

Public Members

int id
string name
junctionGroupType type = roundaboutType
vector<int> juncIds
struct lane
#include <interface.h>

lane holding all properties of a lane

Public Members

int id = -1
string type = "driving"
bool turnLeft = false
bool turnStraight = true
bool turnRight = false
bool level = true
double speed = setting.speed.standard
width w
roadmark rm
material m
int preId = -1
int sucId = -1
struct laneChanges
#include <settings.h>

lane changes settings

Param s:

length of additional lane

Param ds:

length of widening part

Public Members

double s = 25
double ds = 25
struct laneSection
#include <interface.h>

laneSection holds several lanes in a defined s section

Public Members

int id = -1
double s = 0
vector<lane> lanes
offset o
#include <interface.h>

link is either predecessor or successor and defines id and properties of previous/next element

Public Members

int id = -1
linkType elementType = roadType
contactPointType contactPoint = noneType
struct material
#include <interface.h>

material holding the material properties of a lane

Public Members

double s = 0
string surface = "asphalt"
double friction = 0.8
double roughness = 0.015
struct nodeElement

Public Functions

inline nodeElement(const char *value)
inline nodeElement(const char *value, nodeElement &parent)
inline ~nodeElement()
inline int createNode(const char *name)
inline int addAttribute(const char *key, const char *value)
inline int addAttribute(const char *key, string value)
inline int addAttribute(const char *key, junctionGroupType value)
inline int addAttribute(const char *key, int value)
inline int addAttribute(const char *key, float value)
inline int addAttribute(const char *key, double value)
inline int appendToNode(nodeElement &node)
inline int appendToNode(DOMElement *node)
inline int addTextNode(const char *text)

Public Members

DOMElement *domelement
struct object
#include <interface.h>

object holds all object properties

Public Members

int id = -1
string type = ""
double s = 0
double t = 0
double z = 0
double hdg = 0
string orientation = "none"
double length = 0
double width = 0
double height = 0
bool repeat = false
double len = 0
double distance = 0
struct offset
#include <interface.h>

offset holding the lanesection offset with a 3rd order polynomial

Public Members

double a = 0
double b = 0
double c = 0
double d = 0
struct road
#include <interface.h>

road holding all properties of a road

Public Members

bool isConnectingRoad = false
bool isLinkedToNetwork = false
double length = 0
int id = -1
int inputSegmentId = -1
int inputId = -1
int roundAboutInputSegment = -1
int junction = -1
string inputPos = ""
string type = "town"
string classification = ""
link predecessor
link successor
vector<geometry> geometries
vector<laneSection> laneSections
vector<object> objects
vector<sign> signs
struct roadmark
#include <interface.h>

roadmark holding lane appearance properties

Public Members

double s = 0
string type = "solid"
string weight = "standard"
string color = "white"
double width = 0.15
struct roadNetwork
#include <interface.h>

roadNetwork is the overall struct holding all data

Public Functions

inline roadNetwork()

Public Members

string file
string outputFile
vector<road> roads
vector<junction> junctions
vector<control> controller
vector<junctionGroup> juncGroups
int nSignal = 0
int nSegment = 0
struct settings
#include <settings.h>

general settings

Public Members

speeds speed
widths width
laneChanges laneChange
busStops busStop
std::string xmlSchemaLocation
bool silentMode = false
bool overwriteLog = true
int warnings = 0
int versionMajor = 1
int versionMinor = 5
float minConnectingRoadLength = 0.01f
double north = 0
double south = 0
double west = 0
double east = 0
struct settingsExec
#include <settingsExec.h>

A helper struct that stores the command line arguments for the executable.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Public Members

char *fileName
char *outputName
bool silentMode = false
bool overwriteLog = true
struct sign
#include <interface.h>

sign holds all signal properties

Public Members

int id = -1
string type = ""
string subtype = "-1"
int rule = -1
double value = -1
double s = 0
double t = 0
double z = 0
string orientation = "none"
double width = 0.4
double height = 2
bool dynamic = false
string country = "OpenDRIVE"
struct speeds
#include <settings.h>

speed limit settings

Public Members

double standard = 50
double main = 50
double access = 30
class ValidationErrorHandler : public ErrorHandler
#include <xmlParser.h>

very simple error hander for the xerces dom parser

Public Functions

void warning(const xercesc::SAXParseException &ex)
void error(const xercesc::SAXParseException &ex)
void fatalError(const xercesc::SAXParseException &ex)
void resetErrors()

Private Functions

void reportParseException(const xercesc::SAXParseException &ex)
struct width
#include <interface.h>

width holding the lanewidth with a 3rd order polynomial

Public Members

double s = 0
double a = setting.width.standard
double b = 0
double c = 0
double d = 0
struct widths
#include <settings.h>

lane width settings

Public Members

double standard = 3.5
double main = 4
double access = 3
struct xmlTree
#include <xmlParser.h>

Wrapper class that stores the xml dom context.

Public Functions

inline xmlTree()
inline DOMImplementation *getDocImpl()
inline DOMElement *getRootElement()
inline DOMDocument *getDoc()
inline int parseDocument(const char *path)
inline int getErrorCount()
inline xercesc_3_2::Grammar *loadGrammar(const char *const schema_file)
inline ~xmlTree()

Private Members

XercesDOMParser *parser
DOMDocument *doc
ValidationErrorHandler *inputHandler
class XStr
#include <xmlParser.h>

wrapper class that handles conversion from xml string to string smoothly

Public Functions

inline XStr(const char *const toTranscode)
inline XStr(const XMLCh *transcoded)
inline ~XStr()
inline operator string()
inline operator int()
inline operator double()
inline operator XMLCh*()
inline const XMLCh *unicodeForm() const

Private Members

XMLCh *fUnicodeForm
module __main__
module cmp

Functions

tree_to_list(tree)
parse_tree_to_list(tree, x)
print_childs_r(tree, lv)
is_number(s)
cmp_xml_list(list1, list2)

Variables

threshold = 0.0001
args = sys.argv
file1 = args[1]
file2 = args[2]
tree1 = ET.parse(file1)
root1 = tree1.getroot()
tree2 = ET.parse(file2)
root2 = tree2.getroot()
list1 = tree_to_list(root1)
list2 = tree_to_list(root2)
s
n
e
module conf

Variables

parents
True
exist_ok
project = 'Road Generation'
copyright = '2022 Institut für Kraftfahrzeuge, RWTH Aachen, ika'
author = 'Jannik Busse'
release = '1'
extensions = [ "breathe" ]
breathe_default_project = "road-generation"
breathe_implementation_filename_extensions = ['.c', '.cc', '.cpp', '.h', '.hpp']
breathe_projects = {"road-generation":"xml/",}
breathe_projects_source = {"interface" : ( "../src/utils", ["interface.h"] )}
breathe_default_members = ('members', 'private-members', 'undoc-members')
templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
html_theme = 'sphinx_rtd_theme'
html_static_path = ['_static']
html_css_files = ['layout.css',]
primary_domain = 'cpp'
highlight_language = 'cpp'
module ctypes
module setup

Variables

long_description = fh.read()
name
version
author
author_email
description
long_description_content_type
url
packages
install_requires
scripts
classifiers
python_requires
include_package_data
namespace std
module variation
module __main__
module dependencySolver

Functions

getVarLists(varDict, n)
This function returns a list containing lists that can be used for the solve method

Parameters
----------
varDict : dict
    a dict that contains all variables that need to be generated for all n runs
n : int
    the number of different output files

Returns
-------
list
    a list that can be used in the solve function
solveEQ(outerList, n)
This method solves a linear equation system to calculate linar dependent values

Parameters
----------
outerlist: list
    this is the list that gets generated by getVarList
n: int
    number of different output files

Returns
-------
dict
    A dict containing all values of the generated variables.
getDict(symbolDictList)
Returns postprocessed output from solveEQ as dict

Parameters
----------
symbolDictList
    list of solutions from solveEQ

Returns
-------
A dict containing all values of the generated variables.
module runner

Functions

is_var(arg)
get_var_val(key, ii, varDict)
Gets an input in the likes of ${var} and returns the corresponding var value from the dict

Parameters
----------
key: string
    unparsed key of var
ii: int
    current iteration idx
varDict: dict
    variable dictionary

Returns
-------
string
    variable value as string
find_var(item, idx, varDict)
Recursively fills in the values of variables in the given data tree 

Parameters
----------
item: xml.etree.ElementTree.Element
    Tree item to traverse recursively
idx: int
    current iteration idx
vars: dict
    variable dictionary
hasValue(key, varDict)
generateVar(var, n)
Generates a value for a given var node

Parameters
----------
var: xml.etree.ElementTree.Element
    Tree node containing info about the variable
n: int
    number of output files

Returns
-------
array[n]
    n dimensional array containing the values (or linear equation) for the variable
writeTreesToXML(n, tree, inpDir, nwName, varDict)
Saves n revs of the tree to the inpDir as an xml file

Parameters
----------
n:int
    number of revs that will be saved
tree: ElementTree
    the tree struct generated from input
inpDir: str
    input dir which contains the xml files
nwName: str
    name of the output xml file
varDict: dict
    dict containing array of vars
executePipeline(tree, inpDir, varDict)
This method calls the roadGen Lib function for every xml file in the input dir

Parameters
----------
tree: ElementTree
    the tree struct generated from input
inpDir: str
    input dir which contains the xml files
varDict: dict
    dict containing array of vars
initDirectories(inpDir)
This method inits the input directory

Parameters
----------    
inpDir: str
    input directory that will be created
copyTemplate()
This method copies the example template to the current directory
run()

Variables

args = None
namespace XERCES_CPP_NAMESPACE
namespace xercesc
file conf.py
file LICENSE.md
file closeRoadConnection.h
#include “../utils/geometries.h

This file contains methods for building the geometry of a new road.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Defines

p
n
o
i

Functions

int closeRoadConnection(vector<geometry> &geo, double x1, double y1, double phi1, double x2, double y2, double phi2)

function generates geometries recursivly so that the two input points are connected with a feasible geometry

Parameters:
  • geo – vector which contains all output geometries

  • x1 – x component of start point

  • y1 – y component of start point

  • phi1 – angle of start point

  • x2 – x component of end point

  • y2 – y component of end point

  • phi2 – angle of end point

Returns:

int error code

file closeRoadNetwork.h
#include “closeRoadConnection.h

file contains methods for closing two defined points by a new road

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int closeRoadNetwork(const DOMElement *rootNode, roadNetwork &data)

function closes roads by adding new road structures

Parameters:
  • doc – tree structure which contains the input data

  • dataroadNetwork structure generated by this tool

Returns:

int error code

Variables

settings setting
file linkSegments.h
#include <map>
#include <queue>

file contains methodology for linking two segments

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int transformRoad(DOMElement *segmentLink, roadNetwork &data, bool swap = false)

Transforms one toSegments position according to the from segment and the semgment link data to the coordinate system of the reference segment.

Parameters:
  • segmentLink – segment to link

  • data – road network data

  • swap – if true the from and toSegment and road are swapped

Returns:

int error code

int linkSegments(const DOMElement *rootNode, roadNetwork &data)

function links all specified segments the reference frame has to be specified two segments can be linked by determine two contactpoints of the roads

Parameters:
  • doc – tree structure which contains the input data

  • dataroadNetwork structure generated by the tool

Returns:

int error code

Variables

settings setting
file helperExec.cpp
#include “helperExec.h

This file contains helper functions for the executable.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

void printHelpMessage()

prints the help message for the road generaction executable to cout.

functions prints the help message for the executable.

int parseArgs(int argc, char **argv, settingsExec &settings)

parses the command line arguments from the main function and stores them in a settings struct.

Parameters:
  • argc – argc from main

  • argv – argv from main

  • settings – setting struct to store the parsed parameter

Returns:

int error code

Variables

const char * HELP_MESSAGE  ="\nRoad Generation \n\n""Usage: \n""road-generation <fileName>       Generates a .xodr file from input file.\n""\nOptions:\n""    -h                               Display help message.\n""    -s                               Disable console output.\n""    -d <fileDir>                     Specify output file directory.\n""    -o <fileName>                    Specify output file name.\n""    -k                               Keep logfile. Log will be overwritten if this is not set.\n\n"
file helperExec.h
#include <iostream>
#include <string.h>
#include <vector>
#include <stdio.h>
#include “settingsExec.h

This file contains helper functions for the executable.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

void printHelpMessage()

functions prints the help message for the executable.

functions prints the help message for the executable.

int parseArgs(int argc, char **argv, settingsExec &settings)

parses the command line arguments from the main function and stores them in a settings struct.

Parameters:
  • argc – argc from command line

  • argv – argv from command line

  • settings – settings struct to store settings

  • argc – argc from main

  • argv – argv from main

  • settings – setting struct to store the parsed parameter

Returns:

int error code

Returns:

int error code

file libImports.h
#include <string>

Functions

void setFileName(char *file)
void setLogFile(char *file)
int execPipeline()
int executePipeline(char *file)
void setOutputName(char *file)
void setSilentMode(bool sMode)
void setXMLSchemaLocation(char *file)
void setOverwriteLog(bool b)

Variables

char *_fileName

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

char *_outName
std::string _logfile = "log.txt"
file main.cpp
#include <stdio.h>
#include <iostream>
#include “libImports.h
#include “helperExec.h
#include “settingsExec.h
#include <string>

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int main(int argc, char **argv)

main function that calls the roadgeneration library functions

Parameters:
  • argc

  • argv

Returns:

int: error code. 0 means that no errors occured.

file settingsExec.h
#include <string.h>
#include <stdio.h>
#include <iostream>
#include <vector>
file addLaneSections.h

file contains methodology for lanesection changes such as lanedrop, lane widening or restricted lanes

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int addLaneWidening(vector<laneSection> &secs, int side, double s, double ds, bool addOuterLane)

function adds a laneSection with laneWideing to a given lanesection set

Parameters:
  • secs – vector of all lanesections of a road

  • side – determines the road’s side of the widening

  • s – position of lane widening

  • ds – length of lane widening

  • addouterLane – specifies if additional lane is on the outer side or not

Returns:

int error code

int addLaneDrop(vector<laneSection> &secs, int side, double s, double ds)

function adds a laneSection with laneDrop to a given lanesection set

Parameters:
  • secs – vector of all lanesections of a road

  • side – determines the road’s side of the drop

  • s – position of laneDrop

  • ds – length of laneDrop

Returns:

int error code

int addRestrictedAreaWidening(vector<laneSection> &secs, int side, double s, double ds1, double ds2)

function adds a laneSection with restricted area after a lane widening

Parameters:
  • secs – vector of all lanesections of a road

  • side – determines the road’s side of the widening

  • s – position of lane widening

  • ds1 – length of lane widening

  • ds2 – length of restricted areay (always lager than ds1)

Returns:

int error code

int addRestrictedAreaDrop(vector<laneSection> &secs, int side, double s, double ds1, double ds2)

function adds a laneSection with restricted area after a lane drop

Parameters:
  • secs – vector of all lanesections of a road

  • side – determines the road’s side of the drop

  • s – position of lane drop

  • ds1 – length of lane drop

  • ds2 – length of restricted areay (always lager than ds1)

Returns:

int error code

int laneWideningJunction(road &r, double s, double ds, int turn, bool verschwenkung, bool restricted)

function creates laneWidenings in junction areas (in opposite s direction), for additional turning lanes

Parameters:
  • r – road data

  • s – start of widening

  • ds – length of widening

  • turn – 1 = left lane turn, -1 = right lane turn

  • verschwenkung – determines if a ‘verschwenkung’ exists

  • restricted – determines if widening is a restricted area

Returns:

int error code

file addObjects.h

file contains methodology for object creation

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int addTrafficIsland(object o, road &r)

function adds a traffic island to the lane structure

Parameters:
  • o – object data

  • r – road data

Returns:

int error code

int addRoadWork(object o, road &r, int laneId)

function generates a roadwork

Parameters:
  • o – object containing length and position of roadwork

  • r – road which contains the roadwork

  • laneId – lane which contains the roadwork

Returns:

int error code

int addParking(object o, road &r)

function adds parking splot objects

Parameters:
  • o – object data

  • r – road data

Returns:

int error code

int addBusStop(object o, road &r)

function adds a bus top

Parameters:
  • o – objct data

  • r – road data

Returns:

int error code

int getPosition(DOMElement *node, object &o)

function gets the object position

Parameters:
  • node – object input data

  • o – object data

Returns:

int error code

int addObjects(DOMElement *inRoad, road &r, roadNetwork &data)

function creates objects

Parameters:
  • inRoad – road input data from input file

  • r – road data

  • dataroadNetwork structure where the generated roads and junctions are stored

Returns:

int error code

int addSignal(road &r, roadNetwork &data, double s, double t, string type, string subtype, int controller)

function creates a signal which is automatically generated

Parameters:
  • r – road which contains the signal

  • dataroadNetwork data, which holds the controls

  • s – s position of signal

  • t – t position of signal

  • type – type of signal

  • subtype – subtype of signal

  • controller – controllerof signal

Returns:

int error code

file buildRoad.h
#include “../utils/curve.h
#include “addLaneSections.h

file contains method for building up a road

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int computeFirstLast(DOMElement *roadIn, int &foundfirst, int &foundlast, double &sStart, double &sEnd)

function computes first and last considered geometry in s interval

Parameters:
  • roadIn – road input data

  • foundfirst – id of the first considerd geometry

  • foundlast – id of the last considerd geometry

  • sStart – start of the s interval

  • sEnd – end of the s interval

Returns:

int error code

int generateGeometries(DOMElement *roadIn, road &r, double &sStart, double &sEnd)

function genetares the geometries of the reference line based on an s intervall

Parameters:
  • roadIn – road input data

  • r – road data containing the reference line information

  • sStart – start of the s interval

  • sEnd – end of the s interval

Returns:

int error code

int shiftGeometries(road &r, double sStart, double sEnd, double s0, double x0, double y0, double phi0)

function shift the geometries of the reference line

Parameters:
  • r – road input data

  • sStart – start of s interval

  • sEnd – end of s interval

  • s0 – s0 is origin of reference line

  • x0 – global x position of origin

  • y0 – global y position of origin

  • phi0 – global angle of origin

Returns:

int error code

int flipGeometries(road &r)

function flips geometries of reference line

Parameters:

r – road data error code

int addLanes(DOMElement *roadIn, road &r, int mode)

function adds lanes to the road structure

Parameters:
  • roadIn – road input data

  • r – road data

  • mode – defines the mode (flipped or not)

Returns:

int error code

int addLaneSectionChanges(DOMElement *roadIn, road &r, DOMElement *automaticWidening)

function adds additional lane sections for changing lane structure

Parameters:
  • roadIn – road input data

  • r – road data

  • automaticWidening – automatic widing input data

Returns:

int error code

int buildRoad(DOMElement *roadIn, road &r, double sStart, double sEnd, DOMElement *automaticWidening, double s0, double x0, double y0, double phi0)

function builds a road based on the input data

Parameters:
  • road – road input data

  • r – road data

  • sStart – starting s position

  • sEnd – ending s position

  • automaticWidening – automaticWiding input data

  • s0 – position of s where x0, y0, phi0 should be reached

  • x0 – reference x position

  • y0 – reference y position

  • phi0 – reference angle

Returns:

int error code

Variables

settings setting
file buildSegments.h
#include “buildRoad.h
#include “addObjects.h
#include “createLaneConnection.h
#include “createRoadConnection.h
#include “junctionWrapper.h
#include “roundAbout.h
#include “connectingRoad.h

file contains a method for generating segments

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Defines

non
bro
sol

Functions

int buildSegments(const DOMElement *rootNode, roadNetwork &data)

function creates all segments which can be either a junction, roundabout or connectingroad

Parameters:
  • inputxml – tree structure which contains the input data

  • dataroadNetwork data where the openDrive structure should be generated

Returns:

int error code

Variables

settings setting
file connectingRoad.h

file contains method for generating connecting road segment

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int connectingRoad(DOMElement *node, roadNetwork &data)

function generates the road for a connecting road which is specified in the input file

Parameters:
  • node – input data from the input file for the connecting road

  • dataroadNetwork structure where the generated roads and junctions are stored

Returns:

int error code

Variables

settings setting
file createLaneConnection.h

file contains method for generating lane connection in junction area

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int createLaneConnection(road &r, laneSection lS1, laneSection lS2, int from, int to, string left, string right)

function creates a new lane for a connecting road

Parameters:
  • r – connecting road

  • lS1 – lanesection of adjacent road at start

  • lS2 – lanesection of adjacent road at end

  • from – start lane Id

  • to – end lane Id

  • left – left roadmarking

  • right – right roadmarking

Returns:

int error code

Variables

settings setting
file createRoadConnection.h

file contains method for generating road connection in junction area

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int createRoadConnection(road r1, road r2, road &r, junction &junc, int fromId, int toId, string laneMarkLeft, string laneMarkRight)

function creates a new road connection

Parameters:
  • r1 – road at start point

  • r2 – road at end point

  • r – resulting road which is connection from r1 to r2

  • junc – current junction

  • fromId – start lane Id

  • toId – end lane Id

  • laneMarkLeft – left roadmarking

  • laneMarkRight – right roadmarking

Returns:

int error code

Variables

settings setting
file junctionWrapper.h
#include “xjunction.h
#include “tjunction.h

file contains method for generating junctions

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int junctionWrapper(const DOMElement *node, roadNetwork &data)

function takes the junction as input argument and calls the junction type function

Parameters:
  • node – input data from the input file for the tjunction

  • dataroadNetwork structure where the generated roads and junctions are stored

Returns:

int error code

file roundAbout.h

file contains method for generating roundabout

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int juncGroupIdToJuncId(int juncGroupId, int juncIdx)

translates the input segment id and the index of the junction inside the roundabout to an absolute junction id

Parameters:
  • juncGroupId – input id of the segment. Equals the id of the junction group

  • juncIdx – index of the junction inside the roundabout. Starts with 0 and counting up

Returns:

int resulting id of the junction in the output file

int roundAbout(const DOMElement *node, roadNetwork &data)

function generates the roads and junctions for a roundabout which is specified in the input file

Parameters:
  • node – input data from the input file for the roundAbout

  • dataroadNetwork structure where the generated roads and junctions are stored

Returns:

int error code

Variables

settings setting
file tjunction.h

file contains method for generating t junction

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int tjunction(const DOMElement *node, roadNetwork &data)

function generates the roads and junctions for a t junction which is specified in the input file

Parameters:
  • node – input data from the input file for the tjunction

  • dataroadNetwork structure where the generated roads and junctions are stored

Returns:

int error code

Variables

settings setting
file xjunction.h

file contains method for generating x junction

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int xjunction(const DOMElement *domNode, roadNetwork &data)

function generates the roads and junctions for a x junction which is specified in the input file

Parameters:
  • node – input data from the input file for the xjunction

  • dataroadNetwork structure where the generated roads and junctions are stored

Returns:

int error code

Variables

settings setting
file export.cpp
#include “export.h
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <string>
#include <vector>
#include <cmath>
#include <ctime>
#include “utils/settings.h
#include “utils/interface.h
#include “utils/helper.h
#include “utils/xml.h

This file contains the most important functions for using the road generation library.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

EXPORTED void setFileName (char *file)

Sets the filename of the input file.

Parameters:

file – file name *

EXPORTED void setOverwriteLog (bool b)

set overwriting the error log to ture or false

Parameters:

b – true if errorlog should be overwritten

EXPORTED void setLogFile (char *file)

set log file location

Parameters:

file – set file location

EXPORTED void setOutputName (char *outName)

set the output file name

Parameters:

file – output file

EXPORTED int execPipeline ()

execute the pippeline on fileName that is stored in settings

EXPORTED void setSilentMode (bool sMode)

sets the silent mode. Silent mode disables most console output

Parameters:

sMode – sets silent mode to True or False

EXPORTED void setXMLSchemaLocation (char *file)

set path to xml schema files

Parameters:

file – set path

EXPORTED int executePipeline (char *file)

execute the pipeline on given fileName

Parameters:

file – filename to run the pipeline on

Variables

std::string::size_type st
settings setting
file export.h
#include <string>

This file contains the most important functions for using the road generation library.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Defines

EXPORTED

Functions

EXPORTED void setFileName (char *file)

Sets the filename of the input file.

Parameters:

file – file name *

EXPORTED void setXMLSchemaLocation (char *file)

set path to xml schema files

Parameters:

file – set path

EXPORTED void setLogFile (char *file)

set log file location

Parameters:

file – set file location

EXPORTED int execPipeline ()

execute the pippeline on fileName that is stored in settings

EXPORTED int executePipeline (char *file)

execute the pipeline on given fileName

Parameters:

file – filename to run the pipeline on

EXPORTED void setOutputName (char *file)

set the output file name

Parameters:

file – output file

EXPORTED void setSilentMode (bool sMode)

sets the silent mode. Silent mode disables most console output

Parameters:

sMode – sets silent mode to True or False

EXPORTED void setOverwriteLog (bool b)

set overwriting the error log to ture or false

Parameters:

b – true if errorlog should be overwritten

Variables

bool _setOutput = false
char *_fileName
std::string _outName = ""
std::string _logfile = "log.txt"
file curve.h
#include <math.h>

file contains curve function for calculating positions along geometries

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int fresnel(double s, double &x, double &y)

function computes the fresnel integral

Parameters:
  • s – position s in a spiral

  • x – result for x component

  • y – result for y component

Returns:

int error code

int curve(double s, geometry geo, double &x, double &y, double &phi, int fd)

function computes the x, y, phi value for a given geometry at position s

Parameters:
  • s – position where x, y, phi should be computed

  • geo – geometry

  • x – start value of geometry and holds resulting value for x

  • y – start value of geometry and holds resulting value for y

  • phi – start value of geometry and holds resulting value for phi

  • fd – determines if finite differences should be used for derivative

Returns:

int error code

file geometries.h

file contains geometry functionalities

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Christian Geller Contact: christian.geller@rwth-aachen.de

Functions

int addLine(vector<geometry> &geo, double x1, double y1, double phi1, double x2, double y2, double phi2)

function adds a line

Parameters:
  • geo – vector of all geometries

  • x1 – x component of start point

  • y1 – y component of start point

  • phi1 – angle of start point

  • x2 – x component of end point

  • y2 – y component of end point

  • phi2 – angle of end point (not used here)

Returns:

int error code

int addArc(vector<geometry> &geo, double x1, double y1, double phi1, double x2, double y2, double phi2)

function adds an arc

Parameters:
  • geo – vector of all geometries

  • x1 – x component of start point

  • y1 – y component of start point

  • phi1 – angle of start point

  • x2 – x component of end point

  • y2 – y component of end point

  • phi2 – angle of end point

Returns:

int error code

int addCompositeCurve(vector<geometry> &geo, double x1, double y1, double phi1, double x2, double y2, double phi2)

function adds a composite curve

Parameters:
  • geo – vector of all geometries

  • x1 – x component of start point

  • y1 – y component of start point

  • phi1 – angle of start point

  • x2 – x component of end point

  • y2 – y component of end point

  • phi2 – angle of end point

Returns:

int error code

file helper.h
#include <stdio.h>
#include <string.h>

file contains helper functionalities

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Functions

int sgn(double d)

signum function

Parameters:

d – input

Returns:

int sng(d)

int fixAngle(double &a)

function fixes the input angle in the range of [-M_PI, M_PI]

Parameters:

a – angle

Returns:

int error code

int findMinLaneId(laneSection sec)

function find the minimum laneId of current lanesection

Parameters:

sec – lanesection for which the laneId should be computed

Returns:

int minimum laneId -> if not found value 100 is stored

int findMaxLaneId(laneSection sec)

function find the maximum laneId of current lanesection

Parameters:

sec – lanesection for which the laneId should be computed

Returns:

int maximum laneId -> if not found value -100 is stored

bool isBoundary(laneSection sec, int id)

function determines of given laneId is at the boundary of the current lanesection

Parameters:
  • sec – lanesection for which the boundary should be proofed

  • id – laneid for which the boundary should be proofed

Returns:

true if the lane is a boundary-lane

Returns:

false if the lane is not a boundary-lane

int findLane(laneSection sec, lane &l, int id)

function returns the lane with given id

Parameters:
  • sec – lanesection in which the lane is stored

  • l – lane which has the laneId id

  • id – laneId of the lane to find

Returns:

int position in laneSection vector

int findRoad(vector<road> roads, road &r, int id)

function returns the road with the given id

Parameters:
  • roads – road vector in which the road is stored

  • l – road which has the roadId id

  • id – roadId of the lane to find

Returns:

int position in road vector

double laneWidth(lane l, double s)

function determines lanewidth of the given lane at positon s

Parameters:
  • l – lane for which the lanewidth should be computed

  • s – position where the lanewidth should be computed

Returns:

double computed lanewidth

double findTOffset(laneSection sec, int id, double s)

function computes the tOfset of a given lane inside of a lanesection at position s

Parameters:
  • sec – lanesection for which the tOffset should be computed

  • id – laneId of the lane with the tOffset

  • s – s position of the tOffset

Returns:

double computed tOffset

int shiftLanes(laneSection &sec, int id, int dir)

function shifts all lanes in given lanesection from lane with laneId

Parameters:
  • sec – lanesection which should be shifted

  • id – lane which is the start of the shift; all outer lanes are shifted

  • dir – dir = 1 shift to outer side, die = -1 shift to inner side

Returns:

int error code

int findLeftLane(laneSection sec, int side)

function finds the id of the left turn lane

Parameters:
Returns:

int laneId of left lane

int findRightLane(laneSection sec, int side)

function finds the id of the right turn lane

Parameters:
Returns:

int laneId of right lane

int findInnerMiddleLane(laneSection sec, int side)

function finds the id of the inner middle lane (not marked)

Parameters:
Returns:

int laneId of left lane

int findOuterMiddleLane(laneSection sec, int side)

function finds the id of the outer middle lane (not marked)

Parameters:
Returns:

int laneId of left lane

int calcFromTo(road r1, road r2, int &from, int &to, int &nF, int &nT, int mode)

function calculates the possible lane connections

Parameters:
  • r1 – input from road

  • r2 – input to road

  • from – output defining from lane

  • to – output defining from lane

  • nF – amount of possible lanes from

  • nT – amount of possile lanes to

  • mode – either right-right / middle-middle / left-left

Returns:

int error code

int sortRoads(road r1, road &r2, road &r3, road &r4)

function sorts the roads r2,r3,r4 to their corresponding angle

Parameters:
  • r1 – reference road with reference angle

  • r2 – first additional road

  • r3 – second additional road

  • r4 – third additional road

Returns:

int error code

int sortRoads(road r1, road &r2, road &r3)

function sorts the roads r2,r3 to their corresponding angle

Parameters:
  • r1 – reference road with reference angle

  • r2 – first additional road

  • r3 – second additional road

Returns:

int error code

int computeIP(double x1, double y1, double phi1, double x2, double y2, double phi2, int &type, int &type1, int &type2, double &iPx, double &iPy)

function computes intersection point

Parameters:
  • x1 – x position of first point

  • y1 – y position of first point

  • phi1 – angle of first point

  • x2 – x position of second point

  • y2 – y position of second point

  • phi2 – angle of second point

  • type – type (parallel, identical, other)

  • type1 – type of first point (p,n,0)

  • type2 – type of second point (p,n,0)

  • iPx – x position of intersection point

  • iPy – y position of intersection point

Returns:

int error code

template<typename ...Args>
std::string string_format(const std::string &format, Args... args)

function used for xsd checking output

Parameters:
  • format – xsd validation file

  • args – here the project directory PROJ_DIR

Returns:

output buffer

std::string getContactPointType(contactPointType t)

function get contactpoint name

Parameters:

t – contactpoint

Returns:

string name of contactpoint

std::string getGeometryType(geometryType t)

function get geometrytype name

Parameters:

t – geometrytype

Returns:

string name of geometrytype

std::string getLinkType(linkType t)

funtion get linktype name

Parameters:

t – linkname

Returns:

string name of linkname

bool compareObjects(const object &a, const object &b)

function compares objects by id

Parameters:
  • a – object 1

  • b – object 2

Returns:

true id of object 1 is smaller than id of object 2

Returns:

false id of object 2 is smaller than id of object 1

bool compareSignals(const sign &a, const sign &b)

function compares objects by id

Parameters:
  • a – signal 1

  • b – signal 2

Returns:

true id of signal 1 is smaller than id of signal 2

Returns:

false id of signal 2 is smaller than id of signal 1

size_t getTimeStamp(char *date_time)
bool compareLanes(const lane &a, const lane &b)

function compares lanes by id

Parameters:
  • a – lane 1

  • b – lane 2

Returns:

true id of lane 1 is smaller than id of lane 2

Returns:

false id of lane 2 is smaller than id of lane 1

bool isIn(vector<int> &v, int &i)

checks if int is in vector

Parameters:
  • v – vector to check

  • i – integer

Returns:

true int is in vector

Returns:

false int is not in vector

void throwWarning(string msg, string origin, bool mute = false)
void throwWarning(string msg, bool mute = false)
void throwError(string msg, string origin)
void throwError(string msg)
file interface.h

This file contains important data structures.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Enums

enum junctionGroupType

Values:

enumerator roundaboutType
enumerator unknownType
enum contactPointType

Values:

enumerator startType
enumerator endType
enumerator noneType
enum geometryType

Values:

enumerator line
enumerator spiral
enumerator arc
enum linkType

Values:

enumerator roadType
enumerator junctionType

Variables

settings setting
file settings.h

file contains the settings

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse, Christian Geller Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

file xml.h
#include <xercesc/util/XMLString.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <xercesc/framework/LocalFileInputSource.hpp>
#include <xercesc/sax/ErrorHandler.hpp>
#include <xercesc/sax/SAXParseException.hpp>
#include <xercesc/validators/common/Grammar.hpp>
#include <algorithm>
#include “xmlParser.h

Functions

int validateInput(char *file, xmlTree &xmlInput)

function checks the input file against the corresponding input.xsd

Parameters:

file – input file

Returns:

int error code

int validateOutput(roadNetwork &data)

function checks the output file against the corresponding output.xsd

Parameters:

data – output data

Returns:

int error code

helper function to append the link node to road node

Parameters:
  • road – the road xml node

  • sucessor – the potential successor to the road segment

  • sucessor – the potential predecessor to the road segment *

int createXMLXercesC(roadNetwork &data)
int printLogo()

function for displaying the road generation logo

Variables

settings setting
file xmlParser.h
#include <xercesc/util/PlatformUtils.hpp>
#include <xercesc/util/XMLString.hpp>
#include <xercesc/dom/DOM.hpp>
#include <xercesc/util/OutOfMemoryException.hpp>
#include <xercesc/framework/LocalFileFormatTarget.hpp>
#include <xercesc/dom/DOMCDATASection.hpp>
#include <xercesc/parsers/XercesDOMParser.hpp>
#include <iostream>

This file contains functions to parse xml code.

Road-Generation

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika Report bugs and download new versions https://github.com/ika-rwth-aachen/RoadGeneration

This library is distributed under the MIT License.

Author

Jannik Busse Contact: jannik.busse@rwth-aachen.de, christian.geller@rwth-aachen.de

Defines

X(str)

Functions

string readNameFromNode(const DOMElement *node)
string readStrAttrFromNode(const DOMElement *node, const char *attribute, bool suppressOutput = false)

reads an attribute from a xercesC node without causing memory leak. use this method for reading attributes!!!

Parameters:
  • node – the node to read the attribute from

  • attribute – attribute to read

  • suppressOutput – suppress output if the attribute is not found.

Returns:

string returns a string value. Returns an empty string if no attribute with the given name is found.

int readIntAttrFromNode(const DOMElement *node, const char *attribute, bool suppress = false)
double readDoubleAttrFromNode(const DOMElement *node, const char *attribute)
bool readBoolAttrFromNode(const DOMElement *node, const char *attribute)
bool attributeExits(const DOMElement *node, const char *attribute)
DOMElement *getNextSiblingWithTagName(DOMElement *elem, const char *tag)

Get the Next Sibling with the specified tag name. Return NULL if nothing is found.

Parameters:
  • elem – element which to find the sibling of

  • tag – name of the desired sibling

Returns:

DOMElement* sibling if found. NULL otherwise

DOMElement *getChildWithName(const DOMElement *node, const char *childName)

looks for the first node that with matching name in the xml document

Parameters:
  • childName – name too look for

  • res – return Element

Returns:

first child element with name. NULL if nothing is found

DOMElement *getFirstChildFromNode(const DOMElement *node)

Get the First Child object.

Parameters:

node – of the parent object

Returns:

DOMElement* first child of parent object in the xml tree

string readAttributeFromChildren(DOMElement *node, const char *firstchild, const char *attr)

Reads the attribute from a child of a node. Use with caution: if multiple child nodes with the name exist, only the first one will be read.

Parameters:
  • node – the node whose childs should be read

  • firstchild – name of the first child

  • attr – name of the attribute

Returns:

string value of the attribute

string readAttributeFromChildren(DOMElement *node, const char *firstchild, const char *secondchild, const char *attr)

Reads the attribute from a child of a child of a node. Use with caution: if multiple child nodes with the name exist, only the first one will be read.

Parameters:
  • node – the node whose childs should be read

  • firstchild – name of the first child

  • firstchild – name of the child of the first child

  • attr – name of the attribute

Returns:

string value of the attribute

int generateCDATA(const char *data, DOMCDATASection **res)
int init(const char *rootNode)

initializes the dom document. needs to be called befofe using the parser

Parameters:

rootNode – name of the root node

Returns:

int error code

int serialize(const char *outname)

seriaizes the constructed xml tree

Parameters:

outname – name of the output file

Returns:

int error code

DOMElement *getRootElement()
void terminateXMLUtils()

Variables

DOMImplementation *impl
DOMDocument *doc
bool initialized = false
file cmp.py
file __main__.py
file __main__.py
file _README.md
file setup.py
file __init__.py
file dependencySolver.py
file runner.py
page md_LICENSE

MIT License

Copyright (c) 2021 Institut für Kraftfahrzeuge, RWTH Aachen, ika

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

page md_variation__README

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

  • -s suppress 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:

  • 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.

dir src/connection
dir docs
dir src/executable
dir src/generation
dir src/libfiles
dir src
dir test
dir src/utils
dir variation/variation
dir variation