#include <ROEdge.h>

The edge contains two time lines, one for the travel time and one for a second measure which may be used for computing the costs of a route. After loading the weights, it is needed to call "buildTimeLines" in order to initialise these time lines.
Definition at line 60 of file ROEdge.h.
Public Types | |
| enum | EdgeType { ET_NORMAL, ET_DISTRICT, ET_SOURCE, ET_SINK } |
| Possible types of edges. More... | |
Public Member Functions | |
| ROEdge (const std::string &id, RONode *from, RONode *to, unsigned int index, bool useBoundariesOnOverride, bool interpolate=false) throw () | |
| Constructor. | |
| virtual | ~ROEdge () throw () |
| Destructor. | |
Methods for getting/setting travel time and cost information | |
| void | addEffort (SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd) throw () |
| Adds a weight value. | |
| void | addTravelTime (SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd) throw () |
| Adds a travel time value. | |
| SUMOReal | getCO2Effort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getCOEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| Returns the effort for this edge. | |
| ROEdge * | getFollower (unsigned int pos) const throw () |
| Returns the edge at the given position from the list of reachable edges. | |
| SUMOReal | getFuelEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getHCEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| unsigned int | getNoFollowing () const throw () |
| Returns the number of edges this edge is connected to. | |
| SUMOReal | getNoiseEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getNOxEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getPMxEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getTravelTime (const ROVehicle *const veh, SUMOReal time) const throw () |
| Returns the travel time for this edge. | |
Set-up methods | |
| virtual void | addFollower (ROEdge *s) throw () |
| Adds information about a connected edge. | |
| virtual void | addLane (ROLane *lane) throw () |
| Adds a lane to the edge while loading. | |
| void | buildTimeLines (const std::string &measure) throw () |
| Builds the internal representation of the travel time/effort. | |
| void | setType (EdgeType type) throw () |
| Sets the type of te edge. | |
Getter methods | |
| bool | allFollowersProhibit (const ROVehicle *const vehicle) const throw () |
| Returns whether this edge succeding edges prohibit the given vehicle to pass them. | |
| RONode * | getFromNode () const throw () |
| Returns the node this edge starts at. | |
| const std::string & | getID () const throw () |
| Returns the id of the edge. | |
| unsigned int | getLaneNo () const throw () |
| Returns the number of lanes this edge has. | |
| SUMOReal | getLength () const throw () |
| Returns the length of the edge. | |
| unsigned int | getNumericalID () const throw () |
| Returns the index (numeric id) of the edge. | |
| SUMOReal | getSpeed () const throw () |
| Returns the speed allowed on this edge. | |
| RONode * | getToNode () const throw () |
| Returns the node this edge ends at. | |
| EdgeType | getType () const throw () |
| Returns the type of the edge. | |
| bool | isConnectedTo (const ROEdge *const e) const throw () |
| returns the information whether this edge is directly connected to the given | |
| bool | prohibits (const ROVehicle *const vehicle) const throw () |
| Returns whether this edge prohibits the given vehicle to pass it. | |
Static Public Member Functions | |
| static ROEdge * | dictionary (size_t index) throw () |
| Returns the ROEdge at the index. | |
Protected Member Functions | |
| bool | getStoredEffort (SUMOReal time, SUMOReal &ret) const throw () |
| Retrieves the stored effort. | |
Protected Attributes | |
| std::vector< SUMOVehicleClass > | myAllowedClasses |
| The list of allowed vehicle classes. | |
| ValueTimeLine< SUMOReal > | myEfforts |
| Container storing passing time varying over time for the edge. | |
| std::vector< ROEdge * > | myFollowingEdges |
| List of edges that may be approached from this edge. | |
| RONode * | myFromNode |
| The nodes this edge is connecting. | |
| std::string | myID |
| The id of the edge. | |
| unsigned int | myIndex |
| The index (numeric id) of the edge. | |
| bool | myInterpolate |
| Information whether to interpolate at interval boundaries. | |
| std::vector< ROLane * > | myLanes |
| This edge's lanes. | |
| SUMOReal | myLength |
| The length of the edge. | |
| std::vector< SUMOVehicleClass > | myNotAllowedClasses |
| The list of disallowed vehicle classes. | |
| SUMOReal | mySpeed |
| The maximum speed allowed on this edge. | |
| RONode * | myToNode |
| ValueTimeLine< SUMOReal > | myTravelTimes |
| Container storing passing time varying over time for the edge. | |
| EdgeType | myType |
| The type of the edge. | |
| bool | myUseBoundariesOnOverrideE |
| Whether overriding weight boundaries shall be reported. | |
| bool | myUseBoundariesOnOverrideTT |
| Whether overriding weight boundaries shall be reported. | |
| bool | myUsingETimeLine |
| Information whether the time line shall be used instead of the length value. | |
| bool | myUsingTTTimeLine |
| Information whether the time line shall be used instead of the length value. | |
Static Protected Attributes | |
| static std::vector< ROEdge * > | myEdges |
| static bool | myHaveEWarned = false |
| Information whether the edge has reported missing weights. | |
| static bool | myHaveTTWarned = false |
| Information whether the edge has reported missing weights. | |
Private Member Functions | |
| ROEdge & | operator= (const ROEdge &src) |
| Invalidated assignment operator. | |
| ROEdge (const ROEdge &src) | |
| Invalidated copy constructor. | |
| enum ROEdge::EdgeType |
Possible types of edges.
Definition at line 66 of file ROEdge.h.
00066 { 00068 ET_NORMAL, 00070 ET_DISTRICT, 00072 ET_SOURCE, 00074 ET_SINK 00075 };
| ROEdge::ROEdge | ( | const std::string & | id, | |
| RONode * | from, | |||
| RONode * | to, | |||
| unsigned int | index, | |||
| bool | useBoundariesOnOverride, | |||
| bool | interpolate = false | |||
| ) | throw () |
Constructor.
| [in] | id | The id of the edge |
| [in] | from | The node the edge begins at |
| [in] | to | The node the edge ends at |
| [in] | index | The numeric id of the edge |
| [in] | useBoundariesOnOverride | Whether the edge shall use a boundary value if the requested is beyond known time scale |
| [in] | interpolate | Whether the edge shall interpolate at interval boundaries |
Definition at line 58 of file ROEdge.cpp.
00060 : myID(id), mySpeed(-1), 00061 myIndex(index), myLength(-1), 00062 myUsingTTTimeLine(false), myUseBoundariesOnOverrideTT(useBoundariesOnOverride), 00063 myUsingETimeLine(false), myUseBoundariesOnOverrideE(useBoundariesOnOverride), 00064 myFromNode(from), myToNode(to), myInterpolate(interpolate) { 00065 while (myEdges.size()<=index) { 00066 myEdges.push_back(0); 00067 } 00068 myEdges[index] = this; 00069 }
| ROEdge::~ROEdge | ( | ) | throw () [virtual] |
Destructor.
Definition at line 72 of file ROEdge.cpp.
References myLanes.
00072 { 00073 for (std::vector<ROLane*>::iterator i=myLanes.begin(); i!=myLanes.end(); ++i) { 00074 delete(*i); 00075 } 00076 }
| ROEdge::ROEdge | ( | const ROEdge & | src | ) | [private] |
Invalidated copy constructor.
| void ROEdge::addEffort | ( | SUMOReal | value, | |
| SUMOReal | timeBegin, | |||
| SUMOReal | timeEnd | |||
| ) | throw () |
Adds a weight value.
| [in] | value | The value to add |
| [in] | timeBegin | The begin time of the interval the given value is valid for [s] |
| [in] | timeEnd | The end time of the interval the given value is valid for [s] |
Definition at line 132 of file ROEdge.cpp.
References ValueTimeLine< T >::add(), myEfforts, and myUsingETimeLine.
Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::addEdgeWeight().
00132 { 00133 myEfforts.add(timeBegin, timeEnd, value); 00134 myUsingETimeLine = true; 00135 }
| void ROEdge::addFollower | ( | ROEdge * | s | ) | throw () [virtual] |
Adds information about a connected edge.
The edge is added to "myFollowingEdges".
| [in] | lane | The lane to add |
Reimplemented in ROJTREdge.
Definition at line 124 of file ROEdge.cpp.
References myFollowingEdges.
Referenced by ROJTREdge::addFollower(), RONetHandler::parseConnectedEdge(), RONetHandler::parseDistrict(), and RONetHandler::parseDistrictEdge().
00124 { 00125 if (find(myFollowingEdges.begin(), myFollowingEdges.end(), s)==myFollowingEdges.end()) { 00126 myFollowingEdges.push_back(s); 00127 } 00128 }
| void ROEdge::addLane | ( | ROLane * | lane | ) | throw () [virtual] |
Adds a lane to the edge while loading.
The lane's length is adapted. Additionally, the information about allowed/disallowed vehicle classes is patched using the information stored in the lane.
| [in] | lane | The lane to add |
Definition at line 80 of file ROEdge.cpp.
References myAllowedClasses, myLanes, myLength, myNotAllowedClasses, mySpeed, and SUMOReal.
Referenced by RONetHandler::parseLane().
00080 { 00081 SUMOReal length = lane->getLength(); 00082 assert(myLength==-1||length==myLength); 00083 myLength = length; 00084 SUMOReal speed = lane->getSpeed(); 00085 mySpeed = speed > mySpeed ? speed : mySpeed; 00086 myLanes.push_back(lane); 00087 00088 std::vector<SUMOVehicleClass>::const_iterator i; 00089 const std::vector<SUMOVehicleClass> &allowed = lane->getAllowedClasses(); 00090 // for allowed classes 00091 for (i=allowed.begin(); i!=allowed.end(); ++i) { 00092 SUMOVehicleClass allowedC = *i; 00093 std::vector<SUMOVehicleClass>::iterator t; 00094 // add to allowed if not already in there 00095 t = find(myAllowedClasses.begin(), myAllowedClasses.end(), allowedC); 00096 if (t==myAllowedClasses.end()) { 00097 myAllowedClasses.push_back(allowedC); 00098 } 00099 // remove from disallowed if allowed on the lane 00100 t = find(myNotAllowedClasses.begin(), myNotAllowedClasses.end(), allowedC); 00101 if (t!=myNotAllowedClasses.end()) { 00102 myNotAllowedClasses.erase(t); 00103 } 00104 } 00105 // for disallowed classes 00106 const std::vector<SUMOVehicleClass> &disallowed = lane->getNotAllowedClasses(); 00107 for (i=disallowed.begin(); i!=disallowed.end(); ++i) { 00108 SUMOVehicleClass disallowedC = *i; 00109 std::vector<SUMOVehicleClass>::iterator t; 00110 // add to disallowed if not already in there 00111 // and not within allowed 00112 t = find(myAllowedClasses.begin(), myAllowedClasses.end(), disallowedC); 00113 if (t==myAllowedClasses.end()) { 00114 t = find(myNotAllowedClasses.begin(), myNotAllowedClasses.end(), disallowedC); 00115 if (t==myNotAllowedClasses.end()) { 00116 myNotAllowedClasses.push_back(disallowedC); 00117 } 00118 } 00119 } 00120 }
| void ROEdge::addTravelTime | ( | SUMOReal | value, | |
| SUMOReal | timeBegin, | |||
| SUMOReal | timeEnd | |||
| ) | throw () |
Adds a travel time value.
| [in] | value | The value to add |
| [in] | timeBegin | The begin time of the interval the given value is valid for [s] |
| [in] | timeEnd | The end time of the interval the given value is valid for [s] |
Definition at line 139 of file ROEdge.cpp.
References ValueTimeLine< T >::add(), myTravelTimes, and myUsingTTTimeLine.
Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight().
00139 { 00140 myTravelTimes.add(timeBegin, timeEnd, value); 00141 myUsingTTTimeLine = true; 00142 }
Returns whether this edge succeding edges prohibit the given vehicle to pass them.
| [in] | vehicle | The vehicle for which the information has to be returned |
Definition at line 385 of file ROEdge.cpp.
References myFollowingEdges.
Referenced by ROJTREdge::chooseNext().
00385 { 00386 for (std::vector<ROEdge*>::const_iterator i=myFollowingEdges.begin(); i!=myFollowingEdges.end(); ++i) { 00387 if (!(*i)->prohibits(vehicle)) { 00388 return false; 00389 } 00390 } 00391 return true; 00392 }
| void ROEdge::buildTimeLines | ( | const std::string & | measure | ) | throw () |
Builds the internal representation of the travel time/effort.
Should be called after weights / travel times have been loaded.
In the case "measure" is one of "CO", "CO2", "HC", "NOx", "PMx", or "fuel" the proper value (emission/s) is computed and multiplied with the travel time.
| [in] | measure | The name of the measure to use. |
Definition at line 354 of file ROEdge.cpp.
References HelpersHBEFA::computeCO(), HelpersHBEFA::computeCO2(), HelpersHBEFA::computeFuel(), HelpersHBEFA::computeHC(), HelpersHBEFA::computeNOx(), HelpersHBEFA::computePMx(), ValueTimeLine< T >::fillGaps(), myEfforts, myLength, mySpeed, myTravelTimes, myUseBoundariesOnOverrideE, myUseBoundariesOnOverrideTT, myUsingETimeLine, myUsingTTTimeLine, SUMOReal, and SVE_UNKNOWN.
00354 { 00355 if (myUsingETimeLine) { 00356 SUMOReal value = (SUMOReal)(myLength / mySpeed); 00357 if (measure=="CO") { 00358 value = HelpersHBEFA::computeCO(SVE_UNKNOWN, mySpeed, 0) * value; 00359 } 00360 if (measure=="CO2") { 00361 value = HelpersHBEFA::computeCO2(SVE_UNKNOWN, mySpeed, 0) * value; 00362 } 00363 if (measure=="HC") { 00364 value = HelpersHBEFA::computeHC(SVE_UNKNOWN, mySpeed, 0) * value; 00365 } 00366 if (measure=="PMx") { 00367 value = HelpersHBEFA::computePMx(SVE_UNKNOWN, mySpeed, 0) * value; 00368 } 00369 if (measure=="NOx") { 00370 value = HelpersHBEFA::computeNOx(SVE_UNKNOWN, mySpeed, 0) * value; 00371 } 00372 if (measure=="fuel") { 00373 value = HelpersHBEFA::computeFuel(SVE_UNKNOWN, mySpeed, 0) * value; 00374 } 00375 myEfforts.fillGaps(value, myUseBoundariesOnOverrideE); 00376 } 00377 if (myUsingTTTimeLine) { 00378 SUMOReal value = (SUMOReal)(myLength / mySpeed); 00379 myTravelTimes.fillGaps(value, myUseBoundariesOnOverrideTT); 00380 } 00381 }
| SUMOReal ROEdge::getCO2Effort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Definition at line 193 of file ROEdge.cpp.
References HelpersHBEFA::computeCO2(), getStoredEffort(), getTravelTime(), MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
00193 { 00194 SUMOReal ret = 0; 00195 if (!getStoredEffort(time, ret)) { 00196 SUMOReal v = mySpeed; 00197 SUMOEmissionClass c = SVE_UNKNOWN; 00198 if (veh->getType()!=0) { 00199 v = MIN2(veh->getType()->maxSpeed, mySpeed); 00200 c = veh->getType()->emissionClass; 00201 } 00202 ret = HelpersHBEFA::computeCO2(c, v, 0) * getTravelTime(veh, time); 00203 } 00204 return ret; 00205 }
| SUMOReal ROEdge::getCOEffort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Definition at line 177 of file ROEdge.cpp.
References HelpersHBEFA::computeCO(), getStoredEffort(), getTravelTime(), MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
00177 { 00178 SUMOReal ret = 0; 00179 if (!getStoredEffort(time, ret)) { 00180 SUMOReal v = mySpeed; 00181 SUMOEmissionClass c = SVE_UNKNOWN; 00182 if (veh->getType()!=0) { 00183 v = MIN2(veh->getType()->maxSpeed, mySpeed); 00184 c = veh->getType()->emissionClass; 00185 } 00186 ret = HelpersHBEFA::computeCO(c, v, 0) * getTravelTime(veh, time); 00187 } 00188 return ret; 00189 }
| SUMOReal ROEdge::getEffort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Returns the effort for this edge.
| [in] | veh | The vehicle for which the effort on this edge shall be retrieved |
| [in] | time | The tim for which the effort shall be returned [s] |
Definition at line 146 of file ROEdge.cpp.
References getStoredEffort(), myLength, mySpeed, and SUMOReal.
00146 { 00147 SUMOReal ret = 0; 00148 if (!getStoredEffort(time, ret)) { 00149 return (SUMOReal)(myLength / mySpeed); 00150 } 00151 return ret; 00152 }
| ROEdge* ROEdge::getFollower | ( | unsigned int | pos | ) | const throw () [inline] |
Returns the edge at the given position from the list of reachable edges.
| [in] | pos | The position of the list within the list of following |
Definition at line 268 of file ROEdge.h.
References myFollowingEdges.
Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().
00268 { 00269 return myFollowingEdges[pos]; 00270 }
| RONode* ROEdge::getFromNode | ( | ) | const throw () [inline] |
Returns the node this edge starts at.
Definition at line 194 of file ROEdge.h.
References myFromNode.
Referenced by RODFNet::buildApproachList().
00194 { 00195 return myFromNode; 00196 }
| SUMOReal ROEdge::getFuelEffort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Definition at line 257 of file ROEdge.cpp.
References HelpersHBEFA::computeFuel(), getStoredEffort(), getTravelTime(), MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
00257 { 00258 SUMOReal ret = 0; 00259 if (!getStoredEffort(time, ret)) { 00260 SUMOReal v = mySpeed; 00261 SUMOEmissionClass c = SVE_UNKNOWN; 00262 if (veh->getType()!=0) { 00263 v = MIN2(veh->getType()->maxSpeed, mySpeed); 00264 c = veh->getType()->emissionClass; 00265 } 00266 ret = HelpersHBEFA::computeFuel(c, v, 0) * getTravelTime(veh, time); 00267 } 00268 return ret; 00269 }
| SUMOReal ROEdge::getHCEffort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Definition at line 225 of file ROEdge.cpp.
References HelpersHBEFA::computeHC(), getStoredEffort(), getTravelTime(), MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
00225 { 00226 SUMOReal ret = 0; 00227 if (!getStoredEffort(time, ret)) { 00228 SUMOReal v = mySpeed; 00229 SUMOEmissionClass c = SVE_UNKNOWN; 00230 if (veh->getType()!=0) { 00231 v = MIN2(veh->getType()->maxSpeed, mySpeed); 00232 c = veh->getType()->emissionClass; 00233 } 00234 ret = HelpersHBEFA::computeHC(c, v, 0) * getTravelTime(veh, time); 00235 } 00236 return ret; 00237 }
| const std::string& ROEdge::getID | ( | ) | const throw () [inline] |
Returns the id of the edge.
Definition at line 146 of file ROEdge.h.
References myID.
Referenced by ROJTREdge::addFollowerProbability(), RODFNet::buildApproachList(), ROJTRRouter::compute(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), and RODFDetectorCon::getFlowFor().
00146 { 00147 return myID; 00148 }
| unsigned int ROEdge::getLaneNo | ( | ) | const throw () [inline] |
Returns the number of lanes this edge has.
Definition at line 186 of file ROEdge.h.
References myLanes.
Referenced by RODFDetectorHandler::myStartElement().
00186 { 00187 return (unsigned int) myLanes.size(); 00188 }
| SUMOReal ROEdge::getLength | ( | ) | const throw () [inline] |
Returns the length of the edge.
Definition at line 163 of file ROEdge.h.
References myLength.
Referenced by RODFNet::buildRoutes(), and RODFNet::getAbsPos().
00163 { 00164 return myLength; 00165 }
| unsigned int ROEdge::getNoFollowing | ( | ) | const throw () |
Returns the number of edges this edge is connected to.
If this edge's type is set to "sink", 0 is returned, otherwise the number of edges stored in "myFollowingEdges".
Definition at line 314 of file ROEdge.cpp.
References ET_SINK, getType(), and myFollowingEdges.
Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().
00314 { 00315 if (getType()==ET_SINK) { 00316 return 0; 00317 } 00318 return (unsigned int) myFollowingEdges.size(); 00319 }
| SUMOReal ROEdge::getNoiseEffort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Definition at line 273 of file ROEdge.cpp.
References HelpersHarmonoise::computeNoise(), getStoredEffort(), MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
00273 { 00274 SUMOReal ret = 0; 00275 if (!getStoredEffort(time, ret)) { 00276 SUMOReal v = mySpeed; 00277 SUMOEmissionClass c = SVE_UNKNOWN; 00278 if (veh->getType()!=0) { 00279 v = MIN2(veh->getType()->maxSpeed, mySpeed); 00280 c = veh->getType()->emissionClass; 00281 } 00282 ret = HelpersHarmonoise::computeNoise(veh->getType()->emissionClass, v, 0); 00283 } 00284 return ret; 00285 }
| SUMOReal ROEdge::getNOxEffort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Definition at line 241 of file ROEdge.cpp.
References HelpersHBEFA::computeNOx(), getStoredEffort(), getTravelTime(), MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
00241 { 00242 SUMOReal ret = 0; 00243 if (!getStoredEffort(time, ret)) { 00244 SUMOReal v = mySpeed; 00245 SUMOEmissionClass c = SVE_UNKNOWN; 00246 if (veh->getType()!=0) { 00247 v = MIN2(veh->getType()->maxSpeed, mySpeed); 00248 c = veh->getType()->emissionClass; 00249 } 00250 ret = HelpersHBEFA::computeNOx(c, v, 0) * getTravelTime(veh, time); 00251 } 00252 return ret; 00253 }
| unsigned int ROEdge::getNumericalID | ( | ) | const throw () [inline] |
| SUMOReal ROEdge::getPMxEffort | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Definition at line 209 of file ROEdge.cpp.
References HelpersHBEFA::computePMx(), getStoredEffort(), getTravelTime(), MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
00209 { 00210 SUMOReal ret = 0; 00211 if (!getStoredEffort(time, ret)) { 00212 SUMOReal v = mySpeed; 00213 SUMOEmissionClass c = SVE_UNKNOWN; 00214 if (veh->getType()!=0) { 00215 v = MIN2(veh->getType()->maxSpeed, mySpeed); 00216 c = veh->getType()->emissionClass; 00217 } 00218 ret = HelpersHBEFA::computePMx(c, v, 0) * getTravelTime(veh, time); 00219 } 00220 return ret; 00221 }
| SUMOReal ROEdge::getSpeed | ( | ) | const throw () [inline] |
Returns the speed allowed on this edge.
Definition at line 178 of file ROEdge.h.
References mySpeed.
Referenced by RODFNet::buildRoutes(), RODFNet::computeRoutesFor(), RODFNet::isDestination(), RODFNet::isFalseSource(), and RODFNet::isSource().
00178 { 00179 return mySpeed; 00180 }
| bool ROEdge::getStoredEffort | ( | SUMOReal | time, | |
| SUMOReal & | ret | |||
| ) | const throw () [protected] |
Retrieves the stored effort.
| [in] | veh | The vehicle for which the effort on this edge shall be retrieved |
| [in] | time | The tim for which the effort shall be returned |
Definition at line 289 of file ROEdge.cpp.
References ValueTimeLine< T >::describesTime(), ValueTimeLine< T >::getSplitTime(), ValueTimeLine< T >::getValue(), myEfforts, myHaveEWarned, myID, myInterpolate, myTravelTimes, myUsingETimeLine, SUMOReal, toString(), and WRITE_WARNING.
Referenced by getCO2Effort(), getCOEffort(), getEffort(), getFuelEffort(), getHCEffort(), getNoiseEffort(), getNOxEffort(), and getPMxEffort().
00289 { 00290 if (myUsingETimeLine) { 00291 if (!myEfforts.describesTime(time)) { 00292 if (!myHaveEWarned) { 00293 WRITE_WARNING("No interval matches passed time "+ toString(time) + " in edge '" + myID + "'.\n Using edge's length / edge's speed."); 00294 myHaveEWarned = true; 00295 } 00296 return false; 00297 } 00298 if (myInterpolate) { 00299 SUMOReal inTT = myTravelTimes.getValue(time); 00300 SUMOReal ratio = (SUMOReal)(myEfforts.getSplitTime(time, time + (SUMOTime)inTT) - time) / inTT; 00301 if (ratio >= 0) { 00302 ret = ratio * myEfforts.getValue(time) + (1-ratio)*myEfforts.getValue(time + (SUMOTime)inTT); 00303 return true; 00304 } 00305 } 00306 ret = myEfforts.getValue(time); 00307 return true; 00308 } 00309 return false; 00310 }
| RONode* ROEdge::getToNode | ( | ) | const throw () [inline] |
Returns the node this edge ends at.
Definition at line 202 of file ROEdge.h.
References myToNode.
Referenced by RODFNet::buildApproachList().
00202 { 00203 return myToNode; 00204 }
| SUMOReal ROEdge::getTravelTime | ( | const ROVehicle *const | veh, | |
| SUMOReal | time | |||
| ) | const throw () |
Returns the travel time for this edge.
| [in] | veh | The vehicle for which the effort on this edge shall be retrieved |
| [in] | time | The time for which the effort shall be returned [s] |
Definition at line 156 of file ROEdge.cpp.
References ValueTimeLine< T >::describesTime(), ValueTimeLine< T >::getSplitTime(), ValueTimeLine< T >::getValue(), myHaveTTWarned, myID, myInterpolate, myLength, mySpeed, myTravelTimes, myUsingTTTimeLine, SUMOReal, toString(), and WRITE_WARNING.
Referenced by ROJTRRouter::compute(), computeRoutes(), getCO2Effort(), getCOEffort(), getFuelEffort(), getHCEffort(), getNOxEffort(), and getPMxEffort().
00156 { 00157 if (myUsingTTTimeLine) { 00158 if (!myHaveTTWarned && !myTravelTimes.describesTime(time)) { 00159 WRITE_WARNING("No interval matches passed time "+ toString(time) + " in edge '" + myID + "'.\n Using edge's length / edge's speed."); 00160 myHaveTTWarned = true; 00161 } 00162 if (myInterpolate) { 00163 SUMOReal inTT = myTravelTimes.getValue(time); 00164 SUMOReal split = (SUMOReal)(myTravelTimes.getSplitTime(time, time + (SUMOTime)inTT) - time); 00165 if (split >= 0) { 00166 return myTravelTimes.getValue(time + (SUMOTime)inTT) *((SUMOReal)1. - split / inTT) + split; 00167 } 00168 } 00169 return myTravelTimes.getValue(time); 00170 } 00171 // ok, no absolute value was found, use the normal value (without) as default 00172 return (SUMOReal)(myLength / mySpeed); 00173 }
| EdgeType ROEdge::getType | ( | ) | const throw () [inline] |
Returns the type of the edge.
Definition at line 155 of file ROEdge.h.
References myType.
Referenced by RONet::checkSourceAndDestinations(), ROJTRRouter::compute(), and getNoFollowing().
00155 { 00156 return myType; 00157 }
returns the information whether this edge is directly connected to the given
| [in] | e | The edge which may be connected |
Definition at line 212 of file ROEdge.h.
References myFollowingEdges.
00212 { 00213 return std::find(myFollowingEdges.begin(), myFollowingEdges.end(), e)!=myFollowingEdges.end(); 00214 }
Returns whether this edge prohibits the given vehicle to pass it.
| [in] | vehicle | The vehicle for which the information has to be returned |
Definition at line 329 of file ROEdge.cpp.
References DEFAULT_VEH_CLASS, myAllowedClasses, myNotAllowedClasses, and SVC_UNKNOWN.
Referenced by ROJTREdge::chooseNext(), and ROJTRRouter::compute().
00329 { 00330 if (myAllowedClasses.size()==0&&myNotAllowedClasses.size()==0) { 00331 return false; 00332 } 00333 // ok, vehicles with an unknown class may be only prohibited 00334 // if the edge is limited to a set of classes 00335 SUMOVehicleClass vclass = vehicle->getType()!=0 ? vehicle->getType()->vehicleClass : DEFAULT_VEH_CLASS; 00336 if (vclass==SVC_UNKNOWN) { 00337 return false; 00338 } 00339 // check whether it is explicitely disallowed 00340 if (find(myNotAllowedClasses.begin(), myNotAllowedClasses.end(), vclass)!=myNotAllowedClasses.end()) { 00341 return true; 00342 } 00343 // check whether it is within the allowed classes 00344 if (myAllowedClasses.size()==0||find(myAllowedClasses.begin(), myAllowedClasses.end(), vclass)!=myAllowedClasses.end()) { 00345 return false; 00346 } 00347 // ok, we have a set of allowed vehicle classes, but this vehicle's class 00348 // is not among them 00349 return true; 00350 }
| void ROEdge::setType | ( | ROEdge::EdgeType | type | ) | throw () |
Sets the type of te edge.
| [in] | type | The new type for the edge |
Definition at line 323 of file ROEdge.cpp.
References myType.
Referenced by loadJTRDefinitions(), ROJTRTurnDefLoader::myCharacters(), ROJTRTurnDefLoader::myStartElement(), RONetHandler::parseDistrict(), and RONetHandler::parseEdge().
00323 { 00324 myType = type; 00325 }
std::vector<SUMOVehicleClass> ROEdge::myAllowedClasses [protected] |
The list of allowed vehicle classes.
Definition at line 363 of file ROEdge.h.
Referenced by addLane(), and prohibits().
std::vector< ROEdge * > ROEdge::myEdges [static, protected] |
ValueTimeLine<SUMOReal> ROEdge::myEfforts [mutable, protected] |
Container storing passing time varying over time for the edge.
Definition at line 341 of file ROEdge.h.
Referenced by addEffort(), buildTimeLines(), and getStoredEffort().
std::vector<ROEdge*> ROEdge::myFollowingEdges [protected] |
List of edges that may be approached from this edge.
Definition at line 354 of file ROEdge.h.
Referenced by addFollower(), allFollowersProhibit(), ROJTREdge::chooseNext(), getFollower(), getNoFollowing(), isConnectedTo(), and ROJTREdge::setTurnDefaults().
RONode* ROEdge::myFromNode [protected] |
The nodes this edge is connecting.
Definition at line 369 of file ROEdge.h.
Referenced by getFromNode().
bool ROEdge::myHaveEWarned = false [static, protected] |
Information whether the edge has reported missing weights.
Definition at line 347 of file ROEdge.h.
Referenced by getStoredEffort().
bool ROEdge::myHaveTTWarned = false [static, protected] |
Information whether the edge has reported missing weights.
Definition at line 338 of file ROEdge.h.
Referenced by getTravelTime().
std::string ROEdge::myID [protected] |
The id of the edge.
Definition at line 319 of file ROEdge.h.
Referenced by getID(), getStoredEffort(), and getTravelTime().
unsigned int ROEdge::myIndex [protected] |
The index (numeric id) of the edge.
Definition at line 325 of file ROEdge.h.
Referenced by getNumericalID().
bool ROEdge::myInterpolate [protected] |
Information whether to interpolate at interval boundaries.
Definition at line 350 of file ROEdge.h.
Referenced by getStoredEffort(), and getTravelTime().
std::vector<ROLane*> ROEdge::myLanes [protected] |
This edge's lanes.
Definition at line 360 of file ROEdge.h.
Referenced by addLane(), getLaneNo(), and ~ROEdge().
SUMOReal ROEdge::myLength [protected] |
The length of the edge.
Definition at line 328 of file ROEdge.h.
Referenced by addLane(), buildTimeLines(), getEffort(), getLength(), and getTravelTime().
std::vector<SUMOVehicleClass> ROEdge::myNotAllowedClasses [protected] |
The list of disallowed vehicle classes.
Definition at line 366 of file ROEdge.h.
Referenced by addLane(), and prohibits().
SUMOReal ROEdge::mySpeed [protected] |
The maximum speed allowed on this edge.
Definition at line 322 of file ROEdge.h.
Referenced by addLane(), buildTimeLines(), getCO2Effort(), getCOEffort(), getEffort(), getFuelEffort(), getHCEffort(), getNoiseEffort(), getNOxEffort(), getPMxEffort(), getSpeed(), and getTravelTime().
RONode * ROEdge::myToNode [protected] |
ValueTimeLine<SUMOReal> ROEdge::myTravelTimes [mutable, protected] |
Container storing passing time varying over time for the edge.
Definition at line 332 of file ROEdge.h.
Referenced by addTravelTime(), buildTimeLines(), getStoredEffort(), and getTravelTime().
EdgeType ROEdge::myType [protected] |
bool ROEdge::myUseBoundariesOnOverrideE [protected] |
Whether overriding weight boundaries shall be reported.
Definition at line 345 of file ROEdge.h.
Referenced by buildTimeLines().
bool ROEdge::myUseBoundariesOnOverrideTT [protected] |
Whether overriding weight boundaries shall be reported.
Definition at line 336 of file ROEdge.h.
Referenced by buildTimeLines().
bool ROEdge::myUsingETimeLine [protected] |
Information whether the time line shall be used instead of the length value.
Definition at line 343 of file ROEdge.h.
Referenced by addEffort(), buildTimeLines(), and getStoredEffort().
bool ROEdge::myUsingTTTimeLine [protected] |
Information whether the time line shall be used instead of the length value.
Definition at line 334 of file ROEdge.h.
Referenced by addTravelTime(), buildTimeLines(), and getTravelTime().
1.5.6