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

#include <NBS.h>

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

Public Member Functions

 NBS ()
 
virtual ~NBS ()
 
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 ExpandAPair (std::vector< state > &thePath)
 
bool DoSingleSearchStep (std::vector< state > &thePath)
 
virtual const char * GetName ()
 
void ResetNodeCount ()
 
const int GetNumForwardItems ()
 
const BDOpenClosedData< state > & GetForwardItem (unsigned int which)
 
const int GetNumBackwardItems ()
 
const BDOpenClosedData< state > & GetBackwardItem (unsigned int which)
 
void SetForwardHeuristic (Heuristic< state > *h)
 
void SetBackwardHeuristic (Heuristic< state > *h)
 
stateLocation GetNodeForwardLocation (const state &s)
 
stateLocation GetNodeBackwardLocation (const state &s)
 
double GetNodeForwardG (const state &s)
 
double GetNodeBackwardG (const state &s)
 
uint64_t GetNodesExpanded () const
 
uint64_t GetNodesTouched () const
 
uint64_t GetDoubleExpansions () const
 
uint64_t GetNecessaryExpansions () const
 
float GetMeetingPoint ()
 
double GetSolutionCost () const
 
void OpenGLDraw () const
 
void Draw (Graphics::Display &d) const
 
void DrawBipartiteGraph (Graphics::Display &d) const
 

Private Member Functions

void ExtractFromMiddle (std::vector< state > &thePath)
 
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
 
void Draw (Graphics::Display &d, const priorityQueue &queue) const
 
void Expand (uint64_t nextID, priorityQueue &current, priorityQueue &opposite, Heuristic< state > *heuristic, const state &target)
 

Private Attributes

uint64_t nodesTouched
 
uint64_t nodesExpanded
 
state middleNode
 
double currentCost
 
double currentSolutionEstimate
 
std::vector< state > neighbors
 
environment * env
 
std::unordered_map< double, int > counts
 
dataStructure queue
 
state goal
 
state start
 
Heuristic< state > * forwardHeuristic
 
Heuristic< state > * backwardHeuristic
 
bool expand
 
double currentPr
 

Detailed Description

template<class state, class action, class environment, class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
class NBS< state, action, environment, dataStructure, priorityQueue >

Definition at line 32 of file NBS.h.

Constructor & Destructor Documentation

◆ NBS()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
NBS< state, action, environment, dataStructure, priorityQueue >::NBS ( )
inline

◆ ~NBS()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
virtual NBS< state, action, environment, dataStructure, priorityQueue >::~NBS ( )
inlinevirtual

Definition at line 38 of file NBS.h.

Member Function Documentation

◆ DoSingleSearchStep()

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

Definition at line 270 of file NBS.h.

◆ Draw() [1/2]

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

Definition at line 560 of file NBS.h.

References d.

◆ Draw() [2/2]

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

Definition at line 567 of file NBS.h.

References d, kClosed, kOpenReady, and kOpenWaiting.

◆ DrawBipartiteGraph()

template<class state , class action , class environment , class dataStructure , class priorityQueue >
void NBS< state, action, environment, dataStructure, priorityQueue >::DrawBipartiteGraph ( Graphics::Display d) const

Definition at line 608 of file NBS.h.

◆ Expand()

template<class state , class action , class environment , class dataStructure , class priorityQueue >
void NBS< state, action, environment, dataStructure, priorityQueue >::Expand ( uint64_t  nextID,
priorityQueue &  current,
priorityQueue &  opposite,
Heuristic< state > *  heuristic,
const state &  target 
)
private

Definition at line 277 of file NBS.h.

References fgreatereq(), fless(), Heuristic< state >::HCost(), kClosed, kOpenReady, kOpenWaiting, and kUnseen.

◆ ExpandAPair()

template<class state , class action , class environment , class dataStructure , class priorityQueue >
bool NBS< state, action, environment, dataStructure, priorityQueue >::ExpandAPair ( std::vector< state > &  thePath)

Definition at line 221 of file NBS.h.

References fless().

◆ ExtractFromMiddle()

template<class state , class action , class environment , class dataStructure , class priorityQueue >
void NBS< state, action, environment, dataStructure, priorityQueue >::ExtractFromMiddle ( std::vector< state > &  thePath)
private

Definition at line 256 of file NBS.h.

