Eclipse 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:

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 165 of file MSVehicle.h.

Member Typedef Documentation

◆ waitingIntervalList

Definition at line 168 of file MSVehicle.h.

Constructor & Destructor Documentation

◆ WaitingTimeCollector() [1/2]

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

Constructor.

Definition at line 176 of file MSVehicle.cpp.

◆ WaitingTimeCollector() [2/2]

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

Copy constructor.

Definition at line 178 of file MSVehicle.cpp.

Member Function Documentation

◆ appendWaitingTime()

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

append an amount of dt millisecs to the stored waiting times

◆ cumulatedWaitingTime()

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

Definition at line 195 of file MSVehicle.cpp.

References myMemorySize, and myWaitingIntervals.

Referenced by MSVehicle::getAccumulatedWaitingTime().

◆ getMemorySize()

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

Definition at line 193 of file MSVehicle.h.

Referenced by operator=().

◆ getWaitingIntervals()

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

Definition at line 198 of file MSVehicle.h.

Referenced by operator=().

◆ operator!=()

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

Operator !=.

◆ operator=() [1/2]

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

Assignment operator.

Definition at line 181 of file MSVehicle.cpp.

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

◆ operator=() [2/2]

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

Assignment operator (in place!)

Definition at line 188 of file MSVehicle.cpp.

References myWaitingIntervals, and passTime().

◆ passTime()

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

Definition at line 216 of file MSVehicle.cpp.

References myMemorySize, and myWaitingIntervals.

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

Friends And Related Function Documentation

◆ MSVehicle

friend class MSVehicle
friend

Definition at line 166 of file MSVehicle.h.

Field Documentation

◆ myMemorySize

SUMOTime MSVehicle::WaitingTimeCollector::myMemorySize
private

the maximal memory to store

Definition at line 204 of file MSVehicle.h.

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

◆ myWaitingIntervals

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 209 of file MSVehicle.h.

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


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