Eclipse SUMO - Simulation of Urban MObility
ROEdge.h
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 #pragma once
26 #include <config.h>
27 
28 #include <string>
29 #include <map>
30 #include <vector>
31 #include <algorithm>
32 #include <utils/common/Named.h>
33 #include <utils/common/StdDefs.h>
38 #include <utils/geom/Boundary.h>
39 #ifdef HAVE_FOX
40 #include <fx.h>
41 #endif
43 #include "RONode.h"
44 #include "ROVehicle.h"
45 
46 
47 // ===========================================================================
48 // class declarations
49 // ===========================================================================
50 class ROLane;
51 class ROEdge;
52 
53 typedef std::vector<ROEdge*> ROEdgeVector;
54 typedef std::vector<const ROEdge*> ConstROEdgeVector;
55 typedef std::vector<std::pair<const ROEdge*, const ROEdge*> > ROConstEdgePairVector;
56 
57 
58 // ===========================================================================
59 // class definitions
60 // ===========================================================================
70 class ROEdge : public Named, public Parameterised {
71 public:
79  ROEdge(const std::string& id, RONode* from, RONode* to, int index, const int priority);
80 
81 
83  virtual ~ROEdge();
84 
85 
87 
88 
97  virtual void addLane(ROLane* lane);
98 
99 
106  virtual void addSuccessor(ROEdge* s, ROEdge* via = nullptr, std::string dir = "");
107 
108 
112  inline void setFunction(SumoXMLEdgeFunc func) {
113  myFunction = func;
114  }
115 
116 
120  inline void setSource(const bool isSource = true) {
121  myAmSource = isSource;
122  }
123 
124 
128  inline void setSink(const bool isSink = true) {
129  myAmSink = isSink;
130  }
131 
132 
136  inline void setRestrictions(const std::map<SUMOVehicleClass, double>* restrictions) {
137  myRestrictions = restrictions;
138  }
139 
140  inline void setTimePenalty(double value) {
141  myTimePenalty = value;
142  }
143 
145  inline bool isInternal() const {
147  }
148 
150  inline bool isCrossing() const {
152  }
153 
155  inline bool isWalkingArea() const {
157  }
158 
159  inline bool isTazConnector() const {
161  }
162 
163  void setOtherTazConnector(const ROEdge* edge) {
164  myOtherTazConnector = edge;
165  }
166 
167  const ROEdge* getOtherTazConnector() const {
168  return myOtherTazConnector;
169  }
170 
180  void buildTimeLines(const std::string& measure, const bool boundariesOverride);
181 
182  void cacheParamRestrictions(const std::vector<std::string>& restrictionKeys);
184 
185 
186 
188 
189 
194  inline SumoXMLEdgeFunc getFunction() const {
195  return myFunction;
196  }
197 
198 
202  inline bool isSink() const {
203  return myAmSink;
204  }
205 
206 
210  double getLength() const {
211  return myLength;
212  }
213 
217  int getNumericalID() const {
218  return myIndex;
219  }
220 
221 
225  double getSpeedLimit() const {
226  return mySpeed;
227  }
228 
230  // sufficient for the astar air-distance heuristic
231  double getLengthGeometryFactor() const;
232 
237  inline double getVClassMaxSpeed(SUMOVehicleClass vclass) const {
238  if (myRestrictions != 0) {
239  std::map<SUMOVehicleClass, double>::const_iterator r = myRestrictions->find(vclass);
240  if (r != myRestrictions->end()) {
241  return r->second;
242  }
243  }
244  return mySpeed;
245  }
246 
247 
251  int getNumLanes() const {
252  return (int) myLanes.size();
253  }
254 
255 
262  bool isConnectedTo(const ROEdge& e, const SUMOVehicleClass vClass) const;
263 
264 
269  inline bool prohibits(const ROVehicle* const vehicle) const {
270  const SUMOVehicleClass vclass = vehicle->getVClass();
271  return (myCombinedPermissions & vclass) != vclass;
272  }
273 
275  return myCombinedPermissions;
276  }
277 
282  inline bool restricts(const ROVehicle* const vehicle) const {
283  const std::vector<double>& vTypeRestrictions = vehicle->getType()->paramRestrictions;
284  assert(vTypeRestrictions.size() == myParamRestrictions.size());
285  for (int i = 0; i < (int)vTypeRestrictions.size(); i++) {
286  if (vTypeRestrictions[i] > myParamRestrictions[i]) {
287  return true;
288  }
289  }
290  return false;
291  }
292 
293 
298  bool allFollowersProhibit(const ROVehicle* const vehicle) const;
300 
301 
302 
304 
305 
312  void addEffort(double value, double timeBegin, double timeEnd);
313 
314 
321  void addTravelTime(double value, double timeBegin, double timeEnd);
322 
323 
331  int getNumSuccessors() const;
332 
333 
339 
345 
346 
354  int getNumPredecessors() const;
355 
356 
361  const ROEdgeVector& getPredecessors() const {
362  return myApproachingEdges;
363  }
364 
366  const ROEdge* getNormalBefore() const;
367 
369  const ROEdge* getNormalAfter() const;
370 
378  double getEffort(const ROVehicle* const veh, double time) const;
379 
380 
386  bool hasLoadedTravelTime(double time) const;
387 
388 
395  double getTravelTime(const ROVehicle* const veh, double time) const;
396 
397 
406  static inline double getEffortStatic(const ROEdge* const edge, const ROVehicle* const veh, double time) {
407  return edge->getEffort(veh, time);
408  }
409 
410 
418  static inline double getTravelTimeStatic(const ROEdge* const edge, const ROVehicle* const veh, double time) {
419  return edge->getTravelTime(veh, time);
420  }
421 
422  static inline double getTravelTimeStaticRandomized(const ROEdge* const edge, const ROVehicle* const veh, double time) {
423  return edge->getTravelTime(veh, time) * RandHelper::rand(1., gWeightsRandomFactor);
424  }
425 
427  static inline double getTravelTimeAggregated(const ROEdge* const edge, const ROVehicle* const veh, double time) {
428  return edge->getTravelTime(veh, time);
429  }
430 
432  static inline double getTravelTimeStaticPriorityFactor(const ROEdge* const edge, const ROVehicle* const veh, double time) {
433  double result = edge->getTravelTime(veh, time);
434  // lower priority should result in higher effort (and the edge with
435  // minimum priority receives a factor of myPriorityFactor
436  const double relativeInversePrio = 1 - ((edge->getPriority() - myMinEdgePriority) / myEdgePriorityRange);
437  result *= 1 + relativeInversePrio * myPriorityFactor;
438  return result;
439  }
440 
446  inline double getMinimumTravelTime(const ROVehicle* const veh) const {
447  if (isTazConnector()) {
448  return 0;
449  } else if (veh != 0) {
450  return myLength / MIN2(veh->getType()->maxSpeed, veh->getChosenSpeedFactor() * mySpeed);
451  } else {
452  return myLength / mySpeed;
453  }
454  }
455 
456 
457  template<PollutantsInterface::EmissionType ET>
458  static double getEmissionEffort(const ROEdge* const edge, const ROVehicle* const veh, double time) {
459  double ret = 0;
460  if (!edge->getStoredEffort(time, ret)) {
461  const SUMOVTypeParameter* const type = veh->getType();
462  const double vMax = MIN2(type->maxSpeed, edge->mySpeed);
464  ret = PollutantsInterface::computeDefault(type->emissionClass, ET, vMax, accel, 0, edge->getTravelTime(veh, time)); // @todo: give correct slope
465  }
466  return ret;
467  }
468 
469 
470  static double getNoiseEffort(const ROEdge* const edge, const ROVehicle* const veh, double time);
471 
472  static double getStoredEffort(const ROEdge* const edge, const ROVehicle* const /*veh*/, double time) {
473  double ret = 0;
474  edge->getStoredEffort(time, ret);
475  return ret;
476  }
478 
479 
481  double getDistanceTo(const ROEdge* other, const bool doBoundaryEstimate = false) const;
482 
483 
485  static const ROEdgeVector& getAllEdges();
486 
488  static int dictSize() {
489  return (int)myEdges.size();
490  };
491 
492  static void setGlobalOptions(const bool interpolate) {
493  myInterpolate = interpolate;
494  }
495 
497  static const Position getStopPosition(const SUMOVehicleParameter::Stop& stop);
498 
500  int getPriority() const {
501  return myPriority;
502  }
503 
504  const RONode* getFromJunction() const {
505  return myFromJunction;
506  }
507 
508  const RONode* getToJunction() const {
509  return myToJunction;
510  }
511 
516  const std::vector<ROLane*>& getLanes() const {
517  return myLanes;
518  }
519 
521  inline const ROEdge* getBidiEdge() const {
522  return myBidiEdge;
523  }
524 
526  inline void setBidiEdge(const ROEdge* bidiEdge) {
527  myBidiEdge = bidiEdge;
528  }
529 
531  if (myReversedRoutingEdge == nullptr) {
533  }
534  return myReversedRoutingEdge;
535  }
536 
538  if (myRailwayRoutingEdge == nullptr) {
540  }
541  return myRailwayRoutingEdge;
542  }
543 
545  bool hasStoredEffort() const {
546  return myUsingETimeLine;
547  }
548 
550  static bool initPriorityFactor(double priorityFactor);
551 
552 protected:
559  bool getStoredEffort(double time, double& ret) const;
560 
561 
562 
563 protected:
567 
569  const int myIndex;
570 
572  const int myPriority;
573 
575  double mySpeed;
576 
578  double myLength;
579 
586 
591 
593  static bool myInterpolate;
594 
596  static bool myHaveEWarned;
598  static bool myHaveTTWarned;
599 
602 
604 
607 
610 
612  const std::map<SUMOVehicleClass, double>* myRestrictions;
613 
615  std::vector<ROLane*> myLanes;
616 
619 
622 
625 
628 
631 
633  std::vector<double> myParamRestrictions;
634 
636 
638  static double myPriorityFactor;
640  static double myMinEdgePriority;
642  static double myEdgePriorityRange;
643 
645  mutable std::map<SUMOVehicleClass, ROEdgeVector> myClassesSuccessorMap;
646 
648  mutable std::map<SUMOVehicleClass, ROConstEdgePairVector> myClassesViaSuccessorMap;
649 
653 
654 #ifdef HAVE_FOX
656  mutable FXMutex myLock;
657 #endif
658 
659 private:
661  ROEdge(const ROEdge& src);
662 
664  ROEdge& operator=(const ROEdge& src);
665 
666 };
std::vector< ROEdge * > ROEdgeVector
Definition: RODFRouteDesc.h:33
std::vector< std::pair< const ROEdge *, const ROEdge * > > ROConstEdgePairVector
Definition: ROEdge.h:55
std::vector< const ROEdge * > ConstROEdgeVector
Definition: ROEdge.h:54
std::vector< ROEdge * > ROEdgeVector
Definition: ROEdge.h:51
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
SumoXMLEdgeFunc
Numbers representing special SUMO-XML-attribute values for representing edge functions used in netbui...
@ SUMO_ATTR_ACCEL
@ SUMO_ATTR_SIGMA
double gWeightsRandomFactor
Definition: StdDefs.cpp:29
T MIN2(T a, T b)
Definition: StdDefs.h:73
A class that stores a 2D geometrical boundary.
Definition: Boundary.h:39
Base class for objects which have an id.
Definition: Named.h:53
An upper class for objects with additional parameters.
Definition: Parameterised.h:39
static double computeDefault(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const double tt, const std::map< int, double > *param=0)
Returns the amount of emitted pollutant given the vehicle type and default values for the state (in m...
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
double getVClassMaxSpeed(SUMOVehicleClass vclass) const
Returns the lane's maximum speed, given a vehicle's speed limit adaptation.
Definition: ROEdge.h:237
bool hasStoredEffort() const
whether effort data was loaded for this edge
Definition: ROEdge.h:545
int getNumericalID() const
Returns the index (numeric id) of the edge.
Definition: ROEdge.h:217
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
void setFunction(SumoXMLEdgeFunc func)
Sets the function of the edge.
Definition: ROEdge.h:112
ReversedEdge< ROEdge, ROVehicle > * getReversedRoutingEdge() const
Definition: ROEdge.h:530
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
ROEdge & operator=(const ROEdge &src)
Invalidated assignment operator.
static double getStoredEffort(const ROEdge *const edge, const ROVehicle *const, double time)
Definition: ROEdge.h:472
ReversedEdge< ROEdge, ROVehicle > * myReversedRoutingEdge
a reversed version for backward routing
Definition: ROEdge.h:651
bool restricts(const ROVehicle *const vehicle) const
Returns whether this edge has restriction parameters forbidding the given vehicle to pass it.
Definition: ROEdge.h:282
void buildTimeLines(const std::string &measure, const bool boundariesOverride)
Builds the internal representation of the travel time/effort.
Definition: ROEdge.cpp:287
int getNumLanes() const
Returns the number of lanes this edge has.
Definition: ROEdge.h:251
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
void setRestrictions(const std::map< SUMOVehicleClass, double > *restrictions)
Sets the vehicle class specific speed limits of the edge.
Definition: ROEdge.h:136
const ROEdge * getOtherTazConnector() const
Definition: ROEdge.h:167
static bool initPriorityFactor(double priorityFactor)
initialize priority factor range
Definition: ROEdge.cpp:439
int getPriority() const
get edge priority (road class)
Definition: ROEdge.h:500
static ROEdgeVector myEdges
Definition: ROEdge.h:635
bool myAmSource
Definition: ROEdge.h:581
RailEdge< ROEdge, ROVehicle > * myRailwayRoutingEdge
Definition: ROEdge.h:652
static double getTravelTimeStaticPriorityFactor(const ROEdge *const edge, const ROVehicle *const veh, double time)
Return traveltime weighted by edge priority (scaled penalty for low-priority edges)
Definition: ROEdge.h:432
const int myIndex
The index (numeric id) of the edge.
Definition: ROEdge.h:569
SumoXMLEdgeFunc myFunction
The function of the edge.
Definition: ROEdge.h:609
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
Definition: ROEdge.h:585
void setSource(const bool isSource=true)
Sets whether the edge is a source.
Definition: ROEdge.h:120
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
void setBidiEdge(const ROEdge *bidiEdge)
set opposite superposable/congruent edge
Definition: ROEdge.h:526
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
bool prohibits(const ROVehicle *const vehicle) const
Returns whether this edge prohibits the given vehicle to pass it.
Definition: ROEdge.h:269
double getSpeedLimit() const
Returns the speed allowed on this edge.
Definition: ROEdge.h:225
const ROEdge * myOtherTazConnector
the other taz-connector if this edge isTazConnector, otherwise nullptr
Definition: ROEdge.h:621
bool isSink() const
Returns whether the edge acts as a sink.
Definition: ROEdge.h:202
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
void setSink(const bool isSink=true)
Sets whether the edge is a sink.
Definition: ROEdge.h:128
const ROConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges including vias, restricted by vClass.
Definition: ROEdge.cpp:397
static double getTravelTimeAggregated(const ROEdge *const edge, const ROVehicle *const veh, double time)
Alias for getTravelTimeStatic (there is no routing device to provide aggregated travel times)
Definition: ROEdge.h:427
ROEdge(const ROEdge &src)
Invalidated copy constructor.
static double getEmissionEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
Definition: ROEdge.h:458
int getNumSuccessors() const
Returns the number of edges this edge is connected to.
Definition: ROEdge.cpp:247
const ROEdge * myBidiEdge
the bidirectional rail edge or nullpr
Definition: ROEdge.h:624
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
RONode * myFromJunction
the junctions for this edge
Definition: ROEdge.h:565
const ROEdge * getBidiEdge() const
return opposite superposable/congruent edge, if it exist and 0 else
Definition: ROEdge.h:521
static bool myInterpolate
Information whether to interpolate at interval boundaries.
Definition: ROEdge.h:593
const RONode * getFromJunction() const
Definition: ROEdge.h:504
SumoXMLEdgeFunc getFunction() const
Returns the function of the edge.
Definition: ROEdge.h:194
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
static int dictSize()
Returns the number of edges.
Definition: ROEdge.h:488
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
SVCPermissions getPermissions() const
Definition: ROEdge.h:274
void setOtherTazConnector(const ROEdge *edge)
Definition: ROEdge.h:163
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 getTravelTimeStaticRandomized(const ROEdge *const edge, const ROVehicle *const veh, double time)
Definition: ROEdge.h:422
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
const std::map< SUMOVehicleClass, double > * myRestrictions
The vClass speed restrictions for this edge.
Definition: ROEdge.h:612
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
static double getEffortStatic(const ROEdge *const edge, const ROVehicle *const veh, double time)
Returns the effort for the given edge.
Definition: ROEdge.h:406
bool isWalkingArea() const
return whether this edge is walking area
Definition: ROEdge.h:155
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
static void setGlobalOptions(const bool interpolate)
Definition: ROEdge.h:492
const ROEdgeVector & getPredecessors() const
Returns the edge at the given position from the list of incoming edges.
Definition: ROEdge.h:361
bool isCrossing() const
return whether this edge is a pedestrian crossing
Definition: ROEdge.h:150
static double getTravelTimeStatic(const ROEdge *const edge, const ROVehicle *const veh, double time)
Returns the travel time for the given edge.
Definition: ROEdge.h:418
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
Definition: ROEdge.cpp:107
const int myPriority
The edge priority (road class)
Definition: ROEdge.h:572
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
RONode * myToJunction
Definition: ROEdge.h:566
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
RailEdge< ROEdge, ROVehicle > * getRailwayRoutingEdge() const
Definition: ROEdge.h:537
void setTimePenalty(double value)
Definition: ROEdge.h:140
A single lane the router may use.
Definition: ROLane.h:48
Base class for nodes used by the router.
Definition: RONode.h:43
SUMOVehicleClass getVClass() const
Definition: RORoutable.h:105
const SUMOVTypeParameter * getType() const
Returns the type of the routable.
Definition: RORoutable.h:82
A vehicle as used by router.
Definition: ROVehicle.h:50
double getChosenSpeedFactor() const
Returns an upper bound for the speed factor of this vehicle.
Definition: ROVehicle.h:109
static double rand(std::mt19937 *rng=nullptr)
Returns a random real number in [0, 1)
Definition: RandHelper.h:51
Structure representing possible vehicle parameter.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
std::vector< double > paramRestrictions
cached value of parameters which may restrict access to certain edges
double maxSpeed
The vehicle type's maximum speed [m/s].
double getCFParam(const SumoXMLAttr attr, const double defaultValue) const
Returns the named value from the map, or the default if it is not contained there.
SUMOVehicleClass vehicleClass
The vehicle's class.
static double getDefaultImperfection(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default driver's imperfection (sigma or epsilon in Krauss' model) for the given vehicle c...
static double getDefaultAccel(const SUMOVehicleClass vc=SVC_IGNORING)
Returns the default acceleration for the given vehicle class This needs to be a function because the ...
Definition of vehicle stop (position and duration)