Command_SaveTLCoupledDet Class Reference

#include <Command_SaveTLCoupledDet.h>

Inheritance diagram for Command_SaveTLCoupledDet:

MSTLLogicControl::OnSwitchAction Command_SaveTLCoupledLaneDet

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 55 of file Command_SaveTLCoupledDet.h.


Public Member Functions

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

Protected Attributes

MSDetectorFileOutputmyDetector
 The detector to use.
OutputDevicemyDevice
 The file to write the output to.
const
MSTLLogicControl::TLSLogicVariants
myLogics
 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.

Constructor & Destructor Documentation

Command_SaveTLCoupledDet::Command_SaveTLCoupledDet ( MSTLLogicControl::TLSLogicVariants tlls,
MSDetectorFileOutput dtf,
unsigned int  begin,
OutputDevice device 
) throw ()

Constructor.

Parameters:
[in] tlls The logic to observe
[in] dtf The detector used to generate the values
[in] begin The begin simulation time
[in] device The output device to write the detector values into

Definition at line 47 of file Command_SaveTLCoupledDet.cpp.

00051         : myDevice(device), myLogics(tlls), myDetector(dtf),
00052         myStartTime(begin) {
00053     tlls.addSwitchCommand(this);
00054     dtf->writeXMLDetectorProlog(device);
00055 }

Command_SaveTLCoupledDet::~Command_SaveTLCoupledDet (  )  throw () [virtual]

Destructor.

Definition at line 58 of file Command_SaveTLCoupledDet.cpp.

00058                                                             {
00059 }

Command_SaveTLCoupledDet::Command_SaveTLCoupledDet ( const Command_SaveTLCoupledDet  )  [private]

Invalidated copy constructor.


Member Function Documentation

void Command_SaveTLCoupledDet::execute (  )  throw () [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 63 of file Command_SaveTLCoupledDet.cpp.

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

00063                                           {
00064     SUMOTime end = MSNet::getInstance()->getCurrentTimeStep();
00065     if (myStartTime!=end) {
00066         myDetector->writeXMLOutput(myDevice, myStartTime, end);
00067         myStartTime = end;
00068     }
00069 }

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

Invalidated assignment operator.


Field Documentation

The detector to use.

Definition at line 91 of file Command_SaveTLCoupledDet.h.

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

The file to write the output to.

Definition at line 85 of file Command_SaveTLCoupledDet.h.

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

The logic to use.

Definition at line 88 of file Command_SaveTLCoupledDet.h.

The last time the values were written.

Definition at line 94 of file Command_SaveTLCoupledDet.h.

Referenced by Command_SaveTLCoupledLaneDet::execute(), and 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