 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
64 myUsingTTTimeLine(false),
65 myUsingETimeLine(false),
66 myCombinedPermissions(0),
68 while ((
int)
myEdges.size() <= index) {
72 if (from ==
nullptr && to ==
nullptr) {
84 for (std::vector<ROLane*>::iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
94 const double speed = lane->
getSpeed();
122 if (via !=
nullptr) {
158 assert(
this != other);
159 if (doBoundaryEstimate) {
171 return getLanes()[0]->getShape()[-1].distanceTo2D(other->
getLanes()[0]->getShape()[0]);
188 const double inTT = lineTT;
197 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / max speed.");
223 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / edge's speed.");
263 const ROEdge* result =
this;
274 const ROEdge* result =
this;
288 if (measure ==
"CO") {
291 if (measure ==
"CO2") {
294 if (measure ==
"HC") {
297 if (measure ==
"PMx") {
300 if (measure ==
"NOx") {
303 if (measure ==
"fuel") {
306 if (measure ==
"electricity") {
319 for (
const std::string& key : restrictionKeys) {
335 if (!(*i)->prohibits(vehicle)) {
363 FXMutexLock locker(myLock);
371 std::set<ROEdge*> followers;
373 if ((lane->getPermissions() & vClass) != 0) {
374 for (
const auto& next : lane->getOutgoingViaLanes()) {
375 if ((next.first->getPermissions() & vClass) != 0 && (next.second ==
nullptr || (next.second->getPermissions() & vClass) != 0)) {
376 followers.insert(&next.first->getEdge());
383 if ((*it)->isTazConnector()) {
384 followers.insert(*it);
388 followers.begin(), followers.end());
399 FXMutexLock locker(myLock);
407 std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
409 if ((lane->getPermissions() & vClass) != 0) {
410 for (
const auto& next : lane->getOutgoingViaLanes()) {
411 if ((next.first->getPermissions() & vClass) != 0 && (next.second ==
nullptr || (next.second->getPermissions() & vClass) != 0)) {
412 followers.insert(std::make_pair(&next.first->getEdge(), next.second));
419 if (e->isTazConnector()) {
420 followers.insert(std::make_pair(e, e));
424 followers.begin(), followers.end());
433 return std::find(followers.begin(), followers.end(), e) != followers.end();
static const ROEdgeVector & getAllEdges()
Returns all ROEdges.
bool isInternal() const
return whether this edge is an internal edge
SUMOVehicleClass
Definition of vehicle classes to differ between different lane usage and authority types.
bool allFollowersProhibit(const ROVehicle *const vehicle) const
Returns whether this edge succeeding edges prohibit the given vehicle to pass them.
ROEdgeVector myFollowingEdges
List of edges that may be approached from this edge.
std::vector< ROLane * > myLanes
This edge's lanes.
#define WRITE_WARNING(msg)
double getTravelTime(const ROVehicle *const veh, double time) const
Returns the travel time for this edge.
bool describesTime(double time) const
Returns whether a value for the given time is known.
Base class for objects which have an id.
std::string lane
The lane to stop at.
double getLength() const
Returns the length of the lane.
double distanceTo2D(const Position &p) const
returns the euclidean distance in the x-y-plane
ROEdge * getEdge(const std::string &name) const
Retrieves an edge from the network.
static double toDouble(const std::string &sData)
converts a string into the double value described by it by calling the char-type converter
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
const ROEdgeVector & getSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges, restricted by vClass.
ValueTimeLine< double > myEfforts
Container storing passing time varying over time for the edge.
static bool myHaveEWarned
Information whether the edge has reported missing weights.
double getSplitTime(double low, double high) const
Returns the time point at which the value changes.
std::map< SUMOVehicleClass, ROConstEdgePairVector > myClassesViaSuccessorMap
The successors with vias available for a given vClass.
ROConstEdgePairVector myFollowingViaEdges
A single lane the router may use.
ROEdge(const std::string &id, RONode *from, RONode *to, int index, const int priority)
Constructor.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
const SUMOVTypeParameter * getType() const
Returns the type of the routable.
A vehicle as used by router.
const std::vector< ROLane * > & getLanes() const
Returns this edge's lanes.
std::vector< std::pair< const ROEdge *, const ROEdge * > > ROConstEdgePairVector
static RONet * getInstance()
Returns the pointer to the unique instance of RONet (singleton).
static double getNoiseEffort(const ROEdge *const edge, const ROVehicle *const veh, double time)
SUMOVehicleClass getVClass() const
const std::string getParameter(const std::string &key, const std::string &defaultValue="") const
Returns the value for a given key.
const ROConstEdgePairVector & getViaSuccessors(SUMOVehicleClass vClass=SVC_IGNORING) const
Returns the following edges including vias, restricted by vClass.
double getEffort(const ROVehicle *const veh, double time) const
Returns the effort for this edge.
static ROEdgeVector myEdges
SVCPermissions myCombinedPermissions
The list of allowed vehicle classes combined across lanes.
double mySpeed
The maximum speed allowed on this 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.
void addTravelTime(double value, double timeBegin, double timeEnd)
Adds a travel time value.
virtual void addSuccessor(ROEdge *s, ROEdge *via=nullptr, std::string dir="")
Adds information about a connected edge.
double getSpeed() const
Returns the maximum speed allowed on this lane.
void addEffort(double value, double timeBegin, double timeEnd)
Adds a weight value.
ValueTimeLine< double > myTravelTimes
Container storing passing time varying over time for the edge.
bool getStoredEffort(double time, double &ret) const
Retrieves the stored effort.
void add(double begin, double end, T value)
Adds a value for a time interval into the container.
double getLengthGeometryFactor() const
return a lower bound on shape.length() / myLength that is
A point in 2D or 3D with translation and scaling methods.
void add(double x, double y, double z=0)
Makes the boundary include the given coordinate.
void fillGaps(T value, bool extendOverBoundaries=false)
Sets a default value for all unset intervals.
double endPos
The stopping position end.
double maxSpeed
The vehicle type's maximum speed [m/s].
std::vector< ROEdge * > ROEdgeVector
const ROEdge * getNormalBefore() const
if this edge is an internal edge, return its first normal predecessor, otherwise the edge itself
bool isTazConnector() const
void buildTimeLines(const std::string &measure, const bool boundariesOverride)
Builds the internal representation of the travel time/effort.
T getValue(double time) const
Returns the value for the given time.
static bool myInterpolate
Information whether to interpolate at interval boundaries.
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 ...
ROEdgeVector myApproachingEdges
List of edges that approached this edge.
std::vector< std::string > & split(const std::string &s, char delim, std::vector< std::string > &elems)
const RONode * getFromJunction() const
double startPos
The stopping position start.
Distribution_Parameterized speedFactor
The factor by which the maximum speed may deviate from the allowed max speed on the street.
static SUMOEmissionClass getClassByName(const std::string &eClass, const SUMOVehicleClass vc=SVC_IGNORING)
Checks whether the string describes a known vehicle class.
std::vector< double > myParamRestrictions
cached value of parameters which may restrict access
std::string toString(const T &t, std::streamsize accuracy=gPrecision)
double myLength
The length of the edge.
double getLength() const
Returns the length of the edge.
int getNumPredecessors() const
Returns the number of edges connected to this edge.
static std::string getEdgeIDFromLane(const std::string laneID)
return edge id when given the lane ID
const SVCPermissions SVCAll
all VClasses are allowed
virtual ~ROEdge()
Destructor.
std::map< SUMOVehicleClass, ROEdgeVector > myClassesSuccessorMap
The successors available for a given vClass.
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
bool hasLoadedTravelTime(double time) const
Returns whether a travel time for this edge was loaded.
A basic edge for routing applications.
static bool myHaveTTWarned
Information whether the edge has reported missing weights.
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...
SVCPermissions getPermissions() const
Returns the list of allowed vehicle classes.
const ROEdge * getNormalAfter() const
if this edge is an internal edge, return its first normal successor, otherwise the edge itself
double getMinimumTravelTime(const ROVehicle *const veh) const
Returns a lower bound for the travel time on this edge without using any stored timeLine.
bool isConnectedTo(const ROEdge *const e, const ROVehicle *const vehicle) const
returns the information whether this edge is directly connected to the given
SUMOEmissionClass emissionClass
The emission class of this vehicle.
std::string myID
The name of the object.
@ SVC_IGNORING
vehicles ignoring classes
Base class for nodes used by the router.
const Position & getPosition() const
Returns the position of the node.
static const Position getStopPosition(const SUMOVehicleParameter::Stop &stop)
return the coordinates of the center of the given stop
double getDistanceTo(const ROEdge *other, const bool doBoundaryEstimate=false) const
optimistic distance heuristic for use in routing
double myTimePenalty
flat penalty when computing traveltime
bool myUsingETimeLine
Information whether the time line shall be used instead of the length value.
void cacheParamRestrictions(const std::vector< std::string > &restrictionKeys)
Definition of vehicle stop (position and duration)
bool myAmSink
whether the edge is a source or a sink
const RONode * getToJunction() const