In the following, the inputs needed by the simulation modules SUMO and SUMO-GUI are described. Please note that SUMO-GUI does not accept these options as command line parameters; they have to be given as a configuration file.
Traffic Demand (Routes)
The vehicles to simulate must be given. Their description normally includes vehicle types, vehicles, and vehicle routes. Routes are normally given to the simulation modules using the option --route-files <ROUTES_FILE>[,<ROUTES_FILE>]* (or -r <ROUTES_FILE>[,<ROUTES_FILE>]*). As you can see, you can use more than one route file within a single simulation run.
The routes MUST be sorted. The reason is that we want to simulate large road networks with up to millions of routes - and we did. Using a plain PC this is only possible if you do not keep all routes in memory. All files given as parameter to --route-files <ROUTES_FILE>[,<ROUTES_FILE>]* are read step-wise. Starting at the begin time step, new routes are loaded every n time steps for the next n time steps. n may be controlled using the --route-steps <INT> where <=0 forces SUMO/SUMO-GUI to load the file completely. Fetching routes for the next steps only implies that the vehicle types - or maybe "global" routes - must be given in prior to the routes that use them.
After we had the network and the routes, we realised that some additional stuff should be loaded into the simulation: traffic light definitions, variable speed signs, detector definitions, bus stops, etc. etc.
All these additional structures / definitions are given to the simulation using the --additional-files <FILE>[,<FILE>]*. The list of given files is processed incrementally, this means each file is read completely, and the list is processed starting with the first file of the list.
It is somehow important to know what is loaded when. The order is as following:
- the network is read
- the routes are opened and the first n steps are read
- the additional files are read (completely)
- each n time steps, the routes for the next n time steps are read
Defining the Time Period to Simulate
Each simulation requires the definition about the time period to be simulated. This is given to SUMO or SUMO-GUI using the options --begin <TIME> (or -b <TIME> for short) and --end <TIME> (-e <TIME>). Please note that whether the option --end was given influences the simulation's behavior. The details are described below.
The simulation starts at the time given in --begin, which defaults to 0. All vehicles with a departure time (depart) lower than the begin time are discarded.
The simulation performs each time step one-by-one.
The simulation ends in the following cases:
- The final time step was given using --end and this time step was reached (time after a step is >= end).
- No value for --end has been given and all vehicles have been simulated. The state of the simulation is the one in which the last vehicle has left the simulated area. If a TraCI connection is active, the simulation will continue even after the last vehicle (potentially "forever").
- A close command has been received via TraCI
There are two more command line options influencing ending of the simulation:
- --too-many-vehicles <INT> Quit simulation if the given number of vehicles is exceeded
Defining the Time Step Length
SUMO/SUMO-GUI use a time step of one second per default. You may override this using the --step-length <TIME> option. <TIME> is here given in seconds, but you may enter a real number. In conclusion giving --step-length 0.01 will run the simulation using time steps of 10ms.