|
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) | |
| Constructor. | |
| virtual | ~ROEdge () |
| Destructor. | |
Set-up methods | |
| virtual void | addLane (ROLane *lane) |
| Adds a lane to the edge while loading. | |
| virtual void | addFollower (ROEdge *s) |
| Adds information about a connected edge. | |
| void | setType (EdgeType type) |
| Sets the type of te edge. | |
| void | buildTimeLines (const std::string &measure) |
| Builds the internal representation of the travel time/effort. | |
Getter methods | |
| const std::string & | getID () const |
| Returns the id of the edge. | |
| EdgeType | getType () const |
| Returns the type of the edge. | |
| SUMOReal | getLength () const |
| Returns the length of the edge. | |
| unsigned int | getNumericalID () const |
| Returns the index (numeric id) of the edge. | |
| SUMOReal | getSpeed () const |
| Returns the speed allowed on this edge. | |
| unsigned int | getLaneNo () const |
| Returns the number of lanes this edge has. | |
| RONode * | getFromNode () const |
| Returns the node this edge starts at. | |
| RONode * | getToNode () const |
| Returns the node this edge ends at. | |
| bool | isConnectedTo (const ROEdge *const e) const |
| returns the information whether this edge is directly connected to the given | |
| bool | prohibits (const ROVehicle *const vehicle) const |
| Returns whether this edge prohibits the given vehicle to pass it. | |
| bool | allFollowersProhibit (const ROVehicle *const vehicle) const |
| 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) |
| Adds a weight value. | |
| void | addTravelTime (SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd) |
| Adds a travel time value. | |
| unsigned int | getNoFollowing () const |
| Returns the number of edges this edge is connected to. | |
| ROEdge * | getFollower (unsigned int pos) const |
| Returns the edge at the given position from the list of reachable edges. | |
| SUMOReal | getEffort (const ROVehicle *const veh, SUMOReal time) const |
| Returns the effort for this edge. | |
| SUMOReal | getTravelTime (const ROVehicle *const veh, SUMOReal time) const |
| Returns the travel time for this edge. | |
| SUMOReal | getCOEffort (const ROVehicle *const veh, SUMOReal time) const |
| SUMOReal | getCO2Effort (const ROVehicle *const veh, SUMOReal time) const |
| SUMOReal | getPMxEffort (const ROVehicle *const veh, SUMOReal time) const |
| SUMOReal | getHCEffort (const ROVehicle *const veh, SUMOReal time) const |
| SUMOReal | getNOxEffort (const ROVehicle *const veh, SUMOReal time) const |
| SUMOReal | getFuelEffort (const ROVehicle *const veh, SUMOReal time) const |
| SUMOReal | getNoiseEffort (const ROVehicle *const veh, SUMOReal time) const |
Static Public Member Functions | |
| static ROEdge * | dictionary (size_t index) |
| Returns the ROEdge at the index. | |
Protected Member Functions | |
| bool | getStoredEffort (SUMOReal time, SUMOReal &ret) const |
| 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 |
||
| ) |
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 62 of file ROEdge.cpp.
References myEdges.
| ROEdge::~ROEdge | ( | ) | [virtual] |
| ROEdge::ROEdge | ( | const ROEdge & | src | ) | [private] |
Invalidated copy constructor.
| void ROEdge::addEffort | ( | SUMOReal | value, |
| SUMOReal | timeBegin, | ||
| SUMOReal | timeEnd | ||
| ) |
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 118 of file ROEdge.cpp.
References ValueTimeLine< T >::add(), myEfforts, and myUsingETimeLine.
Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::addEdgeWeight().
| void ROEdge::addFollower | ( | ROEdge * | s | ) | [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 110 of file ROEdge.cpp.
References myFollowingEdges.
Referenced by RONetHandler::parseConnectedEdge(), RONetHandler::parseConnection(), RONetHandler::parseDistrict(), and RONetHandler::parseDistrictEdge().
| void ROEdge::addLane | ( | ROLane * | lane | ) | [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 84 of file ROEdge.cpp.
References ROLane::getAllowedClasses(), ROLane::getLength(), ROLane::getNotAllowedClasses(), ROLane::getSpeed(), myAllowedClasses, myLanes, myLength, myNotAllowedClasses, mySpeed, and SUMOReal.
Referenced by RONetHandler::parseLane().
| void ROEdge::addTravelTime | ( | SUMOReal | value, |
| SUMOReal | timeBegin, | ||
| SUMOReal | timeEnd | ||
| ) |
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 125 of file ROEdge.cpp.
References ValueTimeLine< T >::add(), myTravelTimes, and myUsingTTTimeLine.
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 372 of file ROEdge.cpp.
References myFollowingEdges.
Referenced by ROJTREdge::chooseNext().
| void ROEdge::buildTimeLines | ( | const std::string & | measure | ) |
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 341 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.
| ROEdge * ROEdge::dictionary | ( | size_t | index | ) | [static] |
| SUMOReal ROEdge::getCO2Effort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
Definition at line 180 of file ROEdge.cpp.
References HelpersHBEFA::computeCO2(), SUMOVTypeParameter::emissionClass, getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getCOEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
Definition at line 164 of file ROEdge.cpp.
References HelpersHBEFA::computeCO(), SUMOVTypeParameter::emissionClass, getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
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 132 of file ROEdge.cpp.
References getStoredEffort(), myLength, mySpeed, SUMOReal, and UNUSED_PARAMETER.
| ROEdge* ROEdge::getFollower | ( | unsigned int | pos | ) | const [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 272 of file ROEdge.h.
References myFollowingEdges.
Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().
| RONode* ROEdge::getFromNode | ( | ) | const [inline] |
Returns the node this edge starts at.
Definition at line 198 of file ROEdge.h.
References myFromNode.
Referenced by RODFNet::buildApproachList(), and AGPosition::compute2dPosition().
| SUMOReal ROEdge::getFuelEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
Definition at line 244 of file ROEdge.cpp.
References HelpersHBEFA::computeFuel(), SUMOVTypeParameter::emissionClass, getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getHCEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
Definition at line 212 of file ROEdge.cpp.
References HelpersHBEFA::computeHC(), SUMOVTypeParameter::emissionClass, getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| const std::string& ROEdge::getID | ( | ) | const [inline] |
Returns the id of the edge.
Definition at line 150 of file ROEdge.h.
References myID.
Referenced by RONet::addEdge(), ROJTREdge::addFollowerProbability(), RODFNet::buildApproachList(), RODFNet::buildEdgeFlowMap(), ROJTRRouter::compute(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), AGStreet::getName(), and AGStreet::print().
| unsigned int ROEdge::getLaneNo | ( | ) | const [inline] |
Returns the number of lanes this edge has.
Definition at line 190 of file ROEdge.h.
References myLanes.
Referenced by RODFDetectorHandler::myStartElement().
| SUMOReal ROEdge::getLength | ( | ) | const [inline] |
Returns the length of the edge.
Definition at line 167 of file ROEdge.h.
References myLength.
Referenced by AGStreet::AGStreet(), RODFNet::buildRoutes(), RODFNet::getAbsPos(), AGStreet::getLength(), and AGStreet::print().
| unsigned int ROEdge::getNoFollowing | ( | ) | const |
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 301 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 |
Definition at line 260 of file ROEdge.cpp.
References HelpersHarmonoise::computeNoise(), SUMOVTypeParameter::emissionClass, getStoredEffort(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getNOxEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
Definition at line 228 of file ROEdge.cpp.
References HelpersHBEFA::computeNOx(), SUMOVTypeParameter::emissionClass, getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| unsigned int ROEdge::getNumericalID | ( | ) | const [inline] |
| SUMOReal ROEdge::getPMxEffort | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
Definition at line 196 of file ROEdge.cpp.
References HelpersHBEFA::computePMx(), SUMOVTypeParameter::emissionClass, getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMOReal, and SVE_UNKNOWN.
Referenced by computeRoutes().
| SUMOReal ROEdge::getSpeed | ( | ) | const [inline] |
Returns the speed allowed on this edge.
Definition at line 182 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 [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 276 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().
| RONode* ROEdge::getToNode | ( | ) | const [inline] |
Returns the node this edge ends at.
Definition at line 206 of file ROEdge.h.
References myToNode.
Referenced by RODFNet::buildApproachList(), and AGPosition::compute2dPosition().
| SUMOReal ROEdge::getTravelTime | ( | const ROVehicle *const | veh, |
| SUMOReal | time | ||
| ) | const |
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 143 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().
| EdgeType ROEdge::getType | ( | ) | const [inline] |
Returns the type of the edge.
Definition at line 159 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 216 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 316 of file ROEdge.cpp.
References DEFAULT_VEH_CLASS, ROVehicle::getType(), myAllowedClasses, myNotAllowedClasses, SVC_UNKNOWN, and SUMOVTypeParameter::vehicleClass.
Referenced by ROJTREdge::chooseNext(), and ROJTRRouter::compute().
| void ROEdge::setType | ( | ROEdge::EdgeType | type | ) |
Sets the type of te edge.
| [in] | type | The new type for the edge |
Definition at line 310 of file ROEdge.cpp.
References myType.
Referenced by loadJTRDefinitions(), ROJTRTurnDefLoader::myCharacters(), ROJTRTurnDefLoader::myStartElement(), RONetHandler::parseDistrict(), and RONetHandler::parseEdge().
SUMOVehicleClasses ROEdge::myAllowedClasses [protected] |
The list of allowed vehicle classes.
Definition at line 367 of file ROEdge.h.
Referenced by addLane(), and prohibits().
std::vector< ROEdge * > ROEdge::myEdges [static, protected] |
Definition at line 375 of file ROEdge.h.
Referenced by dictionary(), and ROEdge().
ValueTimeLine<SUMOReal> ROEdge::myEfforts [mutable, protected] |
Container storing passing time varying over time for the edge.
Definition at line 345 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 358 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 373 of file ROEdge.h.
Referenced by getFromNode().
bool ROEdge::myHaveEWarned = false [static, protected] |
Information whether the edge has reported missing weights.
Definition at line 351 of file ROEdge.h.
Referenced by getStoredEffort().
bool ROEdge::myHaveTTWarned = false [static, protected] |
Information whether the edge has reported missing weights.
Definition at line 342 of file ROEdge.h.
Referenced by getTravelTime().
std::string ROEdge::myID [protected] |
The id of the edge.
Definition at line 323 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 329 of file ROEdge.h.
Referenced by getNumericalID().
bool ROEdge::myInterpolate [protected] |
Information whether to interpolate at interval boundaries.
Definition at line 354 of file ROEdge.h.
Referenced by getStoredEffort(), and getTravelTime().
std::vector<ROLane*> ROEdge::myLanes [protected] |
This edge's lanes.
Definition at line 364 of file ROEdge.h.
Referenced by addLane(), getLaneNo(), and ~ROEdge().
SUMOReal ROEdge::myLength [protected] |
The length of the edge.
Definition at line 332 of file ROEdge.h.
Referenced by addLane(), buildTimeLines(), getEffort(), getLength(), and getTravelTime().
SUMOVehicleClasses ROEdge::myNotAllowedClasses [protected] |
The list of disallowed vehicle classes.
Definition at line 370 of file ROEdge.h.
Referenced by addLane(), and prohibits().
SUMOReal ROEdge::mySpeed [protected] |
The maximum speed allowed on this edge.
Definition at line 326 of file ROEdge.h.
Referenced by addLane(), buildTimeLines(), getCO2Effort(), getCOEffort(), getEffort(), getFuelEffort(), getHCEffort(), getNoiseEffort(), getNOxEffort(), getPMxEffort(), getSpeed(), and getTravelTime().
RONode * ROEdge::myToNode [protected] |
Definition at line 373 of file ROEdge.h.
Referenced by getToNode().
ValueTimeLine<SUMOReal> ROEdge::myTravelTimes [mutable, protected] |
Container storing passing time varying over time for the edge.
Definition at line 336 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 349 of file ROEdge.h.
Referenced by buildTimeLines().
bool ROEdge::myUseBoundariesOnOverrideTT [protected] |
Whether overriding weight boundaries shall be reported.
Definition at line 340 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 347 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 338 of file ROEdge.h.
Referenced by addTravelTime(), buildTimeLines(), and getTravelTime().