40 if (from == edges.end()) {
48 if (from == edges.begin()) {
49 from = edges.end() - 1;
58 for (std::vector<bool>::const_iterator i = v.begin(); i != v.end(); i++) {
68 for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); i++) {
69 if ((*i)->getToNode() == to && (*i)->getFromNode() == from) {
80 assert(ev.size() > 0);
81 double max = (*(ev.begin()))->getSpeed();
82 for (EdgeVector::const_iterator i = ev.begin() + 1; i != ev.end(); i++) {
84 max > (*i)->getSpeed()
85 ? max : (*i)->getSpeed();
102 return std::find(incoming.begin(), incoming.end(), myEdge) != incoming.end();
117 return std::find(outgoing.begin(), outgoing.end(), myEdge) != outgoing.end();
125 : myDestinationNode(dest) {}
130 return e->
getToNode() == myDestinationNode;
139 assert(e1 !=
nullptr && e2 !=
nullptr);
146 while (fabs(relAngle1 - relAngle2) < 3.0) {
148 const double offset1 =
MAX2(0.0,
MIN2(length1, lookAhead));
149 const double offset2 =
MAX2(0.0,
MIN2(length2, lookAhead));
156 if (lookAhead >
MAX2(length1, length2)) {
161 if (fabs(relAngle1 - relAngle2) < NUMERICAL_EPS) {
165 return relAngle1 > relAngle2;
174 assert(e1 !=
nullptr && e2 !=
nullptr);
181 while (fabs(relAngle1 - relAngle2) < 3.0) {
183 const double offset1 =
MAX2(0.0,
MIN2(length1, length1 - lookAhead));
184 const double offset2 =
MAX2(0.0,
MIN2(length2, length2 - lookAhead));
191 if (lookAhead >
MAX2(length1, length2)) {
196 if (fabs(relAngle1 - relAngle2) < NUMERICAL_EPS) {
200 return relAngle1 > relAngle2;
206 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); i++) {
207 if (i != ev.begin()) {
218 if (edges.size() == 0) {
221 double ret = (*(edges.begin()))->getSpeed();
222 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
223 if ((*i)->getSpeed() > ret) {
224 ret = (*i)->getSpeed();
233 if (edges.size() == 0) {
236 double ret = (*(edges.begin()))->getSpeed();
237 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
238 if ((*i)->getSpeed() < ret) {
239 ret = (*i)->getSpeed();
252 const double absDiff = fabs(angle1 - angle2);
255 if (absDiff < 2 || absDiff > (360 - 2)) {
263 if (e1Peds && !e2Peds) {
265 }
else if (!e1Peds && e2Peds) {
269 if (!e1Peds && e2Peds) {
271 }
else if (e1Peds && !e2Peds) {
282 return angle1 < angle2;
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
@ SVC_PEDESTRIAN
pedestrian
static double legacyDegree(const double angle, const bool positive=false)
bool operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
edge_with_destination_finder(NBNode *dest)
constructor
bool operator()(NBEdge *e) const
bool operator()(const NBNode *const n) const
node_with_incoming_finder(const NBEdge *const e)
constructor
bool operator()(const NBNode *const n) const
node_with_outgoing_finder(const NBEdge *const e)
constructor
bool operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
bool operator()(const NBEdge *e1, const NBEdge *e2) const
comparing operation
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)
static double getMaxSpeed(const EdgeVector &edges)
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
static double getMinSpeed(const EdgeVector &edges)
static double maxSpeed(const EdgeVector &ev)
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
The representation of a single edge during network building.
SVCPermissions getPermissions(int lane=-1) const
get the union of allowed classes over all lanes or for a specific lane
NBNode * getToNode() const
Returns the destination node of the edge.
const PositionVector & getGeometry() const
Returns the geometry of the edge.
const std::string & getID() const
static const double ANGLE_LOOKAHEAD
the distance at which to take the default angle
double getStartAngle() const
Returns the angle at the start of the edge (relative to the node shape center) The angle is computed ...
double getAngleAtNodeToCenter(const NBNode *const node) const
Returns the angle of from the node shape center to where the edge meets the node shape.
NBNode * getFromNode() const
Returns the origin node of the edge.
double getEndAngle() const
Returns the angle at the end of the edge (relative to the node shape center) The angle is computed in...
static double normRelAngle(double angle1, double angle2)
ensure that reverse relAngles (>=179.999) always count as turnarounds (-180)
Represents a single node (junction) during network building.
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges (The edges which yield in this node)
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges (The edges which start at this node)
const Position & getPosition() const
A point in 2D or 3D with translation and scaling methods.
double angleTo2D(const Position &other) const
returns the angle in the plane of the vector pointing from here to the other position (in radians bet...
double length2D() const
Returns the length.
Position positionAtOffset2D(double pos, double lateralOffset=0) const
Returns the position at the given length.