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