SUMO - Simulation of Urban MObility
NBEdgePriorityComputer Class Reference

#include <NBAlgorithms.h>

Collaboration diagram for NBEdgePriorityComputer:
Collaboration graph

Static Public Member Functions

static void computeEdgePriorities (NBNodeCont &nc)
 Computes edge priorities within a node. More...
 
static void computeEdgePrioritiesSingleNode (NBNode *node)
 Computes edge priorities within a single node. More...
 

Static Private Member Functions

static NBEdge * extractAndMarkFirst (NBNode &n, std::vector< NBEdge * > &s, int prio=1)
 Sets the priorites in case of a priority junction. More...
 
static bool hasDifferentPriorities (const EdgeVector &edges, const NBEdge *excluded)
 return whether the priorite attribute can be used to distinguish the edges More...
 
static bool samePriority (const NBEdge *const e1, const NBEdge *const e2)
 Returns whether both edges have the same priority. More...
 
static void setPriorityJunctionPriorities (NBNode &n)
 Sets the priorites in case of a priority junction. More...
 

Detailed Description

Definition at line 225 of file NBAlgorithms.h.

Member Function Documentation

void NBEdgePriorityComputer::computeEdgePriorities ( NBNodeCont &  nc)
static

Computes edge priorities within a node.

Parameters
[in]ncThe container of nodes to loop along

Definition at line 266 of file NBAlgorithms.cpp.

References NBNodeCont::begin(), and NBNodeCont::end().

Referenced by NBNetBuilder::compute().

void NBEdgePriorityComputer::computeEdgePrioritiesSingleNode ( NBNode *  node)
static

Computes edge priorities within a single node.

Parameters
[in]nodethe single node

Definition at line 274 of file NBAlgorithms.cpp.

References NBNode::getType(), NBEdge::MINOR_ROAD, NBNode::myAllEdges, NBNode::myIncomingEdges, NBNode::myOutgoingEdges, and NODETYPE_RIGHT_BEFORE_LEFT.

NBEdge * NBEdgePriorityComputer::extractAndMarkFirst ( NBNode &  n,
std::vector< NBEdge * > &  s,
int  prio = 1 
)
staticprivate

Sets the priorites in case of a priority junction.

Parameters
[in]nThe node to set edges' priorities
[in]sThe vector of edges to get and mark the first from
[in]prioThe priority to assign
Returns
The vector's first edge

Definition at line 412 of file NBAlgorithms.cpp.

References NBEdge::setJunctionPriority().

bool NBEdgePriorityComputer::hasDifferentPriorities ( const EdgeVector &  edges,
const NBEdge *  excluded 
)
staticprivate

return whether the priorite attribute can be used to distinguish the edges

Definition at line 439 of file NBAlgorithms.cpp.

References NBEdge::getPriority().

bool NBEdgePriorityComputer::samePriority ( const NBEdge *const  e1,
const NBEdge *const  e2 
)
staticprivate

Returns whether both edges have the same priority.

Parameters
[in]e1The first edge
[in]e2The second edge Whether both edges have the same priority

Definition at line 424 of file NBAlgorithms.cpp.

References NBEdge::getNumLanes(), NBEdge::getPriority(), and NBEdge::getSpeed().

void NBEdgePriorityComputer::setPriorityJunctionPriorities ( NBNode &  n)
staticprivate

Sets the priorites in case of a priority junction.

Parameters
[in]nThe node to set edges' priorities

Definition at line 291 of file NBAlgorithms.cpp.

References NBEdge::getAngleAtNode(), GeomHelper::getMinAngleDiff(), NBEdge::getPriority(), NBNode::myIncomingEdges, NBNode::myOutgoingEdges, NBEdge::PRIORITY_ROAD, and NBEdge::setJunctionPriority().


The documentation for this class was generated from the following files: