 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
65 myUsingTTTimeLine(false),
66 myUsingETimeLine(false),
67 myCombinedPermissions(0),
69 while ((
int)
myEdges.size() <= index) {
73 if (from ==
nullptr && to ==
nullptr) {
85 for (std::vector<ROLane*>::iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
95 const double speed = lane->
getSpeed();
123 if (via !=
nullptr) {
159 assert(
this != other);
160 if (doBoundaryEstimate) {
172 return getLanes()[0]->getShape()[-1].distanceTo2D(other->
getLanes()[0]->getShape()[0]);
189 const double inTT = lineTT;
198 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / max speed.");
224 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / edge's speed.");
264 const ROEdge* result =
this;
275 const ROEdge* result =
this;
289 if (measure ==
"CO") {
292 if (measure ==
"CO2") {
295 if (measure ==
"HC") {
298 if (measure ==
"PMx") {
301 if (measure ==
"NOx") {
304 if (measure ==
"fuel") {
307 if (measure ==
"electricity") {
327 if (!(*i)->prohibits(vehicle)) {
355 FXMutexLock locker(myLock);
363 std::set<ROEdge*> followers;
365 if ((lane->getPermissions() & vClass) != 0) {
366 for (
const auto& next : lane->getOutgoingViaLanes()) {
367 if ((next.first->getPermissions() & vClass) != 0) {
368 followers.insert(&next.first->getEdge());
375 if ((*it)->isTazConnector()) {
376 followers.insert(*it);
380 followers.begin(), followers.end());
391 FXMutexLock locker(myLock);
399 std::set<std::pair<const ROEdge*, const ROEdge*> > followers;
401 if ((lane->getPermissions() & vClass) != 0) {
402 for (
const auto& next : lane->getOutgoingViaLanes()) {
403 if ((next.first->getPermissions() & vClass) != 0) {
404 followers.insert(std::make_pair(&next.first->getEdge(), next.second));
411 if (e->isTazConnector()) {
412 followers.insert(std::make_pair(e, e));
416 followers.begin(), followers.end());
425 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.
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.
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 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.
std::vector< double > & getParameter()
Returns the parameters of this distribution.
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::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.
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.
Definition of vehicle stop (position and duration)
bool myAmSink
whether the edge is a source or a sink
const RONode * getToJunction() const