46 #ifdef CHECK_MEMORY_LEAKS
48 #endif // CHECK_MEMORY_LEAKS
66 :
Named(id), myFromNode(from), myToNode(to), myIndex(index), myPriority(priority),
67 mySpeed(-1), myLength(-1),
68 myUsingTTTimeLine(false),
69 myUsingETimeLine(false),
70 myCombinedPermissions(0) {
71 while (
myEdges.size() <= index) {
79 for (std::vector<ROLane*>::iterator i =
myLanes.begin(); i !=
myLanes.end(); ++i) {
103 #ifdef HAVE_INTERNAL // catchall for internal stuff
104 s->myApproachingEdges.push_back(
this);
161 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / edge's speed.");
271 WRITE_WARNING(
"No interval matches passed time " +
toString(time) +
" in edge '" +
myID +
"'.\n Using edge's length / edge's speed.");
300 #ifdef HAVE_INTERNAL // catchall for internal stuff
302 ROEdge::getNumApproaching()
const {
306 return (
unsigned int) myApproachingEdges.size();
321 if (measure ==
"CO") {
324 if (measure ==
"CO2") {
327 if (measure ==
"HC") {
330 if (measure ==
"PMx") {
333 if (measure ==
"NOx") {
336 if (measure ==
"fuel") {
351 if (!(*i)->prohibits(vehicle)) {
void fillGaps(T value, bool extendOverBoundaries=false)
Sets a default value for all unset intervals.
static SUMOReal computeCO(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted CO given the vehicle type and state (in mg/s)
RONode * getToNode() const
Returns the node this edge ends at.
SUMOReal get(const SumoXMLAttr attr, const SUMOReal defaultValue) const
Returns the named value from the map, or the default if it is ot contained there. ...
EdgeType getType() const
Returns the type of the edge.
static bool myUseBoundariesOnOverrideTT
Whether overriding weight boundaries shall be reported.
static SUMOReal computeHC(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted HC given the vehicle type and state (in mg/s)
A single lane the router may use.
SUMOReal getDistanceTo(const ROEdge *other) const
optimistic distance heuristic for use in routing
static SUMOReal computeDefaultFuel(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of fuel given the vehicle type and default values for the state (in ml) ...
static std::vector< ROEdge * > myEdges
SUMOReal getSplitTime(SUMOReal low, SUMOReal high) const
Returns the time point at which the value changes.
static bool myInterpolate
Information whether to interpolate at interval boundaries.
EdgeType
Possible types of edges.
static ROEdge * dictionary(size_t index)
Returns the ROEdge at the index.
ValueTimeLine< SUMOReal > myTravelTimes
Container storing passing time varying over time for the edge.
virtual void addLane(ROLane *lane)
Adds a lane to the edge while loading.
SUMOReal getPMxEffort(const ROVehicle *const veh, SUMOReal time) const
const SUMOVTypeParameter * getType() const
Returns the type of the vehicle.
const Position & getPosition()
Returns the position of the node.
SUMOReal getCO2Effort(const ROVehicle *const veh, SUMOReal time) const
const SUMOReal DEFAULT_VEH_SIGMA
void add(SUMOReal begin, SUMOReal end, T value)
Adds a value for a time interval into the container.
static bool myUseBoundariesOnOverrideE
Whether overriding weight boundaries shall be reported.
SVCPermissions myCombinedPermissions
The list of allowed vehicle classes combined across lanes.
SUMOReal getSpeed() const
Returns the maximum speed allowed on this lane.
void addTravelTime(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd)
Adds a travel time value.
#define WRITE_WARNING(msg)
RONode * getFromNode() const
Returns the node this edge starts at.
static SUMOReal computeNoise(SUMOEmissionClass c, double v, double a)
Returns the noise produced by the a vehicle of the given type at the given speed. ...
An edge where vehicles are inserted at (no vehicle may come from back)
A vehicle as used by router.
void setType(EdgeType type)
Sets the type of te edge.
bool allFollowersProhibit(const ROVehicle *const vehicle) const
Returns whether this edge succeding edges prohibit the given vehicle to pass them.
static SUMOReal computeDefaultNOx(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted NOx given the vehicle type and default values for the state (in mg) ...
bool describesTime(SUMOReal time) const
Returns whether a value for the given time is known.
ValueTimeLine< SUMOReal > myEfforts
Container storing passing time varying over time for the edge.
bool myUsingTTTimeLine
Information whether the time line shall be used instead of the length value.
static bool myHaveEWarned
Information whether the edge has reported missing weights.
SUMOReal myLength
The length of the edge.
bool myUsingETimeLine
Information whether the time line shall be used instead of the length value.
SUMOReal getHCEffort(const ROVehicle *const veh, SUMOReal time) const
static SUMOReal computeCO2(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted CO2 given the vehicle type and state (in mg/s)
SUMOReal getNOxEffort(const ROVehicle *const veh, SUMOReal time) const
static SUMOReal computeDefaultCO2(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted CO2 given the vehicle type and default values for the state (in mg) ...
std::string toString(const T &t, std::streamsize accuracy=OUTPUT_ACCURACY)
T getValue(SUMOReal time) const
Returns the value for the given time.
std::vector< ROLane * > myLanes
This edge's lanes.
ROEdge(const std::string &id, RONode *from, RONode *to, unsigned int index, const int priority)
Constructor.
virtual ~ROEdge()
Destructor.
A basic edge for routing applications.
Base class for objects which have an id.
SUMOReal mySpeed
The maximum speed allowed on this edge.
SUMOReal maxSpeed
The vehicle type's maximum speed [m/s].
std::vector< ROEdge * > myFollowingEdges
List of edges that may be approached from this edge.
unsigned int getNoFollowing() const
Returns the number of edges this edge is connected to.
std::string myID
The name of the object.
static SUMOReal computeDefaultPMx(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted PMx given the vehicle type and default values for the state (in mg) ...
void addEffort(SUMOReal value, SUMOReal timeBegin, SUMOReal timeEnd)
Adds a weight value.
SUMOReal getFuelEffort(const ROVehicle *const veh, SUMOReal time) const
SUMOReal getEffort(const ROVehicle *const veh, SUMOReal time) const
Returns the effort for this edge.
void buildTimeLines(const std::string &measure)
Builds the internal representation of the travel time/effort.
static SUMOReal computeNOx(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted NOx given the vehicle type and state (in mg/s)
SUMOReal getLength() const
Returns the length of the lane.
bool getStoredEffort(SUMOReal time, SUMOReal &ret) const
Retrieves the stored effort.
static SUMOReal computeDefaultCO(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted CO given the vehicle type and default values for the state (in mg) ...
static SUMOReal computeFuel(SUMOEmissionClass c, double v, double a)
Returns the amount of consumed fuel given the vehicle type and state (in ml/s)
SUMOReal getNoiseEffort(const ROVehicle *const veh, SUMOReal time) const
SUMOReal distanceTo2D(const Position &p2) const
returns the euclidean distance in the x-y-plane
const SUMOReal DEFAULT_VEH_ACCEL
static SUMOReal computePMx(SUMOEmissionClass c, double v, double a)
Returns the amount of emitted PMx given the vehicle type and state (in mg/s)
SUMOReal getCOEffort(const ROVehicle *const veh, SUMOReal time) const
Base class for nodes used by the router.
SUMOReal getTravelTime(const ROVehicle *const veh, SUMOReal time) const
Returns the travel time for this edge.
An edge where vehicles disappear (no vehicle may leave this edge)
static bool myHaveTTWarned
Information whether the edge has reported missing weights.
static SUMOReal computeDefaultHC(SUMOEmissionClass c, double v, double a, SUMOReal tt)
Returns the amount of emitted HC given the vehicle type and default values for the state (in mg) ...
virtual void addFollower(ROEdge *s, std::string dir="")
Adds information about a connected edge.
SUMOReal getMinimumTravelTime(const ROVehicle *const veh) const
Returns the travel time for this edge without using any stored timeLine.
EdgeType myType
The type of the edge.
SVCPermissions getPermissions()
Returns the list of allowed vehicle classes.
SUMOEmissionClass emissionClass
The emission class of this vehicle.