LCOV - code coverage report
Current view: top level - src/microsim - MSFrame.cpp (source / functions) Coverage Total Hit
Test: lcov.info Lines: 97.0 % 726 704
Test Date: 2024-11-22 15:46:21 Functions: 100.0 % 4 4

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

Generated by: LCOV version 2.0-1