Command_SaveTLSState Class Reference

#include <Command_SaveTLSState.h>

Inheritance diagram for Command_SaveTLSState:

Command

Detailed Description

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

Definition at line 52 of file Command_SaveTLSState.h.


Public Member Functions

 Command_SaveTLSState (const MSTLLogicControl::TLSLogicVariants &logics, OutputDevice &od) throw ()
 Constructor.
 ~Command_SaveTLSState () throw ()
 Destructor.
Derived from Command
SUMOTime execute (SUMOTime currentTime) throw (ProcessError)
 Writes the current state of the tls.

Private Member Functions

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

Private Attributes

const
MSTLLogicControl::TLSLogicVariants
myLogics
 The traffic light logic to use.
OutputDevicemyOutputDevice
 The device to write to.

Constructor & Destructor Documentation

Command_SaveTLSState::Command_SaveTLSState ( const MSTLLogicControl::TLSLogicVariants logics,
OutputDevice od 
) throw ()

Constructor.

Parameters:
[in] tlls The logic to write state of
[in] od The output device to write the state into

Definition at line 44 of file Command_SaveTLSState.cpp.

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

Command_SaveTLSState::~Command_SaveTLSState (  )  throw ()

Destructor.

Definition at line 53 of file Command_SaveTLSState.cpp.

00053                                                     {
00054 }

Command_SaveTLSState::Command_SaveTLSState ( const Command_SaveTLSState  )  [private]

Invalidated copy constructor.


Member Function Documentation

SUMOTime Command_SaveTLSState::execute ( SUMOTime  currentTime  )  throw (ProcessError) [virtual]

Writes the current state of the tls.

Returns always 1.

Parameters:
[in] currentTime The current simulation time (unused)
Returns:
Always 1 (will be executed in next time step)
Exceptions:
ProcessError not here
See also:
Command

Implements Command.

Definition at line 58 of file Command_SaveTLSState.cpp.

References DELTA_T, MSTLLogicControl::TLSLogicVariants::getActive(), MSTrafficLightLogic::getCurrentPhaseDef(), MSTrafficLightLogic::getCurrentPhaseIndex(), MSTrafficLightLogic::getID(), MSPhaseDefinition::getState(), MSTrafficLightLogic::getSubID(), myLogics, myOutputDevice, and time2string().

00058                                                                       {
00059     myOutputDevice << "    <tlsstate time=\"" << time2string(currentTime)
00060     << "\" id=\"" << myLogics.getActive()->getID()
00061     << "\" subid=\"" << myLogics.getActive()->getSubID()
00062     << "\" phase=\"" << myLogics.getActive()->getCurrentPhaseIndex()
00063     << "\" state=\"" << myLogics.getActive()->getCurrentPhaseDef().getState() << "\"/>\n";
00064     return DELTA_T;
00065 }

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

Invalidated assignment operator.


Field Documentation

The traffic light logic to use.

Definition at line 88 of file Command_SaveTLSState.h.

Referenced by execute().

The device to write to.

Definition at line 85 of file Command_SaveTLSState.h.

Referenced by execute().


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

Generated on Wed May 5 00:06:40 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6