Eclipse SUMO - Simulation of Urban MObility
NBEdgePriorityComputer Class Reference

#include <NBAlgorithms.h>

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 double getScore (const NBEdge *e1, const NBEdge *e2, int minPrio, int maxPrio, int maxNumLanes, double maxSpeed)
 score pair of edges for multi-criteria evaluatoin of angle, priority, laneNumber and speed More...
 
static bool hasDifferentPriorities (const EdgeVector &edges, const NBEdge *excluded)
 return whether the priorite attribute can be used to distinguish the edges More...
 
static void markBestParallel (const NBNode &n, NBEdge *bestFirst, NBEdge *bestSecond)
 set priority for edges that are parallel to the best 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, bool forceStraight=false)
 Sets the priorites in case of a priority junction. More...
 

Detailed Description

Definition at line 218 of file NBAlgorithms.h.

Member Function Documentation

◆ computeEdgePriorities()

void NBEdgePriorityComputer::computeEdgePriorities ( NBNodeCont nc)
static

Computes edge priorities within a node.

Parameters
[in]ncThe container of nodes to loop along

Definition at line 396 of file NBAlgorithms.cpp.

References ALLWAY_STOP, EDGEPRIORITY, NBEdge::getIncomingEdges(), LEFT_BEFORE_RIGHT, NOJUNCTION, RIGHT_BEFORE_LEFT, NBEdge::setJunctionPriority(), and setPriorityJunctionPriorities().

Referenced by NBNetBuilder::compute().

Here is the caller graph for this function:

◆ extractAndMarkFirst()

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

References NBEdge::setJunctionPriority().

Referenced by setPriorityJunctionPriorities().

Here is the caller graph for this function:

◆ getScore()

double NBEdgePriorityComputer::getScore ( const NBEdge e1,
const NBEdge e2,
int  minPrio,
int  maxPrio,
int  maxNumLanes,
double  maxSpeed 
)
staticprivate

score pair of edges for multi-criteria evaluatoin of angle, priority, laneNumber and speed

Definition at line 614 of file NBAlgorithms.cpp.

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

Referenced by setPriorityJunctionPriorities().

Here is the caller graph for this function:

◆ hasDifferentPriorities()

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

References NBEdge::getPriority().

Referenced by setPriorityJunctionPriorities().

Here is the caller graph for this function:

◆ markBestParallel()

void NBEdgePriorityComputer::markBestParallel ( const NBNode n,
NBEdge bestFirst,
NBEdge bestSecond 
)
staticprivate

set priority for edges that are parallel to the best edges

Definition at line 631 of file NBAlgorithms.cpp.

References NBEdge::getAngleAtNode(), NBNode::getIncomingEdges(), GeomHelper::getMinAngleDiff(), and NBEdge::getPermissions().

Referenced by setPriorityJunctionPriorities().

Here is the caller graph for this function:

◆ samePriority()

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

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

Referenced by setPriorityJunctionPriorities().

Here is the caller graph for this function:

◆ setPriorityJunctionPriorities()

void NBEdgePriorityComputer::setPriorityJunctionPriorities ( NBNode n,
bool  forceStraight = false 
)
staticprivate

Sets the priorites in case of a priority junction.

Parameters
[in]nThe node to set edges' priorities

Definition at line 425 of file NBAlgorithms.cpp.

References DEBUGCOND, extractAndMarkFirst(), NBEdge::getAngleAtNode(), NBNode::getDirection(), NBEdge::getID(), Named::getID(), GeomHelper::getMinAngleDiff(), NBEdge::getNumLanes(), NBEdge::getPriority(), getScore(), NBEdge::getSpeed(), hasDifferentPriorities(), NBNode::isTLControlled(), NBNode::markBentPriority(), markBestParallel(), MAX2(), MIN2(), NBNode::myAllEdges, NBNode::myIncomingEdges, NBNode::myOutgoingEdges, NBEdge::PRIORITY_ROAD, samePriority(), NBEdge::setJunctionPriority(), STRAIGHT, and toString().

Referenced by computeEdgePriorities().

Here is the caller graph for this function:

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