RODFEdge Class Reference

#include <RODFEdge.h>

Inheritance diagram for RODFEdge:

ROEdge

Detailed Description

Definition at line 52 of file RODFEdge.h.


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) throw ()
 Constructor.
void setFlows (const std::vector< FlowDef > &flows)
 ~RODFEdge () throw ()
 Destructor.
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.
SUMOReal getCO2Effort (const ROVehicle *const veh, SUMOReal time) const throw ()
SUMOReal getCOEffort (const ROVehicle *const veh, SUMOReal time) const throw ()
SUMOReal getEffort (const ROVehicle *const veh, SUMOReal time) const throw ()
 Returns the effort for this edge.
ROEdgegetFollower (unsigned int pos) const throw ()
 Returns the edge at the given position from the list of reachable edges.
SUMOReal getFuelEffort (const ROVehicle *const veh, SUMOReal time) const throw ()
SUMOReal getHCEffort (const ROVehicle *const veh, SUMOReal time) const throw ()
unsigned int getNoFollowing () const throw ()
 Returns the number of edges this edge is connected to.
SUMOReal getNoiseEffort (const ROVehicle *const veh, SUMOReal time) const throw ()
SUMOReal getNOxEffort (const ROVehicle *const veh, SUMOReal time) const throw ()
SUMOReal getPMxEffort (const ROVehicle *const veh, SUMOReal time) const throw ()
SUMOReal getTravelTime (const ROVehicle *const veh, SUMOReal time) const throw ()
 Returns the travel time for this edge.
Set-up methods
virtual void addFollower (ROEdge *s) throw ()
 Adds information about a connected edge.
virtual void addLane (ROLane *lane) throw ()
 Adds a lane to the edge while loading.
void buildTimeLines (const std::string &measure) throw ()
 Builds the internal representation of the travel time/effort.
void setType (EdgeType type) throw ()
 Sets the type of te edge.
Getter methods
bool allFollowersProhibit (const ROVehicle *const vehicle) const throw ()
 Returns whether this edge succeding edges prohibit the given vehicle to pass them.
RONodegetFromNode () const throw ()
 Returns the node this edge starts at.
const std::string & getID () const throw ()
 Returns the id of the edge.
unsigned int getLaneNo () const throw ()
 Returns the number of lanes this edge has.
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.
RONodegetToNode () const throw ()
 Returns the node this edge ends at.
EdgeType getType () const throw ()
 Returns the type of the edge.
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.

Static Public Member Functions

