Creating routes starting from fringes of the map and adding source, sink and via routes
Weights can be provided as to from where the source of the vehicle routes should be and where it should end. In this case, we have to consider that that the vehicles start from north half of the map and go to a particular destination (=sink) via a particular edge.
Small python script for starting the vehicles from the northern fringe:
Create the three xml files with in the directory one for each source, sink and via routes:
Start with the source file where the starting edges are the fringes on the upper half of the bounding box created with the Python script:
Source file looks something like:
Via file contains the edge the vehicle should pass through:
Sink file contains the sink for vehicles:
Lastly, run the randomTrips python script with the follow — weights-prefix option: