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/****************************************************************************/
24// A basic edge for routing applications
25/****************************************************************************/
26#include <config.h>
27
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// ===========================================================================
45bool ROEdge::myInterpolate = false;
46bool ROEdge::myHaveTTWarned = false;
47bool ROEdge::myHaveEWarned = false;
50double ROEdge::myMinEdgePriority(std::numeric_limits<double>::max());
52
53
54// ===========================================================================
55// method definitions
56// ===========================================================================
57ROEdge::ROEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority) :
58 Named(id),
59 myFromJunction(from),
60 myToJunction(to),
61 myIndex(index),
62 myPriority(priority),
63 mySpeed(-1),
64 myLength(0),
65 myAmSink(false),
66 myAmSource(false),
67 myUsingTTTimeLine(false),
68 myUsingETimeLine(false),
69 myCombinedPermissions(0),
70 myOtherTazConnector(nullptr),
71 myTimePenalty(0) {
72 while ((int)myEdges.size() <= index) {
73 myEdges.push_back(0);
74 }
75 myEdges[index] = this;
76 if (from == nullptr && to == nullptr) {
77 // TAZ edge, no lanes
79 } else {
80 // TODO we should not calculate the boundary here, the position for the nodes is not valid yet
81 myBoundary.add(from->getPosition());
83 }
84}
85
86
88 for (ROLane* const lane : myLanes) {
89 delete lane;
90 }
94}
95
96
97void
99 const double speed = lane->getSpeed();
100 if (speed > mySpeed) {
101 mySpeed = speed;
102 myLength = lane->getLength();
103 }
104 mySpeed = speed > mySpeed ? speed : mySpeed;
105 myLanes.push_back(lane);
106
107 // integrate new allowed classes
109}
110
111
112void
113ROEdge::addSuccessor(ROEdge* s, ROEdge* via, std::string) {
114 if (isInternal()) {
115 // for internal edges after an internal junction,
116 // this is called twice and only the second call counts
117 myFollowingEdges.clear();
118 myFollowingViaEdges.clear();
119 }
120 if (find(myFollowingEdges.begin(), myFollowingEdges.end(), s) == myFollowingEdges.end()) {
121 myFollowingEdges.push_back(s);
122 myFollowingViaEdges.push_back(std::make_pair(s, via));
123 if (isTazConnector() && s->getFromJunction() != nullptr) {
125 }
126 if (!isInternal()) {
127 s->myApproachingEdges.push_back(this);
128 if (s->isTazConnector() && getToJunction() != nullptr) {
129 s->myBoundary.add(getToJunction()->getPosition());
130 }
131 }
132 if (via != nullptr) {
133 if (via->myApproachingEdges.size() == 0) {
134 via->myApproachingEdges.push_back(this);
135 }
136 }
137 }
138}
139
140
141void
142ROEdge::addEffort(double value, double timeBegin, double timeEnd) {
143 myEfforts.add(timeBegin, timeEnd, value);
144 myUsingETimeLine = true;
145}
146
147
148void
149ROEdge::addTravelTime(double value, double timeBegin, double timeEnd) {
150 myTravelTimes.add(timeBegin, timeEnd, value);
151 myUsingTTTimeLine = true;
152}
153
154
155double
156ROEdge::getEffort(const ROVehicle* const veh, double time) const {
157 double ret = 0;
158 if (!getStoredEffort(time, ret)) {
159 return myLength / MIN2(veh->getMaxSpeed(), mySpeed) + myTimePenalty;
160 }
161 return ret;
162}
163
164
165double
166ROEdge::getDistanceTo(const ROEdge* other, const bool doBoundaryEstimate) const {
167 assert(this != other);
168 if (doBoundaryEstimate) {
169 return myBoundary.distanceTo2D(other->myBoundary);
170 }
171 if (isTazConnector()) {
172 if (other->isTazConnector()) {
173 return myBoundary.distanceTo2D(other->myBoundary);
174 }
176 }
177 if (other->isTazConnector()) {
178 return other->myBoundary.distanceTo2D(getToJunction()->getPosition());
179 }
180 return getLanes()[0]->getShape()[-1].distanceTo2D(other->getLanes()[0]->getShape()[0]);
181 //return getToJunction()->getPosition().distanceTo2D(other->getFromJunction()->getPosition());
182}
183
184
185bool
186ROEdge::hasLoadedTravelTime(double time) const {
188}
189
190
191double
192ROEdge::getTravelTime(const ROVehicle* const veh, double time) const {
193 if (myUsingTTTimeLine) {
194 if (myTravelTimes.describesTime(time)) {
195 double lineTT = myTravelTimes.getValue(time);
196 if (myInterpolate) {
197 const double inTT = lineTT;
198 const double split = (double)(myTravelTimes.getSplitTime(time, time + inTT) - time);
199 if (split >= 0) {
200 lineTT = myTravelTimes.getValue(time + inTT) * ((double)1. - split / inTT) + split;
201 }
202 }
203 return MAX2(getMinimumTravelTime(veh), lineTT);
204 } else {
205 if (!myHaveTTWarned) {
206 WRITE_WARNINGF(TL("No interval matches passed time=% in edge '%'.\n Using edge's length / max speed."), time, myID);
207 myHaveTTWarned = true;
208 }
209 }
210 }
211 const double speed = veh != nullptr ? MIN2(veh->getMaxSpeed(), veh->getType()->speedFactor.getParameter()[0] * mySpeed) : mySpeed;
212 return myLength / speed + myTimePenalty;
213}
214
215
216double
217ROEdge::getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, double time) {
218 double ret = 0;
219 if (!edge->getStoredEffort(time, ret)) {
220 const double v = MIN2(veh->getMaxSpeed(), edge->mySpeed);
222 }
223 return ret;
224}
225
226
227bool
228ROEdge::getStoredEffort(double time, double& ret) const {
229 if (myUsingETimeLine) {
230 if (!myEfforts.describesTime(time)) {
231 if (!myHaveEWarned) {
232 WRITE_WARNINGF(TL("No interval matches passed time=% in edge '%'.\n Using edge's length / edge's speed."), time, myID);
233 myHaveEWarned = true;
234 }
235 return false;
236 }
237 if (myInterpolate) {
238 const double inTT = myTravelTimes.getValue(time);
239 const double ratio = (myEfforts.getSplitTime(time, time + inTT) - time) / inTT;
240 if (ratio >= 0.) {
241 ret = ratio * myEfforts.getValue(time) + (1. - ratio) * myEfforts.getValue(time + inTT);
242 return true;
243 }
244 }
245 ret = myEfforts.getValue(time);
246 return true;
247 }
248 return false;
249}
250
251
252int
254 if (myAmSink) {
255 return 0;
256 }
257 return (int) myFollowingEdges.size();
258}
259
260
261int
263 if (myAmSource) {
264 return 0;
265 }
266 return (int) myApproachingEdges.size();
267}
268
269
270const ROEdge*
272 const ROEdge* result = this;
273 while (result->isInternal()) {
274 assert(myApproachingEdges.size() == 1);
275 result = result->myApproachingEdges.front();
276 }
277 return result;
278}
279
280
281
282const ROEdge*
284 const ROEdge* result = this;
285 while (result->isInternal()) {
286 assert(myFollowingEdges.size() == 1);
287 result = result->myFollowingEdges.front();
288 }
289 return result;
290}
291
292
293void
294ROEdge::buildTimeLines(const std::string& measure, const bool boundariesOverride) {
295 if (myUsingETimeLine) {
296 double value = myLength / mySpeed;
298 if (measure == "CO") {
299 value = PollutantsInterface::compute(c, PollutantsInterface::CO, mySpeed, 0, 0, nullptr) * value; // @todo: give correct slope
300 }
301 if (measure == "CO2") {
302 value = PollutantsInterface::compute(c, PollutantsInterface::CO2, mySpeed, 0, 0, nullptr) * value; // @todo: give correct slope
303 }
304 if (measure == "HC") {
305 value = PollutantsInterface::compute(c, PollutantsInterface::HC, mySpeed, 0, 0, nullptr) * value; // @todo: give correct slope
306 }
307 if (measure == "PMx") {
308 value = PollutantsInterface::compute(c, PollutantsInterface::PM_X, mySpeed, 0, 0, nullptr) * value; // @todo: give correct slope
309 }
310 if (measure == "NOx") {
311 value = PollutantsInterface::compute(c, PollutantsInterface::NO_X, mySpeed, 0, 0, nullptr) * value; // @todo: give correct slope
312 }
313 if (measure == "fuel") {
314 value = PollutantsInterface::compute(c, PollutantsInterface::FUEL, mySpeed, 0, 0, nullptr) * value; // @todo: give correct slope
315 }
316 if (measure == "electricity") {
317 value = PollutantsInterface::compute(c, PollutantsInterface::ELEC, mySpeed, 0, 0, nullptr) * value; // @todo: give correct slope
318 }
319 myEfforts.fillGaps(value, boundariesOverride);
320 }
321 if (myUsingTTTimeLine) {
322 myTravelTimes.fillGaps(myLength / mySpeed + myTimePenalty, boundariesOverride);
323 }
324}
325
326
327void
328ROEdge::cacheParamRestrictions(const std::vector<std::string>& restrictionKeys) {
329 for (const std::string& key : restrictionKeys) {
330 const std::string value = getParameter(key, "1e40");
332 }
333}
334
335
336double
338 return myLanes.empty() ? 1. : myLanes[0]->getShape().length() / myLanes[0]->getLength();
339}
340
341
342bool
343ROEdge::allFollowersProhibit(const ROVehicle* const vehicle) const {
344 for (ROEdgeVector::const_iterator i = myFollowingEdges.begin(); i != myFollowingEdges.end(); ++i) {
345 if (!(*i)->prohibits(vehicle)) {
346 return false;
347 }
348 }
349 return true;
350}
351
352
353const ROEdgeVector&
355 return myEdges;
356}
357
358
359const Position
361 const double middle = (stop.endPos + stop.startPos) / 2.;
363 return (edge->getFromJunction()->getPosition() + edge->getToJunction()->getPosition()) * (middle / edge->getLength());
364}
365
366
367const ROEdgeVector&
369 if (vClass == SVC_IGNORING || !RONet::getInstance()->hasPermissions() || isTazConnector()) {
370 return myFollowingEdges;
371 }
372#ifdef HAVE_FOX
373 FXMutexLock locker(myLock);
374#endif
375 std::map<SUMOVehicleClass, ROEdgeVector>::const_iterator i = myClassesSuccessorMap.find(vClass);
376 if (i != myClassesSuccessorMap.end()) {
377 // can use cached value
378 return i->second;
379 }
380 // this vClass is requested for the first time. rebuild all successors
381 std::set<ROEdge*> followers;
382 for (const ROLane* const lane : myLanes) {
383 if ((lane->getPermissions() & vClass) != 0) {
384 for (const auto& next : lane->getOutgoingViaLanes()) {
385 if ((next.first->getPermissions() & vClass) != 0 && (next.second == nullptr || (next.second->getPermissions() & vClass) != 0)) {
386 followers.insert(&next.first->getEdge());
387 }
388 }
389 }
390 }
391 // also add district edges (they are not connected at the lane level
392 for (ROEdgeVector::const_iterator it = myFollowingEdges.begin(); it != myFollowingEdges.end(); ++it) {
393 if ((*it)->isTazConnector()) {
394 followers.insert(*it);
395 }
396 }
397 myClassesSuccessorMap[vClass].insert(myClassesSuccessorMap[vClass].begin(),
398 followers.begin(), followers.end());
399 return myClassesSuccessorMap[vClass];
400}
401
402
404ROEdge::getViaSuccessors(SUMOVehicleClass vClass, bool /*ignoreTransientPermissions*/) const {
405 if (vClass == SVC_IGNORING || !RONet::getInstance()->hasPermissions() || isTazConnector()) {
406 return myFollowingViaEdges;
407 }
408#ifdef HAVE_FOX
409 FXMutexLock locker(myLock);
410#endif
411 std::map<SUMOVehicleClass, ROConstEdgePairVector>::const_iterator i = myClassesViaSuccessorMap.find(vClass);
412 if (i != myClassesViaSuccessorMap.end()) {
413 // can use cached value
414 return i->second;
415 }
416 // this vClass is requested for the first time. rebuild all successors
417 std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
418 for (const ROLane* const lane : myLanes) {
419 if ((lane->getPermissions() & vClass) != 0) {
420 for (const auto& next : lane->getOutgoingViaLanes()) {
421 if ((next.first->getPermissions() & vClass) != 0 && (next.second == nullptr || (next.second->getPermissions() & vClass) != 0)) {
422 followers.insert(std::make_pair(&next.first->getEdge(), next.second));
423 }
424 }
425 }
426 }
427 // also add district edges (they are not connected at the lane level
428 for (const ROEdge* e : myFollowingEdges) {
429 if (e->isTazConnector()) {
430 followers.insert(std::make_pair(e, e));
431 }
432 }
433 myClassesViaSuccessorMap[vClass].insert(myClassesViaSuccessorMap[vClass].begin(),
434 followers.begin(), followers.end());
435 return myClassesViaSuccessorMap[vClass];
436}
437
438
439bool
440ROEdge::isConnectedTo(const ROEdge& e, const SUMOVehicleClass vClass) const {
441 const ROEdgeVector& followers = getSuccessors(vClass);
442 return std::find(followers.begin(), followers.end(), &e) != followers.end();
443}
444
445bool
446ROEdge::initPriorityFactor(double priorityFactor) {
447 myPriorityFactor = priorityFactor;
448 double maxEdgePriority = -std::numeric_limits<double>::max();
449 for (ROEdge* edge : myEdges) {
450 maxEdgePriority = MAX2(maxEdgePriority, (double)edge->getPriority());
451 myMinEdgePriority = MIN2(myMinEdgePriority, (double)edge->getPriority());
452 }
453 myEdgePriorityRange = maxEdgePriority - myMinEdgePriority;
454 if (myEdgePriorityRange == 0) {
455 WRITE_WARNING(TL("Option weights.priority-factor does not take effect because all edges have the same priority."));
457 return false;
458 }
459 return true;
460}
461
462
463/****************************************************************************/
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:57
std::vector< ROEdge * > ROEdgeVector
Definition ROEdge.h:55
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:72
bool allFollowersProhibit(const ROVehicle *const vehicle) const
Returns whether this edge succeeding edges prohibit the given vehicle to pass them.
Definition ROEdge.cpp:343
static double myPriorityFactor
Coefficient for factoring edge priority into routing weight.
Definition ROEdge.h:657
const ROEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
Definition ROEdge.cpp:271
double getDistanceTo(const ROEdge *other, const bool doBoundaryEstimate=false) const
optimistic distance heuristic for use in routing
Definition ROEdge.cpp:166
const ROEdge * getNormalAfter() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
Definition ROEdge.cpp:283
void addEffort(double value, double timeBegin, double timeEnd)
Adds a weight value.
Definition ROEdge.cpp:142
bool hasLoadedTravelTime(double time) const
Returns whether a travel time for this edge was loaded.
Definition ROEdge.cpp:186
static double getStoredEffort(const ROEdge *const edge, const ROVehicle *const, double time)
Definition ROEdge.h:483
ReversedEdge< ROEdge, ROVehicle > * myReversedRoutingEdge
a reversed version for backward routing
Definition ROEdge.h:670
void buildTimeLines(const std::string &measure, const bool boundariesOverride)
Builds the internal representation of the travel time/effort.
Definition ROEdge.cpp:294
ROEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
Definition ROEdge.cpp:57
std::vector< ROLane * > myLanes
This edge's lanes.
Definition ROEdge.h:634
static bool initPriorityFactor(double priorityFactor)
initialize priority factor range
Definition ROEdge.cpp:446
static ROEdgeVector myEdges
Definition ROEdge.h:654
bool myAmSource
Definition ROEdge.h:600
RailEdge< ROEdge, ROVehicle > * myRailwayRoutingEdge
Definition ROEdge.h:673
const RONode * getToJunction() const
Definition ROEdge.h:518
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
Definition ROEdge.h:604
std::map< SUMOVehicleClass, ROEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
Definition ROEdge.h:664
bool isTazConnector() const
Definition ROEdge.h:170
std::map< SUMOVehicleClass, ROConstEdgePairVector > myClassesViaSuccessorMap
The successors with vias available for a given vClass.
Definition ROEdge.h:667
std::vector< double > myParamRestrictions
cached value of parameters which may restrict access
Definition ROEdge.h:652
bool myUsingETimeLine
Information whether the time line shall be used instead of the length value.
Definition ROEdge.h:609
const RONode * getFromJunction() const
Definition ROEdge.h:514
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
Definition ROEdge.cpp:98
ValueTimeLine< double > myEfforts
Container storing passing time varying over time for the edge.
Definition ROEdge.h:607
bool isInternal() const
return whether this edge is an internal edge
Definition ROEdge.h:156
virtual ~ROEdge()
Destructor.
Definition ROEdge.cpp:87
int getNumSuccessors() const
Returns the number of edges this edge is connected to.
Definition ROEdge.cpp:253
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
Definition ROEdge.h:646
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
Definition ROEdge.cpp:217
static bool myInterpolate
Information whether to interpolate at interval boundaries.
Definition ROEdge.h:612
const ROConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Returns the following edges including vias, restricted by vClass.
Definition ROEdge.cpp:404
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
Definition ROEdge.cpp:192
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:457
double myLength
The length of the edge.
Definition ROEdge.h:597
bool myAmSink
whether the edge is a source or a sink
Definition ROEdge.h:600
const ROEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
Definition ROEdge.cpp:368
void addTravelTime(double value, double timeBegin, double timeEnd)
Adds a travel time value.
Definition ROEdge.cpp:149
void cacheParamRestrictions(const std::vector< std::string > &restrictionKeys)
Definition ROEdge.cpp:328
int getNumPredecessors() const
Returns the number of edges connected to this edge.
Definition ROEdge.cpp:262
static double myEdgePriorityRange
the difference between maximum and minimum priority for all edges
Definition ROEdge.h:661
double myTimePenalty
flat penalty when computing traveltime
Definition ROEdge.h:649
SVCPermissions myCombinedPermissions
The list of allowed vehicle classes combined across lanes.
Definition ROEdge.h:637
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
Definition ROEdge.cpp:360
static bool myHaveTTWarned
Information whether the edge has reported missing weights.
Definition ROEdge.h:617
double getEffort(const ROVehicle *const veh, double time) const
Returns the effort for this edge.
Definition ROEdge.cpp:156
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
Definition ROEdge.h:526
double getLengthGeometryFactor() const
return a lower bound on shape.length() / myLength that is
Definition ROEdge.cpp:337
double getLength() const
Returns the length of the edge.
Definition ROEdge.h:221
ROEdgeVector myFollowingEdges
List of edges that may be approached from this edge.
Definition ROEdge.h:620
FlippedEdge< ROEdge, RONode, ROVehicle > * myFlippedRoutingEdge
An extended version of the reversed edge for backward routing (used for the arc flag router)
Definition ROEdge.h:672
ROConstEdgePairVector myFollowingViaEdges
Definition ROEdge.h:622
ValueTimeLine< double > myTravelTimes
Container storing passing time varying over time for the edge.
Definition ROEdge.h:602
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition ROEdge.cpp:113
static double myMinEdgePriority
Minimum priority for all edges.
Definition ROEdge.h:659
bool isConnectedTo(const ROEdge &e, const SUMOVehicleClass vClass) const
returns the information whether this edge is directly connected to the given
Definition ROEdge.cpp:440
static bool myHaveEWarned
Information whether the edge has reported missing weights.
Definition ROEdge.h:615
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
Definition ROEdge.cpp:354
ROEdgeVector myApproachingEdges
List of edges that approached this edge.
Definition ROEdge.h:625
double mySpeed
The maximum speed allowed on this edge.
Definition ROEdge.h:594
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:46
const Position & getPosition() const
Returns the position of the node.
Definition RONode.h:67
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.