Eclipse SUMO - Simulation of Urban MObility
Command_SaveTLSProgram.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 /****************************************************************************/
14 // Writes the switch times of a tls into a file when the tls switches
15 /****************************************************************************/
16 #ifndef Command_SaveTLSProgram_h
17 #define Command_SaveTLSProgram_h
18 
19 
20 // ===========================================================================
21 // included modules
22 // ===========================================================================
23 #include <config.h>
24 
25 #include <string>
26 #include <map>
27 #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 private:
81  void writeCurrent();
82 
83 private:
86 
89 
91  std::vector<MSPhaseDefinition> myPreviousStates;
92 
94  std::string myPreviousProgramID;
95 
97  std::string myTLSID;
98 
99 private:
102 
105 
106 };
107 
108 
109 #endif
110 
111 /****************************************************************************/
112 
Command_SaveTLSProgram::Command_SaveTLSProgram
Command_SaveTLSProgram(const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od)
Constructor.
Definition: Command_SaveTLSProgram.cpp:33
MSTLLogicControl.h
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
Command_SaveTLSProgram::execute
SUMOTime execute(SUMOTime currentTime)
Writes the state of the tls if a change occurred.
Definition: Command_SaveTLSProgram.cpp:47
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
Command_SaveTLSProgram::myTLSID
std::string myTLSID
Storage for the tls ID (needed in destructor)
Definition: Command_SaveTLSProgram.h:97
Command_SaveTLSProgram
Writes the switch times of a tls into a file when the tls switches.
Definition: Command_SaveTLSProgram.h:48
Command_SaveTLSProgram::myLogics
const MSTLLogicControl::TLSLogicVariants & myLogics
The traffic light logic to use.
Definition: Command_SaveTLSProgram.h:88
Command_SaveTLSProgram::myPreviousProgramID
std::string myPreviousProgramID
Storage for prior sub-id.
Definition: Command_SaveTLSProgram.h:94
Command_SaveTLSProgram::Command_SaveTLSProgram
Command_SaveTLSProgram(const Command_SaveTLSProgram &)
Invalidated copy constructor.
Command_SaveTLSProgram::~Command_SaveTLSProgram
~Command_SaveTLSProgram()
Destructor.
Definition: Command_SaveTLSProgram.cpp:41
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:55
Command_SaveTLSProgram::writeCurrent
void writeCurrent()
Write the current program.
Definition: Command_SaveTLSProgram.cpp:62
Command_SaveTLSProgram::operator=
Command_SaveTLSProgram & operator=(const Command_SaveTLSProgram &)
Invalidated assignment operator.
Command_SaveTLSProgram::myPreviousStates
std::vector< MSPhaseDefinition > myPreviousStates
Storage for prior state.
Definition: Command_SaveTLSProgram.h:91
Command
Base (microsim) event class.
Definition: Command.h:52
MSPhaseDefinition.h
MSTLLogicControl::TLSLogicVariants
Storage for all programs of a single tls.
Definition: MSTLLogicControl.h:85
Command_SaveTLSProgram::myOutputDevice
OutputDevice & myOutputDevice
The device to write to.
Definition: Command_SaveTLSProgram.h:85
config.h
Command.h