SUMO - Simulation of Urban MObility

ROJTREdge Class Reference

An edge the jtr-router may route through. More...

#include <ROJTREdge.h>

Inheritance diagram for ROJTREdge:
ROEdge

Public Types

enum  EdgeType { ET_NORMAL, ET_DISTRICT, ET_SOURCE, ET_SINK }
 

Possible types of edges.

More...

Public Member Functions

void addFollower (ROEdge *s) throw ()
 Adds information about a connected edge.
void addFollowerProbability (ROJTREdge *follower, SUMOTime begTime, SUMOTime endTime, SUMOReal probability)
 adds the information about the percentage of using a certain follower
ROJTREdge * chooseNext (const ROVehicle *const veh, SUMOTime time) const
 Returns the next edge to use.
 ROJTREdge (const std::string &id, RONode *from, RONode *to, unsigned int index) throw ()
 Constructor.
void setTurnDefaults (const std::vector< SUMOReal > &defs)
 Sets the turning definition defaults.
 ~ROJTREdge () throw ()
 Destructor.
Set-up methods
virtual void addLane (ROLane *lane) throw ()
 Adds a lane to the edge while loading.
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 Types

typedef std::map< ROJTREdge
*, ValueTimeLine< SUMOReal > * > 
FollowerUsageCont
 Definition of a map that stores the probabilities of using a certain follower over time.

Private Member Functions

ROJTREdge & operator= (const ROJTREdge &src)
 invalidated assignment operator
 ROJTREdge (const ROJTREdge &src)
 invalidated copy constructor

Private Attributes

FollowerUsageCont myFollowingDefs
 Storage for the probabilities of using a certain follower over time.
std::vector< SUMOReal > myParsedTurnings
 The defaults for turnings.

Detailed Description

An edge the jtr-router may route through.

A router edge extended by the definition about the probability a vehicle chooses a certain following edge over time.

Definition at line 55 of file ROJTREdge.h.


Member Typedef Documentation

typedef std::map<ROJTREdge*, ValueTimeLine<SUMOReal>*> ROJTREdge::FollowerUsageCont [private]

Definition of a map that stores the probabilities of using a certain follower over time.

Definition at line 111 of file ROJTREdge.h.


Member Enumeration Documentation

enum ROEdge::EdgeType [inherited]

Possible types of edges.

Enumerator:
ET_NORMAL 

A normal edge.

ET_DISTRICT 

An edge representing a whole district.

ET_SOURCE 

An edge where vehicles are inserted at (no vehicle may come from back)

ET_SINK 

An edge where vehicles disappear (no vehicle may leave this edge)

Definition at line 66 of file ROEdge.h.


Constructor & Destructor Documentation

ROJTREdge::ROJTREdge ( const std::string &  id,
RONode *  from,
RONode *  to,
unsigned int  index 
) throw ()

Constructor.

Parameters:
[in]idThe id of the edge
[in]fromThe node the edge begins at
[in]toThe node the edge ends at
[in]indexThe numeric id of the edge

Definition at line 45 of file ROJTREdge.cpp.

ROJTREdge::~ROJTREdge ( ) throw ()

Destructor.

Definition at line 49 of file ROJTREdge.cpp.

References myFollowingDefs.

ROJTREdge::ROJTREdge ( const ROJTREdge &  src) [private]

invalidated copy constructor


Member Function Documentation

void ROEdge::addEffort ( SUMOReal  value,
SUMOReal  timeBegin,
SUMOReal  timeEnd 
) throw () [inherited]

Adds a weight value.

Parameters:
[in]valueThe value to add
[in]timeBeginThe begin time of the interval the given value is valid for [s]
[in]timeEndThe 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 ROJTREdge::addFollower ( ROEdge *  s) throw () [virtual]

Adds information about a connected edge.

Makes this edge know the given following edge. Calls ROEdge::addFollower.

Additionally it generates the entry for the given following edge in myFollowingDefs.

Parameters:
[in]sThe following edge
See also:
ROEdge::addFollower

Reimplemented from ROEdge.

Definition at line 57 of file ROJTREdge.cpp.

