Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
MSEdgeWeightsStorage Class Reference

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

#include <MSEdgeWeightsStorage.h>

Public Member Functions

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

Private Member Functions

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

Private Attributes

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

Detailed Description

A storage for edge travel times and efforts.

Definition at line 41 of file MSEdgeWeightsStorage.h.

Constructor & Destructor Documentation

◆ MSEdgeWeightsStorage() [1/2]

MSEdgeWeightsStorage::MSEdgeWeightsStorage ( )

Constructor.

Definition at line 30 of file MSEdgeWeightsStorage.cpp.

◆ ~MSEdgeWeightsStorage()

MSEdgeWeightsStorage::~MSEdgeWeightsStorage ( )

Destructor.

Definition at line 34 of file MSEdgeWeightsStorage.cpp.

◆ MSEdgeWeightsStorage() [2/2]

MSEdgeWeightsStorage::MSEdgeWeightsStorage ( const MSEdgeWeightsStorage &  )
private

Invalidated copy constructor.

Member Function Documentation

◆ addEffort()

void MSEdgeWeightsStorage::addEffort ( const MSEdge *const  e,
double  begin,
double  end,
double  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 82 of file MSEdgeWeightsStorage.cpp.

References myEfforts.

Referenced by NLBuilder::EdgeFloatTimeLineRetriever_EdgeEffort::addEdgeWeight(), LIBSUMO_NAMESPACE::Edge::setEffort(), and LIBSUMO_NAMESPACE::Vehicle::setEffort().

Here is the caller graph for this function:

◆ addTravelTime()

void MSEdgeWeightsStorage::addTravelTime ( const MSEdge *const  e,
double  begin,
double  end,
double  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 69 of file MSEdgeWeightsStorage.cpp.

References myTravelTimes.

Referenced by LIBSUMO_NAMESPACE::Edge::adaptTraveltime(), NLBuilder::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight(), and LIBSUMO_NAMESPACE::Vehicle::setAdaptedTraveltime().

Here is the caller graph for this function:

◆ empty()

bool MSEdgeWeightsStorage::empty ( ) const
inline

Returns whether neither travel times nor efforts are stored.

Returns
Whether this storage holds no information at all

Definition at line 102 of file MSEdgeWeightsStorage.h.

References myEfforts, and myTravelTimes.

Referenced by MSRoutingEngine::getFreeflowCCHMetric().

Here is the caller graph for this function:

◆ knowsEffort()

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 119 of file MSEdgeWeightsStorage.cpp.

References myEfforts.

Referenced by GUILane::getLoadedEdgeWeight(), and LIBSUMO_NAMESPACE::Vehicle::setEffort().

Here is the caller graph for this function:

◆ knowsTravelTime()

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 113 of file MSEdgeWeightsStorage.cpp.

References myTravelTimes.

Referenced by GUILane::getColorValue(), GUILane::getScaleValue(), GUILane::getStoredEdgeTravelTime(), and LIBSUMO_NAMESPACE::Vehicle::setAdaptedTraveltime().

Here is the caller graph for this function:

◆ operator=()

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

Invalidated assignment operator.

◆ removeEffort()

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

Removes the effort information for an edge.

Parameters
[in]eThe described edge

Definition at line 104 of file MSEdgeWeightsStorage.cpp.

References myEfforts.

Referenced by LIBSUMO_NAMESPACE::Vehicle::setEffort().

Here is the caller graph for this function:

◆ removeTravelTime()

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

Removes the travel time information for an edge.

Parameters
[in]eThe described edge

Definition at line 95 of file MSEdgeWeightsStorage.cpp.

References myTravelTimes.

Referenced by LIBSUMO_NAMESPACE::Vehicle::setAdaptedTraveltime().

Here is the caller graph for this function:

◆ retrieveExistingEffort()

bool MSEdgeWeightsStorage::retrieveExistingEffort ( const MSEdge *const  e,
const double  t,
double &  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 54 of file MSEdgeWeightsStorage.cpp.

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

Referenced by MSNet::getEffort(), LIBSUMO_NAMESPACE::Vehicle::getEffort(), and GUILane::getLoadedEdgeWeight().

Here is the caller graph for this function:

◆ retrieveExistingTravelTime()

bool MSEdgeWeightsStorage::retrieveExistingTravelTime ( const MSEdge *const  e,
const double  t,
double &  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 39 of file MSEdgeWeightsStorage.cpp.

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

Referenced by LIBSUMO_NAMESPACE::Vehicle::getAdaptedTraveltime(), GUILane::getColorValue(), GUILane::getScaleValue(), GUILane::getStoredEdgeTravelTime(), and MSNet::getTravelTime().

Here is the caller graph for this function:

Field Documentation

◆ myEfforts

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

A map of edge->time->effort.

Definition at line 126 of file MSEdgeWeightsStorage.h.

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

◆ myTravelTimes

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

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

Definition at line 123 of file MSEdgeWeightsStorage.h.

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


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