Eclipse SUMO - Simulation of Urban MObility
Loading...
Searching...
No Matches
NBEdgePriorityComputer Class Reference

#include <NBAlgorithms.h>

Static Public Member Functions

static void computeEdgePriorities (NBNodeCont &nc)
 Computes edge priorities within a node.

Static Private Member Functions

static NBEdgeextractAndMarkFirst (NBNode &n, std::vector< NBEdge * > &s, int prio=1)
 Sets the priorites in case of a priority junction.
static double getScore (const NBEdge *e1, const NBEdge *e2, int minPrio, int maxPrio, int maxNumLanes, double maxSpeed, SVCPermissions permissions)
 score pair of edges for multi-criteria evaluatoin of angle, priority, laneNumber and speed
static bool hasDifferentPriorities (const EdgeVector &edges, const NBEdge *excluded)
 return whether the priorite attribute can be used to distinguish the edges
static void markBestParallel (const NBNode &n, NBEdge *bestFirst, NBEdge *bestSecond)
 set priority for edges that are parallel to the best edges
static bool samePriority (const NBEdge *const e1, const NBEdge *const e2, SVCPermissions permissions)
 Returns whether both edges have the same priority.
static void setPriorityJunctionPriorities (NBNode &n, bool forceStraight=false)
 Sets the priorites in case of a priority junction.

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

References ALLWAY_STOP, EDGEPRIORITY, NBEdge::getIncomingEdges(), LEFT_BEFORE_RIGHT, NBEdge::MINOR_ROAD, 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 668 of file NBAlgorithms.cpp.

References n, and 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,
SVCPermissions permissions )
staticprivate

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

Definition at line 631 of file NBAlgorithms.cpp.

References NBEdge::getNumLanesThatAllow(), 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 695 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 648 of file NBAlgorithms.cpp.

References NBEdge::getAngleAtNode(), GeomHelper::getMinAngleDiff(), NBEdge::getPermissions(), n, and NBEdge::PRIORITY_ROAD.

Referenced by setPriorityJunctionPriorities().

Here is the caller graph for this function:

◆ samePriority()

bool NBEdgePriorityComputer::samePriority ( const NBEdge *const e1,
const NBEdge *const e2,
SVCPermissions permissions )
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 680 of file NBAlgorithms.cpp.

References NBEdge::getNumLanesThatAllow(), 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 432 of file NBAlgorithms.cpp.

References DEBUGCOND, extractAndMarkFirst(), NBEdge::getAngleAtNode(), NBEdge::getID(), GeomHelper::getMinAngleDiff(), NBEdge::getNumLanesThatAllow(), NBEdge::getPermissions(), NBEdge::getPriority(), getScore(), NBEdge::getSpeed(), hasDifferentPriorities(), markBestParallel(), MAX2(), MIN2(), NBEdge::MINOR_ROAD, n, NBEdge::PRIORITY_ROAD, samePriority(), NBEdge::setJunctionPriority(), setPriorityJunctionPriorities(), STRAIGHT, SVC_BUS, SVC_PASSENGER, SVC_TRAM, SVC_VULNERABLE, and toString().

Referenced by computeEdgePriorities(), and setPriorityJunctionPriorities().

Here is the caller graph for this function:

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