References ROEdge::addFollower().

void ROJTREdge::addFollowerProbability ( ROJTREdge *  follower,
SUMOTime  begTime,
SUMOTime  endTime,
SUMOReal  probability 
)

adds the information about the percentage of using a certain follower

Parameters:
[in]followerThe following edge
[in]begTimeTime begin for which this probability is valid
[in]endTimeTime end for which this probability is valid
[in]probabilityThe probability to use the given follower

Definition at line 67 of file ROJTREdge.cpp.

References ROEdge::getID(), myFollowingDefs, and WRITE_ERROR.

void ROEdge::addLane ( ROLane *  lane) throw () [virtual, inherited]

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.

Parameters:
[in]laneThe lane to add
Todo:
What about vehicle-type aware connections?

Definition at line 80 of file ROEdge.cpp.

References SUMOReal.

Referenced by RONetHandler::parseLane().

void ROEdge::addTravelTime ( SUMOReal  value,
SUMOReal  timeBegin,
SUMOReal  timeEnd 
) throw () [inherited]

Adds a travel time value.

Parameters:
[in]valueThe value to add
[in]timeBeginThe begin time of the interval the given value is valid for [s]
[in]timeEndThe 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().

bool ROEdge::allFollowersProhibit ( const ROVehicle *const  vehicle) const throw () [inherited]

Returns whether this edge succeding edges prohibit the given vehicle to pass them.

Parameters:
[in]vehicleThe vehicle for which the information has to be returned
Returns:
Whether the vehicle may continue its route on any of the following edges

Definition at line 368 of file ROEdge.cpp.

Referenced by chooseNext().

void ROEdge::buildTimeLines ( const std::string &  measure) throw () [inherited]

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.

Parameters:
[in]measureThe 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.

ROJTREdge * ROJTREdge::chooseNext ( const ROVehicle *const  veh,
SUMOTime  time 
) const

Returns the next edge to use.

Parameters:
[in]vehThe vehicle to choose the next edge for
[in]timeThe time at which the next edge shall be entered
Returns:
The chosen edge

Definition at line 79 of file ROJTREdge.cpp.

References RandomDistributor< T >::add(), ROEdge::allFollowersProhibit(), RandomDistributor< T >::get(), RandomDistributor< T >::getOverallProb(), myFollowingDefs, ROEdge::myFollowingEdges, myParsedTurnings, and ROEdge::prohibits().

Referenced by ROJTRRouter::compute().

ROEdge * ROEdge::dictionary ( size_t  index) throw () [static, inherited]

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 () [inherited]

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 () [inherited]

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 () [inherited]

Returns the effort for this edge.

Parameters:
[in]vehThe vehicle for which the effort on this edge shall be retrieved
[in]timeThe tim for which the effort shall be returned [s]
Returns:
The effort needed by the given vehicle to pass the edge at the given time
Todo:
Recheck whether the vehicle's maximum speed is considered

Definition at line 128 of file ROEdge.cpp.

References SUMOReal, and UNUSED_PARAMETER.

ROEdge* ROEdge::getFollower ( unsigned int  pos) const throw () [inline, inherited]

Returns the edge at the given position from the list of reachable edges.

Parameters:
[in]posThe position of the list within the list of following
Returns:
The following edge, stored at position pos

Definition at line 268 of file ROEdge.h.

References ROEdge::myFollowingEdges.

Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().

RONode* ROEdge::getFromNode ( ) const throw () [inline, inherited]

Returns the node this edge starts at.

Returns:
The node this edge starts at

Definition at line 194 of file ROEdge.h.

References ROEdge::myFromNode.

Referenced by RODFNet::buildApproachList(), and AGPosition::compute2dPosition().

SUMOReal ROEdge::getFuelEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const throw () [inherited]

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 () [inherited]

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, inherited]
unsigned int ROEdge::getLaneNo ( ) const throw () [inline, inherited]

Returns the number of lanes this edge has.

Returns:
This edge's number of lanes

Definition at line 186 of file ROEdge.h.

References ROEdge::myLanes.

Referenced by RODFDetectorHandler::myStartElement().

