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

#include <MM.h>

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

Public Member Functions

 MM (double epsilon=1.0)
 
virtual ~MM ()
 
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 AStarOpenClosedData< state > & GetForwardItem (unsigned int which)
 
const int GetNumBackwardItems ()
 
const AStarOpenClosedData< 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 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 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
 
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, MMCompare<state>>>
class MM< state, action, environment, priorityQueue >

Definition at line 45 of file MM.h.

Constructor & Destructor Documentation

◆ MM()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
MM< state, action, environment, priorityQueue >::MM ( double  epsilon = 1.0)
inline

◆ ~MM()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
virtual MM< state, action, environment, priorityQueue >::~MM ( )
inlinevirtual

Definition at line 48 of file MM.h.

Member Function Documentation

◆ DoSingleSearchStep()

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

◆ Expand()

template<class state , class action , class environment , class priorityQueue >
void MM< 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 365 of file MM.h.

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

◆ ExtractPathToGoal()

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

◆ ExtractPathToGoalFromID()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
void MM< 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, MMCompare<state>>>
void MM< state, action, environment, priorityQueue >::ExtractPathToStart ( state &  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ ExtractPathToStartFromID()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
void MM< 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, MMCompare<state>>>
const AStarOpenClosedData<state>& MM< state, action, environment, priorityQueue >::GetBackwardItem ( unsigned int  which)
inline

◆ GetForwardItem()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
const AStarOpenClosedData<state>& MM< state, action, environment, priorityQueue >::GetForwardItem ( unsigned int  which)
inline

◆ GetName()

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

Definition at line 55 of file MM.h.

◆ GetNecessaryExpansions()

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

◆ GetNodesExpanded()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
uint64_t MM< state, action, environment, priorityQueue >::GetNodesExpanded ( ) const
inline

◆ GetNodesTouched()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
uint64_t MM< state, action, environment, priorityQueue >::GetNodesTouched ( ) const
inline

◆ GetNumBackwardItems()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
const int MM< state, action, environment, priorityQueue >::GetNumBackwardItems ( )
inline

◆ GetNumForwardItems()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
const int MM< state, action, environment, priorityQueue >::GetNumForwardItems ( )
inline

◆ GetPath()

template<class state , class action , class environment , class priorityQueue >
void MM< 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 165 of file MM.h.

◆ GetUniqueNodesExpanded()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
uint64_t MM< state, action, environment, priorityQueue >::GetUniqueNodesExpanded ( ) const
inline

◆ InitializeSearch()

template<class state , class action , class environment , class priorityQueue >
bool MM< 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 176 of file MM.h.

◆ OpenGLDraw() [1/2]

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

Definition at line 524 of file MM.h.

◆ OpenGLDraw() [2/2]

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

◆ PrintHDist()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
void MM< state, action, environment, priorityQueue >::PrintHDist ( )
inline

Definition at line 72 of file MM.h.

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

◆ PrintOpenStats()

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
void MM< 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, MMCompare<state>>>
void MM< state, action, environment, priorityQueue >::ResetNodeCount ( )
inline

◆ SVGDraw() [1/2]

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

Definition at line 574 of file MM.h.

◆ SVGDraw() [2/2]

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

Definition at line 583 of file MM.h.

References kClosedList, and kOpenList.

Member Data Documentation

◆ b

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
std::unordered_map<std::pair<double, double>, int> MM< state, action, environment, priorityQueue >::b
private

Definition at line 145 of file MM.h.

◆ backwardHeuristic

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
Heuristic<state>* MM< state, action, environment, priorityQueue >::backwardHeuristic
private

Definition at line 157 of file MM.h.

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

◆ backwardQueue

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
priorityQueue MM< state, action, environment, priorityQueue >::backwardQueue
private

◆ currentCost

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
double MM< state, action, environment, priorityQueue >::currentCost
private

◆ dist

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
std::unordered_map<std::pair<double, double>, int> MM< state, action, environment, priorityQueue >::dist
private

Definition at line 144 of file MM.h.

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

◆ env

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
environment* MM< state, action, environment, priorityQueue >::env
private

◆ epsilon

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
double MM< state, action, environment, priorityQueue >::epsilon
private

Definition at line 151 of file MM.h.

◆ f

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
std::unordered_map<std::pair<double, double>, int> MM< state, action, environment, priorityQueue >::f
private

◆ forwardHeuristic

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
Heuristic<state>* MM< state, action, environment, priorityQueue >::forwardHeuristic
private

Definition at line 156 of file MM.h.

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

◆ forwardQueue

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
priorityQueue MM< state, action, environment, priorityQueue >::forwardQueue
private

◆ goal

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
state MM< state, action, environment, priorityQueue >::goal
private

Definition at line 143 of file MM.h.

◆ lastMinBackwardG

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
double MM< state, action, environment, priorityQueue >::lastMinBackwardG
private

Definition at line 150 of file MM.h.

◆ lastMinForwardG

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
double MM< state, action, environment, priorityQueue >::lastMinForwardG
private

Definition at line 149 of file MM.h.

◆ middleNode

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
state MM< state, action, environment, priorityQueue >::middleNode
private

Definition at line 147 of file MM.h.

◆ neighbors

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
std::vector<state> MM< state, action, environment, priorityQueue >::neighbors
private

Definition at line 153 of file MM.h.

◆ nodesExpanded

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
uint64_t MM< state, action, environment, priorityQueue >::nodesExpanded
private

◆ nodesTouched

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
uint64_t MM< state, action, environment, priorityQueue >::nodesTouched
private

◆ oldp1

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
double MM< state, action, environment, priorityQueue >::oldp1
private

Definition at line 159 of file MM.h.

◆ oldp2

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
double MM< state, action, environment, priorityQueue >::oldp2
private

Definition at line 160 of file MM.h.

◆ recheckPath

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
bool MM< state, action, environment, priorityQueue >::recheckPath
private

Definition at line 161 of file MM.h.

◆ start

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
state MM< state, action, environment, priorityQueue >::start
private

Definition at line 143 of file MM.h.

◆ t

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
Timer MM< state, action, environment, priorityQueue >::t
private

Definition at line 155 of file MM.h.

◆ uniqueNodesExpanded

template<class state , class action , class environment , class priorityQueue = AStarOpenClosed<state, MMCompare<state>>>
uint64_t MM< state, action, environment, priorityQueue >::uniqueNodesExpanded
private

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