Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
Command_SaveTLCoupledDet Class Reference

Writes e2 state on each tls switch. More...

#include <Command_SaveTLCoupledDet.h>

Inheritance diagram for Command_SaveTLCoupledDet:
[legend]
Collaboration diagram for Command_SaveTLCoupledDet:
[legend]

Public Member Functions

 Command_SaveTLCoupledDet (MSTLLogicControl::TLSLogicVariants &tlls, MSDetectorFileOutput *dtf, SUMOTime begin, OutputDevice &device)
 Constructor.
virtual void execute ()
 Executes the command.
virtual ~Command_SaveTLCoupledDet ()
 Destructor.

Protected Attributes

MSDetectorFileOutputmyDetector
 The detector to use.
OutputDevicemyDevice
 The file to write the output to.
const MSTLLogicControl::TLSLogicVariantsmyLogics
 The logic to use.
SUMOTime myStartTime
 The last time the values were written.

Private Member Functions

 Command_SaveTLCoupledDet (const Command_SaveTLCoupledDet &)
 Invalidated copy constructor.
Command_SaveTLCoupledDetoperator= (const Command_SaveTLCoupledDet &)
 Invalidated assignment operator.

Detailed Description

Writes e2 state on each tls switch.

Todo
Problem: The detector may not save the last state (on simulation end)

Definition at line 46 of file Command_SaveTLCoupledDet.h.

Constructor & Destructor Documentation

◆ Command_SaveTLCoupledDet() [1/2]

Command_SaveTLCoupledDet::Command_SaveTLCoupledDet ( MSTLLogicControl::TLSLogicVariants & tlls,
MSDetectorFileOutput * dtf,
SUMOTime begin,
OutputDevice & device )

Constructor.

Parameters
[in]tllsThe logic to observe
[in]dtfThe detector used to generate the values
[in]beginThe begin simulation time
[in]deviceThe output device to write the detector values into

Definition at line 36 of file Command_SaveTLCoupledDet.cpp.

References MSTLLogicControl::TLSLogicVariants::addSwitchCommand(), myDetector, myDevice, myLogics, myStartTime, and MSDetectorFileOutput::writeXMLDetectorProlog().

Referenced by Command_SaveTLCoupledDet(), Command_SaveTLCoupledLaneDet::Command_SaveTLCoupledLaneDet(), and operator=().

Here is the caller graph for this function:

◆ ~Command_SaveTLCoupledDet()

Command_SaveTLCoupledDet::~Command_SaveTLCoupledDet ( )
virtual

Destructor.

Definition at line 45 of file Command_SaveTLCoupledDet.cpp.

◆ Command_SaveTLCoupledDet() [2/2]

Command_SaveTLCoupledDet::Command_SaveTLCoupledDet ( const Command_SaveTLCoupledDet & )
private

Invalidated copy constructor.

References Command_SaveTLCoupledDet().

Member Function Documentation

◆ execute()

void Command_SaveTLCoupledDet::execute ( )
virtual

Executes the command.

Called when an active tls program switches, this method calls "writeXMLOutput" of its detector (e2; the values are resetted there).

See also
MSDetectorFileOutput::writeXMLOutput
MSE2Collector::writeXMLOutput

Implements MSTLLogicControl::OnSwitchAction.

Reimplemented in Command_SaveTLCoupledLaneDet.

Definition at line 50 of file Command_SaveTLCoupledDet.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), myDetector, myDevice, and myStartTime.

◆ operator=()

Command_SaveTLCoupledDet & Command_SaveTLCoupledDet::operator= ( const Command_SaveTLCoupledDet & )
private

Invalidated assignment operator.

References Command_SaveTLCoupledDet().

Field Documentation

◆ myDetector

MSDetectorFileOutput* Command_SaveTLCoupledDet::myDetector
protected

The detector to use.

Definition at line 82 of file Command_SaveTLCoupledDet.h.

Referenced by Command_SaveTLCoupledDet(), execute(), and Command_SaveTLCoupledLaneDet::execute().

◆ myDevice

OutputDevice& Command_SaveTLCoupledDet::myDevice
protected

The file to write the output to.

Definition at line 76 of file Command_SaveTLCoupledDet.h.

Referenced by Command_SaveTLCoupledDet(), execute(), and Command_SaveTLCoupledLaneDet::execute().

◆ myLogics

const MSTLLogicControl::TLSLogicVariants& Command_SaveTLCoupledDet::myLogics
protected

The logic to use.

Definition at line 79 of file Command_SaveTLCoupledDet.h.

Referenced by Command_SaveTLCoupledDet().

◆ myStartTime

SUMOTime Command_SaveTLCoupledDet::myStartTime
protected

The last time the values were written.

Definition at line 85 of file Command_SaveTLCoupledDet.h.

Referenced by Command_SaveTLCoupledDet(), execute(), and Command_SaveTLCoupledLaneDet::execute().


The documentation for this class was generated from the following files: