FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
FIFE::MultiLayerSearch Class Reference

MultiLayerSearch using A*. More...

#include <multilayersearch.h>

+ Inheritance diagram for FIFE::MultiLayerSearch:
+ Collaboration diagram for FIFE::MultiLayerSearch:

Public Member Functions

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

Private Member Functions

void createSearchFrontier (int32_t startInt, CellCache *cache)
 Creates or resets the SearchFrontier. More...
 
void calcPathStep ()
 Calculates path parts per layer. More...
 
void searchBetweenTargetsNeighbor ()
 Fetch targets from neighbor layers. More...
 
void searchBetweenTargetsMap ()
 Fetch targets from map. 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_startCache
 A pointer to the start CellCache. More...
 
CellCachem_endCache
 A pointer to the end CellCache. More...
 
CellCachem_currentCache
 A pointer to the currently used CellCache. More...
 
Zonem_startZone
 
Zonem_endZone
 
int32_t m_startCoordInt
 The start coordinate as an int32_t. More...
 
int32_t m_lastStartCoordInt
 The last used start coordinate as an int32_t. More...
 
int32_t m_destCoordInt
 The destination coordinate as an int32_t. More...
 
int32_t m_lastDestCoordInt
 The last used 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...
 
std::list< Cell * > m_betweenTargets
 List of targets that need to be solved to reach the real target. More...
 
bool m_foundLast
 Indicates if last between target could be achieved. More...
 
Path m_path
 Path to which all steps are added. More...
 

Additional Inherited Members

Detailed Description

MultiLayerSearch using A*.

Definition at line 45 of file multilayersearch.h.

Constructor & Destructor Documentation

FIFE::MultiLayerSearch::MultiLayerSearch ( Route route,
const int32_t  sessionId 
)
FIFE::MultiLayerSearch::~MultiLayerSearch ( )

Destructor.

Definition at line 107 of file multilayersearch.cpp.

Member Function Documentation

void FIFE::MultiLayerSearch::createSearchFrontier ( int32_t  startInt,
CellCache cache 
)
private

Creates or resets the SearchFrontier.

Parameters
startIntThe start coordinate as integer identifier.
cacheA pointer to the start CellCache.

Definition at line 110 of file multilayersearch.cpp.

References FIFE::PriorityQueue< index_type, priority_type >::clear(), FIFE::CellCache::getMaxIndex(), m_gCosts, m_next, m_sf, m_sortedFrontier, m_spt, and FIFE::PriorityQueue< index_type, priority_type >::pushElement().

Referenced by updateSearch().

+ Here is the caller graph for this function:

void FIFE::MultiLayerSearch::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 125 of file multilayersearch.cpp.

References ABS, calcPathStep(), FIFE::PriorityQueue< index_type, priority_type >::changeElementPriority(), FIFE::PriorityQueue< index_type, priority_type >::clear(), FIFE::CellCache::convertCoordToInt(), FIFE::CellCache::convertIntToCoord(), createSearchFrontier(), FIFE::PriorityQueue< index_type, priority_type >::empty(), FIFE::CellCache::getAdjacentCost(), FIFE::getAngleBetween(), FIFE::CellCache::getCell(), FIFE::Layer::getCellCache(), 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::RoutePatherSearch::getSearchStatus(), FIFE::Route::getZStepRange(), FIFE::Route::isAreaLimited(), FIFE::CellCache::isCellInArea(), m_betweenTargets, m_currentCache, m_destCoordInt, m_endCache, m_foundLast, m_gCosts, FIFE::RoutePatherSearch::m_ignoredBlockers, FIFE::RoutePatherSearch::m_ignoreDynamicBlockers, m_lastDestCoordInt, m_lastStartCoordInt, FIFE::TransitionInfo::m_layer, FIFE::TransitionInfo::m_mc, 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

std::list<Cell*> FIFE::MultiLayerSearch::m_betweenTargets
private

List of targets that need to be solved to reach the real target.

Definition at line 131 of file multilayersearch.h.

Referenced by MultiLayerSearch(), searchBetweenTargetsMap(), searchBetweenTargetsNeighbor(), and updateSearch().

CellCache* FIFE::MultiLayerSearch::m_currentCache
private

A pointer to the currently used CellCache.

Definition at line 103 of file multilayersearch.h.

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

int32_t FIFE::MultiLayerSearch::m_destCoordInt
private

The destination coordinate as an int32_t.

Definition at line 115 of file multilayersearch.h.

Referenced by updateSearch().

CellCache* FIFE::MultiLayerSearch::m_endCache
private

A pointer to the end CellCache.

Definition at line 101 of file multilayersearch.h.

Referenced by MultiLayerSearch(), searchBetweenTargetsMap(), searchBetweenTargetsNeighbor(), and updateSearch().

Zone* FIFE::MultiLayerSearch::m_endZone
private
bool FIFE::MultiLayerSearch::m_foundLast
private

Indicates if last between target could be achieved.

Definition at line 133 of file multilayersearch.h.

Referenced by updateSearch().

Location FIFE::MultiLayerSearch::m_from
private

A location object representing where the search ended.

Definition at line 96 of file multilayersearch.h.

Referenced by calcPathStep(), MultiLayerSearch(), searchBetweenTargetsMap(), and searchBetweenTargetsNeighbor().

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

A table to hold the costs.

Definition at line 126 of file multilayersearch.h.

Referenced by createSearchFrontier(), and updateSearch().

int32_t FIFE::MultiLayerSearch::m_lastDestCoordInt
private

The last used destination coordinate as an int32_t.

Definition at line 117 of file multilayersearch.h.

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

int32_t FIFE::MultiLayerSearch::m_lastStartCoordInt
private

The last used start coordinate as an int32_t.

Definition at line 113 of file multilayersearch.h.

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

int32_t FIFE::MultiLayerSearch::m_next
private

The next coordinate to check out.

Definition at line 119 of file multilayersearch.h.

Referenced by createSearchFrontier(), and updateSearch().

Path FIFE::MultiLayerSearch::m_path
private

Path to which all steps are added.

Definition at line 135 of file multilayersearch.h.

Referenced by calcPath(), and calcPathStep().

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

The search frontier.

Definition at line 124 of file multilayersearch.h.

Referenced by createSearchFrontier(), and updateSearch().

PriorityQueue<int32_t, double> FIFE::MultiLayerSearch::m_sortedFrontier
private

Priority queue to hold nodes on the sf in order.

Definition at line 128 of file multilayersearch.h.

Referenced by createSearchFrontier(), and updateSearch().

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

The shortest path tree.

Definition at line 122 of file multilayersearch.h.

Referenced by calcPath(), calcPathStep(), createSearchFrontier(), and updateSearch().

CellCache* FIFE::MultiLayerSearch::m_startCache
private

A pointer to the start CellCache.

Definition at line 99 of file multilayersearch.h.

Referenced by MultiLayerSearch(), searchBetweenTargetsMap(), and searchBetweenTargetsNeighbor().

int32_t FIFE::MultiLayerSearch::m_startCoordInt
private

The start coordinate as an int32_t.

Definition at line 111 of file multilayersearch.h.

Zone* FIFE::MultiLayerSearch::m_startZone
private
Location FIFE::MultiLayerSearch::m_to
private

A location object representing where the search started.

Definition at line 94 of file multilayersearch.h.

Referenced by MultiLayerSearch(), searchBetweenTargetsNeighbor(), and updateSearch().


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