SUMO - Simulation of Urban MObility
MSEdgeWeightsStorage Class Reference

A storage for edge travel times and efforts. More...

#include <MSEdgeWeightsStorage.h>

Collaboration diagram for MSEdgeWeightsStorage:
Collaboration graph

Public Member Functions

void addEffort (const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
 Adds an effort information for an edge and a time span. More...
 
void addTravelTime (const MSEdge *const e, SUMOReal begin, SUMOReal end, SUMOReal value)
 Adds a travel time information for an edge and a time span. More...
 
bool knowsEffort (const MSEdge *const e) const
 Returns the information whether any effort is known for the given edge. More...
 
bool knowsTravelTime (const MSEdge *const e) const
 Returns the information whether any travel time is known for the given edge. More...
 
 MSEdgeWeightsStorage ()
 Constructor. More...
 
void removeEffort (const MSEdge *const e)
 Removes the effort information for an edge. More...
 
void removeTravelTime (const MSEdge *const e)
 Removes the travel time information for an edge. More...
 
bool retrieveExistingEffort (const MSEdge *const e, const SUMOReal t, SUMOReal &value) const
 Returns an effort for an edge and time if stored. More...
 
bool retrieveExistingTravelTime (const MSEdge *const e, const SUMOReal t, SUMOReal &value) const
 Returns a travel time for an edge and time if stored. More...
 
 ~MSEdgeWeightsStorage ()
 Destructor. More...
 

Private Member Functions

 MSEdgeWeightsStorage (const MSEdgeWeightsStorage &)
 Invalidated copy constructor. More...
 
MSEdgeWeightsStorageoperator= (const MSEdgeWeightsStorage &)
 Invalidated assignment operator. More...
 

Private Attributes

std::map< const MSEdge *, ValueTimeLine< SUMOReal > > myEfforts
 A map of edge->time->effort. More...
 
std::map< const MSEdge *, ValueTimeLine< SUMOReal > > myTravelTimes
 A map of edge->time->travel time. More...
 

Detailed Description

A storage for edge travel times and efforts.

Definition at line 52 of file MSEdgeWeightsStorage.h.

Constructor & Destructor Documentation

MSEdgeWeightsStorage::MSEdgeWeightsStorage ( )

Constructor.

Definition at line 42 of file MSEdgeWeightsStorage.cpp.

MSEdgeWeightsStorage::~MSEdgeWeightsStorage ( )

Destructor.

Definition at line 46 of file MSEdgeWeightsStorage.cpp.

MSEdgeWeightsStorage::MSEdgeWeightsStorage ( const MSEdgeWeightsStorage )
private

Invalidated copy constructor.

Member Function Documentation

void MSEdgeWeightsStorage::addEffort ( const MSEdge *const  e,
SUMOReal  begin,
SUMOReal  end,
SUMOReal  value 
)

Adds an effort information for an edge and a time span.

Parameters
[in]eThe described edge
[in]beginThe begin of the described time span
[in]endThe end of the described time span
[in]valueTheeffort value for this edge and time span

Definition at line 94 of file MSEdgeWeightsStorage.cpp.

References myEfforts.

Referenced by NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight(), TraCIServerAPI_Edge::processSet(), and TraCIServerAPI_Vehicle::processSet().

void MSEdgeWeightsStorage::addTravelTime ( const MSEdge *const  e,
SUMOReal  begin,
SUMOReal  end,
SUMOReal  value 
)

Adds a travel time information for an edge and a time span.

Parameters
[in]eThe described edge
[in]beginThe begin of the described time span
[in]endThe end of the described time span
[in]valueThe travel time value for this edge and time span

Definition at line 81 of file MSEdgeWeightsStorage.cpp.

References myTravelTimes.

Referenced by NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight(), TraCIServerAPI_Edge::processSet(), and TraCIServerAPI_Vehicle::processSet().

bool MSEdgeWeightsStorage::knowsEffort ( const MSEdge *const  e) const

Returns the information whether any effort is known for the given edge.

Parameters
[in]eThe investigated edge
Returns
Whether any travel time information about this edge is stored

Definition at line 131 of file MSEdgeWeightsStorage.cpp.

References myEfforts.

Referenced by GUILane::getLoadedEdgeWeight(), and TraCIServerAPI_Vehicle::processSet().

bool MSEdgeWeightsStorage::knowsTravelTime ( const MSEdge *const  e) const

Returns the information whether any travel time is known for the given edge.

Parameters
[in]eThe investigated edge
Returns
Whether any travel time information about this edge is stored

Definition at line 125 of file MSEdgeWeightsStorage.cpp.

References myTravelTimes.

Referenced by GUILane::getColorValue(), GUILane::getScaleValue(), GUILane::getStoredEdgeTravelTime(), and TraCIServerAPI_Vehicle::processSet().

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

Invalidated assignment operator.

void MSEdgeWeightsStorage::removeEffort ( const MSEdge *const  e)

Removes the effort information for an edge.

Parameters
[in]eThe described edge

Definition at line 116 of file MSEdgeWeightsStorage.cpp.

References myEfforts.

Referenced by TraCIServerAPI_Vehicle::processSet().

void MSEdgeWeightsStorage::removeTravelTime ( const MSEdge *const  e)

Removes the travel time information for an edge.

Parameters
[in]eThe described edge

Definition at line 107 of file MSEdgeWeightsStorage.cpp.

References myTravelTimes.

Referenced by TraCIServerAPI_Vehicle::processSet().

bool MSEdgeWeightsStorage::retrieveExistingEffort ( const MSEdge *const  e,
const SUMOReal  t,
SUMOReal value 
) const

Returns an effort for an edge and time if stored.

Parameters
[in]eThe edge for which the effort shall be retrieved
[in]tThe time for which the effort shall be retrieved
[in]valueThe value if the requested edge/time is described
Returns
Whether the requested edge/time is described

Definition at line 66 of file MSEdgeWeightsStorage.cpp.

References ValueTimeLine< T >::describesTime(), ValueTimeLine< T >::getValue(), and myEfforts.

Referenced by MSNet::getEffort(), GUILane::getLoadedEdgeWeight(), and TraCIServerAPI_Vehicle::processGet().

bool MSEdgeWeightsStorage::retrieveExistingTravelTime ( const MSEdge *const  e,
const SUMOReal  t,
SUMOReal value 
) const

Returns a travel time for an edge and time if stored.

Parameters
[in]eThe edge for which the travel time shall be retrieved
[in]tThe time for which the travel time shall be retrieved
[in]valueThe value if the requested edge/time is described
Returns
Whether the requested edge/time is described

Definition at line 51 of file MSEdgeWeightsStorage.cpp.

References ValueTimeLine< T >::describesTime(), ValueTimeLine< T >::getValue(), and myTravelTimes.

Referenced by GUILane::getColorValue(), GUILane::getScaleValue(), GUILane::getStoredEdgeTravelTime(), MSNet::getTravelTime(), and TraCIServerAPI_Vehicle::processGet().

Field Documentation

std::map<const MSEdge*, ValueTimeLine<SUMOReal> > MSEdgeWeightsStorage::myEfforts
private

A map of edge->time->effort.

Definition at line 129 of file MSEdgeWeightsStorage.h.

Referenced by addEffort(), knowsEffort(), removeEffort(), and retrieveExistingEffort().

std::map<const MSEdge*, ValueTimeLine<SUMOReal> > MSEdgeWeightsStorage::myTravelTimes
private

A map of edge->time->travel time.

Definition at line 126 of file MSEdgeWeightsStorage.h.

Referenced by addTravelTime(), knowsTravelTime(), removeTravelTime(), and retrieveExistingTravelTime().


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