FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::SingleLayerSearch Class Reference

SingleLayerSearch using A*. More...

#include <singlelayersearch.h>

+ Inheritance diagram for FIFE::SingleLayerSearch:
+ Collaboration diagram for FIFE::SingleLayerSearch:

Public Member Functions

 SingleLayerSearch (Route *route, const int32_t sessionId)
 Constructor. More...
 
 ~SingleLayerSearch ()
 Destructor. More...
 
void updateSearch ()
 Updates the search. More...
 
void calcPath ()
 Calculates final path. More...
 

Private Attributes

Location m_to
 A location object representing where the search started. More...
 
Location m_from
 A location object representing where the search ended. More...
 
CellCachem_cellCache
 A pointer to the CellCache. More...
 
int32_t m_startCoordInt
 The start coordinate as an int32_t. More...
 
int32_t m_destCoordInt
 The destination coordinate as an int32_t. More...
 
int32_t m_next
 The next coordinate to check out. More...
 
std::vector< int32_t > m_spt
 The shortest path tree. More...
 
std::vector< int32_t > m_sf
 The search frontier. More...
 
std::vector< double > m_gCosts
 A table to hold the costs. More...
 
PriorityQueue< int32_t, double > m_sortedfrontier
 Priority queue to hold nodes on the sf in order. More...
 

Additional Inherited Members

Detailed Description

SingleLayerSearch using A*.

Definition at line 44 of file singlelayersearch.h.

Constructor & Destructor Documentation

FIFE::SingleLayerSearch::SingleLayerSearch ( Route route,
const int32_t  sessionId 
)

Constructor.

Parameters
routeA pointer to the route for which a path should be searched.
sessionIdA integer containing the session id for this search.

Definition at line 41 of file singlelayersearch.cpp.

References FIFE::CellCache::getMaxIndex(), m_cellCache, m_gCosts, m_sf, m_sortedfrontier, m_spt, m_startCoordInt, and FIFE::PriorityQueue< index_type, priority_type >::pushElement().

FIFE::SingleLayerSearch::~SingleLayerSearch ( )

Destructor.

Definition at line 57 of file singlelayersearch.cpp.

Member Function Documentation

void FIFE::SingleLayerSearch::updateSearch ( )
virtual

Updates the search.

Each update checks all neighbors of the last checked coordinate and selects the most favorable.

Implements FIFE::RoutePatherSearch.

Definition at line 60 of file singlelayersearch.cpp.

References ABS, FIFE::PriorityQueue< index_type, priority_type >::changeElementPriority(), FIFE::CellCache::convertIntToCoord(), FIFE::PriorityQueue< index_type, priority_type >::empty(), FIFE::CellCache::getAdjacentCost(), FIFE::getAngleBetween(), FIFE::CellCache::getCell(), FIFE::Layer::getCellGrid(), FIFE::Cell::getCellType(), FIFE::Route::getCostId(), FIFE::CellGrid::getHeuristicCost(), FIFE::CellCache::getLayer(), FIFE::Cell::getLayer(), FIFE::Location::getLayerCoordinates(), FIFE::Cell::getLayerCoordinates(), FIFE::Route::getLimitedAreas(), FIFE::Cell::getNeighbors(), FIFE::Route::getOccupiedCells(), FIFE::PriorityQueue< index_type, priority_type >::getPriorityElement(), FIFE::Route::getZStepRange(), FIFE::Route::isAreaLimited(), FIFE::CellCache::isCellInArea(), m_cellCache, m_destCoordInt, m_gCosts, FIFE::RoutePatherSearch::m_ignoredBlockers, FIFE::RoutePatherSearch::m_ignoreDynamicBlockers, FIFE::RoutePatherSearch::m_multicell, m_next, FIFE::RoutePatherSearch::m_route, m_sf, m_sortedfrontier, FIFE::RoutePatherSearch::m_specialCost, m_spt, m_to, FIFE::PriorityQueue< index_type, priority_type >::popElement(), FIFE::PriorityQueue< index_type, priority_type >::pushElement(), FIFE::ROUTE_FAILED, FIFE::ROUTE_SEARCHED, FIFE::RoutePatherSearch::search_status_complete, FIFE::RoutePatherSearch::search_status_failed, FIFE::Location::setLayerCoordinates(), FIFE::Route::setRouteStatus(), FIFE::RoutePatherSearch::setSearchStatus(), FIFE::CellGrid::toMultiCoordinates(), and FIFE::PointType3D< T >::z.

Member Data Documentation

CellCache* FIFE::SingleLayerSearch::m_cellCache
private

A pointer to the CellCache.

Definition at line 77 of file singlelayersearch.h.

Referenced by calcPath(), SingleLayerSearch(), and updateSearch().

int32_t FIFE::SingleLayerSearch::m_destCoordInt
private

The destination coordinate as an int32_t.

Definition at line 83 of file singlelayersearch.h.

Referenced by calcPath(), and updateSearch().

Location FIFE::SingleLayerSearch::m_from
private

A location object representing where the search ended.

Definition at line 74 of file singlelayersearch.h.

Referenced by calcPath().

std::vector<double> FIFE::SingleLayerSearch::m_gCosts
private

A table to hold the costs.

Definition at line 95 of file singlelayersearch.h.

Referenced by SingleLayerSearch(), and updateSearch().

int32_t FIFE::SingleLayerSearch::m_next
private

The next coordinate to check out.

Definition at line 86 of file singlelayersearch.h.

Referenced by updateSearch().

std::vector<int32_t> FIFE::SingleLayerSearch::m_sf
private

The search frontier.

Definition at line 92 of file singlelayersearch.h.

Referenced by SingleLayerSearch(), and updateSearch().

PriorityQueue<int32_t, double> FIFE::SingleLayerSearch::m_sortedfrontier
private

Priority queue to hold nodes on the sf in order.

Definition at line 98 of file singlelayersearch.h.

Referenced by SingleLayerSearch(), and updateSearch().

std::vector<int32_t> FIFE::SingleLayerSearch::m_spt
private

The shortest path tree.

Definition at line 89 of file singlelayersearch.h.

Referenced by calcPath(), SingleLayerSearch(), and updateSearch().

int32_t FIFE::SingleLayerSearch::m_startCoordInt
private

The start coordinate as an int32_t.

Definition at line 80 of file singlelayersearch.h.

Referenced by calcPath(), and SingleLayerSearch().

Location FIFE::SingleLayerSearch::m_to
private

A location object representing where the search started.

Definition at line 71 of file singlelayersearch.h.

Referenced by calcPath(), and updateSearch().


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