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

#include <BOAStar.h>

Classes

struct  item
 
struct  stateInfo
 

Public Member Functions

 BOAStar ()
 
virtual ~BOAStar ()
 
void GetPath (environment *env1, environment *env2, Heuristic< state > *h1, Heuristic< state > *h2, const state &from, const state &to, std::vector< state > &thePath)
 
bool InitializeSearch (environment *env1, environment *env2, Heuristic< state > *h1, Heuristic< state > *h2, const state &from, const state &to, std::vector< state > &thePath)
 
bool DoSingleSearchStep (std::vector< state > &thePath)
 
void ExtractPathToStart (state &node, std::vector< state > &thePath)
 
void ExtractPathToStartFromID (size_t node, std::vector< state > &thePath)
 
virtual const char * GetName ()
 
uint64_t GetUniqueNodesExpanded ()
 
void ResetNodeCount ()
 
size_t GetNumItems () const
 
bool IsOpen (size_t item) const
 
state GetItem (size_t item) const
 
float GetItemGCost (size_t item) const
 
float GetItemHCost (size_t item) const
 
uint64_t GetNodesExpanded () const
 
uint64_t GetNodesTouched () const
 
void LogFinalStats (StatCollection *)
 
void Draw (Graphics::Display &d) const
 
void DrawFrontier (Graphics::Display &d, int selected=-1) const
 
void DrawAllPaths (Graphics::Display &d) const
 
void DrawGoal (Graphics::Display &d, int which, rgbColor c=Colors::blue, float width=1.0) const
 
int GetClosestGoal (Graphics::point p, float limit)
 
void SetPhi (std::function< double(double, double)> p)
 
double Phi (double h, double g) const
 
void SetOptimalityBound (double w)
 
double GetOptimalityBound ()
 

Public Attributes

state goal
 
state start
 

Private Member Functions

void GetMinFOnOpen () const
 
size_t GetBestStateOnOpen () const
 
void DrawOpen (Graphics::Display &d) const
 
void Expand (size_t which)
 
void UpdateCost (size_t next, size_t parent)
 
void AddState (const state &s, size_t parent)
 
size_t Lookup (const state &s)
 

Private Attributes

uint64_t nodesTouched
 
uint64_t nodesExpanded
 
std::unordered_map< uint64_t, stateInfohashTable
 
std::vector< itemallStates
 
std::vector< state > neighbors
 
std::vector< itemgoals
 
std::vector< int > openDrawing
 
std::vector< Graphics::pointgoalDrawLocs
 
std::vector< state > solution
 
environment * e1
 
environment * e2
 
Heuristic< state > * h1
 
Heuristic< state > * h2
 
double bound
 
uint64_t uniqueNodesExpanded
 
std::function< double(double, double)> phi
 

Detailed Description

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

Definition at line 16 of file BOAStar.h.

Constructor & Destructor Documentation

◆ BOAStar()

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

Definition at line 19 of file BOAStar.h.

References BOAStar< state, action, environment >::ResetNodeCount().

◆ ~BOAStar()

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

Definition at line 20 of file BOAStar.h.

Member Function Documentation

◆ AddState()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::AddState ( const state &  s,
size_t  parent 
)
private

◆ DoSingleSearchStep()

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

Definition at line 164 of file BOAStar.h.

References to_string_with_precision().

◆ Draw()

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

Definition at line 291 of file BOAStar.h.

References Colors::blue, d, Colors::green, max, and Colors::red.

◆ DrawAllPaths()

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

Definition at line 408 of file BOAStar.h.

References Colors::blue, and d.

◆ DrawFrontier()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::DrawFrontier ( Graphics::Display d,
int  selected = -1 
) const

◆ DrawGoal()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::DrawGoal ( Graphics::Display d,
int  which,
rgbColor  c = Colors::blue,
float  width = 1.0 
) const

Definition at line 425 of file BOAStar.h.

References d, and width.

◆ DrawOpen()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::DrawOpen ( Graphics::Display d) const
private

◆ Expand()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::Expand ( size_t  which)
private

◆ ExtractPathToStart()

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

◆ ExtractPathToStartFromID()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::ExtractPathToStartFromID ( size_t  node,
std::vector< state > &  thePath 
)

◆ GetBestStateOnOpen()

template<class state , class action , class environment >
size_t BOAStar< state, action, environment >::GetBestStateOnOpen
private

Definition at line 215 of file BOAStar.h.

References fequal(), and fless().

◆ GetClosestGoal()

template<class state , class action , class environment >
int BOAStar< state, action, environment >::GetClosestGoal ( Graphics::point  p,
float  limit 
)

Definition at line 442 of file BOAStar.h.

References d, and fless().

◆ GetItem()

template<class state , class action , class environment >
state BOAStar< state, action, environment >::GetItem ( size_t  item) const
inline

Definition at line 41 of file BOAStar.h.

References BOAStar< state, action, environment >::allStates.

◆ GetItemGCost()

template<class state , class action , class environment >
float BOAStar< state, action, environment >::GetItemGCost ( size_t  item) const
inline

Definition at line 42 of file BOAStar.h.

References BOAStar< state, action, environment >::allStates.

◆ GetItemHCost()

template<class state , class action , class environment >
float BOAStar< state, action, environment >::GetItemHCost ( size_t  item) const
inline

