SUMO - Simulation of Urban MObility
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 Private Member Functions

static NBEdgeextractAndMarkFirst (NBNode &n, std::vector< NBEdge * > &s, int prio=1)
 Sets the priorites in case of a priority junction. 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 222 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 287 of file NBAlgorithms.cpp.

References NBNodeCont::begin(), NBNodeCont::end(), NBEdge::MINOR_ROAD, NBNode::myAllEdges, NBNode::myIncomingEdges, NBNode::myOutgoingEdges, NBNode::myType, NODETYPE_RIGHT_BEFORE_LEFT, and setPriorityJunctionPriorities().

Referenced by NBNetBuilder::compute().

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 425 of file NBAlgorithms.cpp.

References NBEdge::setJunctionPriority().

Referenced by setPriorityJunctionPriorities().

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 437 of file NBAlgorithms.cpp.

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

Referenced by setPriorityJunctionPriorities().

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 307 of file NBAlgorithms.cpp.

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

Referenced by computeEdgePriorities().


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