SUMOReal ROEdge::getLength ( ) const throw () [inline, inherited]

Returns the length of the edge.

Returns:
This edge's length

Definition at line 163 of file ROEdge.h.

References ROEdge::myLength.

Referenced by RODFNet::buildRoutes(), RODFNet::getAbsPos(), AGStreet::getLength(), and AGStreet::print().

unsigned int ROEdge::getNoFollowing ( ) const throw () [inherited]

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".

Returns:
The number of edges following this edge

Definition at line 297 of file ROEdge.cpp.

References ROEdge::ET_SINK, ROEdge::getType(), and ROEdge::myFollowingEdges.

Referenced by RODFRouteCont::addAllEndFollower(), and RODFNet::buildApproachList().

SUMOReal ROEdge::getNoiseEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const throw () [inherited]

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 () [inherited]

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, inherited]

Returns the index (numeric id) of the edge.

Returns:
This edge's numerical id

Definition at line 170 of file ROEdge.h.

References ROEdge::myIndex.

SUMOReal ROEdge::getPMxEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const throw () [inherited]

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, inherited]

Returns the speed allowed on this edge.

Returns:
The speed allowed on this edge

Definition at line 178 of file ROEdge.h.

References ROEdge::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, inherited]

Retrieves the stored effort.

Parameters:
[in]vehThe vehicle for which the effort on this edge shall be retrieved
[in]timeThe tim for which the effort shall be returned
Returns:
Whether the effort is given

Definition at line 272 of file ROEdge.cpp.

References SUMOReal, toString(), and WRITE_WARNING.

RONode* ROEdge::getToNode ( ) const throw () [inline, inherited]

Returns the node this edge ends at.

Returns:
The node this edge ends at

Definition at line 202 of file ROEdge.h.

References ROEdge::myToNode.

Referenced by RODFNet::buildApproachList(), and AGPosition::compute2dPosition().

SUMOReal ROEdge::getTravelTime ( const ROVehicle *const  veh,
SUMOReal  time 
) const throw () [inherited]

Returns the travel time for this edge.

Parameters:
[in]vehThe vehicle for which the effort on this edge shall be retrieved
[in]timeThe time for which the effort shall be returned [s]
Returns:
The effort needed by the given vehicle to pass the edge at the given time
Todo:
Recheck whether the vehicle's maximum speed is considered

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, inherited]

Returns the type of the edge.

Returns:
This edge's type
See also:
EdgeType

Definition at line 155 of file ROEdge.h.

References ROEdge::myType.

Referenced by RONet::checkSourceAndDestinations(), ROJTRRouter::compute(), and ROEdge::getNoFollowing().

bool ROEdge::isConnectedTo ( const ROEdge *const  e) const throw () [inline, inherited]

returns the information whether this edge is directly connected to the given

Parameters:
[in]eThe edge which may be connected
Returns:
Whether the given edge is a direct successor to this one

Definition at line 212 of file ROEdge.h.

References ROEdge::myFollowingEdges.

ROJTREdge& ROJTREdge::operator= ( const ROJTREdge &  src) [private]

invalidated assignment operator

bool ROEdge::prohibits ( const ROVehicle *const  vehicle) const throw () [inherited]

Returns whether this edge prohibits the given vehicle to pass it.

Parameters:
[in]vehicleThe vehicle for which the information has to be returned
Returns:
Whether the vehicle must not enter this edge

Definition at line 312 of file ROEdge.cpp.

References DEFAULT_VEH_CLASS, and SVC_UNKNOWN.

Referenced by chooseNext(), and ROJTRRouter::compute().

void ROJTREdge::setTurnDefaults ( const std::vector< SUMOReal > &  defs)

Sets the turning definition defaults.

Parameters:
[in]defThe turning percentage defaults

Definition at line 114 of file ROJTREdge.cpp.

References ROEdge::myFollowingEdges, myParsedTurnings, and SUMOReal.

void ROEdge::setType ( ROEdge::EdgeType  type) throw () [inherited]

Sets the type of te edge.

Parameters:
[in]typeThe 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().


Field Documentation

