66 myUsingTTTimeLine(false),
67 myUsingETimeLine(false),
68 myCombinedPermissions(0),
69 myOtherTazConnector(nullptr),
71 while ((
int)
myEdges.size() <= index) {
75 if (from ==
nullptr && to ==
nullptr) {
97 const double speed = lane->
getSpeed();
130 if (via !=
nullptr) {
165 assert(
this != other);
166 if (doBoundaryEstimate) {
178 return getLanes()[0]->getShape()[-1].distanceTo2D(other->
getLanes()[0]->getShape()[0]);
195 const double inTT = lineTT;
204 WRITE_WARNINGF(
TL(
"No interval matches passed time=% in edge '%'.\n Using edge's length / max speed."), time,
myID);
230 WRITE_WARNINGF(
TL(
"No interval matches passed time=% in edge '%'.\n Using edge's length / edge's speed."), time,
myID);
270 const ROEdge* result =
this;
282 const ROEdge* result =
this;
296 if (measure ==
"CO") {
299 if (measure ==
"CO2") {
302 if (measure ==
"HC") {
305 if (measure ==
"PMx") {
308 if (measure ==
"NOx") {
311 if (measure ==
"fuel") {
314 if (measure ==
"electricity") {
327 for (
const std::string& key : restrictionKeys) {
343 if (!(*i)->prohibits(vehicle)) {
371 FXMutexLock locker(myLock);
379 std::set<ROEdge*> followers;
381 if ((lane->getPermissions() & vClass) != 0) {
382 for (
const auto& next : lane->getOutgoingViaLanes()) {
383 if ((next.first->getPermissions() & vClass) != 0 && (next.second ==
nullptr || (next.second->getPermissions() & vClass) != 0)) {
384 followers.insert(&next.first->getEdge());
391 if ((*it)->isTazConnector()) {
392 followers.insert(*it);
396 followers.begin(), followers.end());
407 FXMutexLock locker(myLock);
415 std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
417 if ((lane->getPermissions() & vClass) != 0) {
418 for (
const auto& next : lane->getOutgoingViaLanes()) {
419 if ((next.first->getPermissions() & vClass) != 0 && (next.second ==
nullptr || (next.second->getPermissions() & vClass) != 0)) {
420 followers.insert(std::make_pair(&next.first->getEdge(), next.second));
427 if (e->isTazConnector()) {
428 followers.insert(std::make_pair(e, e));
432 followers.begin(), followers.end());
440 return std::find(followers.begin(), followers.end(), &e) != followers.end();
446 double maxEdgePriority = -std::numeric_limits<double>::max();
448 maxEdgePriority =
MAX2(maxEdgePriority, (
double)edge->getPriority());
453 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.
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.