HOG2
PRAStar2.h
Go to the documentation of this file.
1 /*
2  * $Id: praStar2.h
3  * hog2
4  *
5  * Created by Nathan Sturtevant on 6/23/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  * Skipping added by Renee Jansen on 5/15/06.
11  *
12  */
13 
14 #ifndef PRASTAR2_H
15 #define PRASTAR2_H
16 
17 #include "SearchAlgorithm.h"
18 #include "Heap.h"
19 #include "CorridorAStar.h"
20 
25 class praStar2 : public SearchAlgorithm {
26 
27 public:
28  praStar2();
29  virtual ~praStar2() {}
30  virtual path *GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp = 0);
31  virtual const char *GetName()
32  { return algName; }
33  void setPartialPathLimit(int limit)
34  { partialLimit = limit; sprintf(algName,"PRA2*(%d)", partialLimit); }
36  void setEnhancedAbstractPathing(bool enhance) { enhancedAbstractPathing = enhance; }
37 
42  void setExpandSearchRadius(bool _expandSearchRadius) { expandSearchRadius = _expandSearchRadius; }
43 
49  void setPlanFromMiddle(bool _planFromMiddle) { planFromMiddle = _planFromMiddle; }
50 
55  void setFixedPlanLevel(int p) { fixedPlanLevel = p; }
56 
61  void setSkipParameter(int _skip) { skip = _skip; }
62 
63  int getTopLevel() { return topLevel; }
64  int getNumLevelsUsed() { return numLevels; }
65 
66 protected:
67  void setupSearch(GraphAbstraction *aMap,
68  std::vector<node *> &fromChain, node *from,
69  std::vector<node *> &toChain, node *to);
71  std::vector<node *> &fromChain,
72  std::vector<node *> &toChain,
74  path *trimPath(path *lastPath, node *origDest);
75 
77  std::vector<node *> &fromChain,
78  std::vector<node *> & toChain);
79 
84  char algName[30];
85 
88  int skip;
89  int topLevel; //the highest level at which an abstract path is found
90  int numLevels; // the number of levels at which an abstract path is found
91 };
92 
93 
94 #endif
praStar2::~praStar2
virtual ~praStar2()
Definition: PRAStar2.h:29
GraphAbstraction
A generic class for basic operations on Graph abstractions.
Definition: GraphAbstraction.h:63
praStar2::numLevels
int numLevels
Definition: PRAStar2.h:90
praStar2::getNumLevelsUsed
int getNumLevelsUsed()
Definition: PRAStar2.h:64
Heap.h
praStar2::trimPath
path * trimPath(path *lastPath, node *origDest)
Definition: PRAStar2.cpp:244
praStar2::setFixedPlanLevel
void setFixedPlanLevel(int p)
Set the level of abstraction to start pathfinding at.
Definition: PRAStar2.h:55
SearchAlgorithm.h
praStar2::setPartialPathLimit
void setPartialPathLimit(int limit)
Definition: PRAStar2.h:33
praStar2::setupSearch
void setupSearch(GraphAbstraction *aMap, std::vector< node * > &fromChain, node *from, std::vector< node * > &toChain, node *to)
Definition: PRAStar2.cpp:53
praStar2::fixedPlanLevel
int fixedPlanLevel
Definition: PRAStar2.h:87
corridorAStar
Corridor AStar builds a a* path between two nodes, restricting itself to a particular corridor,...
Definition: CorridorAStar.h:25
praStar2::setPlanFromMiddle
void setPlanFromMiddle(bool _planFromMiddle)
Set whether we want to start planning in the middle between base and top level of abstraction.
Definition: PRAStar2.h:49
praStar2::cAStar
corridorAStar cAStar
Definition: PRAStar2.h:83
praStar2::buildNextAbstractPath
path * buildNextAbstractPath(GraphAbstraction *, path *lastPath, std::vector< node * > &fromChain, std::vector< node * > &toChain, reservationProvider *)
Definition: PRAStar2.cpp:126
praStar2::praStar2
praStar2()
Definition: PRAStar2.cpp:18
praStar2::planFromMiddle
bool planFromMiddle
Definition: PRAStar2.h:86
praStar2::getPartialPathLimit
int getPartialPathLimit()
Definition: PRAStar2.h:35
praStar2::setExpandSearchRadius
void setExpandSearchRadius(bool _expandSearchRadius)
Set whether we want to expand the corridor to search in.
Definition: PRAStar2.h:42
praStar2::algName
char algName[30]
Definition: PRAStar2.h:84
praStar2::partialLimit
int partialLimit
Definition: PRAStar2.h:80
praStar2::setEnhancedAbstractPathing
void setEnhancedAbstractPathing(bool enhance)
Definition: PRAStar2.h:36
praStar2::GetName
virtual const char * GetName()
Definition: PRAStar2.h:31
CorridorAStar.h
praStar2
The pra* search algorithm which does partial pathfinding using abstraction.
Definition: PRAStar2.h:25
praStar2::getTopLevel
int getTopLevel()
Definition: PRAStar2.h:63
praStar2::expandSearchRadius
bool expandSearchRadius
Definition: PRAStar2.h:82
praStar2::topLevel
int topLevel
Definition: PRAStar2.h:89
reservationProvider
Definition: ReservationProvider.h:33
SearchAlgorithm
A generic algorithm which can be used for pathfinding.
Definition: SearchAlgorithm.h:25
path
A linked list of nodes which form a continuous path.
Definition: Path.h:20
praStar2::selectTopAbstractionLevel
void selectTopAbstractionLevel(GraphAbstraction *aMap, std::vector< node * > &fromChain, std::vector< node * > &toChain)
Definition: PRAStar2.cpp:89
praStar2::skip
int skip
Definition: PRAStar2.h:88
praStar2::GetPath
virtual path * GetPath(GraphAbstraction *aMap, node *from, node *to, reservationProvider *rp=0)
Definition: PRAStar2.cpp:32
praStar2::enhancedAbstractPathing
bool enhancedAbstractPathing
Definition: PRAStar2.h:81
node
Nodes to be stored within a Graph.
Definition: Graph.h:170
praStar2::setSkipParameter
void setSkipParameter(int _skip)
Set how many abstraction layers should be skipped at each step.
Definition: PRAStar2.h:61