Skip to content

How to rebuild the scenario.

Lara Codeca edited this page Sep 14, 2018 · 12 revisions

The starting point is tools/complete.build.sh, it uses scripts from the repository and scripts from the SUMO toolset.

Most of the scripts in the repository require the environmental variable $MOST_SCENARIO set to the absolute path of the MoSTScenario directory. In the Linux terminal that is going to be used for the generation, type source setenv.sh.

All the paths in the configuration files are relative to $MOST_SCENARIO.

Helpers:

  • static/scripts/xml2pickle.py loads an XML file and dumps a cPickle structure, used to speed-up processing.
  • static/scripts/parkings.in.aoi.py uses the shape of an area of interest to filter the parking areas.

Dataset aggregation

MoST Scenario is based on data gathered from different sources and aggregated in an OSM-like format in order to be easily used with SUMO tools. The raw data are in tools/static/data and they are divided by topic. All the files can be open with JOSM, modified, saved and then processed and aggregated using tools/static/osm-like.aggregator.sh. The script requires [osmfilter]{https://wiki.openstreetmap.org/wiki/Osmfilter} installed.

Scripts:

  • static/scripts/compute.area.poly.py computes the centroid and the approximated area for the buildings, it runs on a file containing buildings only.
  • static/scripts/merger/merge.osm.pickles.py merges all the pickle files in a folder and create the complete OSM-like file.

OSM-Like file requirements:

In case you want to use these tools to generate a new scenario from a different OSM file, there are some things to keep in mind.

  • Parking area: the script generates the parking areas looking for OSM nodes that match the _PARKING_DICT structure. The location is computed looking for the closest edge (keeping the shape into account) in the network. The capacity is read from the tag <tag k="capacity" v="#number#"/>. The length of the parking area is fixed (this is cosmetic and it does not affect the capacity).
  • Public Transports: in theory, NETCONVERT should be able to extract the public transports using --ptstop-files and --ptline-files options. Given that the options were not working with tools/static/most.raw.osm, the script produces the same files, split between buses and trains, starting from _is_pt_train and _is_pt_bus.
  • TAZ: the TAZ are extracted from OSM administrative boundaries <tag 'k'='boundary', 'v'='administrative'/> and their relations. Using JOSM is possible to create additional administrative boundaries ad-hoc based on different needs, and the script is going to use them.
  • Buildings: buildings are OSM ways with the tag building set. In order to be used with the activity generation, the additional tags centroid and approx_area are required. The centroid is used to assign the building to a TAZ and an edge, and the approx_area is used to compute weight.

Scenario Generation

tools/static/most.raw.osm is an OSM-like file with data merged from different sources and hand-fixed to obtain a complete source for the scenario generation.

The scenario can be regenerated using tools/static/scenario.generator.sh

Scripts:

  • static/scripts/parkings.osm2sumo.py looks for the parking areas in the OSM-like file and produces the additional files required by SUMO and the activity generation.
  • static/scripts/pt.osm2sumo.py looks for public transports in the OSM-like file and produces the additional files required by SUMO and the activity generation.
  • static/scripts/taz.from.net.osm.py looks for administrative boundaries and buildings in the OSM-like file and produces the additional files required by SUMO and the activity generation.

Mobility Generation

The mobility can be regenerated using tools/mobility/mobility.generator.sh

The mobility generation script is tools/mobility/intermodal.mobilitygen.py and uses a JOSM configuration file, tools/mobility/most.intermodal.mobilitygen.json.

Configuration file:

  • "outputPrefix": relative path to the output folder + file prefix.
  • "sumocfg": SUMO configuration file for TraCI.
  • "SUMOnetFile": SUMO network file.
  • "SUMOadditionals":
    • "vTypes": SUMO vType file.
    • "parkings": SUMO parking file.
  • "intermodalOptions":
    • "parkingAreaWhitelist": list of parking area ids that are going to be used with the intermodal routing.
    • "vehicleAllowedParking": list of vTypes athat are allowe dto use the parking areas.
  • "population":
    • "entities" : number of entities to generate. Note: the triggered vehicles are not counted in this number.
    • "tazDefinition": TAZ definition file.
    • "tazWeights": file with the TAZ weight definition.
    • "buildingsWeight": file with the building weights and associated edges.
  • "taz": dictionary containing the name of the area that is going to be used in the origin-destination distributions and the ccomposition as it is defined in the "tazDefinition". For example:
    • "MonacoArea1Detailed": [2, 3, 4, 5, 6, 7, 8, 9, 10]
  • "distribution": origin-destination distributions by vType and/or vTypeDistribution
    • "pedestrian": this is the only one that uses intermodal.
      • "perc": percentage of "entities" to generate.
      • "composition":
        • "name": name of the slice of mobility.
          • "modes": list of modes defined as ["mode", weight] where mode "public" uses the public transports, and all the other vehicles are used as "triggered". For each entity generated, all the mode are computed and the cost (estimated travel time on an empty net) is multiplied by the weight; the cheapest mode is chosen.
          • "from": name of the origin area.
          • "to": name of the destination area.
          • "perc": percentage of trips for this slice of mobility
          • "withParking": boolean, if true, the vehicle has to be parked.
    • "vType" or "vTypeDistribution": all the other vehicles, not person nor intermodal.
      • "perc": percentage of "entities" to generate.
      • "composition":
        • "name": name of the slice of mobility.
          • "from": name of the origin area.
          • "to": name of the destination area.
          • "perc": percentage of trips for this slice of mobility
          • "withParking": boolean, if true AND the destination edge has a parking, the vehicle will be parked.
  • "interval": departure time interval.
    • "begin": from time in seconds.
    • "end": to time in seconds.
  • "peak": normal distribution for the peak traffic.
    • "mean": mean of the normal distribution.
    • "std": standard deviation for the normal distribution.
  • "stopUntil": uniformly distributed value for the until parameter of the stop.
    • "begin": from time in second.
    • "end": to time in seconds.

IMPORTANT: this wiki page is a work in progress. Do not hesitate to ask for help.