The list of allowed vehicle classes.

Definition at line 363 of file ROEdge.h.

std::vector< ROEdge * > ROEdge::myEdges [static, protected, inherited]

Definition at line 371 of file ROEdge.h.

ValueTimeLine<SUMOReal> ROEdge::myEfforts [mutable, protected, inherited]

Container storing passing time varying over time for the edge.

Definition at line 341 of file ROEdge.h.

Storage for the probabilities of using a certain follower over time.

Definition at line 114 of file ROJTREdge.h.

Referenced by addFollowerProbability(), chooseNext(), and ~ROJTREdge().

std::vector<ROEdge*> ROEdge::myFollowingEdges [protected, inherited]

List of edges that may be approached from this edge.

Definition at line 354 of file ROEdge.h.

Referenced by chooseNext(), ROEdge::getFollower(), ROEdge::getNoFollowing(), ROEdge::isConnectedTo(), and setTurnDefaults().

RONode* ROEdge::myFromNode [protected, inherited]

The nodes this edge is connecting.

Definition at line 369 of file ROEdge.h.

Referenced by ROEdge::getFromNode().

bool ROEdge::myHaveEWarned = false [static, protected, inherited]

Information whether the edge has reported missing weights.

Definition at line 347 of file ROEdge.h.

bool ROEdge::myHaveTTWarned = false [static, protected, inherited]

Information whether the edge has reported missing weights.

Definition at line 338 of file ROEdge.h.

std::string ROEdge::myID [protected, inherited]

The id of the edge.

Definition at line 319 of file ROEdge.h.

Referenced by ROEdge::getID().

unsigned int ROEdge::myIndex [protected, inherited]

The index (numeric id) of the edge.

Definition at line 325 of file ROEdge.h.

Referenced by ROEdge::getNumericalID().

bool ROEdge::myInterpolate [protected, inherited]

Information whether to interpolate at interval boundaries.

Definition at line 350 of file ROEdge.h.

std::vector<ROLane*> ROEdge::myLanes [protected, inherited]

This edge's lanes.

Definition at line 360 of file ROEdge.h.

Referenced by ROEdge::getLaneNo(), and ROEdge::~ROEdge().

SUMOReal ROEdge::myLength [protected, inherited]

The length of the edge.

Definition at line 328 of file ROEdge.h.

Referenced by ROEdge::getLength().

The list of disallowed vehicle classes.

Definition at line 366 of file ROEdge.h.

std::vector<SUMOReal> ROJTREdge::myParsedTurnings [private]

The defaults for turnings.

Definition at line 117 of file ROJTREdge.h.

Referenced by chooseNext(), and setTurnDefaults().

SUMOReal ROEdge::mySpeed [protected, inherited]

The maximum speed allowed on this edge.

Definition at line 322 of file ROEdge.h.

Referenced by ROEdge::getSpeed().

RONode * ROEdge::myToNode [protected, inherited]

Definition at line 369 of file ROEdge.h.

Referenced by ROEdge::getToNode().

ValueTimeLine<SUMOReal> ROEdge::myTravelTimes [mutable, protected, inherited]

Container storing passing time varying over time for the edge.

Definition at line 332 of file ROEdge.h.

EdgeType ROEdge::myType [protected, inherited]

The type of the edge.

Definition at line 357 of file ROEdge.h.

Referenced by ROEdge::getType().

bool ROEdge::myUseBoundariesOnOverrideE [protected, inherited]

Whether overriding weight boundaries shall be reported.

Definition at line 345 of file ROEdge.h.

bool ROEdge::myUseBoundariesOnOverrideTT [protected, inherited]

Whether overriding weight boundaries shall be reported.

Definition at line 336 of file ROEdge.h.

bool ROEdge::myUsingETimeLine [protected, inherited]

Information whether the time line shall be used instead of the length value.

Definition at line 343 of file ROEdge.h.

bool ROEdge::myUsingTTTimeLine [protected, inherited]

Information whether the time line shall be used instead of the length value.

Definition at line 334 of file ROEdge.h.


The documentation for this class was generated from the following files:
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Defines