Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
eclipse
GitHub Repository: eclipse/sumo
Path: blob/main/src/microsim/MSGlobals.h
185785 views
1
/****************************************************************************/
2
// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3
// Copyright (C) 2003-2025 German Aerospace Center (DLR) and others.
4
// This program and the accompanying materials are made available under the
5
// terms of the Eclipse Public License 2.0 which is available at
6
// https://www.eclipse.org/legal/epl-2.0/
7
// This Source Code may also be made available under the following Secondary
8
// Licenses when the conditions for such availability set forth in the Eclipse
9
// Public License 2.0 are satisfied: GNU General Public License, version 2
10
// or later which is available at
11
// https://www.gnu.org/licenses/old-licenses/gpl-2.0-standalone.html
12
// SPDX-License-Identifier: EPL-2.0 OR GPL-2.0-or-later
13
/****************************************************************************/
14
/// @file MSGlobals.h
15
/// @author Daniel Krajzewicz
16
/// @author Christian Roessel
17
/// @author Michael Behrisch
18
/// @author Jakob Erdmann
19
/// @date late summer 2003
20
///
21
// Some static variables for faster access
22
/****************************************************************************/
23
#pragma once
24
#include <config.h>
25
26
#include <map>
27
#include <utils/common/SUMOTime.h>
28
29
30
// ===========================================================================
31
// class declarations
32
// ===========================================================================
33
class MELoop;
34
35
36
// ===========================================================================
37
// class definitions
38
// ===========================================================================
39
/**
40
* @class MSGlobals
41
* This class holds some static variables, filled mostly with values coming
42
* from the command line or the simulation configuration file.
43
* They are stored herein to allow a faster access than from the options
44
* container.
45
*/
46
class MSGlobals {
47
public:
48
/// Information whether empty edges shall be written on dump
49
static bool gOmitEmptyEdgesOnDump;
50
51
/* Allows switching between time step integration methods
52
* "Semi-Implicit Euler" (default) and the ballistic update rule. */
53
static bool gSemiImplicitEulerUpdate;
54
55
/** Information how long the simulation shall wait until it recognizes
56
a vehicle as a grid lock participant */
57
static SUMOTime gTimeToGridlock;
58
59
/** The time to detect grid locks on highways */
60
static SUMOTime gTimeToGridlockHighways;
61
62
/** The speed threshold for gTimeToGridlockHighways */
63
static double gGridlockHighwaysSpeed;
64
65
/** The time to wait for teleport on disconected routes */
66
static SUMOTime gTimeToTeleportDisconnected;
67
68
/** The time to wait for teleport on bidi edges */
69
static SUMOTime gTimeToTeleportBidi;
70
71
/** The time to wait for teleport when rail signals cause deadlock */
72
static SUMOTime gTimeToTeleportRSDeadlock;
73
74
/** Whether gridlocked vehicles shall be removed instead of teleporting */
75
static bool gRemoveGridlocked;
76
77
/** Information how long a vehicle must wait for impatience to grow from 0 to 1 */
78
static SUMOTime gTimeToImpatience;
79
80
/// Information whether the simulation regards internal lanes
81
static bool gUsingInternalLanes;
82
83
/** Vehicles on internal lanes (even partially) with a waiting time that exceeds this threshold
84
* no longer block cross-traffic on the junction */
85
static SUMOTime gIgnoreJunctionBlocker;
86
87
/** information whether the network shall check for collisions */
88
static bool gCheck4Accidents;
89
90
/** information whether the routes shall be checked for connectivity */
91
static bool gCheckRoutes;
92
93
/** information whether dangerous insertion speeds are permitted */
94
static bool gEmergencyInsert;
95
96
/** information Duration of a lane change maneuver */
97
static SUMOTime gLaneChangeDuration;
98
99
/** Lateral resolution within a lane */
100
static double gLateralResolution;
101
102
/// Information whether a state has been loaded
103
static bool gStateLoaded;
104
105
/** Information whether mesosim shall be used */
106
static bool gUseMesoSim;
107
108
/** Information whether limited junction control shall be used */
109
static bool gMesoLimitedJunctionControl;
110
111
/// mesoscopic simulation infrastructure
112
static MELoop* gMesoNet;
113
114
/// length of memory for waiting times (in millisecs)
115
static SUMOTime gWaitingTimeMemory;
116
117
/// default value for the interval between two action points for MSVehicle (defaults to DELTA_T)
118
static SUMOTime gActionStepLength;
119
120
// whether Kirchhoff's laws are used for solving overhead wire circuit
121
static bool gOverheadWireSolver;
122
123
// whether recuperation into the overhead wire is allowed
124
static bool gOverheadWireRecuperation;
125
126
// whether traction substation current limits are taken into account when solving the overhead wire circuit
127
static bool gOverheadWireCurrentLimits;
128
129
/// encoding of the string-option default.emergencydecel
130
static double gDefaultEmergencyDecel;
131
132
/// whether the simulation should replay previous stop times
133
static bool gUseStopEnded;
134
static bool gUseStopStarted;
135
136
/// whether unit tests are being run
137
static bool gUnitTests;
138
139
/// whether the simulationLoop is in the lane changing phase
140
static bool gComputeLC;
141
142
/// whether the simulation is in the process of clearing state (MSNet::clearState)
143
static bool gClearState;
144
145
/// how many threads to use for simulation
146
static int gNumSimThreads;
147
148
/// how many threads to use
149
static int gNumThreads;
150
151
/// threshold for warning about strong deceleration
152
static double gEmergencyDecelWarningThreshold;
153
154
/// (minimum) time penalty for passing a minor link when routing
155
static double gMinorPenalty;
156
/// scaled (minimum) time penalty for passing a tls link when routing
157
static double gTLSPenalty;
158
/// (minimum) time penalty for passing a turnaround link when routing
159
static double gTurnaroundPenalty;
160
161
/// whether parking simulation includes manoeuver time and any associated lane blocking
162
static bool gModelParkingManoeuver;
163
164
/// whether sublane simulation is enabled (sublane model or continuous lanechanging)
165
static bool gSublane;
166
167
/// @brief The tolerance to apply when matching waiting persons and vehicles
168
static double gStopTolerance;
169
170
/// @brief The minimum deceleration at a yellow traffic light (only overruled by emergencyDecel)
171
static double gTLSYellowMinDecel;
172
173
/// @brief Whether lefthand-drive is being simulated
174
static bool gLefthand;
175
176
/// @brief Whether turning specific weights are estimated (and how much)
177
static double gWeightsSeparateTurns;
178
179
/// @brief The minimum waiting time before applying startupDelay
180
static SUMOTime gStartupWaitThreshold;
181
182
/// @brief Whether emission output of some type is needed (files or GUI)
183
static bool gHaveEmissions;
184
185
/// @brief The default value for insertion checks
186
static int gInsertionChecks;
187
188
/// @brief The maximum length of a rail signal block
189
static double gMaxRailSignalBlockLength;
190
};
191
192