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

#include <fMM.h>

Collaboration diagram for fMM< state, action, environment, priorityQueue >:
Collaboration graph
[legend]

Public Member Functions

 fMM (double epsilon=1.0)
 
void SetFraction (double frac)
 
virtual ~fMM ()
 
void GetPath (environment *env, const state &from, const state &to, Heuristic< state > *forward, Heuristic< state > *backward, std::vector< state > &thePath)
 
bool InitializeSearch (environment *env, const state &from, const state &to, Heuristic< state > *forward, Heuristic< state > *backward, std::vector< state > &thePath)
 
bool DoSingleSearchStep (std::vector< state > &thePath)
 
virtual const char * GetName ()
 
void ResetNodeCount ()
 
const int GetNumForwardItems ()
 
const FMMOpenClosedData< state > & GetForwardItem (unsigned int which)
 
const int GetNumBackwardItems ()
 
const FMMOpenClosedData< state > & GetBackwardItem (unsigned int which)
 
uint64_t GetUniqueNodesExpanded () const
 
uint64_t GetNodesExpanded () const
 
uint64_t GetNodesTouched () const
 
uint64_t GetNecessaryExpansions () const
 
std::string SVGDraw () const
 
void OpenGLDraw () const
 
void Draw (Graphics::Display &display) const
 
void PrintHDist ()
 
void PrintOpenStats (std::unordered_map< std::pair< double, double >, int > &s)
 

Private Member Functions

void ExtractPathToGoal (state &node, std::vector< state > &thePath)
 
void ExtractPathToGoalFromID (uint64_t node, std::vector< state > &thePath)
 
void ExtractPathToStart (state &node, std::vector< state > &thePath)
 
void ExtractPathToStartFromID (uint64_t node, std::vector< state > &thePath)
 
void Draw (Graphics::Display &display, const priorityQueue &queue) const
 
void OpenGLDraw (const priorityQueue &queue) const
 
std::string SVGDraw (const priorityQueue &queue) const
 
void Expand (priorityQueue &current, priorityQueue &opposite, Heuristic< state > *heuristic, const state &target, std::unordered_map< std::pair< double, double >, int > &count)
 

Private Attributes

priorityQueue forwardQueue
 
priorityQueue backwardQueue
 
state goal
 
state start
 
std::unordered_map< std::pair< double, double >, int > dist
 
std::unordered_map< std::pair< double, double >, int > f
 
std::unordered_map< std::pair< double, double >, int > b
 
uint64_t nodesTouched
 
uint64_t nodesExpanded
 
uint64_t uniqueNodesExpanded
 
state middleNode
 
double currentCost
 
double lastMinForwardG
 
double lastMinBackwardG
 
double epsilon
 
double fraction
 
std::vector< state > neighbors
 
environment * env
 
Timer t
 
Heuristic< state > * forwardHeuristic
 
Heuristic< state > * backwardHeuristic
 
double oldp1
 
double oldp2
 
bool recheckPath
 

Detailed Description

template<class state, class action, class environment, class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
class fMM< state, action, environment, priorityQueue >

Definition at line 64 of file fMM.h.

Constructor & Destructor Documentation

◆ fMM()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
fMM< state, action, environment, priorityQueue >::fMM ( double  epsilon = 1.0)
inline

◆ ~fMM()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
virtual fMM< state, action, environment, priorityQueue >::~fMM ( )
inlinevirtual

Definition at line 68 of file fMM.h.

Member Function Documentation

◆ DoSingleSearchStep()

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

◆ Draw() [1/2]

template<class state , class action , class environment , class priorityQueue >
void fMM< state, action, environment, priorityQueue >::Draw ( Graphics::Display display) const

Definition at line 678 of file fMM.h.

◆ Draw() [2/2]

template<class state , class action , class environment , class priorityQueue >
void fMM< state, action, environment, priorityQueue >::Draw ( Graphics::Display display,
const priorityQueue &  queue 
) const
private

Definition at line 685 of file fMM.h.

References kClosedList, and kOpenList.

