Eclipse SUMO - Simulation of Urban MObility
Command_SaveTLSSwitches.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 information about the green durations of a tls
16 /****************************************************************************/
17 #ifndef Command_SaveTLSSwitches_h
18 #define Command_SaveTLSSwitches_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 
79  SUMOTime execute(SUMOTime currentTime);
81 
82 
83 private:
86 
89 
91  std::map<int, SUMOTime> myPreviousLinkStates;
92 
93 
94 private:
97 
100 
101 };
102 
103 
104 #endif
105 
106 /****************************************************************************/
107 
Command_SaveTLSSwitches::myLogics
const MSTLLogicControl::TLSLogicVariants & myLogics
The traffic light logic to use.
Definition: Command_SaveTLSSwitches.h:88
MSTLLogicControl.h
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_SaveTLSSwitches::Command_SaveTLSSwitches
Command_SaveTLSSwitches(const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od)
Constructor.
Definition: Command_SaveTLSSwitches.cpp:37
Command_SaveTLSSwitches::execute
SUMOTime execute(SUMOTime currentTime)
Writes the output if a change occurred.
Definition: Command_SaveTLSSwitches.cpp:50
MSTrafficLightLogic
The parent class for traffic light logics.
Definition: MSTrafficLightLogic.h:55
Command_SaveTLSSwitches::~Command_SaveTLSSwitches
~Command_SaveTLSSwitches()
Destructor.
Definition: Command_SaveTLSSwitches.cpp:45
Command_SaveTLSSwitches::myPreviousLinkStates
std::map< int, SUMOTime > myPreviousLinkStates
Storage for prior states; map from signal group to last green time begin.
Definition: Command_SaveTLSSwitches.h:91
Command_SaveTLSSwitches::myOutputDevice
OutputDevice & myOutputDevice
The device to write to.
Definition: Command_SaveTLSSwitches.h:85
Command
Base (microsim) event class.
Definition: Command.h:52
Command_SaveTLSSwitches::operator=
Command_SaveTLSSwitches & operator=(const Command_SaveTLSSwitches &)
Invalidated assignment operator.
MSTLLogicControl::TLSLogicVariants
Storage for all programs of a single tls.
Definition: MSTLLogicControl.h:85
config.h
Command.h
Command_SaveTLSSwitches
Writes information about the green durations of a tls.
Definition: Command_SaveTLSSwitches.h:48