HOG2
GenericSearchAlgorithm.h
Go to the documentation of this file.
1 
27 #ifndef GENERICSEARCHALGORITHM_H
28 #define GENERICSEARCHALGORITHM_H
29 
30 #include <vector>
31 #include "SearchEnvironment.h"
32 #include "StatCollection.h"
33 
34 template <class state, class action, class environment>
36 {
37 public:
40  virtual void GetPath(environment *env, const state &from, const state &to, std::vector<state> &path) = 0;
41  virtual void GetPath(environment *env, const state &from, const state &to, std::vector<action> &path) = 0;
42  virtual bool InitializeSearch(environment *env, const state& from, const state& to, std::vector<state> &thePath) { assert(false); return false; }
43  virtual bool DoSingleSearchStep(std::vector<state> &thePath) { assert(false); return false; }
44  virtual const char *GetName() = 0;
45  virtual uint64_t GetNodesExpanded() const = 0;
46  virtual uint64_t GetNodesTouched() const = 0;
47  virtual void LogFinalStats(StatCollection *stats) = 0;
48  virtual void OpenGLDraw() const {}
49  virtual void OpenGLDraw(const environment *env) const {}
50 };
51 
52 
53 #endif
GenericSearchAlgorithm::LogFinalStats
virtual void LogFinalStats(StatCollection *stats)=0
GenericSearchAlgorithm::GetNodesExpanded
virtual uint64_t GetNodesExpanded() const =0
GenericSearchAlgorithm::DoSingleSearchStep
virtual bool DoSingleSearchStep(std::vector< state > &thePath)
Definition: GenericSearchAlgorithm.h:43
GenericSearchAlgorithm::GetNodesTouched
virtual uint64_t GetNodesTouched() const =0
StatCollection.h
GenericSearchAlgorithm::GenericSearchAlgorithm
GenericSearchAlgorithm()
Definition: GenericSearchAlgorithm.h:38
GenericSearchAlgorithm::GetName
virtual const char * GetName()=0
GenericSearchAlgorithm::InitializeSearch
virtual bool InitializeSearch(environment *env, const state &from, const state &to, std::vector< state > &thePath)
Definition: GenericSearchAlgorithm.h:42
GenericSearchAlgorithm
Definition: GenericSearchAlgorithm.h:35
GenericSearchAlgorithm::GetPath
virtual void GetPath(environment *env, const state &from, const state &to, std::vector< state > &path)=0
StatCollection
The StatCollection class is for collecting stats across different parts of the simulation.
Definition: StatCollection.h:34
GenericSearchAlgorithm::OpenGLDraw
virtual void OpenGLDraw(const environment *env) const
Definition: GenericSearchAlgorithm.h:49
path
A linked list of nodes which form a continuous path.
Definition: Path.h:20
GenericSearchAlgorithm::~GenericSearchAlgorithm
virtual ~GenericSearchAlgorithm()
Definition: GenericSearchAlgorithm.h:39
SearchEnvironment.h
GenericSearchAlgorithm::OpenGLDraw
virtual void OpenGLDraw() const
Definition: GenericSearchAlgorithm.h:48