 |
Eclipse SUMO - Simulation of Urban MObility
|
Go to the documentation of this file.
18 #ifndef NBAlgorithms_h
19 #define NBAlgorithms_h
123 return (
int)(r1 < r2);
131 for (EdgeVector::const_iterator it = e.begin(); it != e.end(); ++it) {
133 result =
MIN2(result, rank);
152 const std::vector<NBEdge*>::iterator& i1,
153 const std::vector<NBEdge*>::iterator& i2);
171 angle = 360. + angle;
175 angle += (double) 180.;
176 if (angle >= (
double) 360.) {
177 angle -= (double) 360.;
180 if (angle < 0.1 || angle > 359.9) {
183 assert(angle >= 0 && angle < (
double)360);
static void validateRailCrossings(NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Checks rail_crossing for validity.
int operator()(const NBNode::Crossing *c1, const NBNode::Crossing *c2) const
static NBEdge * extractAndMarkFirst(NBNode &n, std::vector< NBEdge * > &s, int prio=1)
Sets the priorites in case of a priority junction.
static bool samePriority(const NBEdge *const e1, const NBEdge *const e2)
Returns whether both edges have the same priority.
crossing_by_junction_angle_sorter(const NBNode *node, const EdgeVector &ordering)
A container for traffic light definitions and built programs.
static void setPriorityJunctionPriorities(NBNode &n)
Sets the priorites in case of a priority junction.
static void swapWhenReversed(const NBNode *const n, const std::vector< NBEdge * >::iterator &i1, const std::vector< NBEdge * >::iterator &i2)
Assures correct order for same-angle opposite-direction edges.
std::vector< NBEdge * > EdgeVector
container for (sorted) edges
int getMinRank(const EdgeVector &e) const
retrieves the minimum index in myAllEdges
static void markBestParallel(const NBNode &n, NBEdge *bestFirst, NBEdge *bestSecond)
set priority for edges that are parallel to the best edges
static void computeEdgePriorities(NBNodeCont &nc)
Computes edge priorities within a node.
static void sortNodesEdges(NBNodeCont &nc, bool useNodeShape=false)
Sorts a node's edges clockwise regarding driving direction.
Container for nodes during the netbuilding process.
Sorts "Combination"s by decreasing angle.
The representation of a single edge during network building.
static void computeTurnDirectionsForNode(NBNode *node, bool warn)
Computes turnaround destinations for all incoming edges of the given nodes (if any)
Stores the information about the angle between an incoming ("from") and an outgoing ("to") edge.
combination_by_angle_sorter()
edge_by_junction_angle_sorter(NBNode *n)
double getConvAngle(NBEdge *e) const
Converts the angle of the edge if it is an incoming edge.
int operator()(NBEdge *e1, NBEdge *e2) const
static bool hasDifferentPriorities(const EdgeVector &edges, const NBEdge *excluded)
return whether the priorite attribute can be used to distinguish the edges
int operator()(const Combination &c1, const Combination &c2) const
EdgeVector edges
The edges being crossed.
static bool isRailwayNode(const NBNode *n)
whether the given node only has rail edges
crossing_by_junction_angle_sorter & operator=(const crossing_by_junction_angle_sorter &s)
invalidated assignment operator
Sorts incoming and outgoing edges clockwise around the given node.
NBNode * myNode
The node to compute the relative angle of.
static void computeTurnDirections(NBNodeCont &nc, bool warn=true)
Computes turnaround destinations for all edges (if exist)
Represents a single node (junction) during network building.
A definition of a pedestrian crossing.
double getAngleAtNode(const NBNode *const node) const
Returns the angle of the edge's geometry at the given node.
static void computeNodeTypes(NBNodeCont &nc, NBTrafficLightLogicCont &tlc)
Computes node types.
NBNode * getFromNode() const
Returns the origin node of the edge.
Sorts crossings by minimum clockwise clockwise edge angle. Use the ordering found in myAllEdges of th...
const std::string & getID() const