#include <MSNet.h>
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.
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 MSEdgeWeightsStorage & | myNetKnowledge |
| The global knownledge. | |
| const MSEdgeWeightsStorage & | myVehicleKnowledge |
| The vehicle's knownledge. | |
| MSNet::EdgeWeightsProxi::EdgeWeightsProxi | ( | const MSEdgeWeightsStorage & | vehKnowledge, | |
| const MSEdgeWeightsStorage & | netKnowledge | |||
| ) | [inline] |
Constructor.
| [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] |
| 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 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.
| [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 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 }
const MSEdgeWeightsStorage& MSNet::EdgeWeightsProxi::myNetKnowledge [private] |
The global knownledge.
Definition at line 539 of file MSNet.h.
Referenced by getEffort(), and getTravelTime().
const MSEdgeWeightsStorage& MSNet::EdgeWeightsProxi::myVehicleKnowledge [private] |
The vehicle's knownledge.
Definition at line 536 of file MSNet.h.
Referenced by getEffort(), and getTravelTime().
1.5.6