Eclipse SUMO - Simulation of Urban MObility
Command_SaveTLSSwitchStates.h
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2001-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
15 // Writes the switch times of a tls into a file when the tls switches
16 /****************************************************************************/
17 #ifndef Command_SaveTLSSwitchStates_h
18 #define Command_SaveTLSSwitchStates_h
19 
20 
21 // ===========================================================================
22 // included modules
23 // ===========================================================================
24 #include <config.h>
25 
26 #include <string>
27 #include <map>
28 #include <utils/common/Command.h>
30 
31 
32 // ===========================================================================
33 // class declarations
34 // ===========================================================================
36 class OutputDevice;
37 
38 
39 // ===========================================================================
40 // class definitions
41 // ===========================================================================
49 public:
56  OutputDevice& od);
57 
58 
61 
62 
65 
76  SUMOTime execute(SUMOTime currentTime);
78 
79 
80 private:
83 
86 
88  std::string myPreviousState;
89 
91  std::string myPreviousProgramID;
92 
93 
94 private:
97 
100 
101 };
102 
103 
104 #endif
105 
106 /****************************************************************************/
107 
Command_SaveTLSSwitchStates::myPreviousState
std::string myPreviousState
Storage for prior state.
Definition: Command_SaveTLSSwitchStates.h:88
MSTLLogicControl.h
Command_SaveTLSSwitchStates::myLogics
const MSTLLogicControl::TLSLogicVariants & myLogics
The traffic light logic to use.
Definition: Command_SaveTLSSwitchStates.h:85
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates
Command_SaveTLSSwitchStates(const Command_SaveTLSSwitchStates &)
Invalidated copy constructor.
Command_SaveTLSSwitchStates::~Command_SaveTLSSwitchStates
~Command_SaveTLSSwitchStates()
Destructor.
Definition: Command_SaveTLSSwitchStates.cpp:42
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:55
Command_SaveTLSSwitchStates
Writes the switch times of a tls into a file when the tls switches.
Definition: Command_SaveTLSSwitchStates.h:48
Command_SaveTLSSwitchStates::execute
SUMOTime execute(SUMOTime currentTime)
Writes the state of the tls if a change occurred.
Definition: Command_SaveTLSSwitchStates.cpp:47
Command_SaveTLSSwitchStates::Command_SaveTLSSwitchStates
Command_SaveTLSSwitchStates(const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od)
Constructor.
Definition: Command_SaveTLSSwitchStates.cpp:34
Command
Base (microsim) event class.
Definition: Command.h:52
MSTLLogicControl::TLSLogicVariants
Storage for all programs of a single tls.
Definition: MSTLLogicControl.h:85
config.h
Command.h
Command_SaveTLSSwitchStates::myPreviousProgramID
std::string myPreviousProgramID
Storage for prior sub-id.
Definition: Command_SaveTLSSwitchStates.h:91
Command_SaveTLSSwitchStates::myOutputDevice
OutputDevice & myOutputDevice
The device to write to.
Definition: Command_SaveTLSSwitchStates.h:82
Command_SaveTLSSwitchStates::operator=
Command_SaveTLSSwitchStates & operator=(const Command_SaveTLSSwitchStates &)
Invalidated assignment operator.