 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
41 if (from == edges.end()) {
49 if (from == edges.begin()) {
50 from = edges.end() - 1;
59 for (std::vector<bool>::const_iterator i = v.begin(); i != v.end(); i++) {
69 for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); i++) {
70 if ((*i)->getToNode() == to && (*i)->getFromNode() == from) {
81 assert(ev.size() > 0);
82 double max = (*(ev.begin()))->getSpeed();
83 for (EdgeVector::const_iterator i = ev.begin() + 1; i != ev.end(); i++) {
85 max > (*i)->getSpeed()
86 ? max : (*i)->getSpeed();
103 return std::find(incoming.begin(), incoming.end(), myEdge) != incoming.end();
118 return std::find(outgoing.begin(), outgoing.end(), myEdge) != outgoing.end();
126 : myDestinationNode(dest) {}
131 return e->
getToNode() == myDestinationNode;
140 if (e1 ==
nullptr || e2 ==
nullptr) {
149 while (fabs(relAngle1 - relAngle2) < 3.0) {
162 return relAngle1 > relAngle2;
171 if (e1 ==
nullptr || e2 ==
nullptr) {
180 while (fabs(relAngle1 - relAngle2) < 3.0) {
193 return relAngle1 > relAngle2;
199 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); i++) {
200 if (i != ev.begin()) {
211 if (edges.size() == 0) {
214 double ret = (*(edges.begin()))->getSpeed();
215 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
216 if ((*i)->getSpeed() > ret) {
217 ret = (*i)->getSpeed();
226 if (edges.size() == 0) {
229 double ret = (*(edges.begin()))->getSpeed();
230 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
231 if ((*i)->getSpeed() < ret) {
232 ret = (*i)->getSpeed();
245 const double absDiff = fabs(angle1 - angle2);
248 if (absDiff < 2 || absDiff > (360 - 2)) {
256 if (e1Peds && !e2Peds) {
258 }
else if (!e1Peds && e2Peds) {
262 if (!e1Peds && e2Peds) {
264 }
else if (e1Peds && !e2Peds) {
275 return angle1 < angle2;
@ SVC_PEDESTRIAN
pedestrian
bool operator()(const NBNode *const n) const
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
static double legacyDegree(const double angle, const bool positive=false)
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
double length() const
Returns the length.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
bool operator()(const NBNode *const n) const
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
The representation of a single edge during network building.
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)
const Position & getPosition() const
NBNode * getToNode() const
Returns the destination node of the edge.
static double getMaxSpeed(const EdgeVector &edges)
const PositionVector & getGeometry() const
Returns the geometry of the edge.
static double getMinSpeed(const EdgeVector &edges)
bool operator()(NBEdge *e) const
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
A point in 2D or 3D with translation and scaling methods.
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
static double maxSpeed(const EdgeVector &ev)
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
double getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
int operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
double getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
node_with_outgoing_finder(const NBEdge *const e)
constructor
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position
double getLength() const
Returns the computed length of the edge.
node_with_incoming_finder(const NBEdge *const e)
constructor
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.
edge_with_destination_finder(NBNode *dest)
constructor
double getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
Represents a single node (junction) during network building.
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
NBNode * getFromNode() const
Returns the origin node of the edge.
const std::string & getID() const