◆ Expand()

template<class state , class action , class environment , class priorityQueue >
void fMM< state, action, environment, priorityQueue >::Expand ( priorityQueue &  current,
priorityQueue &  opposite,
Heuristic< state > *  heuristic,
const state &  target,
std::unordered_map< std::pair< double, double >, int > &  count 
)
private

Definition at line 403 of file fMM.h.

References fgreater(), fless(), Heuristic< state >::HCost(), kClosedList, kNotFound, kOpenList, and max.

◆ ExtractPathToGoal()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::ExtractPathToGoal ( state &  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ ExtractPathToGoalFromID()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::ExtractPathToGoalFromID ( uint64_t  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ ExtractPathToStart()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::ExtractPathToStart ( state &  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ ExtractPathToStartFromID()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::ExtractPathToStartFromID ( uint64_t  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ GetBackwardItem()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
const FMMOpenClosedData<state>& fMM< state, action, environment, priorityQueue >::GetBackwardItem ( unsigned int  which)
inline

◆ GetForwardItem()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
const FMMOpenClosedData<state>& fMM< state, action, environment, priorityQueue >::GetForwardItem ( unsigned int  which)
inline

◆ GetName()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
virtual const char* fMM< state, action, environment, priorityQueue >::GetName ( )
inlinevirtual

Definition at line 75 of file fMM.h.

◆ GetNecessaryExpansions()

template<class state , class action , class environment , class priorityQueue >
uint64_t fMM< state, action, environment, priorityQueue >::GetNecessaryExpansions

◆ GetNodesExpanded()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
uint64_t fMM< state, action, environment, priorityQueue >::GetNodesExpanded ( ) const
inline

◆ GetNodesTouched()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
uint64_t fMM< state, action, environment, priorityQueue >::GetNodesTouched ( ) const
inline

◆ GetNumBackwardItems()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
const int fMM< state, action, environment, priorityQueue >::GetNumBackwardItems ( )
inline

◆ GetNumForwardItems()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
const int fMM< state, action, environment, priorityQueue >::GetNumForwardItems ( )
inline

◆ GetPath()

template<class state , class action , class environment , class priorityQueue >
void fMM< state, action, environment, priorityQueue >::GetPath ( environment *  env,
const state &  from,
const state &  to,
Heuristic< state > *  forward,
Heuristic< state > *  backward,
std::vector< state > &  thePath 
)

Definition at line 188 of file fMM.h.

◆ GetUniqueNodesExpanded()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
uint64_t fMM< state, action, environment, priorityQueue >::GetUniqueNodesExpanded ( ) const
inline

◆ InitializeSearch()

template<class state , class action , class environment , class priorityQueue >
bool fMM< state, action, environment, priorityQueue >::InitializeSearch ( environment *  env,
const state &  from,
const state &  to,
Heuristic< state > *  forward,
Heuristic< state > *  backward,
std::vector< state > &  thePath 
)

Definition at line 199 of file fMM.h.

◆ OpenGLDraw() [1/2]

template<class state , class action , class environment , class priorityQueue >
void fMM< state, action, environment, priorityQueue >::OpenGLDraw

Definition at line 572 of file fMM.h.

◆ OpenGLDraw() [2/2]

template<class state , class action , class environment , class priorityQueue >
void fMM< state, action, environment, priorityQueue >::OpenGLDraw ( const priorityQueue &  queue) const
private

◆ PrintHDist()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::PrintHDist ( )
inline

Definition at line 93 of file fMM.h.

References d, fMM< state, action, environment, priorityQueue >::dist, and if().

◆ PrintOpenStats()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::PrintOpenStats ( std::unordered_map< std::pair< double, double >, int > &  s)
inline

◆ ResetNodeCount()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::ResetNodeCount ( )
inline

◆ SetFraction()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
void fMM< state, action, environment, priorityQueue >::SetFraction ( double  frac)
inline

Definition at line 67 of file fMM.h.

References fMM< state, action, environment, priorityQueue >::fraction.

◆ SVGDraw() [1/2]

template<class state , class action , class environment , class priorityQueue >
std::string fMM< state, action, environment, priorityQueue >::SVGDraw

Definition at line 622 of file fMM.h.

◆ SVGDraw() [2/2]

template<class state , class action , class environment , class priorityQueue >
std::string fMM< state, action, environment, priorityQueue >::SVGDraw ( const priorityQueue &  queue) const
private

Definition at line 631 of file fMM.h.

References kClosedList, and kOpenList.

Member Data Documentation

◆ b

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
std::unordered_map<std::pair<double, double>, int> fMM< state, action, environment, priorityQueue >::b
private

Definition at line 167 of file fMM.h.

◆ backwardHeuristic

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
Heuristic<state>* fMM< state, action, environment, priorityQueue >::backwardHeuristic
private

Definition at line 180 of file fMM.h.

Referenced by fMM< state, action, environment, priorityQueue >::fMM().

◆ backwardQueue

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
priorityQueue fMM< state, action, environment, priorityQueue >::backwardQueue
private

◆ currentCost

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
double fMM< state, action, environment, priorityQueue >::currentCost
private

◆ dist

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
std::unordered_map<std::pair<double, double>, int> fMM< state, action, environment, priorityQueue >::dist
private

Definition at line 166 of file fMM.h.

Referenced by fMM< state, action, environment, priorityQueue >::PrintHDist().

◆ env

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
environment* fMM< state, action, environment, priorityQueue >::env
private

◆ epsilon

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
double fMM< state, action, environment, priorityQueue >::epsilon
private

Definition at line 173 of file fMM.h.

◆ f

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
std::unordered_map<std::pair<double, double>, int> fMM< state, action, environment, priorityQueue >::f
private

◆ forwardHeuristic

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
Heuristic<state>* fMM< state, action, environment, priorityQueue >::forwardHeuristic
private

Definition at line 179 of file fMM.h.

Referenced by fMM< state, action, environment, priorityQueue >::fMM().

◆ forwardQueue

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
priorityQueue fMM< state, action, environment, priorityQueue >::forwardQueue
private

◆ fraction

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
double fMM< state, action, environment, priorityQueue >::fraction
private

◆ goal

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
state fMM< state, action, environment, priorityQueue >::goal
private

Definition at line 165 of file fMM.h.

◆ lastMinBackwardG

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
double fMM< state, action, environment, priorityQueue >::lastMinBackwardG
private

Definition at line 172 of file fMM.h.

◆ lastMinForwardG

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
double fMM< state, action, environment, priorityQueue >::lastMinForwardG
private

Definition at line 171 of file fMM.h.

◆ middleNode

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
state fMM< state, action, environment, priorityQueue >::middleNode
private

Definition at line 169 of file fMM.h.

◆ neighbors

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
std::vector<state> fMM< state, action, environment, priorityQueue >::neighbors
private

Definition at line 176 of file fMM.h.

◆ nodesExpanded

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
uint64_t fMM< state, action, environment, priorityQueue >::nodesExpanded
private

◆ nodesTouched

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
uint64_t fMM< state, action, environment, priorityQueue >::nodesTouched
private

◆ oldp1

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
double fMM< state, action, environment, priorityQueue >::oldp1
private

Definition at line 182 of file fMM.h.

◆ oldp2

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
double fMM< state, action, environment, priorityQueue >::oldp2
private

Definition at line 183 of file fMM.h.

◆ recheckPath

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
bool fMM< state, action, environment, priorityQueue >::recheckPath
private

Definition at line 184 of file fMM.h.

◆ start

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
state fMM< state, action, environment, priorityQueue >::start
private

Definition at line 165 of file fMM.h.

◆ t

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
Timer fMM< state, action, environment, priorityQueue >::t
private

Definition at line 178 of file fMM.h.

◆ uniqueNodesExpanded

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, fMMCompare<state>, FMMOpenClosedData<state>>>
uint64_t fMM< state, action, environment, priorityQueue >::uniqueNodesExpanded
private

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