Tools/Routes

The tools' names accord to their function.

=randomDepart.py= By using this Script we can increase the troughput (in terms of input vehicle volume accomodated by SUMO network in fixed time interval). By using this Script you can calibrate different traffic parameter based on the real traffic pattern (exponential distribution is closed to real pattern).

"randomDepart" is a python Script which takes the input as a route file and generates the modified route file with depart time based on exponential distribution. And each time it generates the new traffic pattern.

How to Use: Go to Command prompt (supportable for python2X) For assistance: ./randomDepart.py -h or ./randomDepart.py --help

For using: ./randomDepart.py -r  [-d] [-o ] or ./randomDepart.py --route-file  [--depart-lane] \ [--output-route-file ]

value under [] is optional

Description
"randomDepart" is designed in such a way to reduce the overall complexity and increase the efficiency. Although it is having some constraint but still enough powerfull to serve transportation perspective.

It takes the input file in such a way where mandatory fields considered at the time of modification are:  ...

These are the parameter considered based on the necessity for calibration of traffic parameter.

One optional parameter is DEPRTLANE which you can also override at the time of modification with option -d if this option is optional argument, if provided then DEPARTLANE=FREE for all lanes will be set otherwise FALSE. The last parameter is output file [optional if not provided DEFAULT is "out.rou.xml", will be generated]. so the output file may be in the form-

 ...

Dump: you can also take the dump of modified depart time in excel file by just enabling the commented part in the python script. the all necessary things you need is xlwt package to write into excel file.

Acknowledgements
The script was written by Ashutosh Bajpai.

=routecheck.py= Allows to verify whether routes within the given route-file(s) are valid for the given network. Call(s): routecheck.py [-f|--fix] +

routecheck.py 

If a route is broken (a diconnected), the tool writes something like the following to cout:

If --fix (-f) is given, routes are tried to be repaired (assuming only one link is missing). The name of the output file(s) is generated by appending ".fixed". These file contain repaired routes (if it was possible), each appended link is written in comments after the vehicle.

Known caveats

 * The tool does not deal with vehicle types; it only checks whether routes are connected
 * When working in --fix-mode a vehicle type file must be given
 * No tests for dealing with networks that have internal edges

=routes_Join.py= Joins routes belonging to two networks. A map file with the following syntax is read first: -> It describes at which edges the networks overlapped and which edge was kept in the resulting one. Vehicles from both given route files starting at the first of those edges will be at first not regarded, but their routes are kept in memory. All other vehicles are kept, but if they pass one of the mapped edges, the route is continued by choosing a random route from the list of previously discarded ones which start at the corresponding edge. routes_Join.py     Attention! The routes are not sorted in time!
 * : The prefix to use for vehicles from the first routes file
 * : The first routes file
 * : The prefix to use for vehicles from the second routes file
 * <routes#2>: The second routes file
 * : The edge mapping

=sort_routes.py= This script sorts the vehicles in the given route file by their depart time. If the option is supplied, a slow but memory efficent algorithm is used. /tools/route/sort_routes.py input.rou.xml -o output.rou.xml

=cutRoutes.py= This script cuts down routes from a large scenario to a sub-scenario. This assumes the existence of a big scenario (orig.net.xml and orig.rou.xml). The goal is to simulation only a smaller part of the network (reduced.net.xml) keeping all of the routes that pass through the reduced network. Output can be a route file or a trip file. Depending on the given options the new departure times can be computed from exitTimes (see SUMO option ), extrapolated from the original network or simply copied from the original departure times. If the option is supplied, a slow but memory efficent algorithm is used for sorting the output by departure time. Example usage /tools/route/sort_routes.py reduced.net.xml orig.rou.xml --routes-output output.rou.xml --orig-net orig.net.xml