Emergency 20 Dokumentation  4.2.0
qsf::ai::voronoi::SegmentFinder Class Reference

#include <VoronoiSegmentFinder.h>

Inheritance diagram for qsf::ai::voronoi::SegmentFinder:


class  GridSegment

Public Member Functions

 SegmentFinder (DynamicGraph &graph, DynamicGraph::TweakedGraphDataCollection *erasedDataTracker=nullptr, unsigned int minimumDistanceNeeded=1)
void findSegments (const GridCoordinates &windowMin, const GridCoordinates &windowMax)
void traceConnectionsByWavefront (const TrafficLaneWorld *resultReference)
const std::deque< GridSegment > & getCreatedLanes () const
const std::multimap< unsigned int, unsigned int > & getNodeToLaneConnections () const

Detailed Description

The functionality to create Voronoi diagrams is separated into distinct algorithmic steps. The parts defined inside this file identify connected segments based on a grid where the distances have already been calculated by the Voronoi distance calculator. It is an intermediate step to create an abstract graph inside a traffic lane world from the grid values. It is implemented as a class purely for syntactic clarity inside the algorithm. Instances are used like functions where the whole algorithm is executed with the creation of the object inside its constructor.

Constructor & Destructor Documentation

qsf::ai::voronoi::SegmentFinder::SegmentFinder ( DynamicGraph graph,
DynamicGraph::TweakedGraphDataCollection erasedDataTracker = nullptr,
unsigned int  minimumDistanceNeeded = 1 

The calculator is the primary input and needs to be handled by the distance calculator before. The SegmentCollection and the segment nodes vector are the output parameters that are written as a result of the algorithm. They only consist of the position and the unique id defined by their index inside the vector. Make sure to keep this id valid while transferring them to their final representation. The minimum distance parameter defines which minimal free space is required by the entities to move along to avoid creating unimportant lanes. Segments that have less free space on some parts are cut into several pieces this way.

Member Function Documentation

void qsf::ai::voronoi::SegmentFinder::findSegments ( const GridCoordinates windowMin,
const GridCoordinates windowMax 
const std::deque< SegmentFinder::GridSegment > & qsf::ai::voronoi::SegmentFinder::getCreatedLanes ( ) const
const std::multimap< unsigned int, unsigned int > & qsf::ai::voronoi::SegmentFinder::getNodeToLaneConnections ( ) const
void qsf::ai::voronoi::SegmentFinder::traceConnectionsByWavefront ( const TrafficLaneWorld resultReference)

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