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