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-2017 German Aerospace Center (DLR) and others.
4 /****************************************************************************/
5 //
6 // This program and the accompanying materials
7 // are made available under the terms of the Eclipse Public License v2.0
8 // which accompanies this distribution, and is available at
9 // http://www.eclipse.org/legal/epl-v20.html
10 //
11 /****************************************************************************/
18 // Writes e2 state on each tls switch
19 /****************************************************************************/
20 
21 
22 // ===========================================================================
23 // included modules
24 // ===========================================================================
25 #ifdef _MSC_VER
26 #include <windows_config.h>
27 #else
28 #include <config.h>
29 #endif
30 
32 #include <microsim/MSNet.h>
39 
40 
41 // ===========================================================================
42 // method definitions
43 // ===========================================================================
45  MSDetectorFileOutput* dtf, SUMOTime begin, OutputDevice& device)
46  : myDevice(device), myLogics(tlls), myDetector(dtf),
47  myStartTime(begin) {
48  tlls.addSwitchCommand(this);
49  dtf->writeXMLDetectorProlog(device);
50 }
51 
52 
54 }
55 
56 
57 void
60  if (myStartTime != end) {
62  myStartTime = end;
63  }
64 }
65 
66 
67 
68 /****************************************************************************/
69 
Storage for all programs of a single tls.
static MSNet * getInstance()
Returns the pointer to the unique instance of MSNet (singleton).
Definition: MSNet.cpp:167
Command_SaveTLCoupledDet(MSTLLogicControl::TLSLogicVariants &tlls, MSDetectorFileOutput *dtf, SUMOTime begin, OutputDevice &device)
Constructor.
virtual void writeXMLDetectorProlog(OutputDevice &dev) const =0
Open the XML-output.
void addSwitchCommand(OnSwitchAction *c)
virtual void execute()
Executes the command.
SUMOTime myStartTime
The last time the values were written.
SUMOTime getCurrentTimeStep() const
Returns the current simulation step.
Definition: MSNet.h:253
virtual void writeXMLOutput(OutputDevice &dev, SUMOTime startTime, SUMOTime stopTime)=0
Write the generated output to the given device.
Static storage of an output device and its base (abstract) implementation.
Definition: OutputDevice.h:70
long long int SUMOTime
Definition: TraCIDefs.h:51
OutputDevice & myDevice
The file to write the output to.
MSDetectorFileOutput * myDetector
The detector to use.
virtual ~Command_SaveTLCoupledDet()
Destructor.
Base of value-generating classes (detectors)