MSNet::EdgeWeightsProxi Class Reference

#include <MSNet.h>


Detailed Description

A proxi for edge weights known by a vehicle/known globally.

Both getter methods try to return the vehicle's knowledge about the edge/time, first. If not existing,they try to retrieve it from the global knowledge. If not existing, the travel time retrieval method returns the edges' length divided by the maximum speed (information from the first lane is used). The default value for the effort is 0.

See also:
MSEdgeWeightsStorage

Definition at line 500 of file MSNet.h.


Public Member Functions

 EdgeWeightsProxi (const MSEdgeWeightsStorage &vehKnowledge, const MSEdgeWeightsStorage &netKnowledge)
 Constructor.
SUMOReal getEffort (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t) const
 Returns the effort to pass an edge.
SUMOReal getTravelTime (const MSEdge *const e, const SUMOVehicle *const v, SUMOReal t) const
 Returns the travel time to pass an edge.
 ~EdgeWeightsProxi ()
 Destructor.

Private Attributes

const MSEdgeWeightsStoragemyNetKnowledge
 The global knownledge.
const MSEdgeWeightsStoragemyVehicleKnowledge
 The vehicle's knownledge.

Constructor & Destructor Documentation

MSNet::EdgeWeightsProxi::EdgeWeightsProxi ( const MSEdgeWeightsStorage vehKnowledge,
const MSEdgeWeightsStorage netKnowledge 
) [inline]

Constructor.

Parameters:
[in] vehKnowledge The vehicle's edge weights knowledge
[in] netKnowledge The global edge weights knowledge

Definition at line 506 of file MSNet.h.

00508                 : myVehicleKnowledge(vehKnowledge), myNetKnowledge(netKnowledge) {}

MSNet::EdgeWeightsProxi::~EdgeWeightsProxi (  )  [inline]

Destructor.

Definition at line 512 of file MSNet.h.

00512 {}


Member Function Documentation

SUMOReal MSNet::EdgeWeightsProxi::getEffort ( const MSEdge *const   e,
const SUMOVehicle *const   v,
SUMOReal  t 
) const

Returns the effort to pass an edge.

Parameters:
[in] e The edge for which the effort to be passed shall be returned
[in] v The vehicle that is rerouted
[in] t The time for which the effort shall be returned [s]
Returns:
The effort (abstract) for an edge
See also:
DijkstraRouterTT_ByProxi

Definition at line 109 of file MSNet.cpp.

References myNetKnowledge, myVehicleKnowledge, MSEdgeWeightsStorage::retrieveExistingEffort(), and SUMOReal.

Referenced by TraCIServerAPI_Vehicle::processSet().

00111                                                      {
00112     SUMOReal value;
00113     if (myVehicleKnowledge.retrieveExistingEffort(e, v, t, value)) {
00114         return value;
00115     }
00116     if (myNetKnowledge.retrieveExistingEffort(e, v, t, value)) {
00117         return value;
00118     }
00119     return 0;
00120 }

SUMOReal MSNet::EdgeWeightsProxi::getTravelTime ( const MSEdge *const   e,
const SUMOVehicle *const   v,
SUMOReal  t 
) const

Returns the travel time to pass an edge.

Parameters:
[in] e The edge for which the travel time to be passed shall be returned
[in] v The vehicle that is rerouted
[in] t The time for which the travel time shall be returned [s]
Returns:
The travel time for an edge
See also:
DijkstraRouterTT_ByProxi

Definition at line 124 of file MSNet.cpp.

References MSEdge::getLanes(), MSLane::getLength(), MSLane::getMaxSpeed(), myNetKnowledge, myVehicleKnowledge, MSEdgeWeightsStorage::retrieveExistingTravelTime(), and SUMOReal.

Referenced by traci::TraCIServer::commandChangeTarget(), traci::TraCIServer::postProcessSimulationStep(), TraCIServerAPI_Vehicle::processSet(), and MSTriggeredRerouter::reroute().

00126                                                          {
00127     SUMOReal value;
00128     if (myVehicleKnowledge.retrieveExistingTravelTime(e, v, t, value)) {
00129         return value;
00130     }
00131     if (myNetKnowledge.retrieveExistingTravelTime(e, v, t, value)) {
00132         return value;
00133     }
00134     const MSLane * const l = e->getLanes()[0];
00135     return l->getLength() / l->getMaxSpeed();
00136 }


Field Documentation

The global knownledge.

Definition at line 539 of file MSNet.h.

Referenced by getEffort(), and getTravelTime().

The vehicle's knownledge.

Definition at line 536 of file MSNet.h.

Referenced by getEffort(), and getTravelTime().


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

Generated on Wed May 5 00:06:49 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6