SUMO - Simulation of Urban MObility

RODFEdge Class Reference

#include <RODFEdge.h>

Inheritance diagram for RODFEdge:
ROEdge

Public Types

enum  EdgeType { ET_NORMAL, ET_DISTRICT, ET_SOURCE, ET_SINK }
 

Possible types of edges.

More...

Public Member Functions

const std::vector< FlowDef > & getFlows () const
 RODFEdge (const std::string &id, RONode *from, RONode *to, unsigned int index)
 Constructor.
void setFlows (const std::vector< FlowDef > &flows)
 ~RODFEdge ()
 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

RODFEdge & operator= (const RODFEdge &src)
 Invalidated assignment operator.
 RODFEdge (const RODFEdge &src)
 Invalidated copy constructor.

Private Attributes

std::vector< FlowDef > myFlows

Detailed Description

Definition at line 54 of file RODFEdge.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 70 of file ROEdge.h.


Constructor & Destructor Documentation

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

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 RODFEdge.cpp.

RODFEdge::~RODFEdge ( )

Destructor.

Definition at line 49 of file RODFEdge.cpp.

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

Invalidated copy constructor.


Member Function Documentation

void ROEdge::addEffort ( SUMOReal  value,
SUMOReal  timeBegin,
SUMOReal  timeEnd 
) [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 118 of file ROEdge.cpp.

References ValueTimeLine< T >::add(), ROEdge::myEfforts, and ROEdge::myUsingETimeLine.

Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeWeight::addEdgeWeight().

void ROEdge::addFollower ( ROEdge *  s) [virtual, inherited]

Adds information about a connected edge.

The edge is added to "myFollowingEdges".

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

Reimplemented in ROJTREdge.

Definition at line 110 of file ROEdge.cpp.

References ROEdge::myFollowingEdges.

Referenced by RONetHandler::parseConnectedEdge(), RONetHandler::parseConnection(), RONetHandler::parseDistrict(), and RONetHandler::parseDistrictEdge().

void ROEdge::addLane ( ROLane *  lane) [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 84 of file ROEdge.cpp.

References ROLane::getAllowedClasses(), ROLane::getLength(), ROLane::getNotAllowedClasses(), ROLane::getSpeed(), ROEdge::myAllowedClasses, ROEdge::myLanes, ROEdge::myLength, ROEdge::myNotAllowedClasses, ROEdge::mySpeed, and SUMOReal.

Referenced by RONetHandler::parseLane().

void ROEdge::addTravelTime ( SUMOReal  value,
SUMOReal  timeBegin,
SUMOReal  timeEnd 
) [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 125 of file ROEdge.cpp.

References ValueTimeLine< T >::add(), ROEdge::myTravelTimes, and ROEdge::myUsingTTTimeLine.

Referenced by ROLoader::EdgeFloatTimeLineRetriever_EdgeTravelTime::addEdgeWeight().

bool ROEdge::allFollowersProhibit ( const ROVehicle *const  vehicle) const [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 372 of file ROEdge.cpp.

References ROEdge::myFollowingEdges.

Referenced by ROJTREdge::chooseNext().

void ROEdge::buildTimeLines ( const std::string &  measure) [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 341 of file ROEdge.cpp.

References HelpersHBEFA::computeCO(), HelpersHBEFA::computeCO2(), HelpersHBEFA::computeFuel(), HelpersHBEFA::computeHC(), HelpersHBEFA::computeNOx(), HelpersHBEFA::computePMx(), ValueTimeLine< T >::fillGaps(), ROEdge::myEfforts, ROEdge::myLength, ROEdge::mySpeed, ROEdge::myTravelTimes, ROEdge::myUseBoundariesOnOverrideE, ROEdge::myUseBoundariesOnOverrideTT, ROEdge::myUsingETimeLine, ROEdge::myUsingTTTimeLine, SUMOReal, and SVE_UNKNOWN.

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

Returns the ROEdge at the index.

Definition at line 383 of file ROEdge.cpp.

References ROEdge::myEdges.

SUMOReal ROEdge::getCO2Effort ( const ROVehicle *const  veh,
SUMOReal  time 
) const [inherited]
SUMOReal ROEdge::getCOEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const [inherited]
SUMOReal ROEdge::getEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const [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 132 of file ROEdge.cpp.

References ROEdge::getStoredEffort(), ROEdge::myLength, ROEdge::mySpeed, SUMOReal, and UNUSED_PARAMETER.

const std::vector< FlowDef > & RODFEdge::getFlows ( ) const

Definition at line 59 of file RODFEdge.cpp.

References myFlows.

Referenced by RODFNet::revalidateFlows().

ROEdge* ROEdge::getFollower ( unsigned int  pos) const [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 272 of file ROEdge.h.

References ROEdge::myFollowingEdges.

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

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

Returns the node this edge starts at.

Returns:
The node this edge starts at

Definition at line 198 of file ROEdge.h.

References ROEdge::myFromNode.

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

SUMOReal ROEdge::getFuelEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const [inherited]
SUMOReal ROEdge::getHCEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const [inherited]
const std::string& ROEdge::getID ( ) const [inline, inherited]
unsigned int ROEdge::getLaneNo ( ) const [inline, inherited]

Returns the number of lanes this edge has.

Returns:
This edge's number of lanes

Definition at line 190 of file ROEdge.h.

References ROEdge::myLanes.

Referenced by RODFDetectorHandler::myStartElement().

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

Returns the length of the edge.

Returns:
This edge's length

Definition at line 167 of file ROEdge.h.

References ROEdge::myLength.

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

unsigned int ROEdge::getNoFollowing ( ) const [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 301 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 [inherited]
SUMOReal ROEdge::getNOxEffort ( const ROVehicle *const  veh,
SUMOReal  time 
) const [inherited]
unsigned int ROEdge::getNumericalID ( ) const [inline, inherited]

Returns the index (numeric id) of the edge.

Returns:
This edge's numerical id

Definition at line 174 of file ROEdge.h.

References ROEdge::myIndex.

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

Returns the speed allowed on this edge.

Returns:
The speed allowed on this edge

Definition at line 182 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 [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 276 of file ROEdge.cpp.

References ValueTimeLine< T >::describesTime(), ValueTimeLine< T >::getSplitTime(), ValueTimeLine< T >::getValue(), ROEdge::myEfforts, ROEdge::myHaveEWarned, ROEdge::myID, ROEdge::myInterpolate, ROEdge::myTravelTimes, ROEdge::myUsingETimeLine, SUMOReal, toString(), and WRITE_WARNING.

Referenced by ROEdge::getCO2Effort(), ROEdge::getCOEffort(), ROEdge::getEffort(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROEdge::getNoiseEffort(), ROEdge::getNOxEffort(), and ROEdge::getPMxEffort().

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

Returns the node this edge ends at.

Returns:
The node this edge ends at

Definition at line 206 of file ROEdge.h.

References ROEdge::myToNode.

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

SUMOReal ROEdge::getTravelTime ( const ROVehicle *const  veh,
SUMOReal  time 
) const [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 143 of file ROEdge.cpp.

References ValueTimeLine< T >::describesTime(), ValueTimeLine< T >::getSplitTime(), ValueTimeLine< T >::getValue(), ROEdge::myHaveTTWarned, ROEdge::myID, ROEdge::myInterpolate, ROEdge::myLength, ROEdge::mySpeed, ROEdge::myTravelTimes, ROEdge::myUsingTTTimeLine, SUMOReal, toString(), and WRITE_WARNING.

Referenced by ROJTRRouter::compute(), computeRoutes(), ROEdge::getCO2Effort(), ROEdge::getCOEffort(), ROEdge::getFuelEffort(), ROEdge::getHCEffort(), ROEdge::getNOxEffort(), and ROEdge::getPMxEffort().

EdgeType ROEdge::getType ( ) const [inline, inherited]

Returns the type of the edge.

Returns:
This edge's type
See also:
EdgeType

Definition at line 159 of file ROEdge.h.

References ROEdge::myType.

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

bool ROEdge::isConnectedTo ( const ROEdge *const  e) const [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 216 of file ROEdge.h.

References ROEdge::myFollowingEdges.

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

Invalidated assignment operator.

bool ROEdge::prohibits ( const ROVehicle *const  vehicle) const [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 316 of file ROEdge.cpp.

References DEFAULT_VEH_CLASS, ROVehicle::getType(), ROEdge::myAllowedClasses, ROEdge::myNotAllowedClasses, SVC_UNKNOWN, and SUMOVTypeParameter::vehicleClass.

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

void RODFEdge::setFlows ( const std::vector< FlowDef > &  flows)

Definition at line 53 of file RODFEdge.cpp.

References myFlows.

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

Sets the type of te edge.

Parameters:
[in]typeThe new type for the edge

Definition at line 310 of file ROEdge.cpp.

References ROEdge::myType.

Referenced by loadJTRDefinitions(), ROJTRTurnDefLoader::myCharacters(), ROJTRTurnDefLoader::myStartElement(), RONetHandler::parseDistrict(), and RONetHandler::parseEdge().


Field Documentation

The list of allowed vehicle classes.

Definition at line 367 of file ROEdge.h.

Referenced by ROEdge::addLane(), and ROEdge::prohibits().

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

Definition at line 375 of file ROEdge.h.

Referenced by ROEdge::dictionary(), and ROEdge::ROEdge().

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

Container storing passing time varying over time for the edge.

Definition at line 345 of file ROEdge.h.

Referenced by ROEdge::addEffort(), ROEdge::buildTimeLines(), and ROEdge::getStoredEffort().

std::vector<FlowDef> RODFEdge::myFlows [private]

Definition at line 75 of file RODFEdge.h.

Referenced by getFlows(), and setFlows().

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

The nodes this edge is connecting.

Definition at line 373 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 351 of file ROEdge.h.

Referenced by ROEdge::getStoredEffort().

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

Information whether the edge has reported missing weights.

Definition at line 342 of file ROEdge.h.

Referenced by ROEdge::getTravelTime().

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

The id of the edge.

Definition at line 323 of file ROEdge.h.

Referenced by ROEdge::getID(), ROEdge::getStoredEffort(), and ROEdge::getTravelTime().

unsigned int ROEdge::myIndex [protected, inherited]

The index (numeric id) of the edge.

Definition at line 329 of file ROEdge.h.

Referenced by ROEdge::getNumericalID().

bool ROEdge::myInterpolate [protected, inherited]

Information whether to interpolate at interval boundaries.

Definition at line 354 of file ROEdge.h.

Referenced by ROEdge::getStoredEffort(), and ROEdge::getTravelTime().

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

This edge's lanes.

Definition at line 364 of file ROEdge.h.

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

SUMOReal ROEdge::myLength [protected, inherited]

The length of the edge.

Definition at line 332 of file ROEdge.h.

Referenced by ROEdge::addLane(), ROEdge::buildTimeLines(), ROEdge::getEffort(), ROEdge::getLength(), and ROEdge::getTravelTime().

The list of disallowed vehicle classes.

Definition at line 370 of file ROEdge.h.

Referenced by ROEdge::addLane(), and ROEdge::prohibits().

RONode * ROEdge::myToNode [protected, inherited]

Definition at line 373 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 336 of file ROEdge.h.

Referenced by ROEdge::addTravelTime(), ROEdge::buildTimeLines(), ROEdge::getStoredEffort(), and ROEdge::getTravelTime().

EdgeType ROEdge::myType [protected, inherited]

The type of the edge.

Definition at line 361 of file ROEdge.h.

Referenced by ROEdge::getType(), and ROEdge::setType().

bool ROEdge::myUseBoundariesOnOverrideE [protected, inherited]

Whether overriding weight boundaries shall be reported.

Definition at line 349 of file ROEdge.h.

Referenced by ROEdge::buildTimeLines().

bool ROEdge::myUseBoundariesOnOverrideTT [protected, inherited]

Whether overriding weight boundaries shall be reported.

Definition at line 340 of file ROEdge.h.

Referenced by ROEdge::buildTimeLines().

bool ROEdge::myUsingETimeLine [protected, inherited]

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

Definition at line 347 of file ROEdge.h.

Referenced by ROEdge::addEffort(), ROEdge::buildTimeLines(), and ROEdge::getStoredEffort().

bool ROEdge::myUsingTTTimeLine [protected, inherited]

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

Definition at line 338 of file ROEdge.h.

Referenced by ROEdge::addTravelTime(), ROEdge::buildTimeLines(), and ROEdge::getTravelTime().


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