65 myUsingTTTimeLine(false),
66 myUsingETimeLine(false),
67 myCombinedPermissions(0) {
68 while ((
int)
myEdges.size() <= index) {
72 if (from ==
nullptr && to ==
nullptr) {
83 for (std::vector<ROLane*>::iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
93 const double speed = lane->
getSpeed();
115 if (via !=
nullptr) {
151 if (doBoundaryEstimate) {
179 const double inTT = lineTT;
188 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / max speed.");
214 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / edge's speed.");
254 const ROEdge* result =
this;
265 const ROEdge* result =
this;
279 if (measure ==
"CO") {
282 if (measure ==
"CO2") {
285 if (measure ==
"HC") {
288 if (measure ==
"PMx") {
291 if (measure ==
"NOx") {
294 if (measure ==
"fuel") {
297 if (measure ==
"electricity") {
311 if (!(*i)->prohibits(vehicle)) {
339 FXMutexLock locker(myLock);
347 std::set<ROEdge*> followers;
349 if ((lane->getPermissions() & vClass) != 0) {
350 for (
const auto& next : lane->getOutgoingViaLanes()) {
351 if ((next.first->getPermissions() & vClass) != 0) {
352 followers.insert(&next.first->getEdge());
359 if ((*it)->isTazConnector()) {
360 followers.insert(*it);
364 followers.begin(), followers.end());
375 FXMutexLock locker(myLock);
383 std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
385 if ((lane->getPermissions() & vClass) != 0) {
386 for (
const auto& next : lane->getOutgoingViaLanes()) {
387 if ((next.first->getPermissions() & vClass) != 0) {
388 followers.insert(std::make_pair(&next.first->getEdge(), next.second));
395 if (e->isTazConnector()) {
396 followers.insert(std::make_pair(e, e));
400 followers.begin(), followers.end());
409 return std::find(followers.begin(), followers.end(), e) != followers.end();
void fillGaps(T value, bool extendOverBoundaries=false)
Sets a default value for all unset intervals.
double distanceTo2D(const Position &p) const
returns the euclidean distance in the x-y-plane
static ROEdgeVector myEdges
std::map< SUMOVehicleClass, ROEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
SUMOVehicleClass getVClass() const
const Position & getPosition() const
Returns the position of the node.
double getSplitTime(double low, double high) const
Returns the time point at which the value changes.
bool isTazConnector() const
double myLength
The length of the edge.
void addTravelTime(double value, double timeBegin, double timeEnd)
Adds a travel time value.
A single lane the router may use.
double mySpeed
The maximum speed allowed on this edge.
bool allFollowersProhibit(const ROVehicle *const vehicle) const
Returns whether this edge succeeding edges prohibit the given vehicle to pass them.
int getNumSuccessors() const
Returns the number of edges this edge is connected to.
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types...
double getLength() const
Returns the length of the lane.
double distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
static bool myInterpolate
Information whether to interpolate at interval boundaries.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
const RONode * getFromJunction() const
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
bool describesTime(double time) const
Returns whether a value for the given time is known.
ROConstEdgePairVector myFollowingViaEdges
double getEffort(const ROVehicle *const veh, double time) const
Returns the effort for this edge.
double getLength() const
Returns the length of the edge.
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. ...
const SVCPermissions SVCAll
all VClasses are allowed
const RONode * getToJunction() const
SVCPermissions myCombinedPermissions
The list of allowed vehicle classes combined across lanes.
void add(double begin, double end, T value)
Adds a value for a time interval into the container.
#define WRITE_WARNING(msg)
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
double getMinimumTravelTime(const ROVehicle *const veh) const
Returns a lower bound for the travel time on this edge without using any stored timeLine.
ROEdgeVector myFollowingEdges
List of edges that may be approached from this edge.
int getNumPredecessors() const
Returns the number of edges connected to this edge.
bool hasLoadedTravelTime(double time) const
Returns whether a travel time for this edge was loaded.
A vehicle as used by router.
double getDistanceTo(const ROEdge *other, const bool doBoundaryEstimate=false) const
optimistic distance heuristic for use in routing
double maxSpeed
The vehicle type's maximum speed [m/s].
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
void buildTimeLines(const std::string &measure, const bool boundariesOverride)
Builds the internal representation of the travel time/effort.
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
T getValue(double time) const
Returns the value for the given time.
double startPos
The stopping position start.
const ROEdge * getNormalAfter() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself ...
A point in 2D or 3D with translation and scaling methods.
static bool myHaveEWarned
Information whether the edge has reported missing weights.
bool myUsingETimeLine
Information whether the time line shall be used instead of the length value.
std::vector< ROEdge * > ROEdgeVector
void addEffort(double value, double timeBegin, double timeEnd)
Adds a weight value.
bool myAmSink
whether the edge is a source or a sink
Boundary myBoundary
The bounding rectangle of end nodes incoming or outgoing edges for taz connectors or of my own start ...
bool getStoredEffort(double time, double &ret) const
Retrieves the stored effort.
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
std::vector< std::pair< const ROEdge *, const ROEdge * > > ROConstEdgePairVector
double endPos
The stopping position end.
SVCPermissions getPermissions() const
Returns the list of allowed vehicle classes.
std::vector< ROLane * > myLanes
This edge's lanes.
ValueTimeLine< double > myEfforts
Container storing passing time varying over time for the edge.
virtual ~ROEdge()
Destructor.
A basic edge for routing applications.
Base class for objects which have an id.
std::string lane
The lane to stop at.
double getSpeed() const
Returns the maximum speed allowed on this lane.
bool isInternal() const
return whether this edge is an internal edge
std::string myID
The name of the object.
static double compute(const SUMOEmissionClass c, const EmissionType e, const double v, const double a, const double slope, const std::map< int, double > *param=0)
Returns the amount of the emitted pollutant given the vehicle type and state (in mg/s or ml/s for fue...
const SUMOVTypeParameter * getType() const
Returns the type of the routable.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
ROEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
ROEdgeVector myApproachingEdges
List of edges that approached this edge.
bool isConnectedTo(const ROEdge *const e, const ROVehicle *const vehicle) const
returns the information whether this edge is directly connected to the given
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
std::map< SUMOVehicleClass, ROConstEdgePairVector > myClassesViaSuccessorMap
The successors with vias available for a given vClass.
Definition of vehicle stop (position and duration)
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
const ROEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
ValueTimeLine< double > myTravelTimes
Container storing passing time varying over time for the edge.
const ROConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges including vias, restricted by vClass.
Base class for nodes used by the router.
static bool myHaveTTWarned
Information whether the edge has reported missing weights.
const ROEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself ...
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
static std::string getEdgeIDFromLane(const std::string laneID)
return edge id when given the lane ID
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street...
SUMOEmissionClass emissionClass
The emission class of this vehicle.
vehicles ignoring classes