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

Writes the state of the tls to a file (in each second) More...

#include <Command_SaveTLSState.h>

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

Public Member Functions

 Command_SaveTLSState (const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od, bool saveDetectors, bool saveConditions)
 Constructor.
 
virtual SUMOTime shiftTime (SUMOTime, SUMOTime, SUMOTime)
 Reschedule or deschedule the command when quick-loading state.
 
 ~Command_SaveTLSState ()
 Destructor.
 
Derived from Command
SUMOTime execute (SUMOTime currentTime)
 Writes the current state of the tls.
 

Data Fields

int priority = 0
 

Private Member Functions

 Command_SaveTLSState (const Command_SaveTLSState &)
 Invalidated copy constructor.
 
Command_SaveTLSStateoperator= (const Command_SaveTLSState &)
 Invalidated assignment operator.
 

Private Attributes

const MSTLLogicControl::TLSLogicVariantsmyLogics
 The traffic light logic to use.
 
OutputDevicemyOutputDevice
 The device to write to.
 
const bool mySaveConditions
 
const bool mySaveDetectors
 additiona logging
 

Detailed Description

Writes the state of the tls to a file (in each second)

Definition at line 44 of file Command_SaveTLSState.h.

Constructor & Destructor Documentation

◆ Command_SaveTLSState() [1/2]

Command_SaveTLSState::Command_SaveTLSState ( const MSTLLogicControl::TLSLogicVariants logics,
OutputDevice od,
bool  saveDetectors,
bool  saveConditions 
)

Constructor.

Parameters
[in]tllsThe logic to write state of
[in]odThe output device to write the state into

Definition at line 35 of file Command_SaveTLSState.cpp.

References MSEventControl::addEvent(), MSNet::getEndOfTimestepEvents(), and MSNet::getInstance().

◆ ~Command_SaveTLSState()

Command_SaveTLSState::~Command_SaveTLSState ( )

Destructor.

Definition at line 45 of file Command_SaveTLSState.cpp.

◆ Command_SaveTLSState() [2/2]

Command_SaveTLSState::Command_SaveTLSState ( const Command_SaveTLSState )
private

Invalidated copy constructor.

Member Function Documentation

◆ execute()

◆ operator=()

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

Invalidated assignment operator.

◆ shiftTime()

virtual SUMOTime Command::shiftTime ( SUMOTime  ,
SUMOTime  ,
SUMOTime   
)
inlinevirtualinherited

Reschedule or deschedule the command when quick-loading state.

The implementations should return -1 if the command shall not be re-scheduled, or a value >= 0 that describe the new time at which the command shall be executed again.

Parameters
[in]currentTimeThe current simulation time
[in]execTimeThe time at which the command would have been executed
[in]newTimeThe simulation time at which the simulation is restarted
Returns
The time at which the command shall be executed again

Reimplemented in MSTrafficLightLogic::SwitchCommand, and MSCalibrator::CalibratorCommand.

Definition at line 83 of file Command.h.

Field Documentation

◆ myLogics

const MSTLLogicControl::TLSLogicVariants& Command_SaveTLSState::myLogics
private

The traffic light logic to use.

Definition at line 79 of file Command_SaveTLSState.h.

Referenced by execute().

◆ myOutputDevice

OutputDevice& Command_SaveTLSState::myOutputDevice
private

The device to write to.

Definition at line 76 of file Command_SaveTLSState.h.

Referenced by execute().

◆ mySaveConditions

const bool Command_SaveTLSState::mySaveConditions
private

Definition at line 83 of file Command_SaveTLSState.h.

Referenced by execute().

◆ mySaveDetectors

const bool Command_SaveTLSState::mySaveDetectors
private

additiona logging

Definition at line 82 of file Command_SaveTLSState.h.

Referenced by execute().

◆ priority

int Command::priority = 0
inherited

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