◆ ExtractPathToGoal()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
void NBS< state, action, environment, dataStructure, priorityQueue >::ExtractPathToGoal ( state &  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ ExtractPathToGoalFromID()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
void NBS< state, action, environment, dataStructure, priorityQueue >::ExtractPathToGoalFromID ( uint64_t  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ ExtractPathToStart()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
void NBS< state, action, environment, dataStructure, priorityQueue >::ExtractPathToStart ( state &  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ ExtractPathToStartFromID()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
void NBS< state, action, environment, dataStructure, priorityQueue >::ExtractPathToStartFromID ( uint64_t  node,
std::vector< state > &  thePath 
)
inlineprivate

◆ GetBackwardItem()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
const BDOpenClosedData<state>& NBS< state, action, environment, dataStructure, priorityQueue >::GetBackwardItem ( unsigned int  which)
inline

◆ GetDoubleExpansions()

template<class state , class action , class environment , class dataStructure , class priorityQueue >
uint64_t NBS< state, action, environment, dataStructure, priorityQueue >::GetDoubleExpansions

Definition at line 493 of file NBS.h.

References kClosed.

◆ GetForwardItem()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
const BDOpenClosedData<state>& NBS< state, action, environment, dataStructure, priorityQueue >::GetForwardItem ( unsigned int  which)
inline

◆ GetMeetingPoint()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
float NBS< state, action, environment, dataStructure, priorityQueue >::GetMeetingPoint ( )
inline

◆ GetName()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
virtual const char* NBS< state, action, environment, dataStructure, priorityQueue >::GetName ( )
inlinevirtual

Definition at line 49 of file NBS.h.

◆ GetNecessaryExpansions()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
uint64_t NBS< state, action, environment, dataStructure, priorityQueue >::GetNecessaryExpansions ( ) const
inline

◆ GetNodeBackwardG()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
double NBS< state, action, environment, dataStructure, priorityQueue >::GetNodeBackwardG ( const state &  s)
inline

◆ GetNodeBackwardLocation()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
stateLocation NBS< state, action, environment, dataStructure, priorityQueue >::GetNodeBackwardLocation ( const state &  s)
inline

◆ GetNodeForwardG()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
double NBS< state, action, environment, dataStructure, priorityQueue >::GetNodeForwardG ( const state &  s)
inline

◆ GetNodeForwardLocation()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
stateLocation NBS< state, action, environment, dataStructure, priorityQueue >::GetNodeForwardLocation ( const state &  s)
inline

◆ GetNodesExpanded()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
uint64_t NBS< state, action, environment, dataStructure, priorityQueue >::GetNodesExpanded ( ) const
inline

◆ GetNodesTouched()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
uint64_t NBS< state, action, environment, dataStructure, priorityQueue >::GetNodesTouched ( ) const
inline

◆ GetNumBackwardItems()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
const int NBS< state, action, environment, dataStructure, priorityQueue >::GetNumBackwardItems ( )
inline

◆ GetNumForwardItems()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
const int NBS< state, action, environment, dataStructure, priorityQueue >::GetNumForwardItems ( )
inline

◆ GetPath()

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

Definition at line 184 of file NBS.h.

◆ GetSolutionCost()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
double NBS< state, action, environment, dataStructure, priorityQueue >::GetSolutionCost ( ) const
inline

◆ InitializeSearch()

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

Definition at line 195 of file NBS.h.

◆ OpenGLDraw() [1/2]

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

Definition at line 512 of file NBS.h.

◆ OpenGLDraw() [2/2]

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

Definition at line 519 of file NBS.h.

References kClosed, kOpenReady, and kOpenWaiting.

◆ ResetNodeCount()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
void NBS< state, action, environment, dataStructure, priorityQueue >::ResetNodeCount ( )
inline

◆ SetBackwardHeuristic()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
void NBS< state, action, environment, dataStructure, priorityQueue >::SetBackwardHeuristic ( Heuristic< state > *  h)
inline

◆ SetForwardHeuristic()

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
void NBS< state, action, environment, dataStructure, priorityQueue >::SetForwardHeuristic ( Heuristic< state > *  h)
inline

Member Data Documentation

◆ backwardHeuristic

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
Heuristic<state>* NBS< state, action, environment, dataStructure, priorityQueue >::backwardHeuristic
private

◆ counts

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
std::unordered_map<double, int> NBS< state, action, environment, dataStructure, priorityQueue >::counts
private

◆ currentCost

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
double NBS< state, action, environment, dataStructure, priorityQueue >::currentCost
private

◆ currentPr

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
double NBS< state, action, environment, dataStructure, priorityQueue >::currentPr
private

Definition at line 178 of file NBS.h.

◆ currentSolutionEstimate

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
double NBS< state, action, environment, dataStructure, priorityQueue >::currentSolutionEstimate
private

Definition at line 161 of file NBS.h.

◆ env

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
environment* NBS< state, action, environment, dataStructure, priorityQueue >::env
private

◆ expand

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
bool NBS< state, action, environment, dataStructure, priorityQueue >::expand
private

Definition at line 176 of file NBS.h.

◆ forwardHeuristic

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
Heuristic<state>* NBS< state, action, environment, dataStructure, priorityQueue >::forwardHeuristic
private

◆ goal

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
state NBS< state, action, environment, dataStructure, priorityQueue >::goal
private

Definition at line 170 of file NBS.h.

◆ middleNode

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
state NBS< state, action, environment, dataStructure, priorityQueue >::middleNode
private

◆ neighbors

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
std::vector<state> NBS< state, action, environment, dataStructure, priorityQueue >::neighbors
private

Definition at line 162 of file NBS.h.

◆ nodesExpanded

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
uint64_t NBS< state, action, environment, dataStructure, priorityQueue >::nodesExpanded
private

◆ nodesTouched

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
uint64_t NBS< state, action, environment, dataStructure, priorityQueue >::nodesTouched
private

◆ queue

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
dataStructure NBS< state, action, environment, dataStructure, priorityQueue >::queue
private

◆ start

template<class state , class action , class environment , class dataStructure = NBSQueue<state, 1>, class priorityQueue = BDOpenClosed<state, NBSCompareOpenReady<state, BDOpenClosedData<state>>, NBSCompareOpenWaiting<state, BDOpenClosedData<state>>>>
state NBS< state, action, environment, dataStructure, priorityQueue >::start
private

Definition at line 170 of file NBS.h.


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