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

Writes e2 state of a link for the time the link has yellow/red. More...

#include <Command_SaveTLCoupledLaneDet.h>

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

Public Member Functions

 Command_SaveTLCoupledLaneDet (MSTLLogicControl::TLSLogicVariants &tlls, MSDetectorFileOutput *dtf, SUMOTime begin, OutputDevice &device, const MSLink *link)
 Constructor.
 
void execute ()
 Executes the command.
 
 ~Command_SaveTLCoupledLaneDet ()
 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_SaveTLCoupledLaneDet (const Command_SaveTLCoupledLaneDet &)
 Invalidated copy constructor.
 
Command_SaveTLCoupledLaneDetoperator= (const Command_SaveTLCoupledLaneDet &)
 Invalidated assignment operator.
 

Private Attributes

bool myHadOne
 Whether the last link state was already saved.
 
LinkState myLastState
 The state the link had the last time.
 
const MSLinkmyLink
 The link to observe.
 

Detailed Description

Writes e2 state of a link for the time the link has yellow/red.

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

Definition at line 38 of file Command_SaveTLCoupledLaneDet.h.

Constructor & Destructor Documentation

◆ Command_SaveTLCoupledLaneDet() [1/2]

Command_SaveTLCoupledLaneDet::Command_SaveTLCoupledLaneDet ( MSTLLogicControl::TLSLogicVariants tlls,
MSDetectorFileOutput dtf,
SUMOTime  begin,
OutputDevice device,
const MSLink link 
)

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
[in]linkThe link that shall be observed

Definition at line 37 of file Command_SaveTLCoupledLaneDet.cpp.

References execute().

◆ ~Command_SaveTLCoupledLaneDet()

Command_SaveTLCoupledLaneDet::~Command_SaveTLCoupledLaneDet ( )

Destructor.

Definition at line 46 of file Command_SaveTLCoupledLaneDet.cpp.

◆ Command_SaveTLCoupledLaneDet() [2/2]

Command_SaveTLCoupledLaneDet::Command_SaveTLCoupledLaneDet ( const Command_SaveTLCoupledLaneDet )
private

Invalidated copy constructor.

Member Function Documentation

◆ execute()

void Command_SaveTLCoupledLaneDet::execute ( )
virtual

Executes the command.

Called when an active tls program switches, this method checks whether the tls signal responsible for the link has switched to green. If so, the values collected so far are written using "writeXMLOutput". Otherwise, the values are reset.

See also
MSDetectorFileOutput::writeXMLOutput
MSE2Collector::writeXMLOutput

Reimplemented from Command_SaveTLCoupledDet.

Definition at line 51 of file Command_SaveTLCoupledLaneDet.cpp.

References MSNet::getCurrentTimeStep(), MSNet::getInstance(), MSLink::getState(), LINKSTATE_TL_RED, Command_SaveTLCoupledDet::myDetector, Command_SaveTLCoupledDet::myDevice, myHadOne, myLastState, myLink, Command_SaveTLCoupledDet::myStartTime, MSDetectorFileOutput::reset(), and MSDetectorFileOutput::writeXMLOutput().

Referenced by Command_SaveTLCoupledLaneDet().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

Field Documentation

◆ myDetector

MSDetectorFileOutput* Command_SaveTLCoupledDet::myDetector
protectedinherited

The detector to use.

Definition at line 82 of file Command_SaveTLCoupledDet.h.

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

◆ myDevice

OutputDevice& Command_SaveTLCoupledDet::myDevice
protectedinherited

The file to write the output to.

Definition at line 76 of file Command_SaveTLCoupledDet.h.

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

◆ myHadOne

bool Command_SaveTLCoupledLaneDet::myHadOne
private

Whether the last link state was already saved.

Definition at line 78 of file Command_SaveTLCoupledLaneDet.h.

Referenced by execute().

◆ myLastState

LinkState Command_SaveTLCoupledLaneDet::myLastState
private

The state the link had the last time.

Definition at line 75 of file Command_SaveTLCoupledLaneDet.h.

Referenced by execute().

◆ myLink

const MSLink* Command_SaveTLCoupledLaneDet::myLink
private

The link to observe.

Definition at line 72 of file Command_SaveTLCoupledLaneDet.h.

Referenced by execute().

◆ myLogics

const MSTLLogicControl::TLSLogicVariants& Command_SaveTLCoupledDet::myLogics
protectedinherited

The logic to use.

Definition at line 79 of file Command_SaveTLCoupledDet.h.

◆ myStartTime

SUMOTime Command_SaveTLCoupledDet::myStartTime
protectedinherited

The last time the values were written.

Definition at line 85 of file Command_SaveTLCoupledDet.h.

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


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