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-2020 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  assert(myLanes.empty() || lane->getLength() == myLength);
96  myLength = lane->getLength();
97  const double speed = lane->getSpeed();
98  mySpeed = speed > mySpeed ? speed : mySpeed;
99  myLanes.push_back(lane);
100 
101  // integrate new allowed classes
103 }
104 
105 
106 void
107 ROEdge::addSuccessor(ROEdge* s, ROEdge* via, std::string) {
108  if (isInternal()) {
109  // for internal edges after an internal junction,
110  // this is called twice and only the second call counts
111  myFollowingEdges.clear();
112  myFollowingViaEdges.clear();
113  }
114  if (find(myFollowingEdges.begin(), myFollowingEdges.end(), s) == myFollowingEdges.end()) {
115  myFollowingEdges.push_back(s);
116  myFollowingViaEdges.push_back(std::make_pair(s, via));
117  if (isTazConnector() && s->getFromJunction() != nullptr) {
119  }
120  if (!isInternal()) {
121  s->myApproachingEdges.push_back(this);
122  if (s->isTazConnector() && getToJunction() != nullptr) {
123  s->myBoundary.add(getToJunction()->getPosition());
124  }
125  if (via != nullptr) {
126  if (via->myApproachingEdges.size() == 0) {
127  via->myApproachingEdges.push_back(this);
128  }
129  }
130  }
131  }
132 }
133 
134 
135 void
136 ROEdge::addEffort(double value, double timeBegin, double timeEnd) {
137  myEfforts.add(timeBegin, timeEnd, value);
138  myUsingETimeLine = true;
139 }
140 
141 
142 void
143 ROEdge::addTravelTime(double value, double timeBegin, double timeEnd) {
144  myTravelTimes.add(timeBegin, timeEnd, value);
145  myUsingTTTimeLine = true;
146 }
147 
148 
149 double
150 ROEdge::getEffort(const ROVehicle* const veh, double time) const {
151  double ret = 0;
152  if (!getStoredEffort(time, ret)) {
153  return myLength / MIN2(veh->getType()->maxSpeed, mySpeed) + myTimePenalty;
154  }
155  return ret;
156 }
157 
158 
159 double
160 ROEdge::getDistanceTo(const ROEdge* other, const bool doBoundaryEstimate) const {
161  assert(this != other);
162  if (doBoundaryEstimate) {
163  return myBoundary.distanceTo2D(other->myBoundary);
164  }
165  if (isTazConnector()) {
166  if (other->isTazConnector()) {
167  return myBoundary.distanceTo2D(other->myBoundary);
168  }
170  }
171  if (other->isTazConnector()) {
172  return other->myBoundary.distanceTo2D(getToJunction()->getPosition());
173  }
174  return getLanes()[0]->getShape()[-1].distanceTo2D(other->getLanes()[0]->getShape()[0]);
175  //return getToJunction()->getPosition().distanceTo2D(other->getFromJunction()->getPosition());
176 }
177 
178 
179 bool
180 ROEdge::hasLoadedTravelTime(double time) const {
182 }
183 
184 
185 double
186 ROEdge::getTravelTime(const ROVehicle* const veh, double time) const {
187  if (myUsingTTTimeLine) {
188  if (myTravelTimes.describesTime(time)) {
189  double lineTT = myTravelTimes.getValue(time);
190  if (myInterpolate) {
191  const double inTT = lineTT;
192  const double split = (double)(myTravelTimes.getSplitTime(time, time + inTT) - time);
193  if (split >= 0) {
194  lineTT = myTravelTimes.getValue(time + inTT) * ((double)1. - split / inTT) + split;
195  }
196  }
197  return MAX2(getMinimumTravelTime(veh), lineTT);
198  } else {
199  if (!myHaveTTWarned) {
200  WRITE_WARNING("No interval matches passed time " + toString(time) + " in edge '" + myID + "'.\n Using edge's length / max speed.");
201  myHaveTTWarned = true;
202  }
203  }
204  }
205  const double speed = veh != nullptr ? MIN2(veh->getType()->maxSpeed, veh->getType()->speedFactor.getParameter()[0] * mySpeed) : mySpeed;
206  return myLength / speed + myTimePenalty;
207 }
208 
209 
210 double
211 ROEdge::getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, double time) {
212  double ret = 0;
213  if (!edge->getStoredEffort(time, ret)) {
214  const double v = MIN2(veh->getType()->maxSpeed, edge->mySpeed);
216  }
217  return ret;
218 }
219 
220 
221 bool
222 ROEdge::getStoredEffort(double time, double& ret) const {
223  if (myUsingETimeLine) {
224  if (!myEfforts.describesTime(time)) {
225  if (!myHaveEWarned) {
226  WRITE_WARNING("No interval matches passed time " + toString(time) + " in edge '" + myID + "'.\n Using edge's length / edge's speed.");
227  myHaveEWarned = true;
228  }
229  return false;
230  }
231  if (myInterpolate) {
232  const double inTT = myTravelTimes.getValue(time);
233  const double ratio = (myEfforts.getSplitTime(time, time + inTT) - time) / inTT;
234  if (ratio >= 0.) {
235  ret = ratio * myEfforts.getValue(time) + (1. - ratio) * myEfforts.getValue(time + inTT);
236  return true;
237  }
238  }
239  ret = myEfforts.getValue(time);
240  return true;
241  }
242  return false;
243 }
244 
245 
246 int
248  if (myAmSink) {
249  return 0;
250  }
251  return (int) myFollowingEdges.size();
252 }
253 
254 
255 int
257  if (myAmSource) {
258  return 0;
259  }
260  return (int) myApproachingEdges.size();
261 }
262 
263 
264 const ROEdge*
266  const ROEdge* result = this;
267  while (result->isInternal()) {
268  assert(myApproachingEdges.size() == 1);
269  result = myApproachingEdges.front();
270  }
271  return result;
272 }
273 
274 
275 const ROEdge*
277  const ROEdge* result = this;
278  while (result->isInternal()) {
279  assert(myFollowingEdges.size() == 1);
280  result = myFollowingEdges.front();
281  }
282  return result;
283 }
284 
285 
286 void
287 ROEdge::buildTimeLines(const std::string& measure, const bool boundariesOverride) {
288  if (myUsingETimeLine) {
289  double value = myLength / mySpeed;
291  if (measure == "CO") {
292  value = PollutantsInterface::compute(c, PollutantsInterface::CO, mySpeed, 0, 0) * value; // @todo: give correct slope
293  }
294  if (measure == "CO2") {
295  value = PollutantsInterface::compute(c, PollutantsInterface::CO2, mySpeed, 0, 0) * value; // @todo: give correct slope
296  }
297  if (measure == "HC") {
298  value = PollutantsInterface::compute(c, PollutantsInterface::HC, mySpeed, 0, 0) * value; // @todo: give correct slope
299  }
300  if (measure == "PMx") {
301  value = PollutantsInterface::compute(c, PollutantsInterface::PM_X, mySpeed, 0, 0) * value; // @todo: give correct slope
302  }
303  if (measure == "NOx") {
304  value = PollutantsInterface::compute(c, PollutantsInterface::NO_X, mySpeed, 0, 0) * value; // @todo: give correct slope
305  }
306  if (measure == "fuel") {
307  value = PollutantsInterface::compute(c, PollutantsInterface::FUEL, mySpeed, 0, 0) * value; // @todo: give correct slope
308  }
309  if (measure == "electricity") {
310  value = PollutantsInterface::compute(c, PollutantsInterface::ELEC, mySpeed, 0, 0) * value; // @todo: give correct slope
311  }
312  myEfforts.fillGaps(value, boundariesOverride);
313  }
314  if (myUsingTTTimeLine) {
315  myTravelTimes.fillGaps(myLength / mySpeed + myTimePenalty, boundariesOverride);
316  }
317 }
318 
319 
320 void
321 ROEdge::cacheParamRestrictions(const std::vector<std::string>& restrictionKeys) {
322  for (const std::string& key : restrictionKeys) {
323  const std::string value = getParameter(key, "1e40");
324  myParamRestrictions.push_back(StringUtils::toDouble(value));
325  }
326 }
327 
328 
329 double
331  return myLanes.empty() ? 1. : myLanes[0]->getShape().length() / myLanes[0]->getLength();
332 }
333 
334 
335 bool
336 ROEdge::allFollowersProhibit(const ROVehicle* const vehicle) const {
337  for (ROEdgeVector::const_iterator i = myFollowingEdges.begin(); i != myFollowingEdges.end(); ++i) {
338  if (!(*i)->prohibits(vehicle)) {
339  return false;
340  }
341  }
342  return true;
343 }
344 
345 
346 const ROEdgeVector&
348  return myEdges;
349 }
350 
351 
352 const Position
354  const double middle = (stop.endPos + stop.startPos) / 2.;
356  return (edge->getFromJunction()->getPosition() + edge->getToJunction()->getPosition()) * (middle / edge->getLength());
357 }
358 
359 
360 const ROEdgeVector&
362  if (vClass == SVC_IGNORING || !RONet::getInstance()->hasPermissions() || isTazConnector()) {
363  return myFollowingEdges;
364  }
365 #ifdef HAVE_FOX
366  FXMutexLock locker(myLock);
367 #endif
368  std::map<SUMOVehicleClass, ROEdgeVector>::const_iterator i = myClassesSuccessorMap.find(vClass);
369  if (i != myClassesSuccessorMap.end()) {
370  // can use cached value
371  return i->second;
372  }
373  // this vClass is requested for the first time. rebuild all successors
374  std::set<ROEdge*> followers;
375  for (const ROLane* const lane : myLanes) {
376  if ((lane->getPermissions() & vClass) != 0) {
377  for (const auto& next : lane->getOutgoingViaLanes()) {
378  if ((next.first->getPermissions() & vClass) != 0 && (next.second == nullptr || (next.second->getPermissions() & vClass) != 0)) {
379  followers.insert(&next.first->getEdge());
380  }
381  }
382  }
383  }
384  // also add district edges (they are not connected at the lane level
385  for (ROEdgeVector::const_iterator it = myFollowingEdges.begin(); it != myFollowingEdges.end(); ++it) {
386  if ((*it)->isTazConnector()) {
387  followers.insert(*it);
388  }
389  }
390  myClassesSuccessorMap[vClass].insert(myClassesSuccessorMap[vClass].begin(),
391  followers.begin(), followers.end());
392  return myClassesSuccessorMap[vClass];
393 }
394 
395 
398  if (vClass == SVC_IGNORING || !RONet::getInstance()->hasPermissions() || isTazConnector()) {
399  return myFollowingViaEdges;
400  }
401 #ifdef HAVE_FOX
402  FXMutexLock locker(myLock);
403 #endif
404  std::map<SUMOVehicleClass, ROConstEdgePairVector>::const_iterator i = myClassesViaSuccessorMap.find(vClass);
405  if (i != myClassesViaSuccessorMap.end()) {
406  // can use cached value
407  return i->second;
408  }
409  // this vClass is requested for the first time. rebuild all successors
410  std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
411  for (const ROLane* const lane : myLanes) {
412  if ((lane->getPermissions() & vClass) != 0) {
413  for (const auto& next : lane->getOutgoingViaLanes()) {
414  if ((next.first->getPermissions() & vClass) != 0 && (next.second == nullptr || (next.second->getPermissions() & vClass) != 0)) {
415  followers.insert(std::make_pair(&next.first->getEdge(), next.second));
416  }
417  }
418  }
419  }
420  // also add district edges (they are not connected at the lane level
421  for (const ROEdge* e : myFollowingEdges) {
422  if (e->isTazConnector()) {
423  followers.insert(std::make_pair(e, e));
424  }
425  }
426  myClassesViaSuccessorMap[vClass].insert(myClassesViaSuccessorMap[vClass].begin(),
427  followers.begin(), followers.end());
428  return myClassesViaSuccessorMap[vClass];
429 }
430 
431 
432 bool
433 ROEdge::isConnectedTo(const ROEdge& e, const SUMOVehicleClass vClass) const {
434  const ROEdgeVector& followers = getSuccessors(vClass);
435  return std::find(followers.begin(), followers.end(), &e) != followers.end();
436 }
437 
438 bool
439 ROEdge::initPriorityFactor(double priorityFactor) {
440  myPriorityFactor = priorityFactor;
441  double maxEdgePriority = -std::numeric_limits<double>::max();
442  for (ROEdge* edge : myEdges) {
443  maxEdgePriority = MAX2(maxEdgePriority, (double)edge->getPriority());
444  myMinEdgePriority = MIN2(myMinEdgePriority, (double)edge->getPriority());
445  }
446  myEdgePriorityRange = maxEdgePriority - myMinEdgePriority;
447  if (myEdgePriorityRange == 0) {
448  WRITE_WARNING("Option weights.priority-factor does not take effect because all edges have the same priority.");
449  myPriorityFactor = 0;
450  return false;
451  }
452  return true;
453 }
454 
455 
456 /****************************************************************************/
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
#define WRITE_WARNING(msg)
Definition: MsgHandler.h:276
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:73
T MAX2(T a, T b)
Definition: StdDefs.h:79
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
Definition: ToString.h:44
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:53
std::string myID
The name of the object.
Definition: Named.h:124
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 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...
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:36
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:336
static double myPriorityFactor
Coefficient for factoring edge priority into routing weight.
Definition: ROEdge.h:638
const ROEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
Definition: ROEdge.cpp:265
double getDistanceTo(const ROEdge *other, const bool doBoundaryEstimate=false) const
optimistic distance heuristic for use in routing
Definition: ROEdge.cpp:160
const ROEdge * getNormalAfter() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
Definition: ROEdge.cpp:276
void addEffort(double value, double timeBegin, double timeEnd)
Adds a weight value.
Definition: ROEdge.cpp:136
bool hasLoadedTravelTime(double time) const
Returns whether a travel time for this edge was loaded.
Definition: ROEdge.cpp:180
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:287
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:615
static bool initPriorityFactor(double priorityFactor)
initialize priority factor range
Definition: ROEdge.cpp:439
static ROEdgeVector myEdges
Definition: ROEdge.h:635
bool myAmSource
Definition: ROEdge.h:581
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
Definition: ROEdge.h:585
std::map< SUMOVehicleClass, ROEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition: ROEdge.h:645
bool isTazConnector() const
Definition: ROEdge.h:159
std::map< SUMOVehicleClass, ROConstEdgePairVector > myClassesViaSuccessorMap
The successors with vias available for a given vClass.
Definition: ROEdge.h:648
std::vector< double > myParamRestrictions
cached value of parameters which may restrict access
Definition: ROEdge.h:633
bool myUsingETimeLine
Information whether the time line shall be used instead of the length value.
Definition: ROEdge.h:590
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:588
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:397
int getNumSuccessors() const
Returns the number of edges this edge is connected to.
Definition: ROEdge.cpp:247
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
Definition: ROEdge.h:627
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
Definition: ROEdge.cpp:211
static bool myInterpolate
Information whether to interpolate at interval boundaries.
Definition: ROEdge.h:593
const RONode * getFromJunction() const
Definition: ROEdge.h:504
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
Definition: ROEdge.cpp:186
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:516
double myLength
The length of the edge.
Definition: ROEdge.h:578
bool myAmSink
whether the edge is a source or a sink
Definition: ROEdge.h:581
const ROEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition: ROEdge.cpp:361
void addTravelTime(double value, double timeBegin, double timeEnd)
Adds a travel time value.
Definition: ROEdge.cpp:143
void cacheParamRestrictions(const std::vector< std::string > &restrictionKeys)
Definition: ROEdge.cpp:321
int getNumPredecessors() const
Returns the number of edges connected to this edge.
Definition: ROEdge.cpp:256
static double myEdgePriorityRange
the difference between maximum and minimum priority for all edges
Definition: ROEdge.h:642
double myTimePenalty
flat penalty when computing traveltime
Definition: ROEdge.h:630
SVCPermissions myCombinedPermissions
The list of allowed vehicle classes combined across lanes.
Definition: ROEdge.h:618
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
Definition: ROEdge.cpp:353
static bool myHaveTTWarned
Information whether the edge has reported missing weights.
Definition: ROEdge.h:598
double getEffort(const ROVehicle *const veh, double time) const
Returns the effort for this edge.
Definition: ROEdge.cpp:150
double getLengthGeometryFactor() const
return a lower bound on shape.length() / myLength that is
Definition: ROEdge.cpp:330
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:601
ROConstEdgePairVector myFollowingViaEdges
Definition: ROEdge.h:603
ValueTimeLine< double > myTravelTimes
Container storing passing time varying over time for the edge.
Definition: ROEdge.h:583
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition: ROEdge.cpp:107
static double myMinEdgePriority
Minimum priority for all edges.
Definition: ROEdge.h:640
bool isConnectedTo(const ROEdge &e, const SUMOVehicleClass vClass) const
returns the information whether this edge is directly connected to the given
Definition: ROEdge.cpp:433
static bool myHaveEWarned
Information whether the edge has reported missing weights.
Definition: ROEdge.h:596
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
Definition: ROEdge.cpp:347
ROEdgeVector myApproachingEdges
List of edges that approached this edge.
Definition: ROEdge.h:606
double mySpeed
The maximum speed allowed on this edge.
Definition: ROEdge.h:575
const RONode * getToJunction() const
Definition: ROEdge.h:508
A single lane the router may use.
Definition: ROLane.h:48
double getLength() const
Returns the length of the lane.
Definition: ROLane.h:69
SVCPermissions getPermissions() const
Returns the list of allowed vehicle classes.
Definition: ROLane.h:85
double getSpeed() const
Returns the maximum speed allowed on this lane.
Definition: ROLane.h:77
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
Definition: RONet.cpp:55
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:92
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:58