|
SUMO - Simulation of Urban MObility
|
A basic edge for routing applications. More...
#include <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. | |
Set-up methods | |
| virtual void | addLane (ROLane *lane) throw () |
| Adds a lane to the edge while loading. | |
| virtual void | addFollower (ROEdge *s) throw () |
| Adds information about a connected edge. | |
| void | setType (EdgeType type) throw () |
| Sets the type of te edge. | |
| void | buildTimeLines (const std::string &measure) throw () |
| Builds the internal representation of the travel time/effort. | |
Getter methods | |
| const std::string & | getID () const throw () |
| Returns the id of the edge. | |
| EdgeType | getType () const throw () |
| Returns the type of the edge. | |
| 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. | |
| unsigned int | getLaneNo () const throw () |
| Returns the number of lanes this edge has. | |
| RONode * | getFromNode () const throw () |
| Returns the node this edge starts at. | |
| RONode * | getToNode () const throw () |
| Returns the node this edge ends at. | |
| 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. | |
| bool | allFollowersProhibit (const ROVehicle *const vehicle) const throw () |
| Returns whether this edge succeding edges prohibit the given vehicle to pass them. | |
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. | |
| unsigned int | getNoFollowing () const throw () |
| Returns the number of edges this edge is connected to. | |
| ROEdge * | getFollower (unsigned int pos) const throw () |
| Returns the edge at the given position from the list of reachable edges. | |
| SUMOReal | getEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| Returns the effort for this edge. | |
| SUMOReal | getTravelTime (const ROVehicle *const veh, SUMOReal time) const throw () |
| Returns the travel time for this edge. | |
| SUMOReal | getCOEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getCO2Effort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getPMxEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getHCEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getNOxEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getFuelEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
| SUMOReal | getNoiseEffort (const ROVehicle *const veh, SUMOReal time) const throw () |
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 | |
| SUMOVehicleClasses | 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. | |
| SUMOVehicleClasses | 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. | |
A basic edge for routing applications.
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.
| enum ROEdge::EdgeType |
| 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.
| ROEdge::~ROEdge | ( | ) | throw () [virtual] |
| 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 114 of file ROEdge.cpp.
Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::addEdgeWeight().
| 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 106 of file ROEdge.cpp.
Referenced by ROJTREdge::addFollower(), RONetHandler::parseConnectedEdge(), RONetHandler::parseConnection(), RONetHandler::parseDistrict(), and RONetHandler::parseDistrictEdge().
| 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 SUMOReal.
Referenced by RONetHandler::parseLane().
| 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 121 of file ROEdge.cpp.
Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight().
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 368 of file ROEdge.cpp.
Referenced by ROJTREdge::chooseNext().
| 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 "weight-attribute" is one of "CO", "CO2", "HC", "NOx", "PMx", or "fuel" the proper value (departs/s) is computed and multiplied with the travel time.
| [in] | measure | The name of the measure to use. |
Definition at line 337 of file ROEdge.cpp.
References HelpersHBEFA::computeCO(), HelpersHBEFA::computeCO2(), HelpersHBEFA::computeFuel(), HelpersHBEFA::computeHC(), HelpersHBEFA::computeNOx(), HelpersHBEFA::computePMx(), SUMOReal, and SVE_UNKNOWN.
| ROEdge * ROEdge::dictionary | ( | size_t | index | ) | throw () [static] |
Returns the ROEdge at the index.
Definition at line 379 of file ROEdge.cpp.
| SUMOReal ROEdge::getCO2Effort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const throw () |
Definition at line 176 of file ROEdge.cpp.
References HelpersHBEFA::computeCO2(), MIN2(), SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getCOEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const throw () |
Definition at line 160 of file ROEdge.cpp.
References HelpersHBEFA::computeCO(), MIN2(), SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| 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 128 of file ROEdge.cpp.
References SUMOReal, and UNUSED_PARAMETER.
| 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().
| 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(), and AGPosition::compute2dPosition().
| SUMOReal ROEdge::getFuelEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const throw () |
Definition at line 240 of file ROEdge.cpp.
References HelpersHBEFA::computeFuel(), MIN2(), SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getHCEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const throw () |
Definition at line 208 of file ROEdge.cpp.
References HelpersHBEFA::computeHC(), MIN2(), SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| 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(), RODFNet::buildEdgeFlowMap(), ROJTRRouter::compute(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), AGStreet::getName(), RORDLoader_SUMOBase::myCharacters(), and AGStreet::print().
| 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().
| 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(), RODFNet::getAbsPos(), AGStreet::getLength(), and AGStreet::print().
| 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 297 of file ROEdge.cpp.
References ET_SINK, getType(), and myFollowingEdges.
Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().
| SUMOReal ROEdge::getNoiseEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const throw () |
Definition at line 256 of file ROEdge.cpp.
References HelpersHarmonoise::computeNoise(), MIN2(), SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getNOxEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const throw () |
Definition at line 224 of file ROEdge.cpp.
References HelpersHBEFA::computeNOx(), MIN2(), SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| unsigned int ROEdge::getNumericalID | ( | ) | const throw () [inline] |
| SUMOReal ROEdge::getPMxEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const throw () |
Definition at line 192 of file ROEdge.cpp.
References HelpersHBEFA::computePMx(), MIN2(), SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| 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::buildEdgeFlowMap(), RODFNet::buildRoutes(), RODFNet::computeRoutesFor(), RODFNet::isDestination(), RODFNet::isFalseSource(), and RODFNet::isSource().
| 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 272 of file ROEdge.cpp.
References SUMOReal, toString(), and WRITE_WARNING.
| 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(), and AGPosition::compute2dPosition().
| 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 139 of file ROEdge.cpp.
References SUMOReal, toString(), and WRITE_WARNING.
Referenced by ROJTRRouter::compute(), and computeRoutes().
| 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().
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.
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 312 of file ROEdge.cpp.
References DEFAULT_VEH_CLASS, and SVC_UNKNOWN.
Referenced by ROJTREdge::chooseNext(), and ROJTRRouter::compute().
| void ROEdge::setType | ( | ROEdge::EdgeType | type | ) | throw () |
Sets the type of te edge.
| [in] | type | The new type for the edge |
Definition at line 306 of file ROEdge.cpp.
Referenced by loadJTRDefinitions(), ROJTRTurnDefLoader::myCharacters(), ROJTRTurnDefLoader::myStartElement(), RONetHandler::parseDistrict(), and RONetHandler::parseEdge().
SUMOVehicleClasses ROEdge::myAllowedClasses [protected] |
std::vector< ROEdge * > ROEdge::myEdges [static, protected] |
ValueTimeLine<SUMOReal> ROEdge::myEfforts [mutable, protected] |
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 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] |
bool ROEdge::myHaveTTWarned = false [static, protected] |
std::string ROEdge::myID [protected] |
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] |
std::vector<ROLane*> ROEdge::myLanes [protected] |
This edge's lanes.
Definition at line 360 of file ROEdge.h.
Referenced by getLaneNo(), and ~ROEdge().
SUMOReal ROEdge::myLength [protected] |
SUMOVehicleClasses ROEdge::myNotAllowedClasses [protected] |
SUMOReal ROEdge::mySpeed [protected] |
The maximum speed allowed on this edge.
Definition at line 322 of file ROEdge.h.
Referenced by getSpeed().
RONode * ROEdge::myToNode [protected] |
Definition at line 369 of file ROEdge.h.
Referenced by getToNode().
ValueTimeLine<SUMOReal> ROEdge::myTravelTimes [mutable, protected] |
EdgeType ROEdge::myType [protected] |
bool ROEdge::myUseBoundariesOnOverrideE [protected] |
bool ROEdge::myUseBoundariesOnOverrideTT [protected] |
bool ROEdge::myUsingETimeLine [protected] |
bool ROEdge::myUsingTTTimeLine [protected] |