duarouter
From 30.000 feet#
duarouter imports different demand definitions, computes vehicle routes that may be used by sumo using shortest path computation; When called iteratively duarouter performs dynamic user assignment (DUA). This is facilitated by the tool duaIterate.py which converges to an equilibrium state (DUE).
-
Purpose:
A) Building vehicle routes from demand definitions
B) Computing routes during a user assignment
C) Repairing connectivity problems in existing route files
- System: portable (Linux/Windows is tested); runs on command line
-
Input (mandatory):
A) a road network as generated via netconvert or netgenerate, see Building Networks
B) a demand definition, see Demand Modeling
- Output: Definition of Vehicles, Vehicle Types, and Routes usable by sumo
- Programming Language: C++
Usage Description#
Duarouter has two main purposes: Computing fastest/optimal routes directly as well as iteratively in the context of Dynamic_User_Assignment.
Use dijkstra, astar or CCH when routing with timed edge or lane closures. CH and CHWrapper report the unsupported closures at startup and compute routes without applying them.
Routes with vehicle-class speed restrictions use CHWrapper when CH is selected.
Outputs#
The primary output of duarouter is a .rou.xml file which has its name specified by the option -o). Additionally a .rou.alt.xml with the same name prefix as the .rou.xml file will be generated. This route alternative file holds a routeDistribution for every vehicle. Such a routeDistribution is used during dynamic user assignment (DUA) but can also be loaded directly into sumo.
Options#
You may use a XML schema definition file for setting up a duarouter configuration: duarouterConfiguration.xsd.
Configuration#
All applications of the SUMO-suite handle configuration options the same way. These options are discussed at Basics/Using the Command Line Applications#Configuration Files.
| Option | Description |
|---|---|
| -c <FILE> --configuration-file <FILE> |
Loads the named config on startup |
| -C <FILE> --save-configuration <FILE> |
Saves current configuration into FILE |
| --save-configuration.relative <BOOL> | Enforce relative paths when saving the configuration; default: false |
| --save-template <FILE> | Saves a configuration template (empty) into FILE |
| --save-schema <FILE> | Saves the configuration schema into FILE |
| --save-commented <BOOL> | Adds comments to saved template, configuration, or schema; default: false |
Input#
| Option | Description |
|---|---|
| -n <FILE> --net-file <FILE> |
Use FILE as SUMO-network to route on |
| -a <FILE> --additional-files <FILE> |
Read additional network data (districts, bus stops) from FILE(s) |
| -r <FILE> --route-files <FILE> |
Read sumo routes, alternatives, flows, and trips from FILE(s) |
| --phemlight-path <FILE> | Determines where to load PHEMlight definitions from; default: ./PHEMlight/ |
| --phemlight-year <INT> | Enable fleet age modeling with the given reference year in PHEMlight5; default: 0 |
| --phemlight-temperature <FLOAT> | Set ambient temperature to correct NOx emissions in PHEMlight5; default: 1.79769e+308 |
| -w <FILE> --weight-files <FILE> |
Read network weights from FILE(s) |
| --lane-weight-files <FILE> | Read lane-based network weights from FILE(s) |
| -x <STRING> --weight-attribute <STRING> |
Name of the xml attribute which gives the edge weight; default: traveltime |
| --junction-taz <BOOL> | Initialize a TAZ for every junction to use attributes toJunction and fromJunction; default: false |
Output#
| Option | Description |
|---|---|
| -o <FILE> --output-file <FILE> |
Write generated routes to FILE |
| --vtype-output <FILE> | Write used vehicle types into separate FILE |
| --keep-vtype-distributions <BOOL> | Keep vTypeDistribution ids when writing vehicles and their types; default: false |
| --emissions.volumetric-fuel <BOOL> | Return fuel consumption values in (legacy) unit l instead of mg; default: false |
| --named-routes <BOOL> | Write vehicles that reference routes by their id; default: false |
| --write-license <BOOL> | Include license info into every output file; default: false |
| --write-metadata <BOOL> | Write parsable metadata (configuration etc.) instead of comments; default: false |
| --output-prefix <STRING> | Prefix which is applied to all output files. The special string 'TIME' is replaced by the current time. |
| --output-suffix <STRING> | Suffix which is applied to all output files. The special string 'TIME' is replaced by the current time. |
| --precision <INT> | Defines the number of digits after the comma for floating point output; default: 2 |
| --precision.geo <INT> | Defines the number of digits after the comma for lon,lat output; default: 6 |
| --output.compression <STRING> | Defines the standard compression algorithm (currently only for parquet output) |
| --output.format <STRING> | Defines the standard output format if not derivable from the file name ('xml', 'csv', 'parquet'); default: xml |
| --output.column-header <STRING> | How to derive column headers from attribute names ('none', 'tag', 'auto', 'plain', 'full'); default: auto |
| --output.column-separator <STRING> | Separator in CSV output; default: ; |
| -H <BOOL> --human-readable-time <BOOL> |
Write time values as hour:minute:second or day:hour:minute:second rather than seconds; default: false |
| --alternatives-output <FILE> | Write generated route alternatives to FILE |
| --intermodal-network-output <FILE> | Write edge splits and connectivity to FILE |
| --intermodal-weight-output <FILE> | Write intermodal edges with lengths and travel times to FILE |
| --write-trips <BOOL> | Write trips instead of vehicles (for validating trip input); default: false |
| --write-trips.geo <BOOL> | Write trips with geo-coordinates; default: false |
| --write-trips.junctions <BOOL> | Write trips with fromJunction and toJunction; default: false |
| --write-costs <BOOL> | Include the cost attribute in route output; default: false |
| --exit-times <BOOL> | Write exit times (weights) for each edge; default: false |
| --route-length <BOOL> | Include total route length in the output; default: false |
Processing#
| Option | Description |
|---|---|
| --max-alternatives <INT> | Prune the number of alternatives to INT; default: 5 |
| --with-taz <BOOL> | Use origin and destination zones (districts) for in- and output; default: false |
| --unsorted-input <BOOL> | Assume input is unsorted; default: false |
| -s <TIME> --route-steps <TIME> |
Load routes for the next number of seconds ahead; default: 200 |
| --no-internal-links <BOOL> | Disable (junction) internal links; default: false |
| --randomize-flows <BOOL> | generate random departure times for flow input; default: false |
| --remove-loops <BOOL> | Remove loops within the route; Remove turnarounds at start and end of the route; default: false |
| --repair <BOOL> | Tries to correct a false route; default: false |
| --repair.from <BOOL> | Tries to correct an invalid starting edge by using the first usable edge instead; default: false |
| --repair.to <BOOL> | Tries to correct an invalid destination edge by using the last usable edge instead; default: false |
| --repair.max-detour-factor <FLOAT> | Backtrack on route if the detour is longer than the gap by FACTOR; default: 10 |
| --mapmatch.distance <FLOAT> | Maximum distance when mapping input coordinates (fromXY etc.) to the road network; default: 100 |
| --mapmatch.junctions <BOOL> | Match positions to junctions instead of edges; default: false |
| --mapmatch.taz <BOOL> | Match positions to taz instead of edges; default: false |
| --bulk-routing <BOOL> | Aggregate routing queries with the same origin; default: false |
| --routing-threads <INT> | The number of parallel execution threads used for routing; default: 0 |
| --routing-algorithm <STRING> | Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper', 'CCH']; default: dijkstra |
| --restriction-params <STRING[ ]> | Comma separated list of param keys to compare for additional restrictions |
| --weights.interpolate <BOOL> | Interpolate edge weights at interval boundaries; default: false |
| --weights.expand <BOOL> | Expand the end of the last loaded weight interval to infinity; default: false |
| --weights.minor-penalty <FLOAT> | Apply the given time penalty when computing routing costs for minor-link internal lanes; default: 1.5 |
| --weights.tls-penalty <FLOAT> | Apply the given time penalty when computing routing costs across a traffic light; default: 0 |
| --weights.turnaround-penalty <FLOAT> | Apply the given time penalty when computing routing costs for turnaround internal lanes; default: 5 |
| --weights.reversal-penalty <FLOAT> | Apply the given time penalty when computing routing costs for train reversal. Negative values disable reversal; default: 60 |
| --weights.random-factor <FLOAT> | Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT); default: 1 |
| --weight-period <TIME> | Aggregation period for the given weight files; triggers rebuilding of Contraction Hierarchy; default: 3600 |
| --weights.priority-factor <FLOAT> | Consider edge priorities in addition to travel times, weighted by factor; default: 0 |
| --astar.all-distances <FILE> | Initialize lookup table for astar from the given file (generated by marouter --all-pairs-output) |
| --astar.landmark-distances <FILE> | Initialize lookup table for astar ALT-variant from the given file |
| --astar.save-landmark-distances <FILE> | Save lookup table for astar ALT-variant to the given file |
| --scale <FLOAT> | Scale demand by the given factor (by discarding or duplicating vehicles); default: 1 |
| --scale-suffix <STRING> | Suffix to be added when creating ids for cloned vehicles; default: . |
| --taxi.vclasses <STRING[ ]> | Network permissions that can be accessed by taxis; default: taxi |
| --gawron.beta <FLOAT> | Use FLOAT as Gawron's beta; default: 0.9 |
| --gawron.a <FLOAT> | Use FLOAT as Gawron's a; default: 0.5 |
| --keep-all-routes <BOOL> | Save routes with near zero probability; default: false |
| --skip-new-routes <BOOL> | Only reuse routes from input, do not calculate new ones; default: false |
| --keep-route-probability <FLOAT> | The probability of keeping the old route; default: 0 |
| --ptline-routing <BOOL> | Route all public transport input; default: false |
| --keep-flows <BOOL> | Write flows instead of expanding them into vehicles; default: false |
| --route-choice-method <STRING> | Choose a route choice method: gawron, logit, or lohse; default: gawron |
| --logit <BOOL> | Use c-logit model (deprecated in favor of --route-choice-method logit); default: false |
| --logit.beta <FLOAT> | Use FLOAT as logit's beta; default: -1 |
| --logit.gamma <FLOAT> | Use FLOAT as logit's gamma; default: 1 |
| --logit.theta <FLOAT> | Use FLOAT as logit's theta (negative values mean auto-estimation); default: -1 |
| --persontrip.walkfactor <FLOAT> | Use FLOAT as a factor on pedestrian maximum speed during intermodal routing; default: 0.75 |
| --persontrip.walk-opposite-factor <FLOAT> | Use FLOAT as a factor on walking speed against vehicle traffic direction; default: 1 |
| --persontrip.transfer.car-walk <STRING[ ]> | Where are mode changes from car to walking allowed (possible values: 'parkingAreas', 'ptStops', 'allJunctions' and combinations); default: parkingAreas |
| --persontrip.transfer.taxi-walk <STRING[ ]> | Where taxis can drop off customers ('allJunctions, 'ptStops') |
| --persontrip.transfer.walk-taxi <STRING[ ]> | Where taxis can pick up customers ('allJunctions, 'ptStops') |
| --persontrip.taxi.waiting-time <TIME> | Estimated time for taxi pickup; default: 300 |
| --persontrip.ride-public-line <BOOL> | Only use the intended public transport line rather than any alternative line that stops at the destination; default: false |
| --railway.max-train-length <FLOAT> | Use FLOAT as a maximum train length when initializing the railway router; default: 1000 |
| --max-traveltime <TIME> | Declare routing failure if traveltime exceeds the given positive TIME; default: -1 |
Defaults#
| Option | Description |
|---|---|
| --departlane <STRING> | Assigns a default depart lane |
| --departpos <STRING> | Assigns a default depart position |
| --departspeed <STRING> | Assigns a default depart speed |
| --arrivallane <STRING> | Assigns a default arrival lane |
| --arrivalpos <STRING> | Assigns a default arrival position |
| --arrivalspeed <STRING> | Assigns a default arrival speed |
| --defaults-override <BOOL> | Defaults will override given values; default: false |
Time#
| Option | Description |
|---|---|
| -b <TIME> --begin <TIME> |
Defines the begin time; Previous trips will be discarded; default: 0 |
| -e <TIME> --end <TIME> |
Defines the end time; Later trips will be discarded; Defaults to the maximum time that SUMO can represent; default: -1 |
Report#
All applications of the SUMO-suite handle most of the reporting options the same way. These options are discussed at Basics/Using the Command Line Applications#Reporting Options.
| Option | Description |
|---|---|
| -v <BOOL> --verbose <BOOL> |
Switches to verbose output; default: false |
| --print-options <BOOL> | Prints option values before processing; default: false |
| -? <BOOL> --help <BOOL> |
Prints this screen or selected topics; default: false |
| -V <BOOL> --version <BOOL> |
Prints the current version; default: false |
| -X <STRING> --xml-validation <STRING> |
Set schema validation scheme of XML inputs ("never", "local", "auto" or "always"); default: local |
| --xml-validation.net <STRING> | Set schema validation scheme of SUMO network inputs ("never", "local", "auto" or "always"); default: never |
| --xml-validation.routes <STRING> | Set schema validation scheme of SUMO route inputs ("never", "local", "auto" or "always"); default: local |
| -W <BOOL> --no-warnings <BOOL> |
Disables output of warnings; default: false |
| --aggregate-warnings <INT> | Aggregate warnings of the same type whenever more than INT occur; default: -1 |
| -l <FILE> --log <FILE> |
Writes all messages to FILE (implies verbose) |
| --message-log <FILE> | Writes all non-error messages to FILE (implies verbose) |
| --error-log <FILE> | Writes all warnings and errors to FILE |
| --log.timestamps <BOOL> | Writes timestamps in front of all messages; default: false |
| --log.processid <BOOL> | Writes process ID in front of all messages; default: false |
| --language <STRING> | Language to use in messages; default: C |
| --ignore-errors <BOOL> | Continue if a route could not be build; default: false |
| --stats-period <INT> | Defines how often statistics shall be printed; default: -1 |
| --no-step-log <BOOL> | Disable console output of route parsing step; default: false |
Random Number#
All applications of the SUMO-suite handle randomisation options the same way. These options are discussed at Basics/Using the Command Line Applications#Random Number Options.
| Option | Description |
|---|---|
| --random <BOOL> | Initialises the random number generator with the current system time; default: false |
| --seed <INT> | Initialises the random number generator with the given value; default: 23423 |