57ROEdge::ROEdge(
const std::string&
id,
RONode* from,
RONode* to,
int index,
const int priority,
const std::string& type,
const std::string& routingType) :
64 myRoutingType(routingType),
69 myUsingTTTimeLine(false),
70 myUsingETimeLine(false),
71 mySpeedRestrictions(nullptr),
72 myCombinedPermissions(0),
73 myOtherTazConnector(nullptr),
76 while ((
int)
myEdges.size() <= index) {
80 if (from ==
nullptr && to ==
nullptr) {
93 myFromJunction(const_cast<
RONode*>(from)),
94 myToJunction(const_cast<
RONode*>(to)),
98 mySpeed(
std::numeric_limits<double>::max()),
102 myUsingTTTimeLine(false),
103 myUsingETimeLine(false),
104 myCombinedPermissions(p),
105 myOtherTazConnector(nullptr),
123 const double speed = lane->
getSpeed();
156 if (via !=
nullptr) {
191 assert(
this != other);
192 if (doBoundaryEstimate) {
204 return getLanes()[0]->getShape()[-1].distanceTo2D(other->
getLanes()[0]->getShape()[0]);
221 const double inTT = lineTT;
230 WRITE_WARNINGF(
TL(
"No interval matches passed time=% in edge '%'.\n Using edge's length / max speed."), time,
myID);
255 WRITE_WARNINGF(
TL(
"No interval matches passed time=% in edge '%'.\n Using edge's length / edge's speed."), time,
myID);
295 const ROEdge* result =
this;
307 const ROEdge* result =
this;
321 if (measure ==
"CO") {
324 if (measure ==
"CO2") {
327 if (measure ==
"HC") {
330 if (measure ==
"PMx") {
333 if (measure ==
"NOx") {
336 if (measure ==
"fuel") {
339 if (measure ==
"electricity") {
352 for (
const std::string& key : restrictionKeys) {
368 if (!(*i)->prohibits(vehicle)) {
396 FXMutexLock locker(myLock);
404 std::set<ROEdge*> followers;
406 if ((lane->getPermissions() & vClass) != 0) {
407 for (
const auto& next : lane->getOutgoingViaLanes()) {
408 if ((next.first->getPermissions() & vClass) != 0 && (next.second ==
nullptr || (next.second->getPermissions() & vClass) != 0)) {
409 followers.insert(&next.first->getEdge());
416 if ((*it)->isTazConnector()) {
417 followers.insert(*it);
421 followers.begin(), followers.end());
432 FXMutexLock locker(myLock);
440 std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
442 if ((lane->getPermissions() & vClass) != 0) {
443 for (
const auto& next : lane->getOutgoingViaLanes()) {
444 if ((next.first->getPermissions() & vClass) != 0 && (next.second ==
nullptr || (next.second->getPermissions() & vClass) != 0)) {
445 followers.insert(std::make_pair(&next.first->getEdge(), next.second));
452 if (e->isTazConnector()) {
453 followers.insert(std::make_pair(e, e));
457 followers.begin(), followers.end());
467 return std::find(followers.begin(), followers.end(), &e) != followers.end();
473 double maxEdgePriority = -std::numeric_limits<double>::max();
475 maxEdgePriority =
MAX2(maxEdgePriority, (
double)edge->getPriority());
480 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
long long int SVCPermissions
bitset where each bit declares whether a certain SVC may use this edge/lane
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
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.
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)
bool isConnectedTo(const ROEdge &e, const SUMOVehicleClass vClass, bool ignoreTransientPermissions=false) const
returns the information whether this edge is directly connected to the given
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.
double getMaxSpeed(const RORoutable *const veh) const
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.
static bool myHaveEWarned
Information whether the edge has reported missing weights.
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
ROEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority, const std::string &type, const std::string &routingType)
Constructor.
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.
A vehicle as used by router.
SUMOEmissionClass emissionClass
The emission class of this vehicle.
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)