SUMO - Simulation of Urban MObility
|
A proxi for edge weights known by a vehicle/known globally. More...
#include <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 Member Functions | |
EdgeWeightsProxi & | operator= (const EdgeWeightsProxi &) |
Private Attributes | |
const MSEdgeWeightsStorage & | myNetKnowledge |
The global knownledge. | |
const MSEdgeWeightsStorage & | myVehicleKnowledge |
The vehicle's knownledge. |
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.
MSNet::EdgeWeightsProxi::EdgeWeightsProxi | ( | const MSEdgeWeightsStorage & | vehKnowledge, |
const MSEdgeWeightsStorage & | netKnowledge | ||
) | [inline] |
MSNet::EdgeWeightsProxi::~EdgeWeightsProxi | ( | ) | [inline] |
SUMOReal MSNet::EdgeWeightsProxi::getEffort | ( | const MSEdge *const | e, |
const SUMOVehicle *const | v, | ||
SUMOReal | t | ||
) | const |
Returns the effort to pass an edge.
[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] |
Definition at line 113 of file MSNet.cpp.
References myNetKnowledge, myVehicleKnowledge, MSEdgeWeightsStorage::retrieveExistingEffort(), and SUMOReal.
Referenced by TraCIServerAPI_Vehicle::processSet().
SUMOReal MSNet::EdgeWeightsProxi::getTravelTime | ( | const MSEdge *const | e, |
const SUMOVehicle *const | v, | ||
SUMOReal | t | ||
) | const |
Returns the travel time to pass an edge.
[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] |
Definition at line 128 of file MSNet.cpp.
References MSEdge::getLanes(), MSLane::getLength(), MSLane::getMaxSpeed(), and SUMOReal.
Referenced by MSTriggeredRerouter::notifyEnter(), and TraCIServerAPI_Vehicle::processSet().
EdgeWeightsProxi& MSNet::EdgeWeightsProxi::operator= | ( | const EdgeWeightsProxi & | ) | [private] |
const MSEdgeWeightsStorage& MSNet::EdgeWeightsProxi::myNetKnowledge [private] |
const MSEdgeWeightsStorage& MSNet::EdgeWeightsProxi::myVehicleKnowledge [private] |