HOG2
|
#include <DynamicPotentialSearch.h>
Public Member Functions | |
DynamicPotentialSearch () | |
virtual | ~DynamicPotentialSearch () |
void | GetPath (environment *env, const state &from, const state &to, std::vector< state > &thePath) |
Perform an A* search between two states. More... | |
void | GetPath (environment *, const state &, const state &, std::vector< action > &) |
bool | InitializeSearch (environment *env, const state &from, const state &to, std::vector< state > &thePath) |
Initialize the A* search. More... | |
bool | DoSingleSearchStep (std::vector< state > &thePath) |
** More... | |
void | ExtractPathToStart (const state &node, std::vector< state > &thePath) |
const state & | GetParent (const state &s) |
virtual const char * | GetName () |
Return the name of the algorithm. More... | |
void | PrintStats () |
void | ResetNodeCount () |
int | GetMemoryUsage () |
double | GetBestFMin () |
void | ResetIterator () |
bool | GetNext (double &g, double &h) |
void | SetReopenNodes (bool re) |
bool | GetReopenNodes () |
void | SetHeuristic (Heuristic< state > *h) |
uint64_t | GetNodesExpanded () const |
uint64_t | GetNodesTouched () const |
void | OpenGLDraw () const |
** More... | |
void | Draw (Graphics::Display &d) const |
void | SetOptimalityBound (double w) |
double | GetOptimalityBound () |
Public Attributes | |
std::unordered_map< uint64_t, DPSData< state > > | openClosed |
std::unordered_map< uint64_t, DPSData< state > >::const_iterator | iter |
state | goal |
state | start |
Private Attributes | |
uint64_t | nodesTouched |
uint64_t | nodesExpanded |
std::vector< state > | neighbors |
environment * | env |
double | bestSolution |
double | weight |
double | bound |
bool | reopenNodes |
uint64_t | uniqueNodesExpanded |
Heuristic< state > * | theHeuristic |
Definition at line 56 of file DynamicPotentialSearch.h.
|
inline |
Definition at line 58 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::bound, DynamicPotentialSearch< state, action, environment >::env, DynamicPotentialSearch< state, action, environment >::ResetNodeCount(), DynamicPotentialSearch< state, action, environment >::theHeuristic, and DynamicPotentialSearch< state, action, environment >::weight.
|
inlinevirtual |
Definition at line 59 of file DynamicPotentialSearch.h.
bool DynamicPotentialSearch< state, action, environment >::DoSingleSearchStep | ( | std::vector< state > & | thePath | ) |
**
** Expand a single node.
thePath | will contain an optimal path from start to goal if the function returns TRUE |
Definition at line 266 of file DynamicPotentialSearch.h.
References DPSData< state >::data, fgreater(), fless(), DPSData< state >::g, DPSData< state >::h, if(), and DPSData< state >::open.
void DynamicPotentialSearch< state, action, environment >::Draw | ( | Graphics::Display & | d | ) | const |
Definition at line 519 of file DynamicPotentialSearch.h.
References d.
|
inline |
Definition at line 74 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::env, and DynamicPotentialSearch< state, action, environment >::openClosed.
double DynamicPotentialSearch< state, action, environment >::GetBestFMin |
Definition at line 344 of file DynamicPotentialSearch.h.
References fless().
int DynamicPotentialSearch< state, action, environment >::GetMemoryUsage | ( | ) |
|
virtual |
Return the name of the algorithm.
Definition at line 150 of file DynamicPotentialSearch.h.
bool DynamicPotentialSearch< state, action, environment >::GetNext | ( | double & | g, |
double & | h | ||
) |
Definition at line 369 of file DynamicPotentialSearch.h.
|
inline |
Definition at line 111 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::nodesExpanded.
|
inline |
Definition at line 112 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::nodesTouched.
|
inline |
Definition at line 121 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::bound.
const state& DynamicPotentialSearch< state, action, environment >::GetParent | ( | const state & | s | ) |
void DynamicPotentialSearch< state, action, environment >::GetPath | ( | environment * | _env, |
const state & | from, | ||
const state & | to, | ||
std::vector< action > & | path | ||
) |
Definition at line 181 of file DynamicPotentialSearch.h.
void DynamicPotentialSearch< state, action, environment >::GetPath | ( | environment * | _env, |
const state & | from, | ||
const state & | to, | ||
std::vector< state > & | thePath | ||
) |
Perform an A* search between two states.
_env | The search environment |
from | The start state |
to | The goal state |
thePath | A vector of states which will contain an optimal path between from and to when the function returns, if one exists. |
Definition at line 169 of file DynamicPotentialSearch.h.
|
inline |
Definition at line 107 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::reopenNodes.
bool DynamicPotentialSearch< state, action, environment >::InitializeSearch | ( | environment * | _env, |
const state & | from, | ||
const state & | to, | ||
std::vector< state > & | thePath | ||
) |
Initialize the A* search.
_env | The search environment |
from | The start state |
to | The goal state |
Definition at line 209 of file DynamicPotentialSearch.h.
void DynamicPotentialSearch< state, action, environment >::OpenGLDraw |
**
** ** ** ** Draw the open/closed list
Definition at line 513 of file DynamicPotentialSearch.h.
void DynamicPotentialSearch< state, action, environment >::PrintStats | ( | ) |
void DynamicPotentialSearch< state, action, environment >::ResetIterator |
Definition at line 359 of file DynamicPotentialSearch.h.
|
inline |
Definition at line 87 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::nodesExpanded, DynamicPotentialSearch< state, action, environment >::nodesTouched, and DynamicPotentialSearch< state, action, environment >::uniqueNodesExpanded.
Referenced by DynamicPotentialSearch< state, action, environment >::DynamicPotentialSearch().
|
inline |
Definition at line 109 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::theHeuristic.
|
inline |
Definition at line 120 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::bound.
|
inline |
Definition at line 106 of file DynamicPotentialSearch.h.
References DynamicPotentialSearch< state, action, environment >::reopenNodes.
|
private |
Definition at line 130 of file DynamicPotentialSearch.h.
|
private |
Definition at line 132 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::DynamicPotentialSearch(), DynamicPotentialSearch< state, action, environment >::GetOptimalityBound(), and DynamicPotentialSearch< state, action, environment >::SetOptimalityBound().
|
private |
Definition at line 129 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::DynamicPotentialSearch(), and DynamicPotentialSearch< state, action, environment >::ExtractPathToStart().
state DynamicPotentialSearch< state, action, environment >::goal |
Definition at line 66 of file DynamicPotentialSearch.h.
std::unordered_map<uint64_t, DPSData<state> >::const_iterator DynamicPotentialSearch< state, action, environment >::iter |
Definition at line 65 of file DynamicPotentialSearch.h.
|
private |
Definition at line 125 of file DynamicPotentialSearch.h.
|
private |
Definition at line 123 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::GetNodesExpanded(), and DynamicPotentialSearch< state, action, environment >::ResetNodeCount().
|
private |
Definition at line 123 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::GetNodesTouched(), and DynamicPotentialSearch< state, action, environment >::ResetNodeCount().
std::unordered_map<uint64_t, DPSData<state> > DynamicPotentialSearch< state, action, environment >::openClosed |
Definition at line 64 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::ExtractPathToStart().
|
private |
Definition at line 133 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::GetReopenNodes(), and DynamicPotentialSearch< state, action, environment >::SetReopenNodes().
state DynamicPotentialSearch< state, action, environment >::start |
Definition at line 66 of file DynamicPotentialSearch.h.
|
private |
Definition at line 135 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::DynamicPotentialSearch(), and DynamicPotentialSearch< state, action, environment >::SetHeuristic().
|
private |
Definition at line 134 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::ResetNodeCount().
|
private |
Definition at line 131 of file DynamicPotentialSearch.h.
Referenced by DynamicPotentialSearch< state, action, environment >::DynamicPotentialSearch().