SUMO - Simulation of Urban MObility
MSVehicle::WaitingTimeCollector Class Reference

Stores the waiting intervals over the previous seconds (memory is to be specified in ms.). More...

#include <MSVehicle.h>

Collaboration diagram for MSVehicle::WaitingTimeCollector:
Collaboration graph

Public Member Functions

SUMOTime cumulatedWaitingTime (SUMOTime memory=-1) const
 
SUMOTime getMemorySize () const
 
const waitingIntervalListgetWaitingIntervals () const
 
bool operator!= (const WaitingTimeCollector &wt) const
 Operator !=. More...
 
WaitingTimeCollectoroperator= (const WaitingTimeCollector &wt)
 Assignment operator. More...
 
WaitingTimeCollectoroperator= (SUMOTime t)
 Assignment operator (in place!) More...
 
void passTime (SUMOTime dt, bool waiting)
 
 WaitingTimeCollector (SUMOTime memory=MSGlobals::gWaitingTimeMemory)
 Constructor. More...
 
 WaitingTimeCollector (const WaitingTimeCollector &wt)
 Copy constructor. More...
 

Private Types

typedef std::list< std::pair< SUMOTime, SUMOTime > > waitingIntervalList
 

Private Member Functions

void appendWaitingTime (SUMOTime dt)
 append an amount of dt millisecs to the stored waiting times More...
 

Private Attributes

SUMOTime myMemorySize
 the maximal memory to store More...
 
waitingIntervalList myWaitingIntervals
 

Friends

class MSVehicle
 

Detailed Description

Stores the waiting intervals over the previous seconds (memory is to be specified in ms.).

Definition at line 128 of file MSVehicle.h.

Member Typedef Documentation

Definition at line 131 of file MSVehicle.h.

Constructor & Destructor Documentation

MSVehicle::WaitingTimeCollector::WaitingTimeCollector ( SUMOTime  memory = MSGlobals::gWaitingTimeMemory)

Constructor.

Definition at line 142 of file MSVehicle.cpp.

MSVehicle::WaitingTimeCollector::WaitingTimeCollector ( const WaitingTimeCollector wt)

Copy constructor.

Definition at line 144 of file MSVehicle.cpp.

Member Function Documentation

void MSVehicle::WaitingTimeCollector::appendWaitingTime ( SUMOTime  dt)
private

append an amount of dt millisecs to the stored waiting times

SUMOTime MSVehicle::WaitingTimeCollector::cumulatedWaitingTime ( SUMOTime  memory = -1) const

Definition at line 161 of file MSVehicle.cpp.

References myMemorySize, and myWaitingIntervals.

Referenced by MSVehicle::getAccumulatedWaitingTime().

SUMOTime MSVehicle::WaitingTimeCollector::getMemorySize ( ) const
inline

Definition at line 156 of file MSVehicle.h.

Referenced by operator=().

const waitingIntervalList& MSVehicle::WaitingTimeCollector::getWaitingIntervals ( ) const
inline

Definition at line 161 of file MSVehicle.h.

Referenced by operator=().

bool MSVehicle::WaitingTimeCollector::operator!= ( const WaitingTimeCollector wt) const

Operator !=.

MSVehicle::WaitingTimeCollector & MSVehicle::WaitingTimeCollector::operator= ( const WaitingTimeCollector wt)

Assignment operator.

Definition at line 147 of file MSVehicle.cpp.

References getMemorySize(), getWaitingIntervals(), myMemorySize, and myWaitingIntervals.

MSVehicle::WaitingTimeCollector & MSVehicle::WaitingTimeCollector::operator= ( SUMOTime  t)

Assignment operator (in place!)

Definition at line 154 of file MSVehicle.cpp.

References myWaitingIntervals, and passTime().

void MSVehicle::WaitingTimeCollector::passTime ( SUMOTime  dt,
bool  waiting 
)

Definition at line 182 of file MSVehicle.cpp.

References myMemorySize, and myWaitingIntervals.

Referenced by MSVehicle::executeMove(), and operator=().

Friends And Related Function Documentation

friend class MSVehicle
friend

Definition at line 129 of file MSVehicle.h.

Field Documentation

SUMOTime MSVehicle::WaitingTimeCollector::myMemorySize
private

the maximal memory to store

Definition at line 167 of file MSVehicle.h.

Referenced by cumulatedWaitingTime(), operator=(), and passTime().

waitingIntervalList MSVehicle::WaitingTimeCollector::myWaitingIntervals
private

the stored waiting intervals within the last memory milliseconds If the current (ongoing) waiting interval has begun at time t - dt (where t is the current time) then waitingIntervalList[0]->first = 0., waitingIntervalList[0]->second = dt

Definition at line 172 of file MSVehicle.h.

Referenced by cumulatedWaitingTime(), operator=(), and passTime().


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