HOG2
CorridorAStar.h
Go to the documentation of this file.
1 /*
2  * $Id: corridorAStar.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 6/22/05.
6  * Modified by Nathan Sturtevant on 02/29/20.
7  *
8  * This file is part of HOG2. See https://github.com/nathansttt/hog2 for licensing information.
9  *
10  */
11 
12 #ifndef CORRIDORASTAR_H
13 #define CORRIDORASTAR_H
14 
15 #include "SearchAlgorithm.h"
16 #include "Graph.h"
17 #include "Heap.h"
18 
26 public:
27  corridorAStar();
28  virtual ~corridorAStar() {}
29  path *GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp = 0);
32  path *getBestPath(GraphAbstraction *aMap, node *from, node *to, node *hGoal, reservationProvider *rp = 0);
34  path *getBestPath(GraphAbstraction *aMap, node *afrom, node *ato, node *from, node *to, reservationProvider *rp = 0);
35  void setCorridor(const std::vector<node *> *);
36  virtual const char *GetName() { return "corridorAStar"; }
37 private:
38  void relaxEdge(Heap *nodeHeap, Graph *g, GraphAbstraction *aMap,
39  edge *e, node *from, node *to, node *dest);
40  void relaxFirstEdge(Heap *nodeHeap, Graph *g, GraphAbstraction *aMap,
41  edge *e, node *from, node *afrom, node *ato, node *dest);
42 
43  void relaxFinalEdge(Heap *nodeHeap, Graph *g, GraphAbstraction *aMap,
44  edge *e, node *from, node *to, node *realDest);
45  path *extractBestPath(Graph *g, unsigned int current);
46  const std::vector<node *> *corridor;
47  std::vector<node *> emptyCorridor;
48 };
49 
50 #endif
GraphAbstraction
A generic class for basic operations on Graph abstractions.
Definition: GraphAbstraction.h:63
corridorAStar::corridor
const std::vector< node * > * corridor
Definition: CorridorAStar.h:46
Graph.h
corridorAStar::emptyCorridor
std::vector< node * > emptyCorridor
Definition: CorridorAStar.h:47
Heap.h
SearchAlgorithm.h
corridorAStar
Corridor AStar builds a a* path between two nodes, restricting itself to a particular corridor,...
Definition: CorridorAStar.h:25
Graph
A generic Graph class.
Definition: Graph.h:66
corridorAStar::relaxFirstEdge
void relaxFirstEdge(Heap *nodeHeap, Graph *g, GraphAbstraction *aMap, edge *e, node *from, node *afrom, node *ato, node *dest)
Definition: CorridorAStar.cpp:303
corridorAStar::GetName
virtual const char * GetName()
Definition: CorridorAStar.h:36
corridorAStar::extractBestPath
path * extractBestPath(Graph *g, unsigned int current)
Definition: CorridorAStar.cpp:337
corridorAStar::GetPath
path * GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0)
Definition: CorridorAStar.cpp:28
corridorAStar::relaxFinalEdge
void relaxFinalEdge(Heap *nodeHeap, Graph *g, GraphAbstraction *aMap, edge *e, node *from, node *to, node *realDest)
Definition: CorridorAStar.cpp:320
Heap
A simple & efficient Heap class which uses Graph objects.
Definition: Heap.h:27
corridorAStar::getBestPath
path * getBestPath(GraphAbstraction *aMap, node *from, node *to, node *hGoal, reservationProvider *rp=0)
get the best path from FROM to TO.
Definition: CorridorAStar.cpp:33
reservationProvider
Definition: ReservationProvider.h:33
SearchAlgorithm
A generic algorithm which can be used for pathfinding.
Definition: SearchAlgorithm.h:25
corridorAStar::setCorridor
void setCorridor(const std::vector< node * > *)
Definition: CorridorAStar.cpp:23
corridorAStar::~corridorAStar
virtual ~corridorAStar()
Definition: CorridorAStar.h:28
path
A linked list of nodes which form a continuous path.
Definition: Path.h:20
corridorAStar::relaxEdge
void relaxEdge(Heap *nodeHeap, Graph *g, GraphAbstraction *aMap, edge *e, node *from, node *to, node *dest)
Definition: CorridorAStar.cpp:286
corridorAStar::corridorAStar
corridorAStar()
Definition: CorridorAStar.cpp:18
node
Nodes to be stored within a Graph.
Definition: Graph.h:170
edge
Edge class for connections between node in a Graph.
Definition: Graph.h:129