static ROEdgedictionary (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

std::vector< SUMOVehicleClassmyAllowedClasses
 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.
RONodemyFromNode
 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.
std::vector< SUMOVehicleClassmyNotAllowedClasses
 The list of disallowed vehicle classes.
SUMOReal mySpeed
 The maximum speed allowed on this edge.
RONodemyToNode
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

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

Private Attributes

std::vector< FlowDefmyFlows

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

00066                   {
00068         ET_NORMAL,
00070         ET_DISTRICT,
00072         ET_SOURCE,
00074         ET_SINK
00075     };


Constructor & Destructor Documentation

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

Constructor.

Parameters:
[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 43 of file RODFEdge.cpp.

00044         : ROEdge(id, from, to, index, false) {}

RODFEdge::~RODFEdge (  )  throw ()

Destructor.

Definition at line 47 of file RODFEdge.cpp.

00047 {}

RODFEdge::RODFEdge ( const RODFEdge 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] 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 132 of file ROEdge.cpp.

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

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

00132                                                                               {
00133     myEfforts.add(timeBegin, timeEnd, value);
00134     myUsingETimeLine = true;
00135 }

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

Adds information about a connected edge.

The edge is added to "myFollowingEdges".

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

Reimplemented in ROJTREdge.

Definition at line 124 of file ROEdge.cpp.

References ROEdge::myFollowingEdges.

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

00124                                      {
00125     if (find(myFollowingEdges.begin(), myFollowingEdges.end(), s)==myFollowingEdges.end()) {
00126         myFollowingEdges.push_back(s);
00127     }
00128 }

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] lane The lane to add
Todo:
What about vehicle-type aware connections?

Definition at line 80 of file ROEdge.cpp.

References ROEdge::myAllowedClasses, ROEdge::myLanes, ROEdge::myLength, ROEdge::myNotAllowedClasses, ROEdge::mySpeed, and SUMOReal.

Referenced by RONetHandler::parseLane().

00080                                     {
00081     SUMOReal length = lane->getLength();
00082     assert(myLength==-1||length==myLength);
00083     myLength = length;
00084     SUMOReal speed = lane->getSpeed();
00085     mySpeed = speed > mySpeed ? speed : mySpeed;
00086     myLanes.push_back(lane);
00087 
00088     std::vector<SUMOVehicleClass>::const_iterator i;
00089     const std::vector<SUMOVehicleClass> &allowed = lane->getAllowedClasses();
00090     // for allowed classes
00091     for (i=allowed.begin(); i!=allowed.end(); ++i) {
00092         SUMOVehicleClass allowedC = *i;
00093         std::vector<SUMOVehicleClass>::iterator t;
00094         // add to allowed if not already in there
00095         t = find(myAllowedClasses.begin(), myAllowedClasses.end(), allowedC);
00096         if (t==myAllowedClasses.end()) {
00097             myAllowedClasses.push_back(allowedC);
00098         }
00099         // remove from disallowed if allowed on the lane
00100         t = find(myNotAllowedClasses.begin(), myNotAllowedClasses.end(), allowedC);
00101         if (t!=myNotAllowedClasses.end()) {
00102             myNotAllowedClasses.erase(t);
00103         }
00104     }
00105     // for disallowed classes
00106     const std::vector<SUMOVehicleClass> &disallowed = lane->getNotAllowedClasses();
00107     for (i=disallowed.begin(); i!=disallowed.end(); ++i) {
00108         SUMOVehicleClass disallowedC = *i;
00109         std::vector<SUMOVehicleClass>::iterator t;
00110         // add to disallowed if not already in there
00111         //  and not within allowed
00112         t = find(myAllowedClasses.begin(), myAllowedClasses.end(), disallowedC);
00113         if (t==myAllowedClasses.end()) {
00114             t = find(myNotAllowedClasses.begin(), myNotAllowedClasses.end(), disallowedC);
00115             if (t==myNotAllowedClasses.end()) {
00116                 myNotAllowedClasses.push_back(disallowedC);
00117             }
00118         }
00119     }
00120 }

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

Adds a travel time value.

Parameters:
[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 139 of file ROEdge.cpp.

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

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

00139                                                                                   {
00140     myTravelTimes.add(timeBegin, timeEnd, value);
00141     myUsingTTTimeLine = true;
00142 }

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] vehicle The 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 385 of file ROEdge.cpp.

References ROEdge::myFollowingEdges.

Referenced by ROJTREdge::chooseNext().

00385                                                                           {
00386     for (std::vector<ROEdge*>::const_iterator i=myFollowingEdges.begin(); i!=myFollowingEdges.end(); ++i) {
00387         if (!(*i)->prohibits(vehicle)) {
00388             return false;
00389         }
00390     }
00391     return true;
00392 }

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 "measure" is one of "CO", "CO2", "HC", "NOx", "PMx", or "fuel" the proper value (emission/s) is computed and multiplied with the travel time.

Parameters:
[in] measure The name of the measure to use.

Definition at line 354 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.

00354                                                        {
00355     if (myUsingETimeLine) {
00356         SUMOReal value = (SUMOReal)(myLength / mySpeed);
00357         if (measure=="CO") {
00358             value = HelpersHBEFA::computeCO(SVE_UNKNOWN, mySpeed, 0) * value;
00359         }
00360         if (measure=="CO2") {
00361             value = HelpersHBEFA::computeCO2(SVE_UNKNOWN, mySpeed, 0) * value;
00362         }
00363         if (measure=="HC") {
00364             value = HelpersHBEFA::computeHC(SVE_UNKNOWN, mySpeed, 0) * value;
00365         }
00366         if (measure=="PMx") {
00367             value = HelpersHBEFA::computePMx(SVE_UNKNOWN, mySpeed, 0) * value;
00368         }
00369         if (measure=="NOx") {
00370             value = HelpersHBEFA::computeNOx(SVE_UNKNOWN, mySpeed, 0) * value;
00371         }
00372         if (measure=="fuel") {
00373             value = HelpersHBEFA::computeFuel(SVE_UNKNOWN, mySpeed, 0) * value;
00374         }
00375         myEfforts.fillGaps(value, myUseBoundariesOnOverrideE);
00376     }
00377     if (myUsingTTTimeLine) {
00378         SUMOReal value = (SUMOReal)(myLength / mySpeed);
00379         myTravelTimes.fillGaps(value, myUseBoundariesOnOverrideTT);
00380     }
00381 }

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

Returns the ROEdge at the index.

Definition at line 396 of file ROEdge.cpp.

References ROEdge::myEdges.

00396                                     {
00397     assert(myEdges.size()>id);
00398     return myEdges[id];
00399 }

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

Definition at line 193 of file ROEdge.cpp.

References HelpersHBEFA::computeCO2(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MIN2(), ROEdge::mySpeed, SUMOReal, and SVE_UNKNOWN.

Referenced by computeRoutes().

00193                                                                              {
00194     SUMOReal ret = 0;
00195     if (!getStoredEffort(time, ret)) {
00196         SUMOReal v = mySpeed;
00197         SUMOEmissionClass c = SVE_UNKNOWN;
00198         if (veh->getType()!=0) {
00199             v = MIN2(veh->getType()->maxSpeed, mySpeed);
00200             c = veh->getType()->emissionClass;
00201         }
00202         ret = HelpersHBEFA::computeCO2(c, v, 0) * getTravelTime(veh, time);
00203     }
00204     return ret;
00205 }

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

Definition at line 177 of file ROEdge.cpp.

References HelpersHBEFA::computeCO(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MIN2(), ROEdge::mySpeed, SUMOReal, and SVE_UNKNOWN.

Referenced by computeRoutes().

00177                                                                             {
00178     SUMOReal ret = 0;
00179     if (!getStoredEffort(time, ret)) {
00180         SUMOReal v = mySpeed;
00181         SUMOEmissionClass c = SVE_UNKNOWN;
00182         if (veh->getType()!=0) {
00183             v = MIN2(veh->getType()->maxSpeed, mySpeed);
00184             c = veh->getType()->emissionClass;
00185         }
00186         ret = HelpersHBEFA::computeCO(c, v, 0) * getTravelTime(veh, time);
00187     }
00188     return ret;
00189 }

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

Returns the effort for this edge.

Parameters:
[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]
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 146 of file ROEdge.cpp.

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

00146                                                                          {
00147     SUMOReal ret = 0;
00148     if (!getStoredEffort(time, ret)) {
00149         return (SUMOReal)(myLength / mySpeed);
00150     }
00151     return ret;
00152 }

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

Definition at line 57 of file RODFEdge.cpp.

References myFlows.

00057                          {
00058     return myFlows;
00059 }

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] pos The 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().

00268                                                         {
00269         return myFollowingEdges[pos];
00270     }

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().

00194                                         {
00195         return myFromNode;
00196     }

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

Definition at line 257 of file ROEdge.cpp.

References HelpersHBEFA::computeFuel(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MIN2(), ROEdge::mySpeed, SUMOReal, and SVE_UNKNOWN.

Referenced by computeRoutes().

00257                                                                               {
00258     SUMOReal ret = 0;
00259     if (!getStoredEffort(time, ret)) {
00260         SUMOReal v = mySpeed;
00261         SUMOEmissionClass c = SVE_UNKNOWN;
00262         if (veh->getType()!=0) {
00263             v = MIN2(veh->getType()->maxSpeed, mySpeed);
00264             c = veh->getType()->emissionClass;
00265         }
00266         ret = HelpersHBEFA::computeFuel(c, v, 0) * getTravelTime(veh, time);
00267     }
00268     return ret;
00269 }

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

Definition at line 225 of file ROEdge.cpp.

References HelpersHBEFA::computeHC(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MIN2(), ROEdge::mySpeed, SUMOReal, and SVE_UNKNOWN.

Referenced by computeRoutes().

00225                                                                             {
00226     SUMOReal ret = 0;
00227     if (!getStoredEffort(time, ret)) {
00228         SUMOReal v = mySpeed;
00229         SUMOEmissionClass c = SVE_UNKNOWN;
00230         if (veh->getType()!=0) {
00231             v = MIN2(veh->getType()->maxSpeed, mySpeed);
00232             c = veh->getType()->emissionClass;
00233         }
00234         ret = HelpersHBEFA::computeHC(c, v, 0) * getTravelTime(veh, time);
00235     }
00236     return ret;
00237 }

const std::string& ROEdge::getID (  )  const throw () [inline, inherited]

Returns the id of the edge.

Returns:
This edge's id

Definition at line 146 of file ROEdge.h.

References ROEdge::myID.

Referenced by ROJTREdge::addFollowerProbability(), RODFNet::buildApproachList(), ROJTRRouter::compute(), RODFDetectorCon::getAggFlowFor(), RODFDetectorCon::getAnyDetectorForEdge(), and RODFDetectorCon::getFlowFor().

00146                                            {
00147         return myID;
00148     }

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().

00186                                            {
00187         return (unsigned int) myLanes.size();
00188     }

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(), and RODFNet::getAbsPos().

00163                                        {
00164         return myLength;
00165     }

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 314 of file ROEdge.cpp.

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

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

00314                                      {
00315     if (getType()==ET_SINK) {
00316         return 0;
00317     }
00318     return (unsigned int) myFollowingEdges.size();
00319 }

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

Definition at line 273 of file ROEdge.cpp.

References HelpersHarmonoise::computeNoise(), ROEdge::getStoredEffort(), MIN2(), ROEdge::mySpeed, SUMOReal, and SVE_UNKNOWN.

Referenced by computeRoutes().

00273                                                                                {
00274     SUMOReal ret = 0;
00275     if (!getStoredEffort(time, ret)) {
00276         SUMOReal v = mySpeed;
00277         SUMOEmissionClass c = SVE_UNKNOWN;
00278         if (veh->getType()!=0) {
00279             v = MIN2(veh->getType()->maxSpeed, mySpeed);
00280             c = veh->getType()->emissionClass;
00281         }
00282         ret = HelpersHarmonoise::computeNoise(veh->getType()->emissionClass, v, 0);
00283     }
00284     return ret;
00285 }

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

Definition at line 241 of file ROEdge.cpp.

References HelpersHBEFA::computeNOx(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MIN2(), ROEdge::mySpeed, SUMOReal, and SVE_UNKNOWN.

Referenced by computeRoutes().

00241                                                                              {
00242     SUMOReal ret = 0;
00243     if (!getStoredEffort(time, ret)) {
00244         SUMOReal v = mySpeed;
00245         SUMOEmissionClass c = SVE_UNKNOWN;
00246         if (veh->getType()!=0) {
00247             v = MIN2(veh->getType()->maxSpeed, mySpeed);
00248             c = veh->getType()->emissionClass;
00249         }
00250         ret = HelpersHBEFA::computeNOx(c, v, 0) * getTravelTime(veh, time);
00251     }
00252     return ret;
00253 }

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.

00170                                                 {
00171         return myIndex;
00172     }

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

Definition at line 209 of file ROEdge.cpp.

References HelpersHBEFA::computePMx(), ROEdge::getStoredEffort(), ROEdge::getTravelTime(), MIN2(), ROEdge::mySpeed, SUMOReal, and SVE_UNKNOWN.

Referenced by computeRoutes().

00209                                                                              {
00210     SUMOReal ret = 0;
00211     if (!getStoredEffort(time, ret)) {
00212         SUMOReal v = mySpeed;
00213         SUMOEmissionClass c = SVE_UNKNOWN;
00214         if (veh->getType()!=0) {
00215             v = MIN2(veh->getType()->maxSpeed, mySpeed);
00216             c = veh->getType()->emissionClass;
00217         }
00218         ret = HelpersHBEFA::computePMx(c, v, 0) * getTravelTime(veh, time);
00219     }
00220     return ret;
00221 }

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::buildRoutes(), RODFNet::computeRoutesFor(), RODFNet::isDestination(), RODFNet::isFalseSource(), and RODFNet::isSource().

00178                                       {
00179         return mySpeed;
00180     }

bool ROEdge::getStoredEffort ( SUMOReal  time,
SUMOReal &  ret 
) const throw () [protected, inherited]

Retrieves the stored effort.

Parameters:
[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
Returns:
Whether the effort is given

Definition at line 289 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().

00289                                                                   {
00290     if (myUsingETimeLine) {
00291         if (!myEfforts.describesTime(time)) {
00292             if (!myHaveEWarned) {
00293                 WRITE_WARNING("No interval matches passed time "+ toString(time)  + " in edge '" + myID + "'.\n Using edge's length / edge's speed.");
00294                 myHaveEWarned = true;
00295             }
00296             return false;
00297         }
00298         if (myInterpolate) {
00299             SUMOReal inTT = myTravelTimes.getValue(time);
00300             SUMOReal ratio = (SUMOReal)(myEfforts.getSplitTime(time, time + (SUMOTime)inTT) - time) / inTT;
00301             if (ratio >= 0) {
00302                 ret = ratio * myEfforts.getValue(time) + (1-ratio)*myEfforts.getValue(time + (SUMOTime)inTT);
00303                 return true;
00304             }
00305         }
00306         ret = myEfforts.getValue(time);
00307         return true;
00308     }
00309     return false;
00310 }

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().

00202                                       {
00203         return myToNode;
00204     }

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

Returns the travel time for this edge.

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

00156                                                                          {
00157     if (myUsingTTTimeLine) {
00158         if (!myHaveTTWarned && !myTravelTimes.describesTime(time)) {
00159             WRITE_WARNING("No interval matches passed time "+ toString(time)  + " in edge '" + myID + "'.\n Using edge's length / edge's speed.");
00160             myHaveTTWarned = true;
00161         }
00162         if (myInterpolate) {
00163             SUMOReal inTT = myTravelTimes.getValue(time);
00164             SUMOReal split = (SUMOReal)(myTravelTimes.getSplitTime(time, time + (SUMOTime)inTT) - time);
00165             if (split >= 0) {
00166                 return myTravelTimes.getValue(time + (SUMOTime)inTT) *((SUMOReal)1. - split / inTT) + split;
00167             }
00168         }
00169         return myTravelTimes.getValue(time);
00170     }
00171     // ok, no absolute value was found, use the normal value (without) as default
00172     return (SUMOReal)(myLength / mySpeed);
00173 }

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().

00155                                      {
00156         return myType;
00157     }

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] e The 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.

00212                                                              {
00213         return std::find(myFollowingEdges.begin(), myFollowingEdges.end(), e)!=myFollowingEdges.end();
00214     }

RODFEdge& RODFEdge::operator= ( const RODFEdge 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] vehicle The vehicle for which the information has to be returned
Returns:
Whether the vehicle must not enter this edge

Definition at line 329 of file ROEdge.cpp.

References DEFAULT_VEH_CLASS, ROEdge::myAllowedClasses, ROEdge::myNotAllowedClasses, and SVC_UNKNOWN.

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

00329                                                                {
00330     if (myAllowedClasses.size()==0&&myNotAllowedClasses.size()==0) {
00331         return false;
00332     }
00333     // ok, vehicles with an unknown class may be only prohibited
00334     //  if the edge is limited to a set of classes
00335     SUMOVehicleClass vclass = vehicle->getType()!=0 ? vehicle->getType()->vehicleClass : DEFAULT_VEH_CLASS;
00336     if (vclass==SVC_UNKNOWN) {
00337         return false;
00338     }
00339     // check whether it is explicitely disallowed
00340     if (find(myNotAllowedClasses.begin(), myNotAllowedClasses.end(), vclass)!=myNotAllowedClasses.end()) {
00341         return true;
00342     }
00343     // check whether it is within the allowed classes
00344     if (myAllowedClasses.size()==0||find(myAllowedClasses.begin(), myAllowedClasses.end(), vclass)!=myAllowedClasses.end()) {
00345         return false;
00346     }
00347     // ok, we have a set of allowed vehicle classes, but this vehicle's class
00348     //  is not among them
00349     return true;
00350 }

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

Definition at line 51 of file RODFEdge.cpp.

References myFlows.

00051                                                   {
00052     myFlows = flows;
00053 }

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

Sets the type of te edge.

Parameters:
[in] type The new type for the edge

Definition at line 323 of file ROEdge.cpp.

References ROEdge::myType.

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

00323                                            {
00324     myType = type;
00325 }


Field Documentation

std::vector<SUMOVehicleClass> ROEdge::myAllowedClasses [protected, inherited]

The list of allowed vehicle classes.

Definition at line 363 of file ROEdge.h.

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

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

Definition at line 371 of file ROEdge.h.

Referenced by ROEdge::dictionary().

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.

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

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

Definition at line 73 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 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.

Referenced by ROEdge::getStoredEffort().

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

Information whether the edge has reported missing weights.

Definition at line 338 of file ROEdge.h.

Referenced by ROEdge::getTravelTime().

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

The id of the edge.

Definition at line 319 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 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.

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

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

This edge's lanes.

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

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

std::vector<SUMOVehicleClass> ROEdge::myNotAllowedClasses [protected, inherited]

The list of disallowed vehicle classes.

Definition at line 366 of file ROEdge.h.

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

SUMOReal ROEdge::mySpeed [protected, inherited]

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.

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

EdgeType ROEdge::myType [protected, inherited]

The type of the edge.

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

Referenced by ROEdge::buildTimeLines().

bool ROEdge::myUseBoundariesOnOverrideTT [protected, inherited]

Whether overriding weight boundaries shall be reported.

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

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


The documentation for this class was generated from the following files:

Generated on Wed May 5 00:06:59 2010 for Sumo - Simulation of Urban MObility by  doxygen 1.5.6