SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
MSFrame.cpp
Go to the documentation of this file.
1 /****************************************************************************/
13 // Sets and checks options for microsim; inits global outputs and settings
14 /****************************************************************************/
15 // SUMO, Simulation of Urban MObility; see http://sumo-sim.org/
16 // Copyright (C) 2002-2014 DLR (http://www.dlr.de/) and contributors
17 /****************************************************************************/
18 //
19 // This file is part of SUMO.
20 // SUMO is free software: you can redistribute it and/or modify
21 // it under the terms of the GNU General Public License as published by
22 // the Free Software Foundation, either version 3 of the License, or
23 // (at your option) any later version.
24 //
25 /****************************************************************************/
26 
27 
28 // ===========================================================================
29 // included modules
30 // ===========================================================================
31 #ifdef _MSC_VER
32 #include <windows_config.h>
33 #else
34 #include <config.h>
35 #endif
36 
37 #include <iostream>
38 #include <iomanip>
39 #include <fstream>
40 #include <ctime>
41 #include <stdlib.h>
43 #include <utils/options/Option.h>
46 #include <utils/common/ToString.h>
49 #include <microsim/MSBaseVehicle.h>
50 #include <microsim/MSJunction.h>
51 #include <microsim/MSRoute.h>
52 #include <microsim/MSNet.h>
53 #include <microsim/MSGlobals.h>
58 #include "MSFrame.h"
60 
61 #ifdef CHECK_MEMORY_LEAKS
62 #include <foreign/nvwa/debug_new.h>
63 #endif // CHECK_MEMORY_LEAKS
64 
65 
66 // ===========================================================================
67 // method definitions
68 // ===========================================================================
69 void
72  oc.addCallExample("-b 0 -e 1000 -n net.xml -r routes.xml", "start a simulation from time 0 to 1000 with given net and routes");
73  oc.addCallExample("-c munich_config.cfg", "start with a configuration file");
74  oc.addCallExample("--help", "print help");
75 
76  // insert options sub-topics
77  SystemFrame::addConfigurationOptions(oc); // fill this subtopic, too
78  oc.addOptionSubTopic("Input");
79  oc.addOptionSubTopic("Output");
80  oc.addOptionSubTopic("Time");
81  oc.addOptionSubTopic("Processing");
82  SystemFrame::addReportOptions(oc); // fill this subtopic, too
83 
84 
85  // register configuration options
86  // register input options
87  oc.doRegister("net-file", 'n', new Option_FileName());
88  oc.addSynonyme("net-file", "net");
89  oc.addDescription("net-file", "Input", "Load road network description from FILE");
90 
91  oc.doRegister("route-files", 'r', new Option_FileName());
92  oc.addSynonyme("route-files", "routes");
93  oc.addDescription("route-files", "Input", "Load routes descriptions from FILE(s)");
94 
95  oc.doRegister("additional-files", 'a', new Option_FileName());
96  oc.addSynonyme("additional-files", "additional");
97  oc.addDescription("additional-files", "Input", "Load further descriptions from FILE(s)");
98 
99  oc.doRegister("weight-files", 'w', new Option_FileName());
100  oc.addSynonyme("weight-files", "weights");
101  oc.addDescription("weight-files", "Input", "Load edge/lane weights for online rerouting from FILE");
102  oc.doRegister("weight-attribute", 'x', new Option_String("traveltime"));
103  oc.addSynonyme("weight-attribute", "measure", true);
104  oc.addDescription("weight-attribute", "Input", "Name of the xml attribute which gives the edge weight");
105 
106  oc.doRegister("load-state", new Option_FileName());
107  oc.addDescription("load-state", "Input", "Loads a network state from FILE");
108  oc.doRegister("load-state.offset", new Option_String("0", "TIME"));
109  oc.addDescription("load-state.offset", "Input", "Sets the time offset for vehicle segment exit times");
110 
111  // register output options
112  oc.doRegister("netstate-dump", new Option_FileName());
113  oc.addSynonyme("netstate-dump", "ndump");
114  oc.addSynonyme("netstate-dump", "netstate");
115  oc.addDescription("netstate-dump", "Output", "Save complete network states into FILE");
116  oc.doRegister("netstate-dump.empty-edges", new Option_Bool(false));
117  oc.addSynonyme("netstate-dump.empty-edges", "netstate.empty-edges");
118  oc.addSynonyme("netstate-dump.empty-edges", "dump-empty-edges", true);
119  oc.addDescription("netstate-dump.empty-edges", "Output", "Write also empty edges completely when dumping");
120 
121 
122  oc.doRegister("emission-output", new Option_FileName());
123  oc.addDescription("emission-output", "Output", "Save the emission values of each vehicle");
124  oc.doRegister("fcd-output", new Option_FileName());
125  oc.addDescription("fcd-output", "Output", "Save the Floating Car Data");
126  oc.doRegister("fcd-output.geo", new Option_Bool(false));
127  oc.addDescription("fcd-output.geo", "Output", "Save the Floating Car Data using geo-coordinates (lon/lat)");
128  oc.doRegister("fcd-output.signals", new Option_Bool(false));
129  oc.addDescription("fcd-output.signals", "Output", "Add the vehicle signal state to the FCD output (brake lights etc.)");
130  oc.doRegister("full-output", new Option_FileName());
131  oc.addDescription("full-output", "Output", "Save a lot of information for each timestep (very redundant)");
132  oc.doRegister("queue-output", new Option_FileName());
133  oc.addDescription("queue-output", "Output", "Save the vehicle queues at the junctions (experimental)");
134  oc.doRegister("vtk-output", new Option_FileName());
135  oc.addDescription("vtk-output", "Output", "Save complete vehicle positions inclusive speed values in the VTK Format (usage: /path/out will produce /path/out_$TIMESTEP$.vtp files)");
136  oc.doRegister("amitran-output", new Option_FileName());
137  oc.addDescription("amitran-output", "Output", "Save the vehicle trajectories in the Amitran format");
138 
139 
140  oc.doRegister("summary-output", new Option_FileName());
141  oc.addSynonyme("summary-output", "summary");
142  oc.addSynonyme("summary-output", "emissions-output", true);
143  oc.addSynonyme("summary-output", "emissions", true);
144  oc.addDescription("summary-output", "Output", "Save aggregated vehicle departure info into FILE");
145 
146  oc.doRegister("tripinfo-output", new Option_FileName());
147  oc.addSynonyme("tripinfo-output", "tripinfo");
148  oc.addDescription("tripinfo-output", "Output", "Save single vehicle trip info into FILE");
149 
150  oc.doRegister("vehroute-output", new Option_FileName());
151  oc.addSynonyme("vehroute-output", "vehroutes");
152  oc.addDescription("vehroute-output", "Output", "Save single vehicle route info into FILE");
153 
154  oc.doRegister("vehroute-output.exit-times", new Option_Bool(false));
155  oc.addSynonyme("vehroute-output.exit-times", "vehroutes.exit-times");
156  oc.addDescription("vehroute-output.exit-times", "Output", "Write the exit times for all edges");
157 
158  oc.doRegister("vehroute-output.last-route", new Option_Bool(false));
159  oc.addSynonyme("vehroute-output.last-route", "vehroutes.last-route");
160  oc.addDescription("vehroute-output.last-route", "Output", "Write the last route only");
161 
162  oc.doRegister("vehroute-output.sorted", new Option_Bool(false));
163  oc.addSynonyme("vehroute-output.sorted", "vehroutes.sorted");
164  oc.addDescription("vehroute-output.sorted", "Output", "Sorts the output by departure time");
165 
166  oc.doRegister("vehroute-output.write-unfinished", new Option_Bool(false));
167  oc.addDescription("vehroute-output.write-unfinished", "Output", "Write vehroute output for vehicles which have not arrived at simulation end");
168 
169  oc.doRegister("link-output", new Option_FileName());
170  oc.addDescription("link-output", "Output", "Save links states into FILE");
171 
172  oc.doRegister("bt-output", new Option_FileName());
173  oc.addDescription("bt-output", "Output", "Save bt visibilities into FILE");
174 
175 
176 #ifdef _DEBUG
177  oc.doRegister("movereminder-output", new Option_FileName());
178  oc.addDescription("movereminder-output", "Output", "Save movereminder states of selected vehicles into FILE");
179  oc.doRegister("movereminder-output.vehicles", new Option_String());
180  oc.addDescription("movereminder-output.vehicles", "Output", "List of vehicle ids which shall save their movereminder states");
181 #endif
182 
183  oc.doRegister("save-state.times", new Option_IntVector(IntVector()));
184  oc.addDescription("save-state.times", "Output", "Use INT[] as times at which a network state written");
185  oc.doRegister("save-state.prefix", new Option_FileName("state"));
186  oc.addDescription("save-state.prefix", "Output", "Prefix for network states");
187  oc.doRegister("save-state.files", new Option_FileName());
188  oc.addDescription("save-state.files", "Output", "Files for network states");
189 
190  // register the simulation settings
191  oc.doRegister("begin", 'b', new Option_String("0", "TIME"));
192  oc.addDescription("begin", "Time", "Defines the begin time; The simulation starts at this time");
193 
194  oc.doRegister("end", 'e', new Option_String("-1", "TIME"));
195  oc.addDescription("end", "Time", "Defines the end time; The simulation ends at this time");
196 
197 #ifdef HAVE_SUBSECOND_TIMESTEPS
198  oc.doRegister("step-length", new Option_String("1", "TIME"));
199  oc.addDescription("step-length", "Time", "Defines the step duration");
200 #endif
201 
202 
203  // register the processing options
204  oc.doRegister("route-steps", 's', new Option_String("200", "TIME"));
205  oc.addDescription("route-steps", "Processing", "Load routes for the next number of seconds ahead");
206 
207 #ifdef HAVE_INTERNAL_LANES
208  oc.doRegister("no-internal-links", new Option_Bool(false));
209  oc.addDescription("no-internal-links", "Processing", "Disable (junction) internal links");
210 
211  oc.doRegister("ignore-junction-blocker", new Option_String("-1", "TIME"));
212  oc.addDescription("ignore-junction-blocker", "Processing", "Ignore vehicles which block the junction after they have been standing for SECONDS (-1 means never ignore)");
213 #endif
214 
215  oc.doRegister("ignore-accidents", new Option_Bool(false));
216  oc.addDescription("ignore-accidents", "Processing", "Do not check whether accidents occure more deeply");
217 
218  oc.doRegister("ignore-route-errors", new Option_Bool(false));
219  oc.addDescription("ignore-route-errors", "Processing", "Do not check whether routes are connected");
220 
221  oc.doRegister("max-num-vehicles", new Option_Integer(-1));
222  oc.addSynonyme("max-num-vehicles", "too-many-vehicles", true);
223  oc.addDescription("max-num-vehicles", "Processing", "Quit simulation if this number of vehicles is exceeded");
224 
225  oc.doRegister("scale", new Option_Float());
226  oc.addDescription("scale", "Processing", "Scale demand by the given factor (0..1)");
227 
228  oc.doRegister("time-to-teleport", new Option_String("300", "TIME"));
229  oc.addDescription("time-to-teleport", "Processing", "Specify how long a vehicle may wait until being teleported, defaults to 300, non-positive values disable teleporting");
230  oc.doRegister("time-to-teleport.highways", new Option_String("0", "TIME"));
231  oc.addDescription("time-to-teleport.highways", "Processing", "The teleport time on highways");
232 
233  oc.doRegister("max-depart-delay", new Option_String("-1", "TIME"));
234  oc.addDescription("max-depart-delay", "Processing", "How long vehicles wait for departure before being skipped, defaults to -1 which means vehicles are never skipped");
235 
236  oc.doRegister("sloppy-insert", new Option_Bool(false));
237  oc.addDescription("sloppy-insert", "Processing", "Whether insertion on an edge shall not be repeated in same step once failed");
238 
239  oc.doRegister("eager-insert", new Option_Bool(false));
240  oc.addDescription("eager-insert", "Processing", "Whether each vehicle is checked separately for insertion on an edge");
241 
242  oc.doRegister("random-depart-offset", new Option_String("0", "TIME"));
243  oc.addDescription("random-depart-offset", "Processing", "Each vehicle receives a random offset to its depart value drawn uniformly from [0, TIME]");
244 
245  oc.doRegister("lanechange.allow-swap", new Option_Bool(false));
246  oc.addDescription("lanechange.allow-swap", "Processing", "Whether blocking vehicles trying to change lanes may be swapped");
247 
248  oc.doRegister("lanechange.duration", new Option_String("0", "TIME"));
249  oc.addDescription("lanechange.duration", "Processing", "Duration of a lane change maneuver (default 0)");
250 
251  oc.doRegister("lanechange.overtake-right", new Option_Bool(false));
252  oc.addDescription("lanechange.overtake-right", "Processing", "Whether overtaking on the right on motorways is permitted");
253 
254  oc.doRegister("routing-algorithm", new Option_String("dijkstra"));
255  oc.addDescription("routing-algorithm", "Processing",
256  "Select among routing algorithms ['dijkstra', 'astar']");
257  // pedestrian model
258  oc.doRegister("pedestrian.model", new Option_String("striping"));
259  oc.addDescription("pedestrian.model", "Processing", "Select among pedestrian models ['nonInteracting', 'striping']");
260 
261  oc.doRegister("pedestrian.striping.stripe-width", new Option_Float(0.65));
262  oc.addDescription("pedestrian.striping.stripe-width", "Processing", "Width of parallel stripes for segmenting a sidewalk (meters) for use with model 'striping'");
263 
264  oc.doRegister("pedestrian.striping.dawdling", new Option_Float(0.2));
265  oc.addDescription("pedestrian.striping.dawdling", "Processing", "factor for random slow-downs [0,1] for use with model 'striping'");
266 
267  // devices
268  oc.addOptionSubTopic("Emissions");
269  std::string plp = getenv("PHEMLIGHT_PATH") == 0 ? "./PHEMlight/" : std::string(getenv("PHEMLIGHT_PATH"));
270  oc.doRegister("phemlight-path", new Option_FileName(plp));
271  oc.addDescription("phemlight-path", "Emissions", "Determines where to load PHEMlight definitions from.");
272 
273  oc.addOptionSubTopic("Communication");
275 
276  // register report options
277  oc.doRegister("no-duration-log", new Option_Bool(false));
278  oc.addDescription("no-duration-log", "Report", "Disable performance reports for individual simulation steps");
279 
280  oc.doRegister("no-step-log", new Option_Bool(false));
281  oc.addDescription("no-step-log", "Report", "Disable console output of current simulation step");
282 
283 
284 #ifndef NO_TRACI
285  //remote port 0 if not used
286  oc.addOptionSubTopic("TraCI Server");
287  oc.doRegister("remote-port", new Option_Integer(0));
288  oc.addDescription("remote-port", "TraCI Server", "Enables TraCI Server if set");
289 #ifdef HAVE_PYTHON
290  oc.doRegister("python-script", new Option_String());
291  oc.addDescription("python-script", "TraCI Server", "Runs TraCI script with embedded python");
292 #endif
293 #endif
294  //
295 #ifdef HAVE_INTERNAL
296  oc.addOptionSubTopic("Mesoscopic");
297  oc.doRegister("mesosim", new Option_Bool(false));
298  oc.addDescription("mesosim", "Mesoscopic", "Enables mesoscopic simulation");
299  oc.doRegister("meso-edgelength", new Option_Float(98.0f));
300  oc.addDescription("meso-edgelength", "Mesoscopic", "Length of an edge segment in mesoscopic simulation");
301  oc.doRegister("meso-tauff", new Option_String("1.4", "TIME"));
302  oc.addDescription("meso-tauff", "Mesoscopic", "Factor for calculating the free-free headway time");
303  oc.doRegister("meso-taufj", new Option_String("1.4", "TIME"));
304  oc.addDescription("meso-taufj", "Mesoscopic", "Factor for calculating the free-jam headway time");
305  oc.doRegister("meso-taujf", new Option_String("2", "TIME"));
306  oc.addDescription("meso-taujf", "Mesoscopic", "Factor for calculating the jam-free headway time");
307  oc.doRegister("meso-taujj", new Option_String("2", "TIME"));
308  oc.addDescription("meso-taujj", "Mesoscopic", "Factor for calculating the jam-jam headway time");
309  oc.doRegister("meso-jam-threshold", new Option_Float(-1));
310  oc.addDescription("meso-jam-threshold", "Mesoscopic", "Minimum percentage of occupied space to consider a segment jammed. A negative argument causes thresholds to be computed based on edge speed and tauff (default)");
311  oc.doRegister("meso-multi-queue", new Option_Bool(false));
312  oc.addDescription("meso-multi-queue", "Mesoscopic", "Enable multiple queues at edge ends");
313  oc.doRegister("meso-junction-control", new Option_Bool(false));
314  oc.addDescription("meso-junction-control", "Mesoscopic", "Enable mesoscopic traffic light and priority junction handling");
315  oc.doRegister("meso-junction-control.limited", new Option_Bool(false));
316  oc.addDescription("meso-junction-control.limited", "Mesoscopic", "Enable mesoscopic traffic light and priority junction handling for saturated links. This prevents faulty traffic lights from hindering flow in low-traffic situations");
317  oc.doRegister("meso-recheck", new Option_String("0", "TIME"));
318  oc.addDescription("meso-recheck", "Mesoscopic", "Time interval for rechecking insertion into the next segment after failure");
319 #endif
320 
321  // add rand options
323 
324  // add GUI options
325  // the reason that we include them in vanilla sumo as well is to make reusing config files easy
326  oc.addOptionSubTopic("GUI Only");
327  oc.doRegister("gui-settings-file", new Option_FileName());
328  oc.addDescription("gui-settings-file", "GUI Only", "Load visualisation settings from FILE");
329 
330  oc.doRegister("quit-on-end", 'Q', new Option_Bool(false));
331  oc.addDescription("quit-on-end", "GUI Only", "Quits the GUI when the simulation stops");
332 
333  oc.doRegister("game", 'G', new Option_Bool(false));
334  oc.addDescription("game", "GUI Only", "Start the GUI in gaming mode");
335 
336  oc.doRegister("start", 'S', new Option_Bool(false));
337  oc.addDescription("start", "GUI Only", "Start the simulation after loading");
338 
339  oc.doRegister("disable-textures", 'T', new Option_Bool(false));
340  oc.addDescription("disable-textures", "GUI Only", "Do not load background pictures");
341 
342 #ifdef HAVE_INTERNAL
343  oc.doRegister("osg-view", new Option_Bool(false));
344  oc.addDescription("osg-view", "GUI Only", "Start with an OpenSceneGraph view instead of the regular 2D view");
345 #endif
346 
347 }
348 
349 
350 void
352  // standard outputs
353  OutputDevice::createDeviceByOption("netstate-dump", "netstate", "netstate_file.xsd");
354  OutputDevice::createDeviceByOption("summary-output", "summary", "summary_file.xsd");
355  OutputDevice::createDeviceByOption("tripinfo-output", "tripinfos", "tripinfo_file.xsd");
356 
357  //extended
358  OutputDevice::createDeviceByOption("fcd-output", "fcd-export", "fcd_file.xsd");
359  OutputDevice::createDeviceByOption("emission-output", "emission-export", "emission_file.xsd");
360  OutputDevice::createDeviceByOption("full-output", "full-export", "full_file.xsd");
361  OutputDevice::createDeviceByOption("queue-output", "queue-export", "queue_file.xsd");
362  OutputDevice::createDeviceByOption("amitran-output", "trajectories", "amitran/trajectories.xsd\" timeStepSize=\"" + toString(STEPS2MS(DELTA_T)));
363 
364  //OutputDevice::createDeviceByOption("vtk-output", "vtk-export");
365  OutputDevice::createDeviceByOption("link-output", "link-output");
366  OutputDevice::createDeviceByOption("bt-output", "bt-output");
367 
368 #ifdef _DEBUG
369  OutputDevice::createDeviceByOption("movereminder-output", "movereminder-output");
370 #endif
371 
373 }
374 
375 
376 bool
379  bool ok = true;
380  if (!oc.isSet("net-file")) {
381  WRITE_ERROR("No network file (-n) specified.");
382  ok = false;
383  }
384  if (!oc.isDefault("scale")) {
385  if (oc.getFloat("scale") < 0.) {
386  WRITE_ERROR("Invalid scaling factor.");
387  ok = false;
388  }
389  }
390  if (oc.getBool("vehroute-output.exit-times") && !oc.isSet("vehroute-output")) {
391  WRITE_ERROR("A vehroute-output file is needed for exit times.");
392  ok = false;
393  }
394  if (oc.isSet("gui-settings-file") &&
395  oc.getString("gui-settings-file") != "" &&
396  !oc.isUsableFileList("gui-settings-file")) {
397  ok = false;
398  }
399 #ifdef HAVE_INTERNAL
400  if (oc.getBool("meso-junction-control.limited") && !oc.getBool("meso-junction-control")) {
401  oc.set("meso-junction-control", "true");
402  }
403 #endif
404  const SUMOTime begin = string2time(oc.getString("begin"));
405  const SUMOTime end = string2time(oc.getString("end"));
406  if (begin < 0) {
407  WRITE_ERROR("The begin time should not be negative.");
408  ok = false;
409  }
410  if (end != string2time("-1")) {
411  if (end < begin) {
412  WRITE_ERROR("The end time should be after the begin time.");
413  ok = false;
414  }
415  }
416 #ifdef HAVE_SUBSECOND_TIMESTEPS
417  if (string2time(oc.getString("step-length")) <= 0) {
418  WRITE_ERROR("the minimum step-length is 0.001");
419  ok = false;
420  }
421 #endif
422 #ifdef _DEBUG
423  if (oc.isSet("movereminder-output.vehicles") && !oc.isSet("movereminder-output")) {
424  WRITE_ERROR("option movereminder-output.vehicles requires option movereminder-output to be set");
425  ok = false;
426  }
427 #endif
428  if (oc.getBool("sloppy-insert")) {
429  WRITE_WARNING("The option 'sloppy-insert' is deprecated, because it is now activated by default, see the new option 'eager-insert'.");
430  }
431  return ok;
432 }
433 
434 
435 void
437  // pre-initialise the network
438  // set whether empty edges shall be printed on dump
439  MSGlobals::gOmitEmptyEdgesOnDump = !oc.getBool("netstate-dump.empty-edges");
440 #ifdef HAVE_INTERNAL_LANES
441  // set whether internal lanes shall be used
442  MSGlobals::gUsingInternalLanes = !oc.getBool("no-internal-links");
443  MSGlobals::gIgnoreJunctionBlocker = string2time(oc.getString("ignore-junction-blocker")) < 0 ?
444  std::numeric_limits<SUMOTime>::max() : string2time(oc.getString("ignore-junction-blocker"));
445 #else
448 #endif
449  // set the grid lock time
450  MSGlobals::gTimeToGridlock = string2time(oc.getString("time-to-teleport")) < 0 ? 0 : string2time(oc.getString("time-to-teleport"));
451  MSGlobals::gTimeToGridlockHighways = string2time(oc.getString("time-to-teleport.highways")) < 0 ? 0 : string2time(oc.getString("time-to-teleport.highways"));
452  MSGlobals::gCheck4Accidents = !oc.getBool("ignore-accidents");
453  MSGlobals::gCheckRoutes = !oc.getBool("ignore-route-errors");
454  MSGlobals::gLaneChangeDuration = string2time(oc.getString("lanechange.duration"));
455  MSGlobals::gStateLoaded = oc.isSet("load-state");
456 #ifdef HAVE_INTERNAL
457  MSGlobals::gUseMesoSim = oc.getBool("mesosim");
458  MSGlobals::gMesoLimitedJunctionControl = oc.getBool("meso-junction-control.limited");
460  MSGlobals::gUsingInternalLanes = false;
461  }
462 #endif
464 
465 #ifdef HAVE_SUBSECOND_TIMESTEPS
466  DELTA_T = string2time(oc.getString("step-length"));
467 #endif
468 #ifdef _DEBUG
469  if (oc.isSet("movereminder-output")) {
470  MSBaseVehicle::initMoveReminderOutput(oc);
471  }
472 #endif
473 }
474 
475 
476 
477 /****************************************************************************/
478 
static bool gOmitEmptyEdgesOnDump
Information whether empty edges shall be written on dump.
Definition: MSGlobals.h:61
void doRegister(const std::string &name, Option *v)
Adds an option under the given name.
Definition: OptionsCont.cpp:84
static void insertRandOptions()
Initialises the given options container with random number options.
Definition: RandHelper.cpp:53
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.
Definition: SystemFrame.cpp:74
static void buildStreams()
Builds the streams used possibly by the simulation.
Definition: MSFrame.cpp:351
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
static bool gStateLoaded
Information whether a state has been loaded.
Definition: MSGlobals.h:86
SUMOReal getFloat(const std::string &name) const
Returns the SUMOReal-value of the named option (only for Option_Float)
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
Definition: SystemFrame.cpp:50
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:200
static OptionsCont & getOptions()
Retrieves the options.
Definition: OptionsCont.cpp:67
static bool gCheck4Accidents
Definition: MSGlobals.h:77
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
Definition: MSFrame.cpp:70
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
static void init()
Static intialization.
#define max(a, b)
Definition: polyfonts.c:65
std::vector< int > IntVector
Definition of a vector of unsigned ints.
Definition: Option.h:48
static bool gCheckRoutes
Definition: MSGlobals.h:80
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file) ...
SUMOTime string2time(const std::string &r)
Definition: SUMOTime.cpp:48
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Definition: MSGlobals.h:71
static void initGlobalOptions(const OptionsCont &oc)
init global model parameters
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
Definition: ToString.h:53
static bool checkOptions()
Checks the set options.
Definition: MSFrame.cpp:377
#define WRITE_ERROR(msg)
Definition: MsgHandler.h:205
static SUMOTime gTimeToGridlockHighways
Definition: MSGlobals.h:68
bool set(const std::string &name, const std::string &value)
Sets the given value for the named option.
An integer-option.
Definition: Option.h:309
A storage for options typed value containers)
Definition: OptionsCont.h:108
static SUMOTime gTimeToGridlock
Definition: MSGlobals.h:65
static void insertOptions(OptionsCont &oc)
Inserts options for building devices.
Definition: MSDevice.cpp:62
static SUMOTime gIgnoreJunctionBlocker
Information whether the simulation regards internal lanes.
Definition: MSGlobals.h:74
static bool createDeviceByOption(const std::string &optionName, const std::string &rootElement="", const std::string &schemaFile="")
Creates the device using the output definition stored in the named option.
static const bool gUseMesoSim
Definition: MSGlobals.h:99
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
Definition: MSFrame.cpp:436
#define DELTA_T
Definition: SUMOTime.h:50
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
static SUMOTime gLaneChangeDuration
Definition: MSGlobals.h:83
#define STEPS2MS(x)
Definition: SUMOTime.h:68
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.