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