Eclipse SUMO - Simulation of Urban MObility
ROEdge.cpp
Go to the documentation of this file.
1 /****************************************************************************/
2 // Eclipse SUMO, Simulation of Urban MObility; see https://eclipse.org/sumo
3 // Copyright (C) 2002-2019 German Aerospace Center (DLR) and others.
4 // This program and the accompanying materials
5 // are made available under the terms of the Eclipse Public License v2.0
6 // which accompanies this distribution, and is available at
7 // http://www.eclipse.org/legal/epl-v20.html
8 // SPDX-License-Identifier: EPL-2.0
9 /****************************************************************************/
20 // A basic edge for routing applications
21 /****************************************************************************/
22 
23 
24 // ===========================================================================
25 // included modules
26 // ===========================================================================
27 #include <config.h>
28 
30 #include <utils/common/ToString.h>
31 #include <algorithm>
32 #include <cassert>
33 #include <iostream>
37 #include "ROLane.h"
38 #include "RONet.h"
39 #include "ROVehicle.h"
40 #include "ROEdge.h"
41 
42 
43 // ===========================================================================
44 // static member definitions
45 // ===========================================================================
46 bool ROEdge::myInterpolate = false;
47 bool ROEdge::myHaveTTWarned = false;
48 bool ROEdge::myHaveEWarned = false;
50 
51 
52 // ===========================================================================
53 // method definitions
54 // ===========================================================================
55 ROEdge::ROEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority) :
56  Named(id),
57  myFromJunction(from),
58  myToJunction(to),
59  myIndex(index),
60  myPriority(priority),
61  mySpeed(-1),
62  myLength(0),
63  myAmSink(false),
64  myAmSource(false),
65  myUsingTTTimeLine(false),
66  myUsingETimeLine(false),
67  myCombinedPermissions(0),
68  myTimePenalty(0) {
69  while ((int)myEdges.size() <= index) {
70  myEdges.push_back(0);
71  }
72  myEdges[index] = this;
73  if (from == nullptr && to == nullptr) {
74  // TAZ edge, no lanes
76  } else {
77  // TODO we should not calculate the boundary here, the position for the nodes is not valid yet
78  myBoundary.add(from->getPosition());
79  myBoundary.add(to->getPosition());
80  }
81 }
82 
83 
85  for (std::vector<ROLane*>::iterator i = myLanes.begin(); i != myLanes.end(); ++i) {
86  delete (*i);
87  }
88 }
89 
90 
91 void
93  assert(myLanes.empty() || lane->getLength() == myLength);
94  myLength = lane->getLength();
95  const double speed = lane->getSpeed();
96  mySpeed = speed > mySpeed ? speed : mySpeed;
97  myLanes.push_back(lane);
98 
99  // integrate new allowed classes
101 }
102 
103 
104 void
105 ROEdge::addSuccessor(ROEdge* s, ROEdge* via, std::string) {
106  if (isInternal()) {
107  // for internal edges after an internal junction,
108  // this is called twice and only the second call counts
109  myFollowingEdges.clear();
110  myFollowingViaEdges.clear();
111  }
112  if (find(myFollowingEdges.begin(), myFollowingEdges.end(), s) == myFollowingEdges.end()) {
113  myFollowingEdges.push_back(s);
114  myFollowingViaEdges.push_back(std::make_pair(s, via));
115  if (isTazConnector()) {//s->getFromJunction() != nullptr) {
117  }
118  if (!isInternal()) {
119  s->myApproachingEdges.push_back(this);
120  if (s->isTazConnector()) {//getToJunction() != nullptr) {
121  s->myBoundary.add(getToJunction()->getPosition());
122  }
123  if (via != nullptr) {
124  if (via->myApproachingEdges.size() == 0) {
125  via->myApproachingEdges.push_back(this);
126  }
127  }
128  }
129  }
130 }
131 
132 
133 void
134 ROEdge::addEffort(double value, double timeBegin, double timeEnd) {
135  myEfforts.add(timeBegin, timeEnd, value);
136  myUsingETimeLine = true;
137 }
138 
139 
140 void
141 ROEdge::addTravelTime(double value, double timeBegin, double timeEnd) {
142  myTravelTimes.add(timeBegin, timeEnd, value);
143  myUsingTTTimeLine = true;
144 }
145 
146 
147 double
148 ROEdge::getEffort(const ROVehicle* const veh, double time) const {
149  double ret = 0;
150  if (!getStoredEffort(time, ret)) {
151  return myLength / MIN2(veh->getType()->maxSpeed, mySpeed) + myTimePenalty;
152  }
153  return ret;
154 }
155 
156 
157 double
158 ROEdge::getDistanceTo(const ROEdge* other, const bool doBoundaryEstimate) const {
159  assert(this != other);
160  if (doBoundaryEstimate) {
161  return myBoundary.distanceTo2D(other->myBoundary);
162  }
163  if (isTazConnector()) {
164  if (other->isTazConnector()) {
165  return myBoundary.distanceTo2D(other->myBoundary);
166  }
168  }
169  if (other->isTazConnector()) {
170  return other->myBoundary.distanceTo2D(getToJunction()->getPosition());
171  }
172  return getLanes()[0]->getShape()[-1].distanceTo2D(other->getLanes()[0]->getShape()[0]);
173  //return getToJunction()->getPosition().distanceTo2D(other->getFromJunction()->getPosition());
174 }
175 
176 
177 bool
178 ROEdge::hasLoadedTravelTime(double time) const {
180 }
181 
182 
183 double
184 ROEdge::getTravelTime(const ROVehicle* const veh, double time) const {
185  if (myUsingTTTimeLine) {
186  if (myTravelTimes.describesTime(time)) {
187  double lineTT = myTravelTimes.getValue(time);
188  if (myInterpolate) {
189  const double inTT = lineTT;
190  const double split = (double)(myTravelTimes.getSplitTime(time, time + inTT) - time);
191  if (split >= 0) {
192  lineTT = myTravelTimes.getValue(time + inTT) * ((double)1. - split / inTT) + split;
193  }
194  }
195  return MAX2(getMinimumTravelTime(veh), lineTT);
196  } else {
197  if (!myHaveTTWarned) {
198  WRITE_WARNING("No interval matches passed time " + toString(time) + " in edge '" + myID + "'.\n Using edge's length / max speed.");
199  myHaveTTWarned = true;
200  }
201  }
202  }
203  const double speed = veh != nullptr ? MIN2(veh->getType()->maxSpeed, veh->getType()->speedFactor.getParameter()[0] * mySpeed) : mySpeed;
204  return myLength / speed + myTimePenalty;
205 }
206 
207 
208 double
209 ROEdge::getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, double time) {
210  double ret = 0;
211  if (!edge->getStoredEffort(time, ret)) {
212  const double v = MIN2(veh->getType()->maxSpeed, edge->mySpeed);
214  }
215  return ret;
216 }
217 
218 
219 bool
220 ROEdge::getStoredEffort(double time, double& ret) const {
221  if (myUsingETimeLine) {
222  if (!myEfforts.describesTime(time)) {
223  if (!myHaveEWarned) {
224  WRITE_WARNING("No interval matches passed time " + toString(time) + " in edge '" + myID + "'.\n Using edge's length / edge's speed.");
225  myHaveEWarned = true;
226  }
227  return false;
228  }
229  if (myInterpolate) {
230  const double inTT = myTravelTimes.getValue(time);
231  const double ratio = (myEfforts.getSplitTime(time, time + inTT) - time) / inTT;
232  if (ratio >= 0.) {
233  ret = ratio * myEfforts.getValue(time) + (1. - ratio) * myEfforts.getValue(time + inTT);
234  return true;
235  }
236  }
237  ret = myEfforts.getValue(time);
238  return true;
239  }
240  return false;
241 }
242 
243 
244 int
246  if (myAmSink) {
247  return 0;
248  }
249  return (int) myFollowingEdges.size();
250 }
251 
252 
253 int
255  if (myAmSource) {
256  return 0;
257  }
258  return (int) myApproachingEdges.size();
259 }
260 
261 
262 const ROEdge*
264  const ROEdge* result = this;
265  while (result->isInternal()) {
266  assert(myApproachingEdges.size() == 1);
267  result = myApproachingEdges.front();
268  }
269  return result;
270 }
271 
272 
273 const ROEdge*
275  const ROEdge* result = this;
276  while (result->isInternal()) {
277  assert(myFollowingEdges.size() == 1);
278  result = myFollowingEdges.front();
279  }
280  return result;
281 }
282 
283 
284 void
285 ROEdge::buildTimeLines(const std::string& measure, const bool boundariesOverride) {
286  if (myUsingETimeLine) {
287  double value = myLength / mySpeed;
289  if (measure == "CO") {
290  value = PollutantsInterface::compute(c, PollutantsInterface::CO, mySpeed, 0, 0) * value; // @todo: give correct slope
291  }
292  if (measure == "CO2") {
293  value = PollutantsInterface::compute(c, PollutantsInterface::CO2, mySpeed, 0, 0) * value; // @todo: give correct slope
294  }
295  if (measure == "HC") {
296  value = PollutantsInterface::compute(c, PollutantsInterface::HC, mySpeed, 0, 0) * value; // @todo: give correct slope
297  }
298  if (measure == "PMx") {
299  value = PollutantsInterface::compute(c, PollutantsInterface::PM_X, mySpeed, 0, 0) * value; // @todo: give correct slope
300  }
301  if (measure == "NOx") {
302  value = PollutantsInterface::compute(c, PollutantsInterface::NO_X, mySpeed, 0, 0) * value; // @todo: give correct slope
303  }
304  if (measure == "fuel") {
305  value = PollutantsInterface::compute(c, PollutantsInterface::FUEL, mySpeed, 0, 0) * value; // @todo: give correct slope
306  }
307  if (measure == "electricity") {
308  value = PollutantsInterface::compute(c, PollutantsInterface::ELEC, mySpeed, 0, 0) * value; // @todo: give correct slope
309  }
310  myEfforts.fillGaps(value, boundariesOverride);
311  }
312  if (myUsingTTTimeLine) {
313  myTravelTimes.fillGaps(myLength / mySpeed + myTimePenalty, boundariesOverride);
314  }
315 }
316 
317 
318 double
320  return myLanes.empty() ? 1. : myLanes[0]->getShape().length() / myLanes[0]->getLength();
321 }
322 
323 
324 bool
325 ROEdge::allFollowersProhibit(const ROVehicle* const vehicle) const {
326  for (ROEdgeVector::const_iterator i = myFollowingEdges.begin(); i != myFollowingEdges.end(); ++i) {
327  if (!(*i)->prohibits(vehicle)) {
328  return false;
329  }
330  }
331  return true;
332 }
333 
334 
335 const ROEdgeVector&
337  return myEdges;
338 }
339 
340 
341 const Position
343  const double middle = (stop.endPos + stop.startPos) / 2.;
345  return (edge->getFromJunction()->getPosition() + edge->getToJunction()->getPosition()) * (middle / edge->getLength());
346 }
347 
348 
349 const ROEdgeVector&
351  if (vClass == SVC_IGNORING || !RONet::getInstance()->hasPermissions() || isTazConnector()) {
352  return myFollowingEdges;
353  }
354 #ifdef HAVE_FOX
355  FXMutexLock locker(myLock);
356 #endif
357  std::map<SUMOVehicleClass, ROEdgeVector>::const_iterator i = myClassesSuccessorMap.find(vClass);
358  if (i != myClassesSuccessorMap.end()) {
359  // can use cached value
360  return i->second;
361  }
362  // this vClass is requested for the first time. rebuild all successors
363  std::set<ROEdge*> followers;
364  for (const ROLane* const lane : myLanes) {
365  if ((lane->getPermissions() & vClass) != 0) {
366  for (const auto& next : lane->getOutgoingViaLanes()) {
367  if ((next.first->getPermissions() & vClass) != 0) {
368  followers.insert(&next.first->getEdge());
369  }
370  }
371  }
372  }
373  // also add district edges (they are not connected at the lane level
374  for (ROEdgeVector::const_iterator it = myFollowingEdges.begin(); it != myFollowingEdges.end(); ++it) {
375  if ((*it)->isTazConnector()) {
376  followers.insert(*it);
377  }
378  }
379  myClassesSuccessorMap[vClass].insert(myClassesSuccessorMap[vClass].begin(),
380  followers.begin(), followers.end());
381  return myClassesSuccessorMap[vClass];
382 }
383 
384 
387  if (vClass == SVC_IGNORING || !RONet::getInstance()->hasPermissions() || isTazConnector()) {
388  return myFollowingViaEdges;
389  }
390 #ifdef HAVE_FOX
391  FXMutexLock locker(myLock);
392 #endif
393  std::map<SUMOVehicleClass, ROConstEdgePairVector>::const_iterator i = myClassesViaSuccessorMap.find(vClass);
394  if (i != myClassesViaSuccessorMap.end()) {
395  // can use cached value
396  return i->second;
397  }
398  // this vClass is requested for the first time. rebuild all successors
399  std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
400  for (const ROLane* const lane : myLanes) {
401  if ((lane->getPermissions() & vClass) != 0) {
402  for (const auto& next : lane->getOutgoingViaLanes()) {
403  if ((next.first->getPermissions() & vClass) != 0) {
404  followers.insert(std::make_pair(&next.first->getEdge(), next.second));
405  }
406  }
407  }
408  }
409  // also add district edges (they are not connected at the lane level
410  for (const ROEdge* e : myFollowingEdges) {
411  if (e->isTazConnector()) {
412  followers.insert(std::make_pair(e, e));
413  }
414  }
415  myClassesViaSuccessorMap[vClass].insert(myClassesViaSuccessorMap[vClass].begin(),
416  followers.begin(), followers.end());
417  return myClassesViaSuccessorMap[vClass];
418 }
419 
420 
421 bool
422 ROEdge::isConnectedTo(const ROEdge* const e, const ROVehicle* const vehicle) const {
423  const SUMOVehicleClass vClass = (vehicle == nullptr ? SVC_IGNORING : vehicle->getVClass());
424  const ROEdgeVector& followers = getSuccessors(vClass);
425  return std::find(followers.begin(), followers.end(), e) != followers.end();
426 }
427 
428 
429 /****************************************************************************/
430 
ROEdge::getAllEdges
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
Definition: ROEdge.cpp:336
ROEdge::isInternal
bool isInternal() const
return whether this edge is an internal edge
Definition: ROEdge.h:148
SUMOVehicleClass
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
Definition: SUMOVehicleClass.h:134
ToString.h
ROEdge::allFollowersProhibit
bool allFollowersProhibit(const ROVehicle *const vehicle) const
Returns whether this edge succeeding edges prohibit the given vehicle to pass them.
Definition: ROEdge.cpp:325
MIN2
T MIN2(T a, T b)
Definition: StdDefs.h:74
ROEdge::myFollowingEdges
ROEdgeVector myFollowingEdges
List of edges that may be approached from this edge.
Definition: ROEdge.h:527
ROEdge::myLanes
std::vector< ROLane * > myLanes
This edge's lanes.
Definition: ROEdge.h:541
WRITE_WARNING
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:239
ROEdge::getTravelTime
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
Definition: ROEdge.cpp:184
ValueTimeLine::describesTime
bool describesTime(double time) const
Returns whether a value for the given time is known.
Definition: ValueTimeLine.h:113
Named
Base class for objects which have an id.
Definition: Named.h:57
SUMOVehicleParameter::Stop::lane
std::string lane
The lane to stop at.
Definition: SUMOVehicleParameter.h:580
ROLane::getLength
double getLength() const
Returns the length of the lane.
Definition: ROLane.h:72
Boundary::distanceTo2D
double distanceTo2D(const Position &p) const
returns the euclidean distance in the x-y-plane
Definition: Boundary.cpp:223
RONet::getEdge
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
Definition: RONet.h:153
PollutantsInterface::FUEL
Definition: PollutantsInterface.h:56
ROEdge::myUsingTTTimeLine
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
Definition: ROEdge.h:511
ROEdge::getSuccessors
const ROEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: ROEdge.cpp:350
MsgHandler.h
ROEdge::myEfforts
ValueTimeLine< double > myEfforts
Container storing passing time varying over time for the edge.
Definition: ROEdge.h:514
ROEdge::myHaveEWarned
static bool myHaveEWarned
Information whether the edge has reported missing weights.
Definition: ROEdge.h:522
ValueTimeLine::getSplitTime
double getSplitTime(double low, double high) const
Returns the time point at which the value changes.
Definition: ValueTimeLine.h:132
ROEdge::myClassesViaSuccessorMap
std::map< SUMOVehicleClass, ROConstEdgePairVector > myClassesViaSuccessorMap
The successors with vias available for a given vClass.
Definition: ROEdge.h:559
ROEdge::myFollowingViaEdges
ROConstEdgePairVector myFollowingViaEdges
Definition: ROEdge.h:529
ROEdge::myAmSource
bool myAmSource
Definition: ROEdge.h:507
ROLane
A single lane the router may use.
Definition: ROLane.h:51
ROEdge::ROEdge
ROEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
Definition: ROEdge.cpp:55
SUMOEmissionClass
int SUMOEmissionClass
Definition: SUMOVehicleClass.h:232
RORoutable::getType
const SUMOVTypeParameter * getType() const
Returns the type of the routable.
Definition: RORoutable.h:85
ROVehicle
A vehicle as used by router.
Definition: ROVehicle.h:53
ROEdge::getLanes
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
Definition: ROEdge.h:475
ROConstEdgePairVector
std::vector< std::pair< const ROEdge *, const ROEdge * > > ROConstEdgePairVector
Definition: ROEdge.h:58
ROVehicle.h
RONet::getInstance
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
Definition: RONet.cpp:56
ROEdge::getNoiseEffort
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
Definition: ROEdge.cpp:209
RORoutable::getVClass
SUMOVehicleClass getVClass() const
Definition: RORoutable.h:108
PollutantsInterface::CO
Definition: PollutantsInterface.h:56
HelpersHarmonoise.h
ROEdge::getViaSuccessors
const ROConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges including vias, restricted by vClass.
Definition: ROEdge.cpp:386
ROEdge::getEffort
double getEffort(const ROVehicle *const veh, double time) const
Returns the effort for this edge.
Definition: ROEdge.cpp:148
MAX2
T MAX2(T a, T b)
Definition: StdDefs.h:80
ROEdge::myEdges
static ROEdgeVector myEdges
Definition: ROEdge.h:552
ROEdge::myCombinedPermissions
SVCPermissions myCombinedPermissions
The list of allowed vehicle classes combined across lanes.
Definition: ROEdge.h:544
Distribution_Parameterized::getParameter
std::vector< double > & getParameter()
Returns the parameters of this distribution.
Definition: Distribution_Parameterized.cpp:111
ROEdge::mySpeed
double mySpeed
The maximum speed allowed on this edge.
Definition: ROEdge.h:501
HelpersHarmonoise::computeNoise
static double computeNoise(SUMOEmissionClass c, double v, double a)
Returns the noise produced by the a vehicle of the given type at the given speed.
Definition: HelpersHarmonoise.cpp:97
ROEdge::addTravelTime
void addTravelTime(double value, double timeBegin, double timeEnd)
Adds a travel time value.
Definition: ROEdge.cpp:141
ROEdge::addSuccessor
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition: ROEdge.cpp:105
PollutantsInterface.h
ROLane::getSpeed
double getSpeed() const
Returns the maximum speed allowed on this lane.
Definition: ROLane.h:80
ROEdge::addEffort
void addEffort(double value, double timeBegin, double timeEnd)
Adds a weight value.
Definition: ROEdge.cpp:134
RONet.h
ROEdge::myTravelTimes
ValueTimeLine< double > myTravelTimes
Container storing passing time varying over time for the edge.
Definition: ROEdge.h:509
ROEdge::getStoredEffort
bool getStoredEffort(double time, double &ret) const
Retrieves the stored effort.
Definition: ROEdge.cpp:220
PollutantsInterface::PM_X
Definition: PollutantsInterface.h:56
ValueTimeLine::add
void add(double begin, double end, T value)
Adds a value for a time interval into the container.
Definition: ValueTimeLine.h:61
PollutantsInterface::HC
Definition: PollutantsInterface.h:56
ROEdge::getLengthGeometryFactor
double getLengthGeometryFactor() const
return a lower bound on shape.length() / myLength that is
Definition: ROEdge.cpp:319
Position
A point in 2D or 3D with translation and scaling methods.
Definition: Position.h:39
Boundary::add
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
Definition: Boundary.cpp:79
PollutantsInterface::NO_X
Definition: PollutantsInterface.h:56
ValueTimeLine::fillGaps
void fillGaps(T value, bool extendOverBoundaries=false)
Sets a default value for all unset intervals.
Definition: ValueTimeLine.h:147
SUMOVehicleParameter::Stop::endPos
double endPos
The stopping position end.
Definition: SUMOVehicleParameter.h:598
SUMOVTypeParameter::maxSpeed
double maxSpeed
The vehicle type's maximum speed [m/s].
Definition: SUMOVTypeParameter.h:219
ROEdgeVector
std::vector< ROEdge * > ROEdgeVector
Definition: RODFRouteDesc.h:36
ROEdge::getNormalBefore
const ROEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
Definition: ROEdge.cpp:263
ROEdge::isTazConnector
bool isTazConnector() const
Definition: ROEdge.h:162
ROEdge::buildTimeLines
void buildTimeLines(const std::string &measure, const bool boundariesOverride)
Builds the internal representation of the travel time/effort.
Definition: ROEdge.cpp:285
PollutantsInterface::ELEC
Definition: PollutantsInterface.h:56
PollutantsInterface::CO2
Definition: PollutantsInterface.h:56
ValueTimeLine::getValue
T getValue(double time) const
Returns the value for the given time.
Definition: ValueTimeLine.h:95
ROEdge::myInterpolate
static bool myInterpolate
Information whether to interpolate at interval boundaries.
Definition: ROEdge.h:519
ROEdge::getNumSuccessors
int getNumSuccessors() const
Returns the number of edges this edge is connected to.
Definition: ROEdge.cpp:245
ROEdge::myBoundary
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
Definition: ROEdge.h:547
ROEdge::myApproachingEdges
ROEdgeVector myApproachingEdges
List of edges that approached this edge.
Definition: ROEdge.h:532
split
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
Definition: MSSOTLE2Sensors.cpp:489
ROEdge::getFromJunction
const RONode * getFromJunction() const
Definition: ROEdge.h:462
SUMOVehicleParameter::Stop::startPos
double startPos
The stopping position start.
Definition: SUMOVehicleParameter.h:595
SUMOVTypeParameter::speedFactor
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
Definition: SUMOVTypeParameter.h:229
PollutantsInterface::getClassByName
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
Definition: PollutantsInterface.cpp:54
toString
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:48
ROEdge::myLength
double myLength
The length of the edge.
Definition: ROEdge.h:504
ROEdge::getLength
double getLength() const
Returns the length of the edge.
Definition: ROEdge.h:203
ROEdge::getNumPredecessors
int getNumPredecessors() const
Returns the number of edges connected to this edge.
Definition: ROEdge.cpp:254
SUMOXMLDefinitions::getEdgeIDFromLane
static std::string getEdgeIDFromLane(const std::string laneID)
return edge id when given the lane ID
Definition: SUMOXMLDefinitions.cpp:958
SVCAll
const SVCPermissions SVCAll
all VClasses are allowed
Definition: SUMOVehicleClass.cpp:147
ROEdge::~ROEdge
virtual ~ROEdge()
Destructor.
Definition: ROEdge.cpp:84
ROEdge::myClassesSuccessorMap
std::map< SUMOVehicleClass, ROEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: ROEdge.h:556
ROEdge::addLane
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
Definition: ROEdge.cpp:92
ROEdge::hasLoadedTravelTime
bool hasLoadedTravelTime(double time) const
Returns whether a travel time for this edge was loaded.
Definition: ROEdge.cpp:178
ROEdge
A basic edge for routing applications.
Definition: ROEdge.h:73
ROEdge::myHaveTTWarned
static bool myHaveTTWarned
Information whether the edge has reported missing weights.
Definition: ROEdge.h:524
PollutantsInterface::compute
static double compute(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const std::map< int, double > *param=0)
Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fue...
Definition: PollutantsInterface.cpp:149
config.h
ROLane.h
ROLane::getPermissions
SVCPermissions getPermissions() const
Returns the list of allowed vehicle classes.
Definition: ROLane.h:88
ROEdge::getNormalAfter
const ROEdge * getNormalAfter() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
Definition: ROEdge.cpp:274
ROEdge::getMinimumTravelTime
double getMinimumTravelTime(const ROVehicle *const veh) const
Returns a lower bound for the travel time on this edge without using any stored timeLine.
Definition: ROEdge.h:410
ROEdge::isConnectedTo
bool isConnectedTo(const ROEdge *const e, const ROVehicle *const vehicle) const
returns the information whether this edge is directly connected to the given
Definition: ROEdge.cpp:422
SUMOVTypeParameter::emissionClass
SUMOEmissionClass emissionClass
The emission class of this vehicle.
Definition: SUMOVTypeParameter.h:232
Named::myID
std::string myID
The name of the object.
Definition: Named.h:134
SVC_IGNORING
vehicles ignoring classes
Definition: SUMOVehicleClass.h:136
RONode
Base class for nodes used by the router.
Definition: RONode.h:46
RONode::getPosition
const Position & getPosition() const
Returns the position of the node.
Definition: RONode.h:67
SUMOVTypeParameter.h
ROEdge::getStopPosition
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
Definition: ROEdge.cpp:342
ROEdge::getDistanceTo
double getDistanceTo(const ROEdge *other, const bool doBoundaryEstimate=false) const
optimistic distance heuristic for use in routing
Definition: ROEdge.cpp:158
ROEdge::myTimePenalty
double myTimePenalty
flat penalty when computing traveltime
Definition: ROEdge.h:550
ROEdge.h
ROEdge::myUsingETimeLine
bool myUsingETimeLine
Information whether the time line shall be used instead of the length value.
Definition: ROEdge.h:516
SUMOVehicleParameter::Stop
Definition of vehicle stop (position and duration)
Definition: SUMOVehicleParameter.h:566
ROEdge::myAmSink
bool myAmSink
whether the edge is a source or a sink
Definition: ROEdge.h:507
ROEdge::getToJunction
const RONode * getToJunction() const
Definition: ROEdge.h:466