/****************************************************************************/1// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo2// Copyright (C) 2003-2025 German Aerospace Center (DLR) and others.3// This program and the accompanying materials are made available under the4// terms of the Eclipse Public License 2.0 which is available at5// https://www.eclipse.org/legal/epl-2.0/6// This Source Code may also be made available under the following Secondary7// Licenses when the conditions for such availability set forth in the Eclipse8// Public License 2.0 are satisfied: GNU General Public License, version 29// or later which is available at10// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html11// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later12/****************************************************************************/13/// @file MSGlobals.h14/// @author Daniel Krajzewicz15/// @author Christian Roessel16/// @author Michael Behrisch17/// @author Jakob Erdmann18/// @date late summer 200319///20// Some static variables for faster access21/****************************************************************************/22#pragma once23#include <config.h>2425#include <map>26#include <utils/common/SUMOTime.h>272829// ===========================================================================30// class declarations31// ===========================================================================32class MELoop;333435// ===========================================================================36// class definitions37// ===========================================================================38/**39* @class MSGlobals40* This class holds some static variables, filled mostly with values coming41* from the command line or the simulation configuration file.42* They are stored herein to allow a faster access than from the options43* container.44*/45class MSGlobals {46public:47/// Information whether empty edges shall be written on dump48static bool gOmitEmptyEdgesOnDump;4950/* Allows switching between time step integration methods51* "Semi-Implicit Euler" (default) and the ballistic update rule. */52static bool gSemiImplicitEulerUpdate;5354/** Information how long the simulation shall wait until it recognizes55a vehicle as a grid lock participant */56static SUMOTime gTimeToGridlock;5758/** The time to detect grid locks on highways */59static SUMOTime gTimeToGridlockHighways;6061/** The speed threshold for gTimeToGridlockHighways */62static double gGridlockHighwaysSpeed;6364/** The time to wait for teleport on disconected routes */65static SUMOTime gTimeToTeleportDisconnected;6667/** The time to wait for teleport on bidi edges */68static SUMOTime gTimeToTeleportBidi;6970/** The time to wait for teleport when rail signals cause deadlock */71static SUMOTime gTimeToTeleportRSDeadlock;7273/** Whether gridlocked vehicles shall be removed instead of teleporting */74static bool gRemoveGridlocked;7576/** Information how long a vehicle must wait for impatience to grow from 0 to 1 */77static SUMOTime gTimeToImpatience;7879/// Information whether the simulation regards internal lanes80static bool gUsingInternalLanes;8182/** Vehicles on internal lanes (even partially) with a waiting time that exceeds this threshold83* no longer block cross-traffic on the junction */84static SUMOTime gIgnoreJunctionBlocker;8586/** information whether the network shall check for collisions */87static bool gCheck4Accidents;8889/** information whether the routes shall be checked for connectivity */90static bool gCheckRoutes;9192/** information whether dangerous insertion speeds are permitted */93static bool gEmergencyInsert;9495/** information Duration of a lane change maneuver */96static SUMOTime gLaneChangeDuration;9798/** Lateral resolution within a lane */99static double gLateralResolution;100101/// Information whether a state has been loaded102static bool gStateLoaded;103104/** Information whether mesosim shall be used */105static bool gUseMesoSim;106107/** Information whether limited junction control shall be used */108static bool gMesoLimitedJunctionControl;109110/// mesoscopic simulation infrastructure111static MELoop* gMesoNet;112113/// length of memory for waiting times (in millisecs)114static SUMOTime gWaitingTimeMemory;115116/// default value for the interval between two action points for MSVehicle (defaults to DELTA_T)117static SUMOTime gActionStepLength;118119// whether Kirchhoff's laws are used for solving overhead wire circuit120static bool gOverheadWireSolver;121122// whether recuperation into the overhead wire is allowed123static bool gOverheadWireRecuperation;124125// whether traction substation current limits are taken into account when solving the overhead wire circuit126static bool gOverheadWireCurrentLimits;127128/// encoding of the string-option default.emergencydecel129static double gDefaultEmergencyDecel;130131/// whether the simulation should replay previous stop times132static bool gUseStopEnded;133static bool gUseStopStarted;134135/// whether unit tests are being run136static bool gUnitTests;137138/// whether the simulationLoop is in the lane changing phase139static bool gComputeLC;140141/// whether the simulation is in the process of clearing state (MSNet::clearState)142static bool gClearState;143144/// how many threads to use for simulation145static int gNumSimThreads;146147/// how many threads to use148static int gNumThreads;149150/// threshold for warning about strong deceleration151static double gEmergencyDecelWarningThreshold;152153/// (minimum) time penalty for passing a minor link when routing154static double gMinorPenalty;155/// scaled (minimum) time penalty for passing a tls link when routing156static double gTLSPenalty;157/// (minimum) time penalty for passing a turnaround link when routing158static double gTurnaroundPenalty;159160/// whether parking simulation includes manoeuver time and any associated lane blocking161static bool gModelParkingManoeuver;162163/// whether sublane simulation is enabled (sublane model or continuous lanechanging)164static bool gSublane;165166/// @brief The tolerance to apply when matching waiting persons and vehicles167static double gStopTolerance;168169/// @brief The minimum deceleration at a yellow traffic light (only overruled by emergencyDecel)170static double gTLSYellowMinDecel;171172/// @brief Whether lefthand-drive is being simulated173static bool gLefthand;174175/// @brief Whether turning specific weights are estimated (and how much)176static double gWeightsSeparateTurns;177178/// @brief The minimum waiting time before applying startupDelay179static SUMOTime gStartupWaitThreshold;180181/// @brief Whether emission output of some type is needed (files or GUI)182static bool gHaveEmissions;183184/// @brief The default value for insertion checks185static int gInsertionChecks;186187/// @brief The maximum length of a rail signal block188static double gMaxRailSignalBlockLength;189};190191192