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-2018 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 /****************************************************************************/
16 // Writes the switch times of a tls into a file when the tls switches
17 /****************************************************************************/
18 #ifndef Command_SaveTLSSwitchStates_h
19 #define Command_SaveTLSSwitchStates_h
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #include <config.h>
26 
27 #include <string>
28 #include <map>
29 #include <utils/common/Command.h>
31 
32 
33 // ===========================================================================
34 // class declarations
35 // ===========================================================================
37 class OutputDevice;
38 
39 
40 // ===========================================================================
41 // class definitions
42 // ===========================================================================
50 public:
57  OutputDevice& od);
58 
59 
62 
63 
66 
77  SUMOTime execute(SUMOTime currentTime);
79 
80 
81 private:
84 
87 
89  std::string myPreviousState;
90 
92  std::string myPreviousProgramID;
93 
94 
95 private:
98 
101 
102 };
103 
104 
105 #endif
106 
107 /****************************************************************************/
108 
std::string myPreviousState
Storage for prior state.
long long int SUMOTime
Definition: SUMOTime.h:36
Storage for all programs of a single tls.
const MSTLLogicControl::TLSLogicVariants & myLogics
The traffic light logic to use.
Writes the switch times of a tls into a file when the tls switches.
Base (microsim) event class.
Definition: Command.h:54
SUMOTime execute(SUMOTime currentTime)
Writes the state of the tls if a change occurred.
Command_SaveTLSSwitchStates(const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od)
Constructor.
The parent class for traffic light logics.
std::string myPreviousProgramID
Storage for prior sub-id.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:64
OutputDevice & myOutputDevice
The device to write to.
Command_SaveTLSSwitchStates & operator=(const Command_SaveTLSSwitchStates &)
Invalidated assignment operator.