FIFE  6e1afdbeda11afe9ac53e6023a4be96ef88f1dc6
singlelayersearch.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2005-2017 by the FIFE team *
3  * http://www.fifengine.net *
4  * This file is part of FIFE. *
5  * *
6  * FIFE is free software; you can redistribute it and/or *
7  * modify it under the terms of the GNU Lesser General Public *
8  * License as published by the Free Software Foundation; either *
9  * version 2.1 of the License, or (at your option) any later version. *
10  * *
11  * This library is distributed in the hope that it will be useful, *
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * Lesser General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU Lesser General Public *
17  * License along with this library; if not, write to the *
18  * Free Software Foundation, Inc., *
19  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
20  ***************************************************************************/
21 
22 #ifndef FIFE_PATHFINDER_SINGLELAYERSEARCH
23 #define FIFE_PATHFINDER_SINGLELAYERSEARCH
24 
25 // Standard C++ library includes
26 
27 // 3rd party library includes
28 
29 // FIFE includes
30 // These includes are split up in two parts, separated by one empty line
31 // First block: files included from the FIFE root src directory
32 // Second block: files included from the same folder
34 
35 #include "routepathersearch.h"
36 
37 namespace FIFE {
38 
39  class CellCache;
40  class Route;
41 
45  public:
51  SingleLayerSearch(Route* route, const int32_t sessionId);
52 
56 
61  void updateSearch();
62 
67  void calcPath();
68 
69  private:
72 
75 
78 
80  int32_t m_startCoordInt;
81 
83  int32_t m_destCoordInt;
84 
86  int32_t m_next;
87 
89  std::vector<int32_t> m_spt;
90 
92  std::vector<int32_t> m_sf;
93 
95  std::vector<double> m_gCosts;
96 
99  };
100 }
101 #endif
int32_t m_destCoordInt
The destination coordinate as an int32_t.
PriorityQueue< int32_t, double > m_sortedfrontier
Priority queue to hold nodes on the sf in order.
int32_t m_next
The next coordinate to check out.
Location m_from
A location object representing where the search ended.
A CellCache is an abstract depiction of one or a few layers and contains additional information...
Definition: cellcache.h:111
int32_t m_startCoordInt
The start coordinate as an int32_t.
std::vector< int32_t > m_spt
The shortest path tree.
CellCache * m_cellCache
A pointer to the CellCache.
SingleLayerSearch using A*.
A basic route.
Definition: route.h:64
void updateSearch()
Updates the search.
Location m_to
A location object representing where the search started.
void calcPath()
Calculates final path.
RoutePatherSearch using A*.
SingleLayerSearch(Route *route, const int32_t sessionId)
Constructor.
std::vector< int32_t > m_sf
The search frontier.
std::vector< double > m_gCosts
A table to hold the costs.