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