Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSStopOut.h
Go to the documentation of this file.
1/****************************************************************************/
2// Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.dev/sumo
3// Copyright (C) 2001-2026 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/****************************************************************************/
18// Ouput information about planned vehicle stop
19/****************************************************************************/
20#pragma once
21#include <config.h>
22
23#include <map>
26
27
28// ===========================================================================
29// class declarations
30// ===========================================================================
31class OutputDevice;
32class SUMOVehicle;
33class MSStop;
34
35
36// ===========================================================================
37// class definitions
38// ===========================================================================
48class MSStopOut {
49public:
50
53 static void init();
54
55 static bool active() {
56 return myInstance != 0;
57 }
58
59 static void cleanup();
60
62 return myInstance;
63 }
64
67
69 virtual ~MSStopOut();
70
71 void stopBlocked(const SUMOVehicle* veh, SUMOTime time);
72 void stopNotStarted(const SUMOVehicle* veh);
73 void stopStarted(const SUMOVehicle* veh, int numPersons, int numContainers, SUMOTime time);
74
75 void loadedPersons(const SUMOVehicle* veh, int n);
76 void unloadedPersons(const SUMOVehicle* veh, int n);
77
78 void loadedContainers(const SUMOVehicle* veh, int n);
79 void unloadedContainers(const SUMOVehicle* veh, int n);
80
81 void stopEnded(const SUMOVehicle* veh, const MSStop& stop, bool simEnd = false);
82
85
86private:
87 struct StopInfo {
88
89 StopInfo(SUMOTime now, int numPersons, int numContainers) :
90 blockTime(now),
91 initialNumPersons(numPersons),
94 initialNumContainers(numContainers),
97 }
98
106 };
107
108 std::map<const SUMOVehicle*, StopInfo, ComparatorNumericalIdLess> myStopped;
109
111
113
116
119
120
121};
long long int SUMOTime
Definition GUI.h:36
Realises dumping the complete network state.
Definition MSStopOut.h:48
virtual ~MSStopOut()
Destructor.
Definition MSStopOut.cpp:63
void stopBlocked(const SUMOVehicle *veh, SUMOTime time)
Definition MSStopOut.cpp:67
void loadedContainers(const SUMOVehicle *veh, int n)
MSStopOut(const MSStopOut &)
Invalidated copy constructor.
static void init()
Static intialization.
Definition MSStopOut.cpp:44
std::map< const SUMOVehicle *, StopInfo, ComparatorNumericalIdLess > myStopped
Definition MSStopOut.h:108
static bool active()
Definition MSStopOut.h:55
void stopNotStarted(const SUMOVehicle *veh)
Definition MSStopOut.cpp:76
MSStopOut & operator=(const MSStopOut &)
Invalidated assignment operator.
void unloadedPersons(const SUMOVehicle *veh, int n)
static void cleanup()
Definition MSStopOut.cpp:51
void stopStarted(const SUMOVehicle *veh, int numPersons, int numContainers, SUMOTime time)
Definition MSStopOut.cpp:83
void generateOutputForUnfinished()
generate output for vehicles which are still stopped at simulation end
static MSStopOut * getInstance()
Definition MSStopOut.h:61
void unloadedContainers(const SUMOVehicle *veh, int n)
void stopEnded(const SUMOVehicle *veh, const MSStop &stop, bool simEnd=false)
static MSStopOut * myInstance
Definition MSStopOut.h:112
OutputDevice & myDevice
Definition MSStopOut.h:110
void loadedPersons(const SUMOVehicle *veh, int n)
Definition MSStopOut.cpp:97
Static storage of an output device and its base (abstract) implementation.
Representation of a vehicle.
Definition SUMOVehicle.h:63
StopInfo(SUMOTime now, int numPersons, int numContainers)
Definition MSStopOut.h:89