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 | |
SUMOReal | getDistanceTo (const ROEdge *other) const |
optimistic distance heuristic for use in routing | |
ROEdge (const std::string &id, RONode *from, RONode *to, unsigned int index) | |
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, std::string dir="") |
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. | |
SVCPermissions | getPermissions () const |
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 | getMinimumTravelTime (const ROVehicle *const veh) const |
Returns the travel time for this edge without using any stored timeLine. | |
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. | |
static size_t | dictSize () |
Returns the number of edges. | |
static void | setTimeLineOptions (bool useBoundariesOnOverrideTT, bool useBoundariesOnOverrideE, bool interpolate) |
Protected Member Functions | |
bool | getStoredEffort (SUMOReal time, SUMOReal &ret) const |
Retrieves the stored effort. |
Protected Attributes | |
SVCPermissions | myCombinedPermissions |
The list of allowed vehicle classes combined across lanes. | |
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. | |
std::vector< ROLane * > | myLanes |
This edge's lanes. | |
SUMOReal | myLength |
The length of the edge. | |
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 | 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. | |
static bool | myInterpolate = false |
Information whether to interpolate at interval boundaries. | |
static bool | myUseBoundariesOnOverrideE = false |
Whether overriding weight boundaries shall be reported. | |
static bool | myUseBoundariesOnOverrideTT = false |
Whether overriding weight boundaries shall be reported. |
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 |
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 |
Definition at line 65 of file ROEdge.cpp.
References myEdges.
|
virtual |
|
private |
Invalidated copy constructor.
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 111 of file ROEdge.cpp.
References ValueTimeLine< T >::add(), myEfforts, and myUsingETimeLine.
Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::addEdgeWeight().
|
virtual |
Adds information about a connected edge.
The edge is added to "myFollowingEdges".
[in] | s | The edge to add |
Reimplemented in ROJTREdge.
Definition at line 100 of file ROEdge.cpp.
References myFollowingEdges.
Referenced by RONetHandler::parseConnectedEdge(), RONetHandler::parseConnection(), RONetHandler::parseDistrict(), and RONetHandler::parseDistrictEdge().
|
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 86 of file ROEdge.cpp.
References ROLane::getLength(), ROLane::getPermissions(), ROLane::getSpeed(), myCombinedPermissions, myLanes, myLength, mySpeed, and SUMOReal.
Referenced by RONetHandler::parseLane().
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 118 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 333 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 302 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.
|
static |
|
inlinestatic |
Definition at line 180 of file ROEdge.cpp.
References HelpersHBEFA::computeDefaultCO2(), DEFAULT_VEH_ACCEL, DEFAULT_VEH_SIGMA, SUMOVTypeParameter::emissionClass, SUMOVTypeParameter::get(), getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMO_ATTR_ACCEL, SUMO_ATTR_SIGMA, and SUMOReal.
Referenced by computeRoutes().
Definition at line 168 of file ROEdge.cpp.
References HelpersHBEFA::computeDefaultCO(), DEFAULT_VEH_ACCEL, DEFAULT_VEH_SIGMA, SUMOVTypeParameter::emissionClass, SUMOVTypeParameter::get(), getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMO_ATTR_ACCEL, SUMO_ATTR_SIGMA, and SUMOReal.
Referenced by computeRoutes().
optimistic distance heuristic for use in routing
Definition at line 135 of file ROEdge.cpp.
References Position::distanceTo2D(), getFromNode(), RONode::getPosition(), and getToNode().
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 125 of file ROEdge.cpp.
References getStoredEffort(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), myLength, mySpeed, and SUMOReal.
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 277 of file ROEdge.h.
References myFollowingEdges.
Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().
|
inline |
Returns the node this edge starts at.
Definition at line 196 of file ROEdge.h.
References myFromNode.
Referenced by RODFNet::buildApproachList(), AGPosition::compute2dPosition(), and getDistanceTo().
Definition at line 228 of file ROEdge.cpp.
References HelpersHBEFA::computeDefaultFuel(), DEFAULT_VEH_ACCEL, DEFAULT_VEH_SIGMA, SUMOVTypeParameter::emissionClass, SUMOVTypeParameter::get(), getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMO_ATTR_ACCEL, SUMO_ATTR_SIGMA, and SUMOReal.
Referenced by computeRoutes().
Definition at line 204 of file ROEdge.cpp.
References HelpersHBEFA::computeDefaultHC(), DEFAULT_VEH_ACCEL, DEFAULT_VEH_SIGMA, SUMOVTypeParameter::emissionClass, SUMOVTypeParameter::get(), getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMO_ATTR_ACCEL, SUMO_ATTR_SIGMA, and SUMOReal.
Referenced by computeRoutes().
|
inline |
Returns the id of the edge.
Definition at line 148 of file ROEdge.h.
References myID.
Referenced by RONet::addEdge(), ROJTREdge::addFollowerProbability(), RODFNet::buildApproachList(), RODFNet::buildEdgeFlowMap(), ROJTRRouter::compute(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), AGStreet::getName(), RODFNet::idComp::operator()(), and AGStreet::print().
|
inline |
Returns the number of lanes this edge has.
Definition at line 188 of file ROEdge.h.
References myLanes.
Referenced by RODFDetectorHandler::myStartElement().
|
inline |
Returns the length of the edge.
Definition at line 165 of file ROEdge.h.
References myLength.
Referenced by AGStreet::AGStreet(), RODFNet::buildRoutes(), RODFNet::getAbsPos(), AGStreet::getLength(), and AGStreet::print().
Returns the travel time for this edge without using any stored timeLine.
[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 162 of file ROEdge.cpp.
References ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), myLength, mySpeed, and SUMOReal.
Referenced by computeRoutes(), and getTravelTime().
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 276 of file ROEdge.cpp.
References ET_SINK, getType(), and myFollowingEdges.
Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().
Definition at line 240 of file ROEdge.cpp.
References HelpersHarmonoise::computeNoise(), SUMOVTypeParameter::emissionClass, getStoredEffort(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, and SUMOReal.
Referenced by computeRoutes().
Definition at line 216 of file ROEdge.cpp.
References HelpersHBEFA::computeDefaultNOx(), DEFAULT_VEH_ACCEL, DEFAULT_VEH_SIGMA, SUMOVTypeParameter::emissionClass, SUMOVTypeParameter::get(), getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMO_ATTR_ACCEL, SUMO_ATTR_SIGMA, and SUMOReal.
Referenced by computeRoutes().
|
inline |
|
inline |
Definition at line 228 of file ROEdge.h.
References myCombinedPermissions.
Definition at line 192 of file ROEdge.cpp.
References HelpersHBEFA::computeDefaultPMx(), DEFAULT_VEH_ACCEL, DEFAULT_VEH_SIGMA, SUMOVTypeParameter::emissionClass, SUMOVTypeParameter::get(), getStoredEffort(), getTravelTime(), ROVehicle::getType(), SUMOVTypeParameter::maxSpeed, MIN2(), mySpeed, SUMO_ATTR_ACCEL, SUMO_ATTR_SIGMA, and SUMOReal.
Referenced by computeRoutes().
|
inline |
Returns the speed allowed on this edge.
Definition at line 180 of file ROEdge.h.
References mySpeed.
Referenced by RODFNet::buildEdgeFlowMap(), RODFNet::buildRoutes(), RODFNet::computeRoutesFor(), RODFNet::isDestination(), RODFNet::isFalseSource(), and RODFNet::isSource().
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 251 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().
|
inline |
Returns the node this edge ends at.
Definition at line 204 of file ROEdge.h.
References myToNode.
Referenced by RODFNet::buildApproachList(), AGPosition::compute2dPosition(), and getDistanceTo().
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 141 of file ROEdge.cpp.
References ValueTimeLine< T >::describesTime(), getMinimumTravelTime(), ValueTimeLine< T >::getSplitTime(), ValueTimeLine< T >::getValue(), myHaveTTWarned, myID, myInterpolate, myTravelTimes, myUsingTTTimeLine, SUMOReal, toString(), and WRITE_WARNING.
Referenced by ROJTRRouter::compute(), computeRoutes(), getCO2Effort(), getCOEffort(), getFuelEffort(), getHCEffort(), getNOxEffort(), and getPMxEffort().
|
inline |
Returns the type of the edge.
Definition at line 157 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 214 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 223 of file ROEdge.h.
References ROVehicle::getVClass(), and myCombinedPermissions.
Referenced by ROJTREdge::chooseNext(), and ROJTRRouter::compute().
|
inlinestatic |
Definition at line 353 of file ROEdge.h.
References myInterpolate, myUseBoundariesOnOverrideE, and myUseBoundariesOnOverrideTT.
Referenced by RODUAEdgeBuilder::RODUAEdgeBuilder().
void ROEdge::setType | ( | ROEdge::EdgeType | type | ) |
Sets the type of te edge.
[in] | type | The new type for the edge |
Definition at line 296 of file ROEdge.cpp.
References myType.
Referenced by loadJTRDefinitions(), ROJTRTurnDefLoader::myCharacters(), ROJTRTurnDefLoader::myStartElement(), RONetHandler::parseDistrict(), and RONetHandler::parseEdge().
|
protected |
The list of allowed vehicle classes combined across lanes.
Definition at line 425 of file ROEdge.h.
Referenced by addLane(), getPermissions(), and prohibits().
|
staticprotected |
Definition at line 430 of file ROEdge.h.
Referenced by dictionary(), dictSize(), and ROEdge().
|
mutableprotected |
Container storing passing time varying over time for the edge.
Definition at line 396 of file ROEdge.h.
Referenced by addEffort(), buildTimeLines(), and getStoredEffort().
|
protected |
List of edges that may be approached from this edge.
Definition at line 411 of file ROEdge.h.
Referenced by addFollower(), allFollowersProhibit(), ROJTREdge::chooseNext(), getFollower(), getNoFollowing(), isConnectedTo(), and ROJTREdge::setTurnDefaults().
|
protected |
The nodes this edge is connecting.
Definition at line 428 of file ROEdge.h.
Referenced by getFromNode().
|
staticprotected |
Information whether the edge has reported missing weights.
Definition at line 406 of file ROEdge.h.
Referenced by getStoredEffort().
|
staticprotected |
Information whether the edge has reported missing weights.
Definition at line 408 of file ROEdge.h.
Referenced by getTravelTime().
|
protected |
The id of the edge.
Definition at line 376 of file ROEdge.h.
Referenced by getID(), getStoredEffort(), and getTravelTime().
|
protected |
The index (numeric id) of the edge.
Definition at line 382 of file ROEdge.h.
Referenced by getNumericalID().
|
staticprotected |
Information whether to interpolate at interval boundaries.
Definition at line 403 of file ROEdge.h.
Referenced by getStoredEffort(), getTravelTime(), and setTimeLineOptions().
|
protected |
This edge's lanes.
Definition at line 422 of file ROEdge.h.
Referenced by addLane(), getLaneNo(), and ~ROEdge().
|
protected |
The length of the edge.
Definition at line 385 of file ROEdge.h.
Referenced by addLane(), buildTimeLines(), getEffort(), getLength(), and getMinimumTravelTime().
|
protected |
The maximum speed allowed on this edge.
Definition at line 379 of file ROEdge.h.
Referenced by addLane(), buildTimeLines(), getCO2Effort(), getCOEffort(), getEffort(), getFuelEffort(), getHCEffort(), getMinimumTravelTime(), getNoiseEffort(), getNOxEffort(), getPMxEffort(), and getSpeed().
|
protected |
Definition at line 428 of file ROEdge.h.
Referenced by getToNode().
|
mutableprotected |
Container storing passing time varying over time for the edge.
Definition at line 389 of file ROEdge.h.
Referenced by addTravelTime(), buildTimeLines(), getStoredEffort(), and getTravelTime().
|
protected |
|
staticprotected |
Whether overriding weight boundaries shall be reported.
Definition at line 400 of file ROEdge.h.
Referenced by buildTimeLines(), and setTimeLineOptions().
|
staticprotected |
Whether overriding weight boundaries shall be reported.
Definition at line 393 of file ROEdge.h.
Referenced by buildTimeLines(), and setTimeLineOptions().
|
protected |
Information whether the time line shall be used instead of the length value.
Definition at line 398 of file ROEdge.h.
Referenced by addEffort(), buildTimeLines(), and getStoredEffort().
|
protected |
Information whether the time line shall be used instead of the length value.
Definition at line 391 of file ROEdge.h.
Referenced by addTravelTime(), buildTimeLines(), and getTravelTime().