39 #ifdef CHECK_MEMORY_LEAKS
41 #endif // CHECK_MEMORY_LEAKS
53 if (from == edges.end()) {
61 if (from == edges.begin()) {
62 from = edges.end() - 1;
71 for (std::vector<bool>::const_iterator i = v.begin(); i != v.end(); i++) {
81 for (EdgeVector::const_iterator i = edges.begin(); i != edges.end(); i++) {
82 if ((*i)->getToNode() == to && (*i)->getFromNode() == from) {
93 assert(ev.size() > 0);
95 for (EdgeVector::const_iterator i = ev.begin() + 1; i != ev.end(); i++) {
97 max > (*i)->getSpeed()
98 ? max : (*i)->getSpeed();
115 return std::find(incoming.begin(), incoming.end(), myEdge) != incoming.end();
130 return std::find(outgoing.begin(), outgoing.end(), myEdge) != outgoing.end();
139 : myDestinationNode(dest) {}
144 return e->
getToNode() == myDestinationNode;
152 if (e1 == 0 || e2 == 0) {
161 while (fabs(relAngle1 - relAngle2) < 3.0) {
167 referencePos1.
x(), referencePos1.
y()));
170 referencePos2.
x(), referencePos2.
y()));
176 return relAngle1 > relAngle2;
185 if (e1 == 0 || e2 == 0) {
194 while (fabs(relAngle1 - relAngle2) < 3.0) {
199 referencePos1.
x(), referencePos1.
y(),
202 referencePos2.
x(), referencePos2.
y(),
209 return relAngle1 > relAngle2;
215 for (EdgeVector::const_iterator i = ev.begin(); i != ev.end(); i++) {
216 if (i != ev.begin()) {
229 if (edges.size() == 0) {
232 SUMOReal ret = (*(edges.begin()))->getSpeed();
233 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
234 if ((*i)->getSpeed() > ret) {
235 ret = (*i)->getSpeed();
244 if (edges.size() == 0) {
247 SUMOReal ret = (*(edges.begin()))->getSpeed();
248 for (EdgeVector::const_iterator i = edges.begin() + 1; i != edges.end(); i++) {
249 if ((*i)->getSpeed() < ret) {
250 ret = (*i)->getSpeed();
const EdgeVector & getIncomingEdges() const
Returns this node's incoming edges.
node_with_outgoing_finder(const NBEdge *const e)
constructor
static SUMOReal normRelAngle(SUMOReal angle1, SUMOReal angle2)
SUMOReal getEndAngle() const
Returns the angle at the end of the edge The angle is computed in computeAngle()
friend std::ostream & operator<<(std::ostream &os, const EdgeVector &ev)
The representation of a single edge during network building.
bool operator()(const NBNode *const n) const
static void nextCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
SUMOReal x() const
Returns the x-position.
const EdgeVector & getOutgoingEdges() const
Returns this node's outgoing edges.
const Position & getPosition() const
Returns the position of this node.
static std::ostream & out(std::ostream &os, const std::vector< bool > &v)
bool operator()(const NBNode *const n) const
A point in 2D or 3D with translation and scaling methods.
static SUMOReal maxSpeed(const EdgeVector &ev)
static SUMOReal angle(SUMOReal x1, SUMOReal y1, SUMOReal x2, SUMOReal y2)
edge_with_destination_finder(NBNode *dest)
constructor
static SUMOReal getMaxSpeed(const EdgeVector &edges)
SUMOReal length() const
Returns the length.
NBNode * getToNode() const
Returns the destination node of the edge.
Position positionAtOffset2D(SUMOReal pos) const
Returns the position at the given length.
std::vector< NBEdge * > EdgeVector
const PositionVector & getGeometry() const
Returns the geometry of the edge.
SUMOReal y() const
Returns the y-position.
bool operator()(NBEdge *e) const
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
node_with_incoming_finder(const NBEdge *const e)
constructor
Represents a single node (junction) during network building.
SUMOReal getStartAngle() const
Returns the angle at the start of the edge The angle is computed in computeAngle() ...
static SUMOReal getMinSpeed(const EdgeVector &edges)
static void nextCCW(const EdgeVector &edges, EdgeVector::const_iterator &from)
int operator()(NBEdge *e1, NBEdge *e2) const
comparing operation
static const SUMOReal ANGLE_LOOKAHEAD
the distance at which to take the default anglen
static NBEdge * findConnectingEdge(const EdgeVector &edges, NBNode *from, NBNode *to)
SUMOReal getLength() const
Returns the computed length of the edge.
NBNode * getFromNode() const
Returns the origin node of the edge.