Definition at line 43 of file BOAStar.h.

References BOAStar< state, action, environment >::allStates.

◆ GetMinFOnOpen()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::GetMinFOnOpen ( ) const
private

◆ GetName()

template<class state , class action , class environment >
virtual const char* BOAStar< state, action, environment >::GetName ( )
inlinevirtual

Definition at line 33 of file BOAStar.h.

◆ GetNodesExpanded()

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

Definition at line 47 of file BOAStar.h.

References BOAStar< state, action, environment >::nodesExpanded.

◆ GetNodesTouched()

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

Definition at line 48 of file BOAStar.h.

References BOAStar< state, action, environment >::nodesTouched.

◆ GetNumItems()

template<class state , class action , class environment >
size_t BOAStar< state, action, environment >::GetNumItems ( ) const
inline

Definition at line 39 of file BOAStar.h.

References BOAStar< state, action, environment >::allStates.

◆ GetOptimalityBound()

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

Definition at line 70 of file BOAStar.h.

References BOAStar< state, action, environment >::bound.

◆ GetPath()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::GetPath ( environment *  env1,
environment *  env2,
Heuristic< state > *  h1,
Heuristic< state > *  h2,
const state &  from,
const state &  to,
std::vector< state > &  thePath 
)

Definition at line 120 of file BOAStar.h.

◆ GetUniqueNodesExpanded()

template<class state , class action , class environment >
uint64_t BOAStar< state, action, environment >::GetUniqueNodesExpanded ( )
inline

◆ InitializeSearch()

template<class state , class action , class environment >
bool BOAStar< state, action, environment >::InitializeSearch ( environment *  env1,
environment *  env2,
Heuristic< state > *  h1,
Heuristic< state > *  h2,
const state &  from,
const state &  to,
std::vector< state > &  thePath 
)

Definition at line 133 of file BOAStar.h.

References Heuristic< state >::HCost().

◆ IsOpen()

template<class state , class action , class environment >
bool BOAStar< state, action, environment >::IsOpen ( size_t  item) const
inline

Definition at line 40 of file BOAStar.h.

References BOAStar< state, action, environment >::allStates.

◆ LogFinalStats()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::LogFinalStats ( StatCollection )
inline

Definition at line 50 of file BOAStar.h.

◆ Lookup()

template<class state , class action , class environment >
size_t BOAStar< state, action, environment >::Lookup ( const state &  s)
private

◆ Phi()

template<class state , class action , class environment >
double BOAStar< state, action, environment >::Phi ( double  h,
double  g 
) const
inline

Definition at line 61 of file BOAStar.h.

References BOAStar< state, action, environment >::phi.

◆ ResetNodeCount()

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

◆ SetOptimalityBound()

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

◆ SetPhi()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::SetPhi ( std::function< double(double, double)>  p)
inline

Definition at line 57 of file BOAStar.h.

References BOAStar< state, action, environment >::phi.

◆ UpdateCost()

template<class state , class action , class environment >
void BOAStar< state, action, environment >::UpdateCost ( size_t  next,
size_t  parent 
)
private

Member Data Documentation

◆ allStates

template<class state , class action , class environment >
std::vector<item> BOAStar< state, action, environment >::allStates
private

◆ bound

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

◆ e1

template<class state , class action , class environment >
environment* BOAStar< state, action, environment >::e1
private

Definition at line 109 of file BOAStar.h.

◆ e2

template<class state , class action , class environment >
environment * BOAStar< state, action, environment >::e2
private

Definition at line 109 of file BOAStar.h.

◆ goal

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

Definition at line 25 of file BOAStar.h.

◆ goalDrawLocs

template<class state , class action , class environment >
std::vector<Graphics::point> BOAStar< state, action, environment >::goalDrawLocs
mutableprivate

Definition at line 107 of file BOAStar.h.

◆ goals

template<class state , class action , class environment >
std::vector<item> BOAStar< state, action, environment >::goals
private

Definition at line 105 of file BOAStar.h.

◆ h1

template<class state , class action , class environment >
Heuristic<state>* BOAStar< state, action, environment >::h1
private

Definition at line 110 of file BOAStar.h.

◆ h2

template<class state , class action , class environment >
Heuristic<state> * BOAStar< state, action, environment >::h2
private

Definition at line 110 of file BOAStar.h.

◆ hashTable

template<class state , class action , class environment >
std::unordered_map<uint64_t, stateInfo> BOAStar< state, action, environment >::hashTable
private

Definition at line 97 of file BOAStar.h.

◆ neighbors

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

Definition at line 99 of file BOAStar.h.

◆ nodesExpanded

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

◆ nodesTouched

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

◆ openDrawing

template<class state , class action , class environment >
std::vector<int> BOAStar< state, action, environment >::openDrawing
private

Definition at line 106 of file BOAStar.h.

◆ phi

template<class state , class action , class environment >
std::function<double(double, double)> BOAStar< state, action, environment >::phi
private

◆ solution

template<class state , class action , class environment >
std::vector<state> BOAStar< state, action, environment >::solution
private

Definition at line 108 of file BOAStar.h.

◆ start

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

Definition at line 25 of file BOAStar.h.

◆ uniqueNodesExpanded

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

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