67 myUsingTTTimeLine(false),
68 myUsingETimeLine(false),
69 myCombinedPermissions(0),
70 myOtherTazConnector(nullptr),
72 while ((
int)
myEdges.size() <= index) {
76 if (from ==
nullptr && to ==
nullptr) {
99 const double speed = lane->
getSpeed();
132 if (via !=
nullptr) {
167 assert(
this != other);
168 if (doBoundaryEstimate) {
180 return getLanes()[0]->getShape()[-1].distanceTo2D(other->
getLanes()[0]->getShape()[0]);
197 const double inTT = lineTT;
206 WRITE_WARNINGF(
TL(
"No interval matches passed time=% in edge '%'.\n Using edge's length / max speed."), time,
myID);
232 WRITE_WARNINGF(
TL(
"No interval matches passed time=% in edge '%'.\n Using edge's length / edge's speed."), time,
myID);
272 const ROEdge* result =
this;
284 const ROEdge* result =
this;
298 if (measure ==
"CO") {
301 if (measure ==
"CO2") {
304 if (measure ==
"HC") {
307 if (measure ==
"PMx") {
310 if (measure ==
"NOx") {
313 if (measure ==
"fuel") {
316 if (measure ==
"electricity") {
329 for (
const std::string& key : restrictionKeys) {
345 if (!(*i)->prohibits(vehicle)) {
373 FXMutexLock locker(myLock);
381 std::set<ROEdge*> followers;
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());
393 if ((*it)->isTazConnector()) {
394 followers.insert(*it);
398 followers.begin(), followers.end());
409 FXMutexLock locker(myLock);
417 std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
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));
429 if (e->isTazConnector()) {
430 followers.insert(std::make_pair(e, e));
434 followers.begin(), followers.end());
442 return std::find(followers.begin(), followers.end(), &e) != followers.end();
448 double maxEdgePriority = -std::numeric_limits<double>::max();
450 maxEdgePriority =
MAX2(maxEdgePriority, (
double)edge->getPriority());
455 WRITE_WARNING(
TL(
"Option weights.priority-factor does not take effect because all edges have the same priority."));
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
#define WRITE_WARNINGF(...)
#define WRITE_WARNING(msg)
std::vector< ROEdge * > ROEdgeVector
std::vector< std::pair< const ROEdge *, const ROEdge * > > ROConstEdgePairVector
std::vector< ROEdge * > ROEdgeVector
const SVCPermissions SVCAll
all VClasses are allowed
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
@ SVC_IGNORING
vehicles ignoring classes
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
double distanceTo2D(const Position &p) const
returns the euclidean distance in the x-y-plane
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.
std::string myID
The name of the object.
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.
A basic edge for routing applications.
bool allFollowersProhibit(const ROVehicle *const vehicle) const
Returns whether this edge succeeding edges prohibit the given vehicle to pass them.
static double myPriorityFactor
Coefficient for factoring edge priority into routing weight.
const ROEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
double getDistanceTo(const ROEdge *other, const bool doBoundaryEstimate=false) const
optimistic distance heuristic for use in routing
const ROEdge * getNormalAfter() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
void addEffort(double value, double timeBegin, double timeEnd)
Adds a weight value.
bool hasLoadedTravelTime(double time) const
Returns whether a travel time for this edge was loaded.
static double getStoredEffort(const ROEdge *const edge, const ROVehicle *const, double time)
ReversedEdge< ROEdge, ROVehicle > * myReversedRoutingEdge
a reversed version for backward routing
void buildTimeLines(const std::string &measure, const bool boundariesOverride)
Builds the internal representation of the travel time/effort.
ROEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
std::vector< ROLane * > myLanes
This edge's lanes.
static bool initPriorityFactor(double priorityFactor)
initialize priority factor range
static ROEdgeVector myEdges
RailEdge< ROEdge, ROVehicle > * myRailwayRoutingEdge
const RONode * getToJunction() const
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
std::map< SUMOVehicleClass, ROEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
bool isTazConnector() const
std::map< SUMOVehicleClass, ROConstEdgePairVector > myClassesViaSuccessorMap
The successors with vias available for a given vClass.
std::vector< double > myParamRestrictions
cached value of parameters which may restrict access
bool myUsingETimeLine
Information whether the time line shall be used instead of the length value.
const RONode * getFromJunction() const
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
ValueTimeLine< double > myEfforts
Container storing passing time varying over time for the edge.
bool isInternal() const
return whether this edge is an internal edge
virtual ~ROEdge()
Destructor.
int getNumSuccessors() const
Returns the number of edges this edge is connected to.
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
static bool myInterpolate
Information whether to interpolate at interval boundaries.
const ROConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING, bool ignoreTransientPermissions=false) const
Returns the following edges including vias, restricted by vClass.
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
double getMinimumTravelTime(const ROVehicle *const veh) const
Returns a lower bound for the travel time on this edge without using any stored timeLine.
double myLength
The length of the edge.
bool myAmSink
whether the edge is a source or a sink
const ROEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
void addTravelTime(double value, double timeBegin, double timeEnd)
Adds a travel time value.
void cacheParamRestrictions(const std::vector< std::string > &restrictionKeys)
int getNumPredecessors() const
Returns the number of edges connected to this edge.
static double myEdgePriorityRange
the difference between maximum and minimum priority for all edges
double myTimePenalty
flat penalty when computing traveltime
SVCPermissions myCombinedPermissions
The list of allowed vehicle classes combined across lanes.
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
static bool myHaveTTWarned
Information whether the edge has reported missing weights.
double getEffort(const ROVehicle *const veh, double time) const
Returns the effort for this edge.
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
double getLengthGeometryFactor() const
return a lower bound on shape.length() / myLength that is
double getLength() const
Returns the length of the edge.
ROEdgeVector myFollowingEdges
List of edges that may be approached from this edge.
FlippedEdge< ROEdge, RONode, ROVehicle > * myFlippedRoutingEdge
An extended version of the reversed edge for backward routing (used for the arc flag router)
ROConstEdgePairVector myFollowingViaEdges
ValueTimeLine< double > myTravelTimes
Container storing passing time varying over time for the edge.
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
static double myMinEdgePriority
Minimum priority for all edges.
bool isConnectedTo(const ROEdge &e, const SUMOVehicleClass vClass) const
returns the information whether this edge is directly connected to the given
static bool myHaveEWarned
Information whether the edge has reported missing weights.
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
ROEdgeVector myApproachingEdges
List of edges that approached this edge.
double mySpeed
The maximum speed allowed on this edge.
A single lane the router may use.
double getLength() const
Returns the length of the lane.
SVCPermissions getPermissions() const
Returns the list of allowed vehicle classes.
double getSpeed() const
Returns the maximum speed allowed on this lane.
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
Base class for nodes used by the router.
const Position & getPosition() const
Returns the position of the node.
const SUMOVTypeParameter * getType() const
Returns the type of the routable.
double getMaxSpeed() const
Returns the vehicle's maximum speed.
A vehicle as used by router.
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.