Eclipse SUMO - Simulation of Urban MObility
Command_SaveTLCoupledDet.cpp
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 e2 state on each tls switch
16 /****************************************************************************/
17 
18 
19 // ===========================================================================
20 // included modules
21 // ===========================================================================
22 #include <config.h>
23 
25 #include <microsim/MSNet.h>
32 
33 
34 // ===========================================================================
35 // method definitions
36 // ===========================================================================
38  MSDetectorFileOutput* dtf, SUMOTime begin, OutputDevice& device)
39  : myDevice(device), myLogics(tlls), myDetector(dtf),
40  myStartTime(begin) {
41  tlls.addSwitchCommand(this);
42  dtf->writeXMLDetectorProlog(device);
43 }
44 
45 
47 }
48 
49 
50 void
53  if (myStartTime != end) {
55  myStartTime = end;
56  }
57 }
58 
59 
60 
61 /****************************************************************************/
62 
MSDetectorFileOutput::writeXMLDetectorProlog
virtual void writeXMLDetectorProlog(OutputDevice &dev) const =0
Open the XML-output.
Command_SaveTLCoupledDet::myDevice
OutputDevice & myDevice
The file to write the output to.
Definition: Command_SaveTLCoupledDet.h:78
Command_SaveTLCoupledDet::myDetector
MSDetectorFileOutput * myDetector
The detector to use.
Definition: Command_SaveTLCoupledDet.h:84
MSNet.h
MSDetectorFileOutput
Base of value-generating classes (detectors)
Definition: MSDetectorFileOutput.h:63
OutputDevice
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:63
MsgHandler.h
Command_SaveTLCoupledDet::~Command_SaveTLCoupledDet
virtual ~Command_SaveTLCoupledDet()
Destructor.
Definition: Command_SaveTLCoupledDet.cpp:46
SUMOTime
long long int SUMOTime
Definition: SUMOTime.h:34
MSDetectorFileOutput.h
MSTrafficLightLogic.h
Command_SaveTLCoupledDet::execute
virtual void execute()
Executes the command.
Definition: Command_SaveTLCoupledDet.cpp:51
MSNet::getCurrentTimeStep
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:283
MSDetectorFileOutput::writeXMLOutput
virtual void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)=0
Write the generated output to the given device.
OutputDevice.h
UtilExceptions.h
MSTLLogicControl::TLSLogicVariants::addSwitchCommand
void addSwitchCommand(OnSwitchAction *c)
Definition: MSTLLogicControl.cpp:177
Command_SaveTLCoupledDet.h
MSNet::getInstance
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
Command_SaveTLCoupledDet::Command_SaveTLCoupledDet
Command_SaveTLCoupledDet(MSTLLogicControl::TLSLogicVariants &tlls, MSDetectorFileOutput *dtf, SUMOTime begin, OutputDevice &device)
Constructor.
Definition: Command_SaveTLCoupledDet.cpp:37
MSTLLogicControl::TLSLogicVariants
Storage for all programs of a single tls.
Definition: MSTLLogicControl.h:85
config.h
MSEventControl.h
Command_SaveTLCoupledDet::myStartTime
SUMOTime myStartTime
The last time the values were written.
Definition: Command_SaveTLCoupledDet.h:87