HOG2
Public Member Functions | Public Attributes | Private Attributes | List of all members
DynamicPotentialSearch< state, action, environment > Class Template Reference

#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
 

Detailed Description

template<class state, class action, class environment>
class DynamicPotentialSearch< state, action, environment >

Definition at line 56 of file DynamicPotentialSearch.h.

Constructor & Destructor Documentation

◆ DynamicPotentialSearch()

template<class state , class action , class environment >
DynamicPotentialSearch< state, action, environment >::DynamicPotentialSearch ( )
inline

◆ ~DynamicPotentialSearch()

template<class state , class action , class environment >
virtual DynamicPotentialSearch< state, action, environment >::~DynamicPotentialSearch ( )
inlinevirtual

Definition at line 59 of file DynamicPotentialSearch.h.

Member Function Documentation

◆ DoSingleSearchStep()

template<class state , class action , class environment >
bool DynamicPotentialSearch< state, action, environment >::DoSingleSearchStep ( std::vector< state > &  thePath)

‍**

‍** Expand a single node.

Author
Nathan Sturtevant
Date
03/22/06
Parameters
thePathwill contain an optimal path from start to goal if the function returns TRUE
Returns
TRUE if there is no path or if we have found the goal, FALSE otherwise

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.

◆ Draw()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::Draw ( Graphics::Display d) const

Definition at line 519 of file DynamicPotentialSearch.h.

References d.

◆ ExtractPathToStart()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::ExtractPathToStart ( const state &  node,
std::vector< state > &  thePath 
)
inline

◆ GetBestFMin()

template<class state , class action , class environment >
double DynamicPotentialSearch< state, action, environment >::GetBestFMin

Definition at line 344 of file DynamicPotentialSearch.h.

References fless().

◆ GetMemoryUsage()

template<class state , class action , class environment >
int DynamicPotentialSearch< state, action, environment >::GetMemoryUsage ( )

◆ GetName()

template<class state , class action , class environment >
const char * DynamicPotentialSearch< state, action, environment >::GetName
virtual

Return the name of the algorithm.

Author
Nathan Sturtevant
Date
03/22/06
Returns
The name of the algorithm

Definition at line 150 of file DynamicPotentialSearch.h.

◆ GetNext()

template<class state , class action , class environment >
bool DynamicPotentialSearch< state, action, environment >::GetNext ( double &  g,
double &  h 
)

Definition at line 369 of file DynamicPotentialSearch.h.

◆ GetNodesExpanded()

template<class state , class action , class environment >
uint64_t DynamicPotentialSearch< state, action, environment >::GetNodesExpanded ( ) const
inline

◆ GetNodesTouched()

template<class state , class action , class environment >
uint64_t DynamicPotentialSearch< state, action, environment >::GetNodesTouched ( ) const
inline

◆ GetOptimalityBound()

template<class state , class action , class environment >
double DynamicPotentialSearch< state, action, environment >::GetOptimalityBound ( )
inline

◆ GetParent()

template<class state , class action , class environment >
const state& DynamicPotentialSearch< state, action, environment >::GetParent ( const state &  s)

◆ GetPath() [1/2]

template<class state , class action , class environment >
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.

◆ GetPath() [2/2]

template<class state , class action , class environment >
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.

Author
Nathan Sturtevant
Date
03/22/06
Parameters
_envThe search environment
fromThe start state
toThe goal state
thePathA 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.

◆ GetReopenNodes()

template<class state , class action , class environment >
bool DynamicPotentialSearch< state, action, environment >::GetReopenNodes ( )
inline

◆ InitializeSearch()

template<class state , class action , class environment >
bool DynamicPotentialSearch< state, action, environment >::InitializeSearch ( environment *  _env,
const state &  from,
const state &  to,
std::vector< state > &  thePath 
)

Initialize the A* search.

Author
Nathan Sturtevant
Date
03/22/06
Parameters
_envThe search environment
fromThe start state
toThe goal state
Returns
TRUE if initialization was successful, FALSE otherwise

Definition at line 209 of file DynamicPotentialSearch.h.

◆ OpenGLDraw()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::OpenGLDraw

‍**

‍** ‍** ‍** ‍** Draw the open/closed list

Author
Nathan Sturtevant
Date
03/12/09

Definition at line 513 of file DynamicPotentialSearch.h.

◆ PrintStats()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::PrintStats ( )

◆ ResetIterator()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::ResetIterator

Definition at line 359 of file DynamicPotentialSearch.h.

◆ ResetNodeCount()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::ResetNodeCount ( )
inline

◆ SetHeuristic()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::SetHeuristic ( Heuristic< state > *  h)
inline

◆ SetOptimalityBound()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::SetOptimalityBound ( double  w)
inline

◆ SetReopenNodes()

template<class state , class action , class environment >
void DynamicPotentialSearch< state, action, environment >::SetReopenNodes ( bool  re)
inline

Member Data Documentation

◆ bestSolution

template<class state , class action , class environment >
double DynamicPotentialSearch< state, action, environment >::bestSolution
private

Definition at line 130 of file DynamicPotentialSearch.h.

◆ bound

template<class state , class action , class environment >
double DynamicPotentialSearch< state, action, environment >::bound
private

◆ env

template<class state , class action , class environment >
environment* DynamicPotentialSearch< state, action, environment >::env
private

◆ goal

template<class state , class action , class environment >
state DynamicPotentialSearch< state, action, environment >::goal

Definition at line 66 of file DynamicPotentialSearch.h.

◆ iter

template<class state , class action , class environment >
std::unordered_map<uint64_t, DPSData<state> >::const_iterator DynamicPotentialSearch< state, action, environment >::iter

Definition at line 65 of file DynamicPotentialSearch.h.

◆ neighbors

template<class state , class action , class environment >
std::vector<state> DynamicPotentialSearch< state, action, environment >::neighbors
private

Definition at line 125 of file DynamicPotentialSearch.h.

◆ nodesExpanded

template<class state , class action , class environment >
uint64_t DynamicPotentialSearch< state, action, environment >::nodesExpanded
private

◆ nodesTouched

template<class state , class action , class environment >
uint64_t DynamicPotentialSearch< state, action, environment >::nodesTouched
private

◆ openClosed

template<class state , class action , class environment >
std::unordered_map<uint64_t, DPSData<state> > DynamicPotentialSearch< state, action, environment >::openClosed

◆ reopenNodes

template<class state , class action , class environment >
bool DynamicPotentialSearch< state, action, environment >::reopenNodes
private

◆ start

template<class state , class action , class environment >
state DynamicPotentialSearch< state, action, environment >::start

Definition at line 66 of file DynamicPotentialSearch.h.

◆ theHeuristic

template<class state , class action , class environment >
Heuristic<state>* DynamicPotentialSearch< state, action, environment >::theHeuristic
private

◆ uniqueNodesExpanded

template<class state , class action , class environment >
uint64_t DynamicPotentialSearch< state, action, environment >::uniqueNodesExpanded
private

◆ weight

template<class state , class action , class environment >
double DynamicPotentialSearch< state, action, environment >::weight
private

The documentation for this class was generated from the following file: