![]() |
Eclipse SUMO - Simulation of Urban MObility
|
Represents an element of the node partition (i.e. a node set). More...
#include <KDTreePartition.h>
Public Member Functions | |
| Cell (std::vector< const Cell * > *cells, std::vector< std::vector< const Cell * > > *levelCells, std::vector< const N * > *sortedNodes, int numberOfLevels, int level, Axis axis, size_t fromInclusive, size_t toExclusive, Cell *supercell, double minX, double maxX, double minY, double maxY, bool isLeftOrLowerCell, const V *const vehicle, const bool havePermissions, const bool haveRestrictions) | |
| Constructor. | |
| bool | contains (const N *node) const |
| Tests whether the given node belongs to the cell. | |
| std::unordered_set< const E * > * | edgeSet (const V *const vehicle) const |
| Returns all edges situated inside the cell. | |
| Axis | getAxis () const |
| Returns the axis of the cell's spatial extension (x or y). | |
| const std::vector< const N * > & | getBoundaryFromNodes () const |
| Returns the vector of boundary nodes which are from-nodes of outgoing boundary edges. | |
| const std::unordered_set< const E * > & | getIncomingBoundaryEdges () const |
| Returns the set of incoming boundary edges. | |
| const Cell * | getLeftOrLowerSubcell () const |
| Returns the left (cell's axis is X) or lower (cell's axis is Y) subcell. | |
| int | getLevel () const |
| Returns the cell's level. | |
| double | getMaxX () const |
| Returns the maximum coordinate of a cell node in X-direction (aka right border coordinate). | |
| double | getMaxY () const |
| Returns the maximum coordinate of a cell node in Y-direction (aka upper border coordinate). | |
| double | getMedianCoordinate () const |
| Returns the median coordinate. | |
| double | getMinX () const |
| Returns the minimum coordinate of a cell node in X-direction (aka left border coordinate). | |
| double | getMinY () const |
| Returns the minimum coordinate of a cell node in Y-direction (aka lower border coordinate). | |
| int | getNumber () const |
| Returns the cell's number. | |
| int | getNumberOfCells () const |
| Returns the number of cells. | |
| const std::unordered_set< const E * > & | getOutgoingBoundaryEdges () const |
| Returns the set of outgoing boundary edges. | |
| const Cell * | getRightOrUpperSubcell () const |
| Returns the right (cell's axis is X) or upper (cell's axis is Y) subcell. | |
| const Cell * | getSupercell () const |
| Returns the supercell. | |
| bool | isLeftOrLowerCell () const |
| Returns the boolean flag indicating whether this cell is a left or lower cell or not. | |
| std::pair< typename std::vector< const N * >::const_iterator, typename std::vector< const N * >::const_iterator > | nodeIterators () const |
| Returns a pair of iterators (first, last) to iterate over the nodes of the cell. | |
| std::vector< const N * > * | nodes () const |
| Returns a new vector of nodes in the cell. | |
| size_t | numberOfEdgesEndingInCell (const V *const vehicle) const |
| Returns the number of edges ending in the cell. | |
| size_t | numberOfEdgesStartingInCell (const V *const vehicle) const |
| Returns the number of edges starting in the cell. | |
| virtual | ~Cell () |
| Destructor. | |
Private Member Functions | |
| void | completeSpatialInfo () |
| Completes the information about the spatial extent. | |
| bool | isInBounds (const N *node) const |
| Tests whether a given node is situated within the spatial bounds of the cell. | |
| bool | isProhibited (const E *const edge, const V *const vehicle) const |
| Returns true iff driving the given vehicle on the given edge is prohibited. | |
| double | maxAxisValue () const |
| Returns the maximum coordinate of the cell nodes' positions, in the direction of the cell's axis (X or Y). | |
| double | maxAxisValue (Axis axis) const |
| Returns the maximum coordinate of the cell nodes' positions, in the direction of the given axis (X or Y). | |
| double | minAxisValue () const |
| Returns the minimum coordinate of the cell nodes' positions, in the direction of the cell's axis (X or Y). | |
| double | minAxisValue (Axis axis) const |
| Returns the minimum coordinate of the cell nodes' positions, in the direction of the given axis (X or Y). | |
| size_t | partition () |
| Performs one partition step on the set of nodes sorted wrt to the k-d tree subdivision scheme. | |
Static Private Member Functions | |
| static int & | cellCounter () |
| Returns the global cell counter. | |
Private Attributes | |
| const Axis | myAxis |
| The axis of the spatial extension. | |
| std::vector< const N * > | myBoundaryFromNodes |
| Those nodes on the cell boundary, which are from-nodes of outgoing boundary edges. | |
| std::vector< const Cell * > * | myCells |
| The cells. | |
| const size_t | myFromInclusive |
| The from-index (inclusive). | |
| bool | myHasCompleteSpatialInfo |
| The boolean flag indicating whether the information about the cell's spatial extent is complete or not. | |
| bool | myHasNodesSortedWrtToMyAxis |
| The boolean flag indicating whether the cell's nodes are sorted wrt to the cell's axis or not. | |
| const bool | myHavePermissions |
| The boolean flag indicating whether edge permissions need to be considered or not. | |
| const bool | myHaveRestrictions |
| The boolean flag indicating whether edge restrictions need to be considered or not. | |
| std::unordered_set< const E * > | myIncomingBoundaryEdges |
| The incoming edges on the cell boundary. | |
| bool | myIsLeftOrLowerCell |
| The boolean flag indicating whether this cell is a left/lower cell or not. | |
| Cell * | myLeftOrLowerSubcell |
| The left (cell's axis is X) or lower (cell's axis is Y) subcell. | |
| const int | myLevel |
| The level. | |
| std::vector< std::vector< const Cell * > > * | myLevelCells |
| The cells of all partitions at all levels of the k-d tree subdivisional scheme. | |
| double | myMaxX |
| The maximum x-value of a node in the cell. | |
| double | myMaxY |
| The maximum y-value of a node in the cell. | |
| double | myMedianCoordinate |
| The coordinate in the axis' direction of the node at the median index. | |
| double | myMinX |
| The minimum x-value of a node in the cell. | |
| double | myMinY |
| The minimum y-value of a node in the cell. | |
| const int | myNumber |
| The number. | |
| const int | myNumberOfLevels |
| The total number of levels of the k-d tree. | |
| std::unordered_set< const E * > | myOutgoingBoundaryEdges |
| The outgoing edges on the cell boundary. | |
| Cell * | myRightOrUpperSubcell |
| The right (cell's axis is X) or upper (cell's axis is Y) subcell. | |
| std::vector< const N * > * | mySortedNodes |
| The container with all nodes, sorted wrt to the k-d tree subdivisional scheme. | |
| Cell * | mySupercell |
| The super cell. | |
| const size_t | myToExclusive |
| The to-index (exclusive). | |
Represents an element of the node partition (i.e. a node set).
Definition at line 145 of file KDTreePartition.h.
| KDTreePartition< E, N, V >::Cell::Cell | ( | std::vector< const Cell * > * | cells, |
| std::vector< std::vector< const Cell * > > * | levelCells, | ||
| std::vector< const N * > * | sortedNodes, | ||
| int | numberOfLevels, | ||
| int | level, | ||
| Axis | axis, | ||
| size_t | fromInclusive, | ||
| size_t | toExclusive, | ||
| Cell * | supercell, | ||
| double | minX, | ||
| double | maxX, | ||
| double | minY, | ||
| double | maxY, | ||
| bool | isLeftOrLowerCell, | ||
| const V *const | vehicle, | ||
| const bool | havePermissions, | ||
| const bool | haveRestrictions ) |
Constructor.
| [in] | cells | The vector of all cells |
| [in] | levelCells | The vector of all level cell vectors |
| [in] | sortedNodes | The vector of nodes |
| [in] | numberOfLevels | The number of levels |
| [in] | level | The level |
| [in] | axis | The axis (X or X) |
| [in] | fromInclusive | The from-index (inclusive) |
| [in] | toExclusive | The to-index (exclusive) |
| [in] | supercell | The supercell |
| [in] | minX | The minimum X-value of nodes in the cell |
| [in] | maxX | The maximum X-value of nodes in the cell |
| [in] | minY | The minimum Y-value of nodes in the cell |
| [in] | maxY | The maximum Y-value of nodes in the cell |
| [in] | isLeftOrLowerCell | Boolean flag indicating whether this cell is a left or lower cell or not |
| [in] | vehicle | The vehicle |
| [in] | havePermissions | The boolean flag indicating whether edge permissions need to be considered or not |
| [in] | haveRestrictions | The boolean flag indicating whether edge restrictions need to be considered or not |
go through the nodes of the cell in order to identify and collect boundary nodes / edges
Definition at line 779 of file KDTreePartition.h.
References Cell(), cellCounter(), completeSpatialInfo(), contains(), edgeSet(), KDTreePartition< E, N, V >::flip(), isLeftOrLowerCell(), isProhibited(), myAxis, myBoundaryFromNodes, myCells, myFromInclusive, myHasCompleteSpatialInfo, myHasNodesSortedWrtToMyAxis, myHavePermissions, myHaveRestrictions, myIncomingBoundaryEdges, myIsLeftOrLowerCell, myLeftOrLowerSubcell, myLevel, myLevelCells, myMaxX, myMaxY, myMedianCoordinate, myMinX, myMinY, myNumber, myNumberOfLevels, myOutgoingBoundaryEdges, myRightOrUpperSubcell, mySortedNodes, mySupercell, myToExclusive, nodes(), partition(), and KDTreePartition< E, N, V >::X.
Referenced by Cell(), getLeftOrLowerSubcell(), getRightOrUpperSubcell(), and getSupercell().
|
inlinevirtual |
Destructor.
Definition at line 206 of file KDTreePartition.h.
References myLeftOrLowerSubcell, and myRightOrUpperSubcell.
|
inlinestaticprivate |
Returns the global cell counter.
Definition at line 341 of file KDTreePartition.h.
References cellCounter().
Referenced by Cell(), cellCounter(), and getNumberOfCells().
|
private |
Completes the information about the spatial extent.
Definition at line 1247 of file KDTreePartition.h.
References maxAxisValue(), minAxisValue(), myHasCompleteSpatialInfo, myMaxX, myMaxY, myMinX, myMinY, KDTreePartition< E, N, V >::X, and KDTreePartition< E, N, V >::Y.
Referenced by Cell().
| bool KDTreePartition< E, N, V >::Cell::contains | ( | const N * | node | ) | const |
Tests whether the given node belongs to the cell.
| node | The node |
Definition at line 1416 of file KDTreePartition.h.
References isInBounds(), and myLevel.
Referenced by Cell(), AFCentralizedSPTree< E, N, V >::computeCentralizedSPTree(), edgeSet(), AFRouter< E, N, V, M >::flagContext(), and AFRouter< E, N, V, M >::flagContextNaive().
| std::unordered_set< const E * > * KDTreePartition< E, N, V >::Cell::edgeSet | ( | const V *const | vehicle | ) | const |
Returns all edges situated inside the cell.
| [in] | vehicle | The vehicle |
Definition at line 1265 of file KDTreePartition.h.
References contains(), edgeSet(), isProhibited(), myFromInclusive, mySortedNodes, and myToExclusive.
Referenced by Cell(), AFBuild< E, N, V, M >::computeArcFlagsAux(), and edgeSet().
|
inline |
Returns the axis of the cell's spatial extension (x or y).
Definition at line 212 of file KDTreePartition.h.
References myAxis.
|
inline |
Returns the vector of boundary nodes which are from-nodes of outgoing boundary edges.
Definition at line 262 of file KDTreePartition.h.
References myBoundaryFromNodes.
Referenced by AFBuild< E, N, V, M >::computeArcFlags(), and AFBuild< E, N, V, M >::computeArcFlagsNaive().
|
inline |
Returns the set of incoming boundary edges.
Definition at line 280 of file KDTreePartition.h.
References myIncomingBoundaryEdges.
|
inline |
Returns the left (cell's axis is X) or lower (cell's axis is Y) subcell.
Definition at line 291 of file KDTreePartition.h.
References Cell(), and myLeftOrLowerSubcell.
|
inline |
|
inline |
Returns the maximum coordinate of a cell node in X-direction (aka right border coordinate).
Definition at line 307 of file KDTreePartition.h.
References myMaxX.
|
inline |
Returns the maximum coordinate of a cell node in Y-direction (aka upper border coordinate).
Definition at line 315 of file KDTreePartition.h.
References myMaxY.
|
inline |
Returns the median coordinate.
Definition at line 328 of file KDTreePartition.h.
References myMedianCoordinate.
|
inline |
Returns the minimum coordinate of a cell node in X-direction (aka left border coordinate).
Definition at line 303 of file KDTreePartition.h.
References myMinX.
|
inline |
Returns the minimum coordinate of a cell node in Y-direction (aka lower border coordinate).
Definition at line 311 of file KDTreePartition.h.
References myMinY.
|
inline |
Returns the cell's number.
Definition at line 231 of file KDTreePartition.h.
References myNumber.
Referenced by AFBuild< E, N, V, M >::computeArcFlags(), AFBuild< E, N, V, M >::computeArcFlagsAux(), and AFBuild< E, N, V, M >::computeArcFlagsNaive().
|
inline |
Returns the number of cells.
Definition at line 242 of file KDTreePartition.h.
References cellCounter().
|
inline |
Returns the set of outgoing boundary edges.
Definition at line 286 of file KDTreePartition.h.
References myOutgoingBoundaryEdges.
Referenced by AFBuild< E, N, V, M >::computeArcFlags(), AFBuild< E, N, V, M >::computeArcFlagsNaive(), and AFCentralizedSPTree< E, N, V >::computeCentralizedSPTree().
|
inline |
Returns the right (cell's axis is X) or upper (cell's axis is Y) subcell.
Definition at line 295 of file KDTreePartition.h.
References Cell(), and myRightOrUpperSubcell.
|
inline |
Returns the supercell.
Definition at line 299 of file KDTreePartition.h.
References Cell(), and mySupercell.
Referenced by AFBuild< E, N, V, M >::computeArcFlags(), AFBuild< E, N, V, M >::computeArcFlagsAux(), AFBuild< E, N, V, M >::computeArcFlagsNaive(), AFCentralizedSPTree< E, N, V >::computeCentralizedSPTree(), AFRouter< E, N, V, M >::flagContext(), and AFRouter< E, N, V, M >::flagContextNaive().
|
private |
Tests whether a given node is situated within the spatial bounds of the cell.
| node | The node |
Definition at line 1406 of file KDTreePartition.h.
References myMaxX, and myMaxY.
Referenced by contains().
|
inline |
Returns the boolean flag indicating whether this cell is a left or lower cell or not.
Definition at line 324 of file KDTreePartition.h.
References myIsLeftOrLowerCell.
Referenced by Cell(), AFBuild< E, N, V, M >::computeArcFlagsAux(), AFRouter< E, N, V, M >::flagContext(), and AFRouter< E, N, V, M >::flagContextNaive().
|
inlineprivate |
Returns true iff driving the given vehicle on the given edge is prohibited.
| [in] | edge | The edge |
| [in] | vehicle | The vehicle |
Definition at line 351 of file KDTreePartition.h.
References myHavePermissions, and myHaveRestrictions.
Referenced by Cell(), edgeSet(), numberOfEdgesEndingInCell(), and numberOfEdgesStartingInCell().
|
private |
Returns the maximum coordinate of the cell nodes' positions, in the direction of the cell's axis (X or Y).
Definition at line 1192 of file KDTreePartition.h.
References maxAxisValue(), and myAxis.
|
private |
Returns the maximum coordinate of the cell nodes' positions, in the direction of the given axis (X or Y).
| axis | The axis |
Definition at line 1158 of file KDTreePartition.h.
References maxAxisValue(), myAxis, myFromInclusive, myHasNodesSortedWrtToMyAxis, mySortedNodes, myToExclusive, and KDTreePartition< E, N, V >::Y.
Referenced by completeSpatialInfo(), maxAxisValue(), and maxAxisValue().
|
private |
Returns the minimum coordinate of the cell nodes' positions, in the direction of the cell's axis (X or Y).
Definition at line 1153 of file KDTreePartition.h.
References minAxisValue(), and myAxis.
|
private |
Returns the minimum coordinate of the cell nodes' positions, in the direction of the given axis (X or Y).
| axis | The axis |
Definition at line 1120 of file KDTreePartition.h.
References minAxisValue(), myAxis, myFromInclusive, myHasNodesSortedWrtToMyAxis, mySortedNodes, myToExclusive, and KDTreePartition< E, N, V >::Y.
Referenced by completeSpatialInfo(), minAxisValue(), and minAxisValue().
| std::pair< typename std::vector< const N * >::const_iterator, typename std::vector< const N * >::const_iterator > KDTreePartition< E, N, V >::Cell::nodeIterators | ( | ) | const |
Returns a pair of iterators (first, last) to iterate over the nodes of the cell.
Definition at line 1356 of file KDTreePartition.h.
References myFromInclusive, mySortedNodes, and myToExclusive.
Referenced by AFBuild< E, N, V, M >::computeArcFlagsAux(), and AFBuild< E, N, V, M >::initSupercellEdges().
| std::vector< const N * > * KDTreePartition< E, N, V >::Cell::nodes | ( | ) | const |
Returns a new vector of nodes in the cell.
Definition at line 1365 of file KDTreePartition.h.
References myFromInclusive, mySortedNodes, myToExclusive, and nodes().
Referenced by Cell(), and nodes().
| size_t KDTreePartition< E, N, V >::Cell::numberOfEdgesEndingInCell | ( | const V *const | vehicle | ) | const |
Returns the number of edges ending in the cell.
| [in] | vehicle | The vehicle. |
Definition at line 1307 of file KDTreePartition.h.
References isProhibited(), myFromInclusive, mySortedNodes, and myToExclusive.
| size_t KDTreePartition< E, N, V >::Cell::numberOfEdgesStartingInCell | ( | const V *const | vehicle | ) | const |
Returns the number of edges starting in the cell.
| [in] | vehicle | The vehicle. |
Definition at line 1331 of file KDTreePartition.h.
References isProhibited(), myFromInclusive, mySortedNodes, and myToExclusive.
|
private |
Performs one partition step on the set of nodes sorted wrt to the k-d tree subdivision scheme.
Definition at line 1197 of file KDTreePartition.h.
References myAxis, myFromInclusive, myHasNodesSortedWrtToMyAxis, myMedianCoordinate, mySortedNodes, mySupercell, myToExclusive, KDTreePartition< E, N, V >::X, and KDTreePartition< E, N, V >::Y.
Referenced by Cell().
|
private |
The axis of the spatial extension.
Definition at line 399 of file KDTreePartition.h.
Referenced by Cell(), getAxis(), maxAxisValue(), maxAxisValue(), minAxisValue(), minAxisValue(), and partition().
|
private |
Those nodes on the cell boundary, which are from-nodes of outgoing boundary edges.
Definition at line 410 of file KDTreePartition.h.
Referenced by Cell(), and getBoundaryFromNodes().
|
private |
|
private |
The from-index (inclusive).
Definition at line 401 of file KDTreePartition.h.
Referenced by Cell(), edgeSet(), maxAxisValue(), minAxisValue(), nodeIterators(), nodes(), numberOfEdgesEndingInCell(), numberOfEdgesStartingInCell(), and partition().
|
private |
The boolean flag indicating whether the information about the cell's spatial extent is complete or not.
Definition at line 445 of file KDTreePartition.h.
Referenced by Cell(), and completeSpatialInfo().
|
private |
The boolean flag indicating whether the cell's nodes are sorted wrt to the cell's axis or not.
Definition at line 447 of file KDTreePartition.h.
Referenced by Cell(), maxAxisValue(), minAxisValue(), and partition().
|
private |
The boolean flag indicating whether edge permissions need to be considered or not.
Definition at line 461 of file KDTreePartition.h.
Referenced by Cell(), and isProhibited().
|
private |
The boolean flag indicating whether edge restrictions need to be considered or not.
Definition at line 463 of file KDTreePartition.h.
Referenced by Cell(), and isProhibited().
|
private |
The incoming edges on the cell boundary.
Definition at line 418 of file KDTreePartition.h.
Referenced by Cell(), and getIncomingBoundaryEdges().
|
private |
The boolean flag indicating whether this cell is a left/lower cell or not.
Definition at line 449 of file KDTreePartition.h.
Referenced by Cell(), and isLeftOrLowerCell().
|
private |
The left (cell's axis is X) or lower (cell's axis is Y) subcell.
Definition at line 433 of file KDTreePartition.h.
Referenced by Cell(), getLeftOrLowerSubcell(), and ~Cell().
|
private |
The level.
Definition at line 395 of file KDTreePartition.h.
Referenced by Cell(), contains(), and getLevel().
|
private |
The cells of all partitions at all levels of the k-d tree subdivisional scheme.
Definition at line 389 of file KDTreePartition.h.
Referenced by Cell().
|
private |
The maximum x-value of a node in the cell.
Definition at line 439 of file KDTreePartition.h.
Referenced by Cell(), completeSpatialInfo(), getMaxX(), and isInBounds().
|
private |
The maximum y-value of a node in the cell.
Definition at line 443 of file KDTreePartition.h.
Referenced by Cell(), completeSpatialInfo(), getMaxY(), and isInBounds().
|
private |
The coordinate in the axis' direction of the node at the median index.
Definition at line 465 of file KDTreePartition.h.
Referenced by Cell(), getMedianCoordinate(), and partition().
|
private |
The minimum x-value of a node in the cell.
Definition at line 437 of file KDTreePartition.h.
Referenced by Cell(), completeSpatialInfo(), and getMinX().
|
private |
The minimum y-value of a node in the cell.
Definition at line 441 of file KDTreePartition.h.
Referenced by Cell(), completeSpatialInfo(), and getMinY().
|
private |
The number.
Definition at line 397 of file KDTreePartition.h.
Referenced by Cell(), and getNumber().
|
private |
The total number of levels of the k-d tree.
Definition at line 393 of file KDTreePartition.h.
Referenced by Cell().
|
private |
The outgoing edges on the cell boundary.
Definition at line 424 of file KDTreePartition.h.
Referenced by Cell(), and getOutgoingBoundaryEdges().
|
private |
The right (cell's axis is X) or upper (cell's axis is Y) subcell.
Definition at line 435 of file KDTreePartition.h.
Referenced by Cell(), getRightOrUpperSubcell(), and ~Cell().
|
private |
The container with all nodes, sorted wrt to the k-d tree subdivisional scheme.
Definition at line 391 of file KDTreePartition.h.
Referenced by Cell(), edgeSet(), maxAxisValue(), minAxisValue(), nodeIterators(), nodes(), numberOfEdgesEndingInCell(), numberOfEdgesStartingInCell(), and partition().
|
private |
The super cell.
Definition at line 431 of file KDTreePartition.h.
Referenced by Cell(), getSupercell(), and partition().
|
private |
The to-index (exclusive).
Definition at line 403 of file KDTreePartition.h.
Referenced by Cell(), edgeSet(), maxAxisValue(), minAxisValue(), nodeIterators(), nodes(), numberOfEdgesEndingInCell(), numberOfEdgesStartingInCell(), and partition().