Eclipse SUMO - Simulation of Urban MObility
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MSFrame.cpp
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2002-2025 German Aerospace Center (DLR) and others.
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// https://www.eclipse.org/legal/epl-2.0/
7// This Source Code may also be made available under the following Secondary
8// Licenses when the conditions for such availability set forth in the Eclipse
9// Public License 2.0 are satisfied: GNU General Public License, version 2
10// or later which is available at
11// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13/****************************************************************************/
24// Sets and checks options for microsim; inits global outputs and settings
25/****************************************************************************/
26#include <config.h>
27
28#include <iostream>
29#include <iomanip>
30#include <fstream>
31#include <ctime>
42#include <microsim/MSJunction.h>
43#include <microsim/MSRoute.h>
44#include <microsim/MSNet.h>
45#include <microsim/MSLane.h>
46#include <microsim/MSGlobals.h>
54#include "MSFrame.h"
55
56
57// ===========================================================================
58// method definitions
59// ===========================================================================
60void
63 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");
64 oc.addCallExample("-c munich_config.cfg", "start with a configuration file");
65 oc.addCallExample("--help", "print help");
66
67 // insert options sub-topics
68 SystemFrame::addConfigurationOptions(oc); // fill this subtopic, too
69 oc.addOptionSubTopic("Input");
70 oc.addOptionSubTopic("Output");
71 oc.addOptionSubTopic("Time");
72 oc.addOptionSubTopic("Processing");
73 oc.addOptionSubTopic("Routing");
74
75 // register configuration options
76 // register input options
77 oc.doRegister("net-file", 'n', new Option_FileName());
78 oc.addSynonyme("net-file", "net");
79 oc.addDescription("net-file", "Input", TL("Load road network description from FILE"));
80 oc.addXMLDefault("net-file", "net");
81
82 oc.doRegister("route-files", 'r', new Option_FileName());
83 oc.addSynonyme("route-files", "routes");
84 oc.addDescription("route-files", "Input", TL("Load routes descriptions from FILE(s)"));
85
86 oc.doRegister("additional-files", 'a', new Option_FileName());
87 oc.addSynonyme("additional-files", "additional");
88 oc.addDescription("additional-files", "Input", TL("Load further descriptions from FILE(s)"));
89
90 oc.doRegister("weight-files", 'w', new Option_FileName());
91 oc.addSynonyme("weight-files", "weights");
92 oc.addDescription("weight-files", "Input", TL("Load edge/lane weights for online rerouting from FILE"));
93 oc.doRegister("weight-attribute", 'x', new Option_String("traveltime"));
94 oc.addSynonyme("weight-attribute", "measure", true);
95 oc.addDescription("weight-attribute", "Input", TL("Name of the xml attribute which gives the edge weight"));
96
97 oc.doRegister("load-state", new Option_FileName());
98 oc.addDescription("load-state", "Input", TL("Loads a network state from FILE"));
99 oc.doRegister("load-state.offset", new Option_String("0", "TIME"));
100 oc.addDescription("load-state.offset", "Input", TL("Shifts all times loaded from a saved state by the given offset"));
101 oc.doRegister("load-state.remove-vehicles", new Option_StringVector(StringVector({""})));
102 oc.addDescription("load-state.remove-vehicles", "Input", TL("Removes vehicles with the given IDs from the loaded state"));
103
104 oc.doRegister("junction-taz", new Option_Bool(false));
105 oc.addDescription("junction-taz", "Input", TL("Initialize a TAZ for every junction to use attributes toJunction and fromJunction"));
106
107 // need to do this here to be able to check for network and route input options
109
110 // register output options
111 oc.doRegister("netstate-dump", new Option_FileName());
112 oc.addSynonyme("netstate-dump", "ndump");
113 oc.addSynonyme("netstate-dump", "netstate");
114 oc.addSynonyme("netstate-dump", "netstate-output");
115 oc.addDescription("netstate-dump", "Output", TL("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", "netstate-output.empty-edges");
119 oc.addSynonyme("netstate-dump.empty-edges", "dump-empty-edges", true);
120 oc.addDescription("netstate-dump.empty-edges", "Output", TL("Write also empty edges completely when dumping"));
121 oc.doRegister("netstate-dump.precision", new Option_Integer(2));
122 oc.addSynonyme("netstate-dump.precision", "netstate.precision");
123 oc.addSynonyme("netstate-dump.precision", "netstate-output.precision");
124 oc.addSynonyme("netstate-dump.precision", "dump-precision", true);
125 oc.addDescription("netstate-dump.precision", "Output", TL("Write positions and speeds with the given precision (default 2)"));
126
127
128 oc.doRegister("emission-output", new Option_FileName());
129 oc.addDescription("emission-output", "Output", TL("Save the emission values of each vehicle"));
130 oc.doRegister("emission-output.precision", new Option_Integer(2));
131 oc.addDescription("emission-output.precision", "Output", TL("Write emission values with the given precision (default 2)"));
132 oc.doRegister("emission-output.geo", new Option_Bool(false));
133 oc.addDescription("emission-output.geo", "Output", TL("Save the positions in emission output using geo-coordinates (lon/lat)"));
134
135 oc.doRegister("emission-output.step-scaled", new Option_Bool(false));
136 oc.addDescription("emission-output.step-scaled", "Output", TL("Write emission values scaled to the step length rather than as per-second values"));
137 oc.doRegister("emission-output.attributes", new Option_StringVector());
138 oc.addDescription("emission-output.attributes", "Output", TL("List attributes that should be included in the emission output"));
139
140 oc.doRegister("battery-output", new Option_FileName());
141 oc.addDescription("battery-output", "Output", TL("Save the battery values of each vehicle"));
142 oc.doRegister("battery-output.precision", new Option_Integer(2));
143 oc.addDescription("battery-output.precision", "Output", TL("Write battery values with the given precision (default 2)"));
144
145 oc.doRegister("elechybrid-output", new Option_FileName());
146 oc.addDescription("elechybrid-output", "Output", TL("Save the elecHybrid values of each vehicle"));
147 oc.doRegister("elechybrid-output.precision", new Option_Integer(2));
148 oc.addDescription("elechybrid-output.precision", "Output", TL("Write elecHybrid values with the given precision (default 2)"));
149 oc.doRegister("elechybrid-output.aggregated", new Option_Bool(false));
150 oc.addDescription("elechybrid-output.aggregated", "Output", TL("Write elecHybrid values into one aggregated file"));
151
152 oc.doRegister("chargingstations-output", new Option_FileName());
153 oc.addDescription("chargingstations-output", "Output", TL("Write data of charging stations"));
154 oc.doRegister("chargingstations-output.aggregated", new Option_Bool(false));
155 oc.addDescription("chargingstations-output.aggregated", "Output", TL("Write aggregated charging event data instead of single time steps"));
156 oc.doRegister("chargingstations-output.aggregated.write-unfinished", new Option_Bool(false));
157 oc.addDescription("chargingstations-output.aggregated.write-unfinished", "Output", TL("Write aggregated charging event data for vehicles which have not arrived at simulation end"));
158
159 oc.doRegister("overheadwiresegments-output", new Option_FileName());
160 oc.addDescription("overheadwiresegments-output", "Output", TL("Write data of overhead wire segments"));
161
162 oc.doRegister("substations-output", new Option_FileName());
163 oc.addDescription("substations-output", "Output", TL("Write data of electrical substation stations"));
164 oc.doRegister("substations-output.precision", new Option_Integer(2));
165 oc.addDescription("substations-output.precision", "Output", TL("Write substation values with the given precision (default 2)"));
166
167 oc.doRegister("fcd-output", new Option_FileName());
168 oc.addDescription("fcd-output", "Output", TL("Save the Floating Car Data"));
169 oc.doRegister("fcd-output.geo", new Option_Bool(false));
170 oc.addDescription("fcd-output.geo", "Output", TL("Save the Floating Car Data using geo-coordinates (lon/lat)"));
171 oc.doRegister("fcd-output.signals", new Option_Bool(false));
172 oc.addDescription("fcd-output.signals", "Output", TL("Add the vehicle signal state to the FCD output (brake lights etc.)"));
173 oc.doRegister("fcd-output.distance", new Option_Bool(false));
174 oc.addDescription("fcd-output.distance", "Output", TL("Add kilometrage to the FCD output (linear referencing)"));
175 oc.doRegister("fcd-output.acceleration", new Option_Bool(false));
176 oc.addDescription("fcd-output.acceleration", "Output", TL("Add acceleration to the FCD output"));
177 oc.doRegister("fcd-output.max-leader-distance", new Option_Float(-1));
178 oc.addDescription("fcd-output.max-leader-distance", "Output", TL("Add leader vehicle information to the FCD output (within the given distance)"));
179 oc.doRegister("fcd-output.params", new Option_StringVector());
180 oc.addDescription("fcd-output.params", "Output", TL("Add generic parameter values to the FCD output"));
181 oc.doRegister("fcd-output.filter-edges.input-file", new Option_FileName());
182 oc.addDescription("fcd-output.filter-edges.input-file", "Output", TL("Restrict fcd output to the edge selection from the given input file"));
183 oc.doRegister("fcd-output.attributes", new Option_StringVector());
184 oc.addDescription("fcd-output.attributes", "Output", TL("List attributes that should be included in the FCD output"));
185 oc.doRegister("fcd-output.filter-shapes", new Option_StringVector());
186 oc.addDescription("fcd-output.filter-shapes", "Output", TL("List shape names that should be used to filter the FCD output"));
187
188 oc.doRegister("device.ssm.filter-edges.input-file", new Option_FileName());
189 oc.addDescription("device.ssm.filter-edges.input-file", "Output", TL("Restrict SSM device output to the edge selection from the given input file"));
190
191 oc.doRegister("full-output", new Option_FileName());
192 oc.addDescription("full-output", "Output", TL("Save a lot of information for each timestep (very redundant)"));
193
194 oc.doRegister("queue-output", new Option_FileName());
195 oc.addDescription("queue-output", "Output", TL("Save the vehicle queues at the junctions (experimental)"));
196 oc.doRegister("queue-output.period", new Option_String("-1", "TIME"));
197 oc.addDescription("queue-output.period", "Output", TL("Save vehicle queues with the given period"));
198
199 oc.doRegister("vtk-output", new Option_FileName());
200 oc.addDescription("vtk-output", "Output", TL("Save complete vehicle positions inclusive speed values in the VTK Format (usage: /path/out will produce /path/out_$TIMESTEP$.vtp files)"));
201 oc.doRegister("amitran-output", new Option_FileName());
202 oc.addDescription("amitran-output", "Output", TL("Save the vehicle trajectories in the Amitran format"));
203
204
205 oc.doRegister("summary-output", new Option_FileName());
206 oc.addSynonyme("summary-output", "summary");
207 oc.addDescription("summary-output", "Output", TL("Save aggregated vehicle departure info into FILE"));
208
209 oc.doRegister("summary-output.period", new Option_String("-1", "TIME"));
210 oc.addDescription("summary-output.period", "Output", TL("Save summary-output with the given period"));
211
212 oc.doRegister("person-summary-output", new Option_FileName());
213 oc.addDescription("person-summary-output", "Output", TL("Save aggregated person counts into FILE"));
214
215 oc.doRegister("tripinfo-output", new Option_FileName());
216 oc.addSynonyme("tripinfo-output", "tripinfo");
217 oc.addDescription("tripinfo-output", "Output", TL("Save single vehicle trip info into FILE"));
218
219 oc.doRegister("tripinfo-output.write-unfinished", new Option_Bool(false));
220 oc.addDescription("tripinfo-output.write-unfinished", "Output", TL("Write tripinfo output for vehicles which have not arrived at simulation end"));
221
222 oc.doRegister("tripinfo-output.write-undeparted", new Option_Bool(false));
223 oc.addDescription("tripinfo-output.write-undeparted", "Output", TL("Write tripinfo output for vehicles which have not departed at simulation end because of depart delay"));
224
225 oc.doRegister("personinfo-output", new Option_FileName());
226 oc.addSynonyme("personinfo-output", "personinfo");
227 oc.addDescription("personinfo-output", "Output", TL("Save personinfo and containerinfo to separate FILE"));
228
229 oc.doRegister("vehroute-output", new Option_FileName());
230 oc.addSynonyme("vehroute-output", "vehroutes");
231 oc.addDescription("vehroute-output", "Output", TL("Save single vehicle route info into FILE"));
232
233 oc.doRegister("vehroute-output.exit-times", new Option_Bool(false));
234 oc.addSynonyme("vehroute-output.exit-times", "vehroutes.exit-times");
235 oc.addDescription("vehroute-output.exit-times", "Output", TL("Write the exit times for all edges"));
236
237 oc.doRegister("vehroute-output.last-route", new Option_Bool(false));
238 oc.addSynonyme("vehroute-output.last-route", "vehroutes.last-route");
239 oc.addDescription("vehroute-output.last-route", "Output", TL("Write the last route only"));
240
241 oc.doRegister("vehroute-output.sorted", new Option_Bool(false));
242 oc.addSynonyme("vehroute-output.sorted", "vehroutes.sorted");
243 oc.addDescription("vehroute-output.sorted", "Output", TL("Sorts the output by departure time"));
244
245 oc.doRegister("vehroute-output.dua", new Option_Bool(false));
246 oc.addSynonyme("vehroute-output.dua", "vehroutes.dua");
247 oc.addDescription("vehroute-output.dua", "Output", TL("Write the output in the duarouter alternatives style"));
248
249 oc.doRegister("vehroute-output.cost", new Option_Bool(false));
250 oc.addDescription("vehroute-output.cost", "Output", TL("Write costs for all routes"));
251
252 oc.doRegister("vehroute-output.intended-depart", new Option_Bool(false));
253 oc.addSynonyme("vehroute-output.intended-depart", "vehroutes.intended-depart");
254 oc.addDescription("vehroute-output.intended-depart", "Output", TL("Write the output with the intended instead of the real departure time"));
255
256 oc.doRegister("vehroute-output.route-length", new Option_Bool(false));
257 oc.addSynonyme("vehroute-output.route-length", "vehroutes.route-length");
258 oc.addDescription("vehroute-output.route-length", "Output", TL("Include total route length in the output"));
259
260 oc.doRegister("vehroute-output.write-unfinished", new Option_Bool(false));
261 oc.addDescription("vehroute-output.write-unfinished", "Output", TL("Write vehroute output for vehicles which have not arrived at simulation end"));
262
263 oc.doRegister("vehroute-output.skip-ptlines", new Option_Bool(false));
264 oc.addDescription("vehroute-output.skip-ptlines", "Output", TL("Skip vehroute output for public transport vehicles"));
265
266 oc.doRegister("vehroute-output.incomplete", new Option_Bool(false));
267 oc.addDescription("vehroute-output.incomplete", "Output", TL("Include invalid routes and route stubs in vehroute output"));
268
269 oc.doRegister("vehroute-output.stop-edges", new Option_Bool(false));
270 oc.addDescription("vehroute-output.stop-edges", "Output", TL("Include information about edges between stops"));
271
272 oc.doRegister("vehroute-output.speedfactor", new Option_Bool(false));
273 oc.addDescription("vehroute-output.speedfactor", "Output", TL("Write the vehicle speedFactor (defaults to 'true' if departSpeed is written)"));
274
275 oc.doRegister("vehroute-output.internal", new Option_Bool(false));
276 oc.addDescription("vehroute-output.internal", "Output", TL("Include internal edges in the output"));
277
278 oc.doRegister("personroute-output", new Option_FileName());
279 oc.addSynonyme("personroute-output", "personroutes");
280 oc.addDescription("personroute-output", "Output", TL("Save person and container routes to separate FILE"));
281
282 oc.doRegister("link-output", new Option_FileName());
283 oc.addDescription("link-output", "Output", TL("Save links states into FILE"));
284
285 oc.doRegister("railsignal-block-output", new Option_FileName());
286 oc.addDescription("railsignal-block-output", "Output", TL("Save railsignal-blocks into FILE"));
287
288 oc.doRegister("railsignal-vehicle-output", new Option_FileName());
289 oc.addDescription("railsignal-vehicle-output", "Output", TL("Record entry and exit times of vehicles for railsignal blocks into FILE"));
290
291 oc.doRegister("bt-output", new Option_FileName());
292 oc.addDescription("bt-output", "Output", TL("Save bluetooth visibilities into FILE (in conjunction with device.btreceiver and device.btsender)"));
293
294 oc.doRegister("lanechange-output", new Option_FileName());
295 oc.addDescription("lanechange-output", "Output", TL("Record lane changes and their motivations for all vehicles into FILE"));
296
297 oc.doRegister("lanechange-output.started", new Option_Bool(false));
298 oc.addDescription("lanechange-output.started", "Output", TL("Record start of lane change manoeuvres"));
299
300 oc.doRegister("lanechange-output.ended", new Option_Bool(false));
301 oc.addDescription("lanechange-output.ended", "Output", TL("Record end of lane change manoeuvres"));
302
303 oc.doRegister("lanechange-output.xy", new Option_Bool(false));
304 oc.addDescription("lanechange-output.xy", "Output", TL("Record coordinates of lane change manoeuvres"));
305
306 oc.doRegister("stop-output", new Option_FileName());
307 oc.addDescription("stop-output", "Output", TL("Record stops and loading/unloading of passenger and containers for all vehicles into FILE"));
308 oc.doRegister("stop-output.write-unfinished", new Option_Bool(false));
309 oc.addDescription("stop-output.write-unfinished", "Output", TL("Write stop output for stops which have not ended at simulation end"));
310
311 oc.doRegister("collision-output", new Option_FileName());
312 oc.addDescription("collision-output", "Output", TL("Write collision information into FILE"));
313
314 oc.doRegister("edgedata-output", new Option_FileName());
315 oc.addDescription("edgedata-output", "Output", TL("Write aggregated traffic statistics for all edges into FILE"));
316 oc.doRegister("lanedata-output", new Option_FileName());
317 oc.addDescription("lanedata-output", "Output", TL("Write aggregated traffic statistics for all lanes into FILE"));
318
319 oc.doRegister("statistic-output", new Option_FileName());
320 oc.addSynonyme("statistic-output", "statistics-output");
321 oc.addDescription("statistic-output", "Output", TL("Write overall statistics into FILE"));
322
323 oc.doRegister("deadlock-output", new Option_FileName());
324 oc.addDescription("deadlock-output", "Output", TL("Write reports on deadlocks FILE"));
325
326#ifdef _DEBUG
327 oc.doRegister("movereminder-output", new Option_FileName());
328 oc.addDescription("movereminder-output", "Output", TL("Save movereminder states of selected vehicles into FILE"));
329 oc.doRegister("movereminder-output.vehicles", new Option_StringVector());
330 oc.addDescription("movereminder-output.vehicles", "Output", TL("List of vehicle ids which shall save their movereminder states"));
331#endif
332
333 oc.doRegister("save-state.times", new Option_StringVector());
334 oc.addDescription("save-state.times", "Output", TL("Use TIME[] as times at which a network state written"));
335 oc.doRegister("save-state.period", new Option_String("-1", "TIME"));
336 oc.addDescription("save-state.period", "Output", TL("save state repeatedly after TIME period"));
337 oc.doRegister("save-state.period.keep", new Option_Integer(0));
338 oc.addDescription("save-state.period.keep", "Output", TL("Keep only the last INT periodic state files"));
339 oc.doRegister("save-state.prefix", new Option_FileName(StringVector({ "state" })));
340 oc.addDescription("save-state.prefix", "Output", TL("Prefix for network states"));
341 oc.doRegister("save-state.suffix", new Option_String(".xml.gz"));
342 oc.addDescription("save-state.suffix", "Output", TL("Suffix for network states (.xml.gz or .xml)"));
343 oc.doRegister("save-state.files", new Option_FileName());
344 oc.addDescription("save-state.files", "Output", TL("Files for network states"));
345 oc.doRegister("save-state.rng", new Option_Bool(false));
346 oc.addDescription("save-state.rng", "Output", TL("Save random number generator states"));
347 oc.doRegister("save-state.transportables", new Option_Bool(false));
348 oc.addDescription("save-state.transportables", "Output", TL("Save person and container states (experimental)"));
349 oc.doRegister("save-state.constraints", new Option_Bool(false));
350 oc.addDescription("save-state.constraints", "Output", TL("Save rail signal constraints"));
351 oc.doRegister("save-state.precision", new Option_Integer(2));
352 oc.addDescription("save-state.precision", "Output", TL("Write internal state values with the given precision (default 2)"));
353
354 // register the simulation settings
355 oc.doRegister("begin", 'b', new Option_String("0", "TIME"));
356 oc.addDescription("begin", "Time", TL("Defines the begin time in seconds; The simulation starts at this time"));
357
358 oc.doRegister("end", 'e', new Option_String("-1", "TIME"));
359 oc.addDescription("end", "Time", TL("Defines the end time in seconds; The simulation ends at this time"));
360
361 oc.doRegister("step-length", new Option_String("1", "TIME"));
362 oc.addDescription("step-length", "Time", TL("Defines the step duration in seconds"));
363
364 oc.doRegister("step-method.ballistic", new Option_Bool(false));
365 oc.addDescription("step-method.ballistic", "Processing", TL("Whether to use ballistic method for the positional update of vehicles (default is a semi-implicit Euler method)."));
366
367 oc.doRegister("extrapolate-departpos", new Option_Bool(false));
368 oc.addDescription("extrapolate-departpos", "Processing", TL("Whether vehicles that depart between simulation steps should extrapolate the depart position"));
369
370 oc.doRegister("threads", new Option_Integer(1));
371 oc.addDescription("threads", "Processing", TL("Defines the number of threads for parallel simulation"));
372
373 oc.doRegister("lateral-resolution", new Option_Float(-1));
374 oc.addDescription("lateral-resolution", "Processing", TL("Defines the resolution in m when handling lateral positioning within a lane (with -1 all vehicles drive at the center of their lane"));
375
376 // register the processing options
377 oc.doRegister("route-steps", 's', new Option_String("200", "TIME"));
378 oc.addDescription("route-steps", "Processing", TL("Load routes for the next number of seconds ahead"));
379
380 oc.doRegister("no-internal-links", new Option_Bool(false));
381 oc.addDescription("no-internal-links", "Processing", TL("Disable (junction) internal links"));
382
383 oc.doRegister("ignore-junction-blocker", new Option_String("-1", "TIME"));
384 oc.addDescription("ignore-junction-blocker", "Processing", TL("Ignore vehicles which block the junction after they have been standing for SECONDS (-1 means never ignore)"));
385
386 oc.doRegister("ignore-route-errors", new Option_Bool(false));
387 oc.addDescription("ignore-route-errors", "Processing", TL("Do not check whether routes are connected"));
388
389 oc.doRegister("ignore-accidents", new Option_Bool(false));
390 oc.addDescription("ignore-accidents", "Processing", TL("Do not check whether accidents occur"));
391
392 oc.doRegister("collision.action", new Option_String("teleport"));
393 oc.addDescription("collision.action", "Processing", TL("How to deal with collisions: [none,warn,teleport,remove]"));
394
395 oc.doRegister("intermodal-collision.action", new Option_String("warn"));
396 oc.addDescription("intermodal-collision.action", "Processing", TL("How to deal with collisions between vehicle and pedestrian: [none,warn,teleport,remove]"));
397
398 oc.doRegister("collision.stoptime", new Option_String("0", "TIME"));
399 oc.addDescription("collision.stoptime", "Processing", TL("Let vehicle stop for TIME before performing collision.action (except for action 'none')"));
400
401 oc.doRegister("intermodal-collision.stoptime", new Option_String("0", "TIME"));
402 oc.addDescription("intermodal-collision.stoptime", "Processing", TL("Let vehicle stop for TIME before performing intermodal-collision.action (except for action 'none')"));
403
404 oc.doRegister("collision.check-junctions", new Option_Bool(false));
405 oc.addDescription("collision.check-junctions", "Processing", TL("Enables collisions checks on junctions"));
406
407 oc.doRegister("collision.check-junctions.mingap", new Option_Float(0));
408 oc.addDescription("collision.check-junctions.mingap", "Processing", TL("Increase or decrease sensitivity for junction collision check"));
409
410 oc.doRegister("collision.mingap-factor", new Option_Float(-1));
411 oc.addDescription("collision.mingap-factor", "Processing", TL("Sets the fraction of minGap that must be maintained to avoid collision detection. If a negative value is given, the carFollowModel parameter is used"));
412
413 oc.doRegister("keep-after-arrival", new Option_String("0", "TIME"));
414 oc.addDescription("keep-after-arrival", "Processing", TL("After a vehicle arrives, keep it in memory for the given TIME (for TraCI access)"));
415
416 oc.doRegister("max-num-vehicles", new Option_Integer(-1));
417 oc.addDescription("max-num-vehicles", "Processing", TL("Delay vehicle insertion to stay within the given maximum number"));
418
419 oc.doRegister("max-num-persons", new Option_Integer(-1));
420 oc.addDescription("max-num-persons", "Processing", TL("Delay person insertion to stay within the given maximum number"));
421
422 oc.doRegister("max-num-teleports", new Option_Integer(-1));
423 oc.addDescription("max-num-teleports", "Processing", TL("Abort the simulation if the given maximum number of teleports is exceeded"));
424
425 oc.doRegister("scale", new Option_Float(1.));
426 oc.addDescription("scale", "Processing", TL("Scale demand by the given factor (by discarding or duplicating vehicles)"));
427
428 oc.doRegister("scale-suffix", new Option_String("."));
429 oc.addDescription("scale-suffix", "Processing", TL("Suffix to be added when creating ids for cloned vehicles"));
430
431 oc.doRegister("time-to-teleport", new Option_String("300", "TIME"));
432 oc.addDescription("time-to-teleport", "Processing", TL("Specify how long a vehicle may wait until being teleported, defaults to 300, non-positive values disable teleporting"));
433
434 oc.doRegister("time-to-teleport.highways", new Option_String("0", "TIME"));
435 oc.addDescription("time-to-teleport.highways", "Processing", TL("The waiting time after which vehicles on a fast road (speed > 69km/h) are teleported if they are on a non-continuing lane"));
436
437 oc.doRegister("time-to-teleport.highways.min-speed", new Option_Float(69 / 3.6));
438 oc.addDescription("time-to-teleport.highways.min-speed", "Processing", TL("The waiting time after which vehicles on a fast road (default: speed > 69km/h) are teleported if they are on a non-continuing lane"));
439
440 oc.doRegister("time-to-teleport.disconnected", new Option_String("-1", "TIME"));
441 oc.addDescription("time-to-teleport.disconnected", "Processing", TL("The waiting time after which vehicles with a disconnected route are teleported. Negative values disable teleporting"));
442
443 oc.doRegister("time-to-teleport.remove", new Option_Bool(false));
444 oc.addDescription("time-to-teleport.remove", "Processing", TL("Whether vehicles shall be removed after waiting too long instead of being teleported"));
445
446 oc.doRegister("time-to-teleport.remove-constraint", new Option_Bool(false));
447 oc.addDescription("time-to-teleport.remove-constraint", "Processing", TL("Whether rail-signal-constraint based deadlocks shall be cleared by removing a constraint"));
448
449 oc.doRegister("time-to-teleport.ride", new Option_String("-1", "TIME"));
450 oc.addDescription("time-to-teleport.ride", "Processing", TL("The waiting time after which persons / containers waiting for a pickup are teleported. Negative values disable teleporting"));
451
452 oc.doRegister("time-to-teleport.bidi", new Option_String("-1", "TIME"));
453 oc.addDescription("time-to-teleport.bidi", "Processing", TL("The waiting time after which vehicles on bidirectional edges are teleported"));
454
455 oc.doRegister("time-to-teleport.railsignal-deadlock", new Option_String("-1", "TIME"));
456 oc.addDescription("time-to-teleport.railsignal-deadlock", "Processing", TL("The waiting time after which vehicles in a rail-signal based deadlock are teleported"));
457
458 oc.doRegister("waiting-time-memory", new Option_String("100", "TIME"));
459 oc.addDescription("waiting-time-memory", "Processing", TL("Length of time interval, over which accumulated waiting time is taken into account (default is 100s.)"));
460
461 oc.doRegister("startup-wait-threshold", new Option_String("2", "TIME"));
462 oc.addDescription("startup-wait-threshold", "Processing", TL("Minimum consecutive waiting time before applying startupDelay"));
463
464 oc.doRegister("max-depart-delay", new Option_String("-1", "TIME"));
465 oc.addDescription("max-depart-delay", "Processing", TL("How long vehicles wait for departure before being skipped, defaults to -1 which means vehicles are never skipped"));
466
467 oc.doRegister("sloppy-insert", new Option_Bool(false));
468 oc.addDescription("sloppy-insert", "Processing", TL("Whether insertion on an edge shall not be repeated in same step once failed"));
469
470 oc.doRegister("eager-insert", new Option_Bool(false));
471 oc.addDescription("eager-insert", "Processing", TL("Whether each vehicle is checked separately for insertion on an edge"));
472
473 oc.doRegister("emergency-insert", new Option_Bool(false));
474 oc.addDescription("emergency-insert", "Processing", TL("Allow inserting a vehicle in a situation which requires emergency braking"));
475
476 oc.doRegister("insertion-checks", new Option_String("all"));
477 oc.addDescription("insertion-checks", "Processing", TL("Override default value for vehicle attribute insertionChecks"));
478
479 oc.doRegister("random-depart-offset", new Option_String("0", "TIME"));
480 oc.addDescription("random-depart-offset", "Processing", TL("Each vehicle receives a random offset to its depart value drawn uniformly from [0, TIME]"));
481
482 oc.doRegister("lanechange.duration", new Option_String("0", "TIME"));
483 oc.addDescription("lanechange.duration", "Processing", TL("Duration of a lane change maneuver (default 0)"));
484
485 oc.doRegister("lanechange.overtake-right", new Option_Bool(false));
486 oc.addDescription("lanechange.overtake-right", "Processing", TL("Whether overtaking on the right on motorways is permitted"));
487
488 oc.doRegister("tls.all-off", new Option_Bool(false));
489 oc.addDescription("tls.all-off", "Processing", TL("Switches off all traffic lights."));
490
491 oc.doRegister("tls.actuated.show-detectors", new Option_Bool(false));
492 oc.addDescription("tls.actuated.show-detectors", "Processing", TL("Sets default visibility for actuation detectors"));
493
494 oc.doRegister("tls.actuated.jam-threshold", new Option_Float(-1));
495 oc.addDescription("tls.actuated.jam-threshold", "Processing", TL("Sets default jam-threshold parameter for all actuation detectors"));
496
497 oc.doRegister("tls.actuated.detector-length", new Option_Float(0));
498 oc.addDescription("tls.actuated.detector-length", "Processing", TL("Sets default detector length parameter for all actuation detectors"));
499
500 oc.doRegister("tls.delay_based.detector-range", new Option_Float(100));
501 oc.addDescription("tls.delay_based.detector-range", "Processing", TL("Sets default range for detecting delayed vehicles"));
502
503 oc.doRegister("tls.yellow.min-decel", new Option_Float(3.0));
504 oc.addDescription("tls.yellow.min-decel", "Processing", TL("Minimum deceleration when braking at yellow"));
505
506 oc.doRegister("railsignal-moving-block", new Option_Bool(false));
507 oc.addDescription("railsignal-moving-block", "Processing", TL("Let railsignals operate in moving-block mode by default"));
508
509 oc.doRegister("railsignal.max-block-length", new Option_Float(2e4));
510 oc.addDescription("railsignal.max-block-length", "Processing", TL("Do not build blocks longer than FLOAT and issue a warning instead"));
511
512 oc.doRegister("railsignal.default-classes", new Option_StringVector(StringVector({"rail", "rail_fast", "rail_electric", "rail_urban"})));
513 oc.addDescription("railsignal.default-classes", "Processing", TL("List vehicle classes that uses block-based insertion checks even when the network has no rail signals for them"));
514
515 oc.doRegister("time-to-impatience", new Option_String("180", "TIME"));
516 oc.addDescription("time-to-impatience", "Processing", TL("Specify how long a vehicle may wait until impatience grows from 0 to 1, defaults to 300, non-positive values disable impatience growth"));
517
518 oc.doRegister("default.action-step-length", new Option_Float(0.0));
519 oc.addDescription("default.action-step-length", "Processing", TL("Length of the default interval length between action points for the car-following and lane-change models (in seconds). If not specified, the simulation step-length is used per default. Vehicle- or VType-specific settings override the default. Must be a multiple of the simulation step-length."));
520
521 oc.doRegister("default.carfollowmodel", new Option_String("Krauss"));
522 oc.addDescription("default.carfollowmodel", "Processing", TL("Select default car following model (Krauss, IDM, ...)"));
523 oc.addSynonyme("default.carfollowmodel", "carfollow.model");
524
525 oc.doRegister("default.speeddev", new Option_Float(-1));
526 oc.addDescription("default.speeddev", "Processing", TL("Select default speed deviation. A negative value implies vClass specific defaults (0.1 for the default passenger class)"));
527
528 oc.doRegister("default.emergencydecel", new Option_String("default"));
529 oc.addDescription("default.emergencydecel", "Processing", TL("Select default emergencyDecel value among ('decel', 'default', FLOAT) which sets the value either to the same as the deceleration value, a vClass-class specific default or the given FLOAT in m/s^2"));
530
531 oc.doRegister("overhead-wire.solver", new Option_Bool(true));
532 oc.addDescription("overhead-wire.solver", "Processing", TL("Use Kirchhoff's laws for solving overhead wire circuit"));
533
534 oc.doRegister("overhead-wire.recuperation", new Option_Bool(true));
535 oc.addDescription("overhead-wire.recuperation", "Processing", TL("Enable recuperation from the vehicle equipped with elecHybrid device into the overhead wire."));
536
537 oc.doRegister("overhead-wire.substation-current-limits", new Option_Bool(true));
538 oc.addDescription("overhead-wire.substation-current-limits", "Processing", TL("Enable current limits of traction substation during solving the overhead wire electrical circuit."));
539
540 oc.doRegister("emergencydecel.warning-threshold", new Option_Float(1));
541 oc.addDescription("emergencydecel.warning-threshold", "Processing", TL("Sets the fraction of emergency decel capability that must be used to trigger a warning."));
542
543 oc.doRegister("parking.maneuver", new Option_Bool(false));
544 oc.addDescription("parking.maneuver", "Processing", TL("Whether parking simulation includes maneuvering time and associated lane blocking"));
545
546 oc.doRegister("use-stop-ended", new Option_Bool(false));
547 oc.addDescription("use-stop-ended", "Processing", TL("Override stop until times with stop ended times when given"));
548
549 oc.doRegister("use-stop-started", new Option_Bool(false));
550 oc.addDescription("use-stop-started", "Processing", TL("Override stop arrival times with stop started times when given"));
551
552 // pedestrian model
553 oc.doRegister("pedestrian.model", new Option_String("striping"));
554 oc.addDescription("pedestrian.model", "Processing", TL("Select among pedestrian models ['nonInteracting', 'striping', 'remote']"));
555
556 oc.doRegister("pedestrian.timegap-crossing", new Option_Float(2.));
557 oc.addDescription("pedestrian.timegap-crossing", "Processing", TL("Minimal acceptable gap (in seconds) between two vehicles before starting to cross"));
558
559 oc.doRegister("pedestrian.striping.stripe-width", new Option_Float(0.64));
560 oc.addDescription("pedestrian.striping.stripe-width", "Processing", TL("Width of parallel stripes for segmenting a sidewalk (meters) for use with model 'striping'"));
561
562 oc.doRegister("pedestrian.striping.dawdling", new Option_Float(0.2));
563 oc.addDescription("pedestrian.striping.dawdling", "Processing", TL("Factor for random slow-downs [0,1] for use with model 'striping'"));
564
565 oc.doRegister("pedestrian.striping.mingap-to-vehicle", new Option_Float(0.25));
566 oc.addDescription("pedestrian.striping.mingap-to-vehicle", "Processing", TL("Minimal gap / safety buffer (in meters) from a pedestrian to another vehicle for use with model 'striping'"));
567
568 oc.doRegister("pedestrian.striping.jamtime", new Option_String("300", "TIME"));
569 oc.addDescription("pedestrian.striping.jamtime", "Processing", TL("Time in seconds after which pedestrians start squeezing through a jam when using model 'striping' (non-positive values disable squeezing)"));
570 oc.doRegister("pedestrian.striping.jamtime.crossing", new Option_String("10", "TIME"));
571 oc.addDescription("pedestrian.striping.jamtime.crossing", "Processing", TL("Time in seconds after which pedestrians start squeezing through a jam while on a pedestrian crossing when using model 'striping' (non-positive values disable squeezing)"));
572 oc.doRegister("pedestrian.striping.jamtime.narrow", new Option_String("1", "TIME"));
573 oc.addDescription("pedestrian.striping.jamtime.narrow", "Processing", TL("Time in seconds after which pedestrians start squeezing through a jam while on a narrow lane when using model 'striping'"));
574
575 oc.doRegister("pedestrian.striping.jamfactor", new Option_Float(0.25));
576 oc.addDescription("pedestrian.striping.jamfactor", "Processing", TL("Factor for reducing speed of pedestrian in jammed state"));
577
578 oc.doRegister("pedestrian.striping.reserve-oncoming", new Option_Float(0.0));
579 oc.addDescription("pedestrian.striping.reserve-oncoming", "Processing", TL("Fraction of stripes to reserve for oncoming pedestrians"));
580
581 oc.doRegister("pedestrian.striping.reserve-oncoming.junctions", new Option_Float(0.34));
582 oc.addDescription("pedestrian.striping.reserve-oncoming.junctions", "Processing", TL("Fraction of stripes to reserve for oncoming pedestrians on crossings and walkingareas"));
583
584 oc.doRegister("pedestrian.striping.reserve-oncoming.max", new Option_Float(1.28));
585 oc.addDescription("pedestrian.striping.reserve-oncoming.max", "Processing", TL("Maximum width in m to reserve for oncoming pedestrians"));
586
587 oc.doRegister("pedestrian.striping.legacy-departposlat", new Option_Bool(false));
588 oc.addDescription("pedestrian.striping.legacy-departposlat", "Processing", TL("Interpret departPosLat for walks in legacy style"));
589
590 oc.doRegister("pedestrian.striping.walkingarea-detail", new Option_Integer(4));
591 oc.addDescription("pedestrian.striping.walkingarea-detail", "Processing", TL("Generate INT intermediate points to smooth out lanes within the walkingarea"));
592
593#ifdef JPS_VERSION
594 oc.doRegister("pedestrian.jupedsim.step-length", new Option_String("0.01", "TIME"));
595 oc.addDescription("pedestrian.jupedsim.step-length", "Processing", TL("The update interval of the JuPedSim simulation (in seconds)"));
596 oc.doRegister("pedestrian.jupedsim.exit-tolerance", new Option_Float(1.));
597 oc.addDescription("pedestrian.jupedsim.exit-tolerance", "Processing", TL("The distance to accept the JuPedSim arrival point (in meters)"));
598 oc.doRegister("pedestrian.jupedsim.model", new Option_String("CollisionFreeSpeed"));
599 oc.addDescription("pedestrian.jupedsim.model", "Processing", TL("The submodel to use in JuPedSim ('CollisionFreeSpeed', 'CollisionFreeSpeedV2', 'GeneralizedCentrifugalForce', 'SocialForce')"));
600 oc.doRegister("pedestrian.jupedsim.strength-neighbor-repulsion", new Option_Float(8.));
601 oc.addDescription("pedestrian.jupedsim.strength-neighbor-repulsion", "Processing", TL("The neighbor repulsion strength of the JuPedSim model"));
602 oc.doRegister("pedestrian.jupedsim.range-neighbor-repulsion", new Option_Float(.1));
603 oc.addDescription("pedestrian.jupedsim.range-neighbor-repulsion", "Processing", TL("The neighbor repulsion range of the JuPedSim model (in meters)"));
604 oc.doRegister("pedestrian.jupedsim.strength-geometry-repulsion", new Option_Float(5.));
605 oc.addDescription("pedestrian.jupedsim.strength-geometry-repulsion", "Processing", TL("The geometry repulsion strength of the JuPedSim model"));
606 oc.doRegister("pedestrian.jupedsim.range-geometry-repulsion", new Option_Float(.02));
607 oc.addDescription("pedestrian.jupedsim.range-geometry-repulsion", "Processing", TL("The geometry repulsion range of the JuPedSim model (in meters)"));
608 oc.doRegister("pedestrian.jupedsim.wkt", new Option_FileName());
609 oc.addDescription("pedestrian.jupedsim.wkt", "Output", TL("The filename to output the JuPedSim network as WKT"));
610 oc.doRegister("pedestrian.jupedsim.wkt.geo", new Option_Bool(false));
611 oc.addDescription("pedestrian.jupedsim.wkt.geo", "Output", TL("Whether to output JuPedSim network as WKT using geo-coordinates (lon/lat)"));
612 oc.doRegister("pedestrian.jupedsim.py", new Option_FileName());
613 oc.addDescription("pedestrian.jupedsim.py", "Output", TL("The filename to output the JuPedSim setup as Python script"));
614#endif
615
616 oc.doRegister("ride.stop-tolerance", new Option_Float(10.));
617 oc.addDescription("ride.stop-tolerance", "Processing", TL("Tolerance to apply when matching pedestrian and vehicle positions on boarding at individual stops"));
618
619 oc.doRegister("mapmatch.distance", new Option_Float(100));
620 oc.addDescription("mapmatch.distance", "Processing", TL("Maximum distance when mapping input coordinates (fromXY etc.) to the road network"));
621
622 oc.doRegister("mapmatch.junctions", new Option_Bool(false));
623 oc.addDescription("mapmatch.junctions", "Processing", TL("Match positions to junctions instead of edges"));
624
625 oc.doRegister("mapmatch.taz", new Option_Bool(false));
626 oc.addDescription("mapmatch.taz", "Processing", TL("Match positions to taz instead of edges"));
627
628 // generic routing options
629 oc.doRegister("routing-algorithm", new Option_String("dijkstra"));
630 oc.addDescription("routing-algorithm", "Routing",
631 "Select among routing algorithms ['dijkstra', 'astar', 'CH', 'CHWrapper']");
632
633 oc.doRegister("weights.random-factor", new Option_Float(1.));
634 oc.addDescription("weights.random-factor", "Routing", TL("Edge weights for routing are dynamically disturbed by a random factor drawn uniformly from [1,FLOAT)"));
635
636 oc.doRegister("weights.minor-penalty", new Option_Float(1.5));
637 oc.addDescription("weights.minor-penalty", "Routing", TL("Apply the given time penalty when computing minimum routing costs for minor-link internal lanes"));
638
639 oc.doRegister("weights.tls-penalty", new Option_Float(0));
640 oc.addDescription("weights.tls-penalty", "Routing", TL("Apply scaled travel time penalties based on green split when computing minimum routing costs for internal lanes at traffic lights"));
641
642 oc.doRegister("weights.turnaround-penalty", new Option_Float(5.0));
643 oc.addDescription("weights.turnaround-penalty", "Processing", TL("Apply the given time penalty when computing routing costs for turnaround internal lanes"));
644
645 oc.doRegister("weights.priority-factor", new Option_Float(0));
646 oc.addDescription("weights.priority-factor", "Routing", TL("Consider edge priorities in addition to travel times, weighted by factor"));
647
648 oc.doRegister("weights.separate-turns", new Option_Float(0));
649 oc.addDescription("weights.separate-turns", "Routing", TL("Distinguish travel time by turn direction and shift a fraction of the estimated time loss ahead of the intersection onto the internal edges"));
650
651 oc.doRegister("astar.all-distances", new Option_FileName());
652 oc.addDescription("astar.all-distances", "Routing", TL("Initialize lookup table for astar from the given file (generated by marouter --all-pairs-output)"));
653
654 oc.doRegister("astar.landmark-distances", new Option_FileName());
655 oc.addDescription("astar.landmark-distances", "Routing", TL("Initialize lookup table for astar ALT-variant from the given file"));
656
657 oc.doRegister("persontrip.walkfactor", new Option_Float(double(0.75)));
658 oc.addDescription("persontrip.walkfactor", "Routing", TL("Use FLOAT as a factor on pedestrian maximum speed during intermodal routing"));
659
660 oc.doRegister("persontrip.walk-opposite-factor", new Option_Float(1.0));
661 oc.addDescription("persontrip.walk-opposite-factor", "Processing", TL("Use FLOAT as a factor on walking speed against vehicle traffic direction"));
662
663 oc.doRegister("persontrip.transfer.car-walk", new Option_StringVector(StringVector({ "parkingAreas" })));
664 oc.addDescription("persontrip.transfer.car-walk", "Routing",
665 "Where are mode changes from car to walking allowed (possible values: 'parkingAreas', 'ptStops', 'allJunctions' and combinations)");
666
667 oc.doRegister("persontrip.transfer.taxi-walk", new Option_StringVector());
668 oc.addDescription("persontrip.transfer.taxi-walk", "Routing", TL("Where taxis can drop off customers ('allJunctions, 'ptStops')"));
669
670 oc.doRegister("persontrip.transfer.walk-taxi", new Option_StringVector());
671 oc.addDescription("persontrip.transfer.walk-taxi", "Routing", TL("Where taxis can pick up customers ('allJunctions, 'ptStops')"));
672
673 oc.doRegister("persontrip.default.group", new Option_String());
674 oc.addDescription("persontrip.default.group", "Routing", TL("When set, trips between the same origin and destination will share a taxi by default"));
675
676 oc.doRegister("persontrip.taxi.waiting-time", new Option_String("300", "TIME"));
677 oc.addDescription("persontrip.taxi.waiting-time", "Routing", TL("Estimated time for taxi pickup"));
678
679 oc.doRegister("persontrip.ride-public-line", new Option_Bool(false));
680 oc.addDescription("persontrip.ride-public-line", "Routing", TL("Only use the intended public transport line rather than any alternative line that stops at the destination"));
681
682 oc.doRegister("railway.max-train-length", new Option_Float(1000.0));
683 oc.addDescription("railway.max-train-length", "Routing", TL("Use FLOAT as a maximum train length when initializing the railway router"));
684
685 oc.doRegister("replay-rerouting", new Option_Bool(false));
686 oc.addDescription("replay-rerouting", "Routing", TL("Replay exact rerouting sequence from vehroute-output"));
687
688 // devices
689 oc.addOptionSubTopic("Emissions");
690 oc.doRegister("emissions.volumetric-fuel", new Option_Bool(false));
691 oc.addDescription("emissions.volumetric-fuel", "Emissions", TL("Return fuel consumption values in (legacy) unit l instead of mg"));
692
693 oc.doRegister("phemlight-path", new Option_FileName(StringVector({ "./PHEMlight/" })));
694 oc.addDescription("phemlight-path", "Emissions", TL("Determines where to load PHEMlight definitions from"));
695
696 oc.doRegister("phemlight-year", new Option_Integer(0));
697 oc.addDescription("phemlight-year", "Emissions", TL("Enable fleet age modelling with the given reference year in PHEMlight5"));
698
699 oc.doRegister("phemlight-temperature", new Option_Float(INVALID_DOUBLE));
700 oc.addDescription("phemlight-temperature", "Emissions", TL("Set ambient temperature to correct NOx emissions in PHEMlight5"));
701
702 oc.addOptionSubTopic("Communication");
703 oc.addOptionSubTopic("Battery");
705
706 // register report options
707 oc.doRegister("duration-log.disable", new Option_Bool(false));
708 oc.addSynonyme("duration-log.disable", "no-duration-log", false);
709 oc.addDescription("duration-log.disable", "Report", TL("Disable performance reports for individual simulation steps"));
710
711 oc.doRegister("duration-log.statistics", 't', new Option_Bool(false));
712 oc.addDescription("duration-log.statistics", "Report", TL("Enable statistics on vehicle trips"));
713
714 oc.doRegister("no-step-log", new Option_Bool(false));
715 oc.addDescription("no-step-log", "Report", TL("Disable console output of current simulation step"));
716
717 oc.doRegister("step-log.period", new Option_Integer(100));
718 oc.addDescription("step-log.period", "Report", TL("Number of simulation steps between step-log outputs"));
719
720 //remote port 0 if not used
721 oc.addOptionSubTopic("TraCI Server");
722 oc.doRegister("remote-port", new Option_Integer(0));
723 oc.addDescription("remote-port", "TraCI Server", TL("Enables TraCI Server if set"));
724 oc.doRegister("num-clients", new Option_Integer(1));
725 oc.addDescription("num-clients", "TraCI Server", TL("Expected number of connecting clients"));
726
727 oc.addOptionSubTopic("Mesoscopic");
728 oc.doRegister("mesosim", new Option_Bool(false));
729 oc.addDescription("mesosim", "Mesoscopic", TL("Enables mesoscopic simulation"));
730 oc.doRegister("meso-edgelength", new Option_Float(98.0f));
731 oc.addDescription("meso-edgelength", "Mesoscopic", TL("Length of an edge segment in mesoscopic simulation"));
732 oc.doRegister("meso-tauff", new Option_String("1.13", "TIME"));
733 oc.addDescription("meso-tauff", "Mesoscopic", TL("Factor for calculating the net free-free headway time"));
734 oc.doRegister("meso-taufj", new Option_String("1.13", "TIME"));
735 oc.addDescription("meso-taufj", "Mesoscopic", TL("Factor for calculating the net free-jam headway time"));
736 oc.doRegister("meso-taujf", new Option_String("1.73", "TIME"));
737 oc.addDescription("meso-taujf", "Mesoscopic", TL("Factor for calculating the jam-free headway time"));
738 oc.doRegister("meso-taujj", new Option_String("1.4", "TIME"));
739 oc.addDescription("meso-taujj", "Mesoscopic", TL("Factor for calculating the jam-jam headway time"));
740 oc.doRegister("meso-jam-threshold", new Option_Float(-1));
741 oc.addDescription("meso-jam-threshold", "Mesoscopic",
742 "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)");
743 oc.doRegister("meso-multi-queue", new Option_Bool(true));
744 oc.addDescription("meso-multi-queue", "Mesoscopic", TL("Enable multiple queues at edge ends"));
745 oc.doRegister("meso-lane-queue", new Option_Bool(false));
746 oc.addDescription("meso-lane-queue", "Mesoscopic", TL("Enable separate queues for every lane"));
747 oc.doRegister("meso-ignore-lanes-by-vclass", new Option_StringVector(StringVector({ "pedestrian", "bicycle" })));
748 oc.addDescription("meso-ignore-lanes-by-vclass", "Mesoscopic", TL("Do not build queues (or reduce capacity) for lanes allowing only the given vclasses"));
749 oc.addSynonyme("meso-ignore-lanes-by-vclass", "meso.ignore-lanes.by-vclass");
750 oc.doRegister("meso-junction-control", new Option_Bool(false));
751 oc.addDescription("meso-junction-control", "Mesoscopic", TL("Enable mesoscopic traffic light and priority junction handling"));
752 oc.doRegister("meso-junction-control.limited", new Option_Bool(false));
753 oc.addDescription("meso-junction-control.limited", "Mesoscopic",
754 "Enable mesoscopic traffic light and priority junction handling for saturated links. This prevents faulty traffic lights from hindering flow in low-traffic situations");
755 oc.doRegister("meso-tls-penalty", new Option_Float(0));
756 oc.addDescription("meso-tls-penalty", "Mesoscopic",
757 "Apply scaled travel time penalties when driving across tls controlled junctions based on green split instead of checking actual phases");
758 oc.doRegister("meso-tls-flow-penalty", new Option_Float(0));
759 oc.addDescription("meso-tls-flow-penalty", "Mesoscopic",
760 "Apply scaled headway penalties when driving across tls controlled junctions based on green split instead of checking actual phases");
761 oc.doRegister("meso-minor-penalty", new Option_String("0", "TIME"));
762 oc.addDescription("meso-minor-penalty", "Mesoscopic",
763 "Apply fixed time penalty when driving across a minor link. When using --meso-junction-control.limited, the penalty is not applied whenever limited control is active.");
764 oc.doRegister("meso-overtaking", new Option_Bool(false));
765 oc.addDescription("meso-overtaking", "Mesoscopic", TL("Enable mesoscopic overtaking"));
766 oc.doRegister("meso-recheck", new Option_String("0", "TIME"));
767 oc.addDescription("meso-recheck", "Mesoscopic", TL("Time interval for rechecking insertion into the next segment after failure"));
768
769 // add rand options
771 oc.doRegister("thread-rngs", new Option_Integer(64));
772 oc.addDescription("thread-rngs", "Random Number",
773 "Number of pre-allocated random number generators to ensure repeatable multi-threaded simulations (should be at least the number of threads for repeatable simulations).");
774
775 // add GUI options
776 // the reason that we include them in vanilla sumo as well is to make reusing config files easy
777 oc.addOptionSubTopic("GUI Only");
778 oc.doRegister("gui-settings-file", 'g', new Option_FileName());
779 oc.addDescription("gui-settings-file", "GUI Only", TL("Load visualisation settings from FILE"));
780
781 oc.doRegister("quit-on-end", 'Q', new Option_Bool(false));
782 oc.addDescription("quit-on-end", "GUI Only", TL("Quits the GUI when the simulation stops"));
783
784 oc.doRegister("game", 'G', new Option_Bool(false));
785 oc.addDescription("game", "GUI Only", TL("Start the GUI in gaming mode"));
786
787 oc.doRegister("game.mode", new Option_String("tls"));
788 oc.addDescription("game.mode", "GUI Only", TL("Select the game type ('tls', 'drt')"));
789
790 oc.doRegister("start", 'S', new Option_Bool(false));
791 oc.addDescription("start", "GUI Only", TL("Start the simulation after loading"));
792
793 oc.doRegister("delay", 'd', new Option_Float(0.0));
794 oc.addDescription("delay", "GUI Only", TL("Use FLOAT in ms as delay between simulation steps"));
795
796 oc.doRegister("breakpoints", 'B', new Option_StringVector());
797 oc.addDescription("breakpoints", "GUI Only", TL("Use TIME[] as times when the simulation should halt"));
798
799 oc.doRegister("edgedata-files", new Option_FileName());
800 oc.addSynonyme("edgedata-files", "data-files");
801 oc.addDescription("edgedata-files", "GUI Only", TL("Load edge/lane weights for visualization from FILE"));
802
803 oc.doRegister("alternative-net-file", 'N', new Option_FileName());
804 oc.addDescription("alternative-net-file", "GUI Only", TL("Load a secondary road network for abstract visualization from FILE"));
805
806 oc.doRegister("selection-file", new Option_FileName());
807 oc.addDescription("selection-file", "GUI Only", TL("Load pre-selected elements from FILE"));
808
809 oc.doRegister("demo", 'D', new Option_Bool(false));
810 oc.addDescription("demo", "GUI Only", TL("Restart the simulation after ending (demo mode)"));
811
812 oc.doRegister("disable-textures", 'T', new Option_Bool(false));
813 oc.addDescription("disable-textures", "GUI Only", TL("Do not load background pictures"));
814
815 oc.doRegister("registry-viewport", new Option_Bool(false));
816 oc.addDescription("registry-viewport", "GUI Only", TL("Load current viewport from registry"));
817
818 oc.doRegister("window-size", new Option_StringVector());
819 oc.addDescription("window-size", "GUI Only", TL("Create initial window with the given x,y size"));
820
821 oc.doRegister("window-pos", new Option_StringVector());
822 oc.addDescription("window-pos", "GUI Only", TL("Create initial window at the given x,y position"));
823
824 oc.doRegister("tracker-interval", new Option_String("1", "TIME"));
825 oc.addDescription("tracker-interval", "GUI Only", TL("The aggregation period for value tracker windows"));
826
827#ifdef HAVE_OSG
828 oc.doRegister("osg-view", new Option_Bool(false));
829 oc.addDescription("osg-view", "GUI Only", TL("Start with an OpenSceneGraph view instead of the regular 2D view"));
830#endif
831
832 // gui testing
833 oc.doRegister("gui-testing", new Option_Bool(false));
834 oc.addDescription("gui-testing", "GUI Only", TL("Enable overlay for screen recognition"));
835
836 // gui testing - debug
837 oc.doRegister("gui-testing-debug", new Option_Bool(false));
838 oc.addDescription("gui-testing-debug", "GUI Only", TL("Enable output messages during GUI-Testing"));
839
840 // gui testing - settings output
841 oc.doRegister("gui-testing.setting-output", new Option_FileName());
842 oc.addDescription("gui-testing.setting-output", "GUI Only", TL("Save gui settings in the given settings output file"));
843}
844
845
846void
848 // standard outputs
849 OutputDevice::createDeviceByOption("netstate-dump", "netstate", "netstate_file.xsd");
850 OutputDevice::createDeviceByOption("summary-output", "summary", "summary_file.xsd");
851 OutputDevice::createDeviceByOption("person-summary-output", "personSummary", "person_summary_file.xsd");
852 OutputDevice::createDeviceByOption("tripinfo-output", "tripinfos", "tripinfo_file.xsd");
853
854 //extended
855 OutputDevice::createDeviceByOption("fcd-output", "fcd-export", "fcd_file.xsd");
856 OutputDevice::createDeviceByOption("emission-output", "emission-export", "emission_file.xsd");
857 OutputDevice::createDeviceByOption("battery-output", "battery-export", "battery_file.xsd");
858 if (OptionsCont::getOptions().getBool("elechybrid-output.aggregated")) {
859 // RICE_TODO: Add path to elechybrid-output.aggregated xsd file
860 OutputDevice::createDeviceByOption("elechybrid-output", "elecHybrid-export-aggregated", "\" recuperationEnabled=\"" + toString(MSGlobals::gOverheadWireRecuperation));
861 }
862 //OutputDevice::createDeviceByOption("elecHybrid-output", "elecHybrid-export");
863 OutputDevice::createDeviceByOption("chargingstations-output", "chargingstations-export");
864 OutputDevice::createDeviceByOption("overheadwiresegments-output", "overheadWireSegments-export");
865 OutputDevice::createDeviceByOption("substations-output", "substations-export");
866 OutputDevice::createDeviceByOption("full-output", "full-export", "full_file.xsd");
867 OutputDevice::createDeviceByOption("queue-output", "queue-export", "queue_file.xsd");
868 OutputDevice::createDeviceByOption("amitran-output", "trajectories", "amitran/trajectories.xsd\" timeStepSize=\"" + toString(STEPS2MS(DELTA_T)));
869
870 //OutputDevice::createDeviceByOption("vtk-output", "vtk-export");
871 OutputDevice::createDeviceByOption("link-output", "link-output");
872 OutputDevice::createDeviceByOption("railsignal-block-output", "railsignal-block-output");
873 OutputDevice::createDeviceByOption("railsignal-vehicle-output", "railsignal-vehicle-output");
874 OutputDevice::createDeviceByOption("bt-output", "bt-output");
875 OutputDevice::createDeviceByOption("lanechange-output", "lanechanges");
876 OutputDevice::createDeviceByOption("stop-output", "stops", "stopinfo_file.xsd");
877 OutputDevice::createDeviceByOption("collision-output", "collisions", "collision_file.xsd");
878 OutputDevice::createDeviceByOption("statistic-output", "statistics", "statistic_file.xsd");
879 OutputDevice::createDeviceByOption("deadlock-output", "additional", "additional_file.xsd");
880
881#ifdef _DEBUG
882 OutputDevice::createDeviceByOption("movereminder-output", "movereminder-output");
883#endif
884
887}
888
889
890bool
893 bool ok = true;
894 if (!oc.isSet("net-file") && oc.isDefault("remote-port")) {
895 WRITE_ERROR(TL("No network file (-n) specified."));
896 ok = false;
897 }
898 if (oc.getFloat("scale") < 0.) {
899 WRITE_ERROR(TL("Invalid scaling factor."));
900 ok = false;
901 }
902 if (oc.getBool("vehroute-output.exit-times") && !oc.isSet("vehroute-output")) {
903 WRITE_ERROR(TL("A vehroute-output file is needed for exit times."));
904 ok = false;
905 }
906 if (oc.isSet("gui-settings-file") &&
907 oc.getString("gui-settings-file") != "" &&
908 !oc.isUsableFileList("gui-settings-file")) {
909 ok = false;
910 }
911 if (oc.getBool("demo") && oc.isDefault("start")) {
912 oc.setDefault("start", "true");
913 }
914 if (oc.getBool("demo") && oc.getBool("quit-on-end")) {
915 WRITE_ERROR(TL("You can either restart or quit on end."));
916 ok = false;
917 }
918 if (oc.getBool("meso-junction-control.limited") && !oc.getBool("meso-junction-control")) {
919 if (!oc.isDefault("meso-junction-control")) {
920 WRITE_WARNING(TL("The option 'meso-junction-control.limited' implies 'meso-junction-control'."))
921 }
922 oc.setDefault("meso-junction-control", "true");
923 }
924 if (oc.getBool("mesosim")) {
925 if (oc.isDefault("pedestrian.model")) {
926 oc.setDefault("pedestrian.model", "nonInteracting");
927 }
928 }
929 if (string2time(oc.getString("device.fcd.begin")) < 0) {
930 oc.setDefault("device.fcd.begin", oc.getString("begin"));
931 }
932 if (string2time(oc.getString("device.emissions.begin")) < 0) {
933 oc.setDefault("device.emissions.begin", oc.getString("begin"));
934 }
935 const SUMOTime begin = string2time(oc.getString("begin"));
936 const SUMOTime end = string2time(oc.getString("end"));
937 if (begin < 0) {
938 WRITE_ERROR(TL("The begin time should not be negative."));
939 ok = false;
940 }
941 // DELTA_T not yet initialized
942 const SUMOTime deltaT = MAX2((SUMOTime)1, string2time(oc.getString("step-length")));
943 if (begin < TIME2STEPS(1)) {
944 checkStepLengthMultiple(begin, " for begin", deltaT);
945 }
946 if (end != string2time("-1")) {
947 if (end < begin) {
948 WRITE_ERROR(TL("The end time should be after the begin time."));
949 ok = false;
950 }
951 }
952 if (string2time(oc.getString("step-length")) <= 0) {
953 WRITE_ERROR(TL("the minimum step-length is 0.001."));
954 ok = false;
955 }
956 const SUMOTime period = string2time(oc.getString("device.fcd.period"));
957 if (period > 0) {
958 checkStepLengthMultiple(period, " for device.fcd.period", deltaT);
959 }
960 const SUMOTime statePeriod = string2time(oc.getString("save-state.period"));
961 if (statePeriod > 0) {
962 checkStepLengthMultiple(statePeriod, " for save-state.period", deltaT);
963 }
964 for (const std::string& timeStr : oc.getStringVector("save-state.times")) {
965 try {
966 const SUMOTime saveT = string2time(timeStr);
967 if (end > 0 && saveT >= end) {
968 WRITE_WARNINGF(TL("The save-state time=% will not be used before simulation end at %."), timeStr, time2string(end));
969 } else {
970 checkStepLengthMultiple(saveT, " for save-state.times", deltaT, begin);
971 }
972 } catch (ProcessError& e) {
973 WRITE_ERROR("Invalid time '" + timeStr + "' for option 'save-state.times'. " + e.what());
974 ok = false;
975 }
976 }
977
978#ifdef _DEBUG
979 if (oc.isSet("movereminder-output.vehicles") && !oc.isSet("movereminder-output")) {
980 WRITE_ERROR(TL("option movereminder-output.vehicles requires option movereminder-output to be set"));
981 ok = false;
982 }
983#endif
984 if (oc.getBool("sloppy-insert")) {
985 WRITE_WARNING(TL("The option 'sloppy-insert' is deprecated, because it is now activated by default, see the new option 'eager-insert'."));
986 }
987 if (string2time(oc.getString("lanechange.duration")) > 0 && oc.getFloat("lateral-resolution") > 0) {
988 WRITE_ERROR(TL("Only one of the options 'lanechange.duration' or 'lateral-resolution' may be given."));
989 ok = false;
990 }
991 if (oc.getBool("mesosim") && (oc.getFloat("lateral-resolution") > 0 || string2time(oc.getString("lanechange.duration")) > 0)) {
992 WRITE_ERROR(TL("Sublane dynamics are not supported by mesoscopic simulation."));
993 ok = false;
994 }
995 if (oc.getBool("ignore-accidents")) {
996 WRITE_WARNING(TL("The option 'ignore-accidents' is deprecated. Use 'collision.action none' instead."));
997 }
998 if (oc.getBool("duration-log.statistics") && oc.isDefault("verbose")) {
999 oc.setDefault("verbose", "true");
1000 }
1001 if (oc.isDefault("precision") && string2time(oc.getString("step-length")) % 10 != 0) {
1002 oc.setDefault("precision", "3");
1003 }
1004 if (oc.isDefault("tracker-interval") && !oc.isDefault("step-length")) {
1005 oc.setDefault("tracker-interval", oc.getString("step-length"));
1006 }
1007 if (oc.getBool("tripinfo-output.write-undeparted")) {
1008 if (!oc.isDefault("tripinfo-output.write-unfinished") && !oc.getBool("tripinfo-output.write-unfinished")) {
1009 WRITE_WARNING(TL("The option tripinfo-output.write-undeparted implies tripinfo-output.write-unfinished."));
1010 }
1011 oc.setDefault("tripinfo-output.write-unfinished", "true");
1012 }
1013 if (oc.getInt("precision") > 2) {
1014 if (oc.isDefault("netstate-dump.precision")) {
1015 oc.setDefault("netstate-dump.precision", toString(oc.getInt("precision")));
1016 }
1017 if (oc.isDefault("emission-output.precision")) {
1018 oc.setDefault("emission-output.precision", toString(oc.getInt("precision")));
1019 }
1020 if (oc.isDefault("battery-output.precision")) {
1021 oc.setDefault("battery-output.precision", toString(oc.getInt("precision")));
1022 }
1023 if (oc.isDefault("elechybrid-output.precision")) {
1024 oc.setDefault("elechybrid-output.precision", toString(oc.getInt("precision")));
1025 }
1026 if (oc.isDefault("substations-output.precision")) {
1027 oc.setDefault("substations-output.precision", toString(oc.getInt("precision")));
1028 }
1029 }
1030 if (!SUMOXMLDefinitions::CarFollowModels.hasString(oc.getString("carfollow.model"))) {
1031 WRITE_ERRORF(TL("Unknown model '%' for option 'carfollow.model'."), oc.getString("carfollow.model"));
1032 ok = false;
1033 }
1034 if (oc.isSet("default.emergencydecel")) {
1035 const std::string val = oc.getString("default.emergencydecel");
1036 if (val != "default" && val != "decel") {
1037 try {
1039 } catch (NumberFormatException&) {
1040 WRITE_ERRORF(TL("Invalid value '%' for option 'default.emergencydecel'. Must be a FLOAT or 'default' or 'decel'."), val);
1041 ok = false;
1042 }
1043 }
1044 }
1045
1046 if (oc.isSet("time-to-teleport.railsignal-deadlock")) {
1047 SUMOTime t1 = string2time(oc.getString("time-to-teleport"));
1048 SUMOTime t2 = string2time(oc.getString("time-to-teleport.railsignal-deadlock"));
1049 if (t1 > 0 && t2 > 0 && t1 <= t2) {
1050 WRITE_WARNINGF(TL("Railsignal-deadlock will not be detected because time-to-teleport (%) is lower than time-to-teleport.railsignal-deadlock (%)."), time2string(t1), time2string(t2));
1051 }
1052 }
1053
1054 oc.doRegister("", new Option_String("-1", "TIME"));
1055
1056
1057 if (oc.getFloat("delay") < 0.0) {
1058 WRITE_ERROR(TL("You need a non-negative delay."));
1059 ok = false;
1060 }
1061 for (const std::string& val : oc.getStringVector("breakpoints")) {
1062 try {
1063 string2time(val);
1064 } catch (ProcessError& e) {
1065 WRITE_ERROR("Invalid time '" + val + "' for option 'breakpoints'. " + e.what());
1066 ok = false;
1067 }
1068 }
1069#ifndef HAVE_FOX
1070 if (oc.getInt("threads") > 1) {
1071 WRITE_ERROR(TL("Parallel simulation is only possible when compiled with Fox."));
1072 ok = false;
1073 }
1074#endif
1075 if (oc.getInt("threads") < 1) {
1076 WRITE_ERROR(TL("You need at least one thread."));
1077 ok = false;
1078 }
1079 if (oc.getInt("threads") > oc.getInt("thread-rngs")) {
1080 WRITE_WARNING(TL("Number of threads exceeds number of thread-rngs. Simulation runs with the same seed may produce different results."));
1081 }
1082 if (oc.getString("game.mode") != "tls" && oc.getString("game.mode") != "drt") {
1083 WRITE_ERROR(TL("game.mode must be one of ['tls', 'drt']"));
1084 ok = false;
1085 }
1086
1087 if (oc.isSet("persontrip.transfer.car-walk")) {
1088 for (const std::string& opt : OptionsCont::getOptions().getStringVector("persontrip.transfer.car-walk")) {
1089 if (opt != "parkingAreas" && opt != "ptStops" && opt != "allJunctions") {
1090 WRITE_ERRORF(TL("Invalid transfer option '%'. Must be one of 'parkingAreas', 'ptStops' or 'allJunctions'."), opt);
1091 ok = false;
1092 }
1093 }
1094 }
1095 if (!oc.isDefault("weights.random-factor") && (oc.isSet("astar.all-distances") || oc.isSet("astar.landmark-distances"))) {
1096 WRITE_WARNING(TL("The option --weights.random-factor should not be used together with astar and precomputed distances."));
1097 }
1098
1099#ifdef JPS_VERSION
1100 const std::string pedestrianJPSModel = oc.getString("pedestrian.jupedsim.model");
1101 const std::vector<std::string> allowedPedestrianJPSModels = {"CollisionFreeSpeed", "CollisionFreeSpeedV2", "GeneralizedCentrifugalForce", "SocialForce"};
1102 if (std::find(allowedPedestrianJPSModels.begin(), allowedPedestrianJPSModels.end(), pedestrianJPSModel) == allowedPedestrianJPSModels.end()) {
1103 WRITE_ERRORF(TL("Invalid JuPedSim model '%'. Must be one of 'CollisionFreeSpeed', 'CollisionFreeSpeedV2', 'GeneralizedCentrifugalForce' or 'SocialForce'."), pedestrianJPSModel);
1104 ok = false;
1105 }
1106#endif
1107
1108 ok &= MSDevice::checkOptions(oc);
1109 ok &= SystemFrame::checkOptions(oc);
1110
1111 return ok;
1112}
1113
1114
1115void
1117 // pre-initialise the network
1118 // set whether empty edges shall be printed on dump
1119 MSGlobals::gOmitEmptyEdgesOnDump = !oc.getBool("netstate-dump.empty-edges");
1120 // set whether internal lanes shall be used
1121 MSGlobals::gUsingInternalLanes = !oc.getBool("no-internal-links");
1122 MSGlobals::gIgnoreJunctionBlocker = string2time(oc.getString("ignore-junction-blocker")) < 0 ?
1123 std::numeric_limits<SUMOTime>::max() : string2time(oc.getString("ignore-junction-blocker"));
1124 // set the grid lock time
1125 MSGlobals::gTimeToGridlock = string2time(oc.getString("time-to-teleport")) < 0 ? 0 : string2time(oc.getString("time-to-teleport"));
1126 MSGlobals::gTimeToImpatience = string2time(oc.getString("time-to-impatience"));
1127 MSGlobals::gTimeToGridlockHighways = string2time(oc.getString("time-to-teleport.highways")) < 0 ? 0 : string2time(oc.getString("time-to-teleport.highways"));
1128 MSGlobals::gGridlockHighwaysSpeed = oc.getFloat("time-to-teleport.highways.min-speed");
1129 MSGlobals::gTimeToTeleportDisconnected = string2time(oc.getString("time-to-teleport.disconnected"));
1130 MSGlobals::gTimeToTeleportBidi = string2time(oc.getString("time-to-teleport.bidi"));
1131 MSGlobals::gTimeToTeleportRSDeadlock = string2time(oc.getString("time-to-teleport.railsignal-deadlock"));
1132 MSGlobals::gRemoveGridlocked = oc.getBool("time-to-teleport.remove");
1133 MSGlobals::gCheck4Accidents = !oc.getBool("ignore-accidents");
1134 MSGlobals::gCheckRoutes = !oc.getBool("ignore-route-errors");
1135 MSGlobals::gEmergencyInsert = oc.getBool("emergency-insert");
1136 MSGlobals::gWeightsSeparateTurns = oc.getFloat("weights.separate-turns");
1137 MSGlobals::gStartupWaitThreshold = string2time(oc.getString("startup-wait-threshold"));
1138 MSGlobals::gLaneChangeDuration = string2time(oc.getString("lanechange.duration"));
1139 MSGlobals::gLateralResolution = oc.getFloat("lateral-resolution");
1141 MSGlobals::gStateLoaded = oc.isSet("load-state");
1142 MSGlobals::gUseMesoSim = oc.getBool("mesosim");
1143 MSGlobals::gMesoLimitedJunctionControl = oc.getBool("meso-junction-control.limited");
1146 }
1147 MSGlobals::gWaitingTimeMemory = string2time(oc.getString("waiting-time-memory"));
1149 MSGlobals::gOverheadWireSolver = oc.getBool("overhead-wire.solver");
1150 MSGlobals::gOverheadWireRecuperation = oc.getBool("overhead-wire.recuperation");
1151 MSGlobals::gOverheadWireCurrentLimits = oc.getBool("overhead-wire.substation-current-limits");
1153 MSGlobals::gMaxRailSignalBlockLength = oc.getFloat("railsignal.max-block-length");
1154
1156
1157 DELTA_T = string2time(oc.getString("step-length"));
1158
1159 const bool integrationMethodSet = !oc.isDefault("step-method.ballistic");
1160 const bool actionStepLengthSet = !oc.isDefault("default.action-step-length");
1161 MSGlobals::gSemiImplicitEulerUpdate = !oc.getBool("step-method.ballistic");
1162 // Init default value for gActionStepLength
1163 if (MSGlobals::gSemiImplicitEulerUpdate && actionStepLengthSet && !integrationMethodSet) {
1164 WRITE_MESSAGE(TL("Integration method was set to 'ballistic', since a default action step length was specified."));
1166 }
1167 double givenDefaultActionStepLength = oc.getFloat("default.action-step-length");
1169
1170 const std::string defaultEmergencyDecelOption = OptionsCont::getOptions().getString("default.emergencydecel");
1171 if (defaultEmergencyDecelOption == "default") {
1173 } else if (defaultEmergencyDecelOption == "decel") {
1175 } else {
1176 // value already checked in checkOptions()
1177 MSGlobals::gDefaultEmergencyDecel = StringUtils::toDouble(defaultEmergencyDecelOption);
1178 }
1179 MSGlobals::gNumSimThreads = oc.getInt("threads");
1180 MSGlobals::gNumThreads = MAX2(MSGlobals::gNumSimThreads, oc.getInt("device.rerouting.threads"));
1181
1182 MSGlobals::gEmergencyDecelWarningThreshold = oc.getFloat("emergencydecel.warning-threshold");
1183 MSGlobals::gMinorPenalty = oc.getFloat("weights.minor-penalty");
1184 MSGlobals::gTLSPenalty = oc.getFloat("weights.tls-penalty");
1185 MSGlobals::gTurnaroundPenalty = oc.getFloat("weights.turnaround-penalty");
1186
1187 MSGlobals::gModelParkingManoeuver = oc.getBool("parking.maneuver");
1188
1189 MSGlobals::gStopTolerance = oc.getFloat("ride.stop-tolerance");
1190 MSGlobals::gTLSYellowMinDecel = oc.getFloat("tls.yellow.min-decel");
1191 MSGlobals::gUseStopEnded = oc.getBool("use-stop-ended");
1192 MSGlobals::gUseStopStarted = oc.getBool("use-stop-started");
1193
1194 SVCPermissions defaultClasses = 0;
1195 for (const std::string& vClassName : oc.getStringVector("railsignal.default-classes")) {
1196 defaultClasses |= parseVehicleClasses(vClassName);
1197 }
1199
1200#ifdef _DEBUG
1201 if (oc.isSet("movereminder-output")) {
1202 MSBaseVehicle::initMoveReminderOutput(oc);
1203 }
1204#endif
1205}
1206
1207
1208/****************************************************************************/
long long int SUMOTime
Definition GUI.h:36
#define WRITE_WARNINGF(...)
Definition MsgHandler.h:288
#define WRITE_ERRORF(...)
Definition MsgHandler.h:297
#define WRITE_MESSAGE(msg)
Definition MsgHandler.h:289
#define WRITE_ERROR(msg)
Definition MsgHandler.h:296
#define WRITE_WARNING(msg)
Definition MsgHandler.h:287
#define TL(string)
Definition MsgHandler.h:305
std::vector< std::string > StringVector
Definition of a vector of strings.
Definition Option.h:42
SUMOTime DELTA_T
Definition SUMOTime.cpp:38
bool checkStepLengthMultiple(const SUMOTime t, const std::string &error, SUMOTime deltaT, SUMOTime begin)
check if given SUMOTime is multiple of the step length
Definition SUMOTime.cpp:158
SUMOTime string2time(const std::string &r)
convert string to SUMOTime
Definition SUMOTime.cpp:46
std::string time2string(SUMOTime t, bool humanReadable)
convert SUMOTime to string (independently of global format setting)
Definition SUMOTime.cpp:91
#define TIME2STEPS(x)
Definition SUMOTime.h:57
#define STEPS2MS(x)
Definition SUMOTime.h:59
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DEFAULT
const int VTYPEPARS_DEFAULT_EMERGENCYDECEL_DECEL
SVCPermissions parseVehicleClasses(const std::string &allowedS)
Parses the given definition of allowed vehicle classes into the given containers Deprecated classes g...
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
const double INVALID_DOUBLE
invalid double
Definition StdDefs.h:64
T MAX2(T a, T b)
Definition StdDefs.h:82
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition ToString.h:46
static void initGlobalOptions(const OptionsCont &oc)
init global model parameters
static void init()
Static intialization.
static void insertOptions(OptionsCont &oc)
Inserts options for building devices.
Definition MSDevice.cpp:75
static bool checkOptions(OptionsCont &oc)
check device-specific options
Definition MSDevice.cpp:104
static void buildStreams()
Builds the streams used possibly by the simulation.
Definition MSFrame.cpp:847
static void setMSGlobals(OptionsCont &oc)
Sets the global microsim-options.
Definition MSFrame.cpp:1116
static void fillOptions()
Inserts options used by the simulation into the OptionsCont-singleton.
Definition MSFrame.cpp:61
static bool checkOptions()
Checks the set options.
Definition MSFrame.cpp:891
static bool gOverheadWireCurrentLimits
Definition MSGlobals.h:127
static double gStopTolerance
The tolerance to apply when matching waiting persons and vehicles.
Definition MSGlobals.h:168
static SUMOTime gTimeToTeleportDisconnected
Definition MSGlobals.h:66
static bool gModelParkingManoeuver
whether parking simulation includes manoeuver time and any associated lane blocking
Definition MSGlobals.h:162
static bool gUseMesoSim
Definition MSGlobals.h:106
static bool gUseStopStarted
Definition MSGlobals.h:134
static double gMinorPenalty
(minimum) time penalty for passing a minor link when routing
Definition MSGlobals.h:155
static SUMOTime gTimeToGridlockHighways
Definition MSGlobals.h:60
static bool gCheckRoutes
Definition MSGlobals.h:91
static double gGridlockHighwaysSpeed
Definition MSGlobals.h:63
static double gWeightsSeparateTurns
Whether turning specific weights are estimated (and how much)
Definition MSGlobals.h:177
static double gTLSPenalty
scaled (minimum) time penalty for passing a tls link when routing
Definition MSGlobals.h:157
static SUMOTime gStartupWaitThreshold
The minimum waiting time before applying startupDelay.
Definition MSGlobals.h:180
static bool gOverheadWireRecuperation
Definition MSGlobals.h:124
static bool gRemoveGridlocked
Definition MSGlobals.h:75
static double gDefaultEmergencyDecel
encoding of the string-option default.emergencydecel
Definition MSGlobals.h:130
static double gTLSYellowMinDecel
The minimum deceleration at a yellow traffic light (only overruled by emergencyDecel)
Definition MSGlobals.h:171
static SUMOTime gTimeToTeleportBidi
Definition MSGlobals.h:69
static double gTurnaroundPenalty
(minimum) time penalty for passing a turnaround link when routing
Definition MSGlobals.h:159
static bool gOverheadWireSolver
Definition MSGlobals.h:121
static double gLateralResolution
Definition MSGlobals.h:100
static bool gSemiImplicitEulerUpdate
Definition MSGlobals.h:53
static int gInsertionChecks
The default value for insertion checks.
Definition MSGlobals.h:186
static SUMOTime gTimeToTeleportRSDeadlock
Definition MSGlobals.h:72
static SUMOTime gTimeToImpatience
Definition MSGlobals.h:78
static bool gStateLoaded
Information whether a state has been loaded.
Definition MSGlobals.h:103
static bool gCheck4Accidents
Definition MSGlobals.h:88
static double gMaxRailSignalBlockLength
The maximum length of a rail signal block.
Definition MSGlobals.h:189
static bool gEmergencyInsert
Definition MSGlobals.h:94
static int gNumSimThreads
how many threads to use for simulation
Definition MSGlobals.h:146
static bool gOmitEmptyEdgesOnDump
Information whether empty edges shall be written on dump.
Definition MSGlobals.h:49
static SUMOTime gIgnoreJunctionBlocker
Definition MSGlobals.h:85
static bool gSublane
whether sublane simulation is enabled (sublane model or continuous lanechanging)
Definition MSGlobals.h:165
static SUMOTime gLaneChangeDuration
Definition MSGlobals.h:97
static bool gMesoLimitedJunctionControl
Definition MSGlobals.h:109
static bool gUseStopEnded
whether the simulation should replay previous stop times
Definition MSGlobals.h:133
static SUMOTime gActionStepLength
default value for the interval between two action points for MSVehicle (defaults to DELTA_T)
Definition MSGlobals.h:118
static SUMOTime gWaitingTimeMemory
length of memory for waiting times (in millisecs)
Definition MSGlobals.h:115
static double gEmergencyDecelWarningThreshold
threshold for warning about strong deceleration
Definition MSGlobals.h:152
static bool gUsingInternalLanes
Information whether the simulation regards internal lanes.
Definition MSGlobals.h:81
static int gNumThreads
how many threads to use
Definition MSGlobals.h:149
static SUMOTime gTimeToGridlock
Definition MSGlobals.h:57
static void initCollisionOptions(const OptionsCont &oc)
Definition MSLane.cpp:4477
static void initSignalized(SVCPermissions svc)
static void init()
Static intialization.
Definition MSStopOut.cpp:43
A storage for options typed value containers)
Definition OptionsCont.h:89
void addDescription(const std::string &name, const std::string &subtopic, const std::string &description)
Adds a description for an option.
bool isSet(const std::string &name, bool failOnNonExistant=true) const
Returns the information whether the named option is set.
double getFloat(const std::string &name) const
Returns the double-value of the named option (only for Option_Float)
int getInt(const std::string &name) const
Returns the int-value of the named option (only for Option_Integer)
std::string getString(const std::string &name) const
Returns the string-value of the named option (only for Option_String)
void addSynonyme(const std::string &name1, const std::string &name2, bool isDeprecated=false)
Adds a synonyme for an options name (any order)
bool isDefault(const std::string &name) const
Returns the information whether the named option has still the default value.
bool setDefault(const std::string &name, const std::string &value)
Sets the given value for the named option as new default value.
void doRegister(const std::string &name, Option *o)
Adds an option under the given name.
void addOptionSubTopic(const std::string &topic)
Adds an option subtopic.
bool getBool(const std::string &name) const
Returns the boolean-value of the named option (only for Option_Bool)
const StringVector & getStringVector(const std::string &name) const
Returns the list of string-value of the named option (only for Option_StringVector)
void addXMLDefault(const std::string &name, const std::string &xmlRoot="")
Adds an XML root element to handle by default. The special root "" denotes the default handler.
static OptionsCont & getOptions()
Retrieves the options.
bool isUsableFileList(const std::string &name) const
Checks whether the named option is usable as a file list (with at least a single file)
void addCallExample(const std::string &example, const std::string &desc)
Add a call example.
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 void insertRandOptions(OptionsCont &oc)
Initialises the given options container with random number options.
static int parseInsertionChecks(const std::string &value)
parses insertion checks
static SUMOTime processActionStepLength(double given)
Checks and converts given value for the action step length from seconds to miliseconds assuring it be...
static StringBijection< SumoXMLTag > CarFollowModels
car following models
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
static bool checkOptions(OptionsCont &oc)
checks shared options and sets StdDefs
static void addConfigurationOptions(OptionsCont &oc)
Adds configuration options to the given container.
static void addReportOptions(OptionsCont &oc)
Adds reporting options to the given container.