HOG2
Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
AStarOpenClosed< state, CmpKey, dataStructure > Class Template Reference

#include <AStarOpenClosed.h>

Public Member Functions

 AStarOpenClosed ()
 
 ~AStarOpenClosed ()
 
void Reset (int val=0)
 Remove all objects from queue. More...
 
uint64_t AddOpenNode (const state &val, uint64_t hash, double f, double g, double h, uint64_t parent=kTAStarNoNode)
 Add object into open list. More...
 
uint64_t AddOpenNode (const state &val, uint64_t hash, double g, double h, uint64_t parent=kTAStarNoNode)
 Add object into open list. More...
 
uint64_t AddClosedNode (state &val, uint64_t hash, double f, double g, double h, uint64_t parent=kTAStarNoNode)
 Add object into closed list. More...
 
uint64_t AddClosedNode (state &val, uint64_t hash, double g, double h, uint64_t parent=kTAStarNoNode)
 
void KeyChanged (uint64_t objKey)
 Indicate that the key for a particular object has changed. More...
 
dataLocation Lookup (uint64_t hashKey, uint64_t &objKey) const
 Returns location of object as well as object key. More...
 
dataStructure & Lookup (uint64_t objKey)
 
const dataStructure & Lookat (uint64_t objKey) const
 
void Remove (uint64_t hash)
 Remove item from open/closed. More...
 
uint64_t Peek () const
 Peek at the next item to be expanded. More...
 
uint64_t Close (uint64_t objKey)
 Move the given item to the closed list and return key. More...
 
uint64_t Close ()
 Move the best item to the closed list and return key. More...
 
void Reopen (uint64_t objKey)
 Move item off the closed list and back onto the open list. More...
 
void CloseAllOnOpen ()
 
uint64_t GetOpenItem (unsigned int which)
 
size_t OpenSize () const
 
size_t ClosedSize () const
 
size_t size () const
 
bool empty () const
 

Private Types

typedef std::unordered_map< uint64_t, uint64_t, AHash64IndexTable
 

Private Member Functions

bool HeapifyUp (uint64_t index)
 Moves a node up the heap. More...
 
void HeapifyDown (uint64_t index)
 

Private Attributes

std::vector< uint64_t > theHeap
 
IndexTable table
 
std::vector< dataStructure > elements
 

Detailed Description

template<typename state, typename CmpKey, class dataStructure = AStarOpenClosedData<state>>
class AStarOpenClosed< state, CmpKey, dataStructure >

Definition at line 74 of file AStarOpenClosed.h.

Member Typedef Documentation

◆ IndexTable

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
typedef std::unordered_map<uint64_t, uint64_t, AHash64> AStarOpenClosed< state, CmpKey, dataStructure >::IndexTable
private

Definition at line 115 of file AStarOpenClosed.h.

Constructor & Destructor Documentation

◆ AStarOpenClosed()

template<typename state , typename CmpKey , class dataStructure >
AStarOpenClosed< state, CmpKey, dataStructure >::AStarOpenClosed

Definition at line 122 of file AStarOpenClosed.h.

◆ ~AStarOpenClosed()

template<typename state , typename CmpKey , class dataStructure >
AStarOpenClosed< state, CmpKey, dataStructure >::~AStarOpenClosed

Definition at line 127 of file AStarOpenClosed.h.

Member Function Documentation

◆ AddClosedNode() [1/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::AddClosedNode ( state &  val,
uint64_t  hash,
double  f,
double  g,
double  h,
uint64_t  parent = kTAStarNoNode 
)

Add object into closed list.

Definition at line 210 of file AStarOpenClosed.h.

◆ AddClosedNode() [2/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::AddClosedNode ( state &  val,
uint64_t  hash,
double  g,
double  h,
uint64_t  parent = kTAStarNoNode 
)

Definition at line 222 of file AStarOpenClosed.h.

◆ AddOpenNode() [1/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::AddOpenNode ( const state &  val,
uint64_t  hash,
double  f,
double  g,
double  h,
uint64_t  parent = kTAStarNoNode 
)

◆ AddOpenNode() [2/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::AddOpenNode ( const state &  val,
uint64_t  hash,
double  g,
double  h,
uint64_t  parent = kTAStarNoNode 
)

Add object into open list.

Definition at line 179 of file AStarOpenClosed.h.

◆ Close() [1/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::Close

Move the best item to the closed list and return key.

Definition at line 311 of file AStarOpenClosed.h.

◆ Close() [2/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::Close ( uint64_t  objKey)

Move the given item to the closed list and return key.

Definition at line 291 of file AStarOpenClosed.h.

Referenced by ImprovedOptimisticSearch< state, action, environment >::DoGreedyStep(), and ImprovedOptimisticSearch< state, action, environment >::DoOptimalStep().

◆ CloseAllOnOpen()

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
void AStarOpenClosed< state, CmpKey, dataStructure >::CloseAllOnOpen ( )
inline

◆ ClosedSize()

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
size_t AStarOpenClosed< state, CmpKey, dataStructure >::ClosedSize ( ) const
inline

◆ empty()

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
bool AStarOpenClosed< state, CmpKey, dataStructure >::empty ( ) const
inline

Definition at line 104 of file AStarOpenClosed.h.

◆ GetOpenItem()

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::GetOpenItem ( unsigned int  which)
inline

◆ HeapifyDown()

template<typename state , typename CmpKey , class dataStructure >
void AStarOpenClosed< state, CmpKey, dataStructure >::HeapifyDown ( uint64_t  index)
private

Definition at line 363 of file AStarOpenClosed.h.

◆ HeapifyUp()

template<typename state , typename CmpKey , class dataStructure >
bool AStarOpenClosed< state, CmpKey, dataStructure >::HeapifyUp ( uint64_t  index)
private

Moves a node up the heap.

Returns true if the node was moved, false otherwise.

Definition at line 343 of file AStarOpenClosed.h.

◆ KeyChanged()

template<typename state , typename CmpKey , class dataStructure >
void AStarOpenClosed< state, CmpKey, dataStructure >::KeyChanged ( uint64_t  objKey)

Indicate that the key for a particular object has changed.

Definition at line 253 of file AStarOpenClosed.h.

Referenced by ImprovedOptimisticSearch< state, action, environment >::DoGreedyStep(), and ImprovedOptimisticSearch< state, action, environment >::DoOptimalStep().

◆ Lookat()

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
const dataStructure& AStarOpenClosed< state, CmpKey, dataStructure >::Lookat ( uint64_t  objKey) const
inline

◆ Lookup() [1/2]

template<typename state , typename CmpKey , class dataStructure >
dataLocation AStarOpenClosed< state, CmpKey, dataStructure >::Lookup ( uint64_t  hashKey,
uint64_t &  objKey 
) const

Returns location of object as well as object key.

Definition at line 263 of file AStarOpenClosed.h.

Referenced by OptimisticSearch< state, action, environment >::CheckNextFocalNode(), ImprovedOptimisticSearch< state, action, environment >::CheckNextNode(), OptimisticSearch< state, action, environment >::CheckNextOpenNode(), ImprovedOptimisticSearch< state, action, environment >::DoGreedyStep(), ImprovedOptimisticSearch< state, action, environment >::DoOptimalStep(), AStarEpsilon< state, action, environment >::ExtractPathToStart(), ImprovedOptimisticSearch< state, action, environment >::ExtractPathToStart(), OptimisticSearch< state, action, environment >::ExtractPathToStart(), PEAStar< state, action, environment >::ExtractPathToStart(), EPEAStar< state, action, environment >::ExtractPathToStart(), ImprovedOptimisticSearch< state, action, environment >::ExtractPathToStartFromID(), ImprovedOptimisticSearch< state, action, environment >::GetClosedListGCost(), ImprovedOptimisticSearch< state, action, environment >::GetOpenItem(), ImprovedOptimisticSearch< state, action, environment >::GetOpenListGCost(), ImprovedOptimisticSearch< state, action, environment >::GetParent(), AStarEpsilon< state, action, environment >::GetStateLocation(), ImprovedOptimisticSearch< state, action, environment >::GetStateLocation(), OptimisticSearch< state, action, environment >::GetStateLocation(), AStarEpsilon< state, action, environment >::HaveExpandedState(), ImprovedOptimisticSearch< state, action, environment >::HaveExpandedState(), PEAStar< state, action, environment >::HaveExpandedState(), OptimisticSearch< state, action, environment >::HaveExpandedState(), and EPEAStar< state, action, environment >::HaveExpandedState().

◆ Lookup() [2/2]

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
dataStructure& AStarOpenClosed< state, CmpKey, dataStructure >::Lookup ( uint64_t  objKey)
inline

Definition at line 86 of file AStarOpenClosed.h.

◆ OpenSize()

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
size_t AStarOpenClosed< state, CmpKey, dataStructure >::OpenSize ( ) const
inline

◆ Peek()

template<typename state , typename CmpKey , class dataStructure >
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::Peek

◆ Remove()

template<typename state , typename CmpKey , class dataStructure >
void AStarOpenClosed< state, CmpKey, dataStructure >::Remove ( uint64_t  hash)

Remove item from open/closed.

Definition at line 237 of file AStarOpenClosed.h.

◆ Reopen()

template<typename state , typename CmpKey , class dataStructure >
void AStarOpenClosed< state, CmpKey, dataStructure >::Reopen ( uint64_t  objKey)

Move item off the closed list and back onto the open list.

Definition at line 329 of file AStarOpenClosed.h.

Referenced by ImprovedOptimisticSearch< state, action, environment >::DoGreedyStep(), and ImprovedOptimisticSearch< state, action, environment >::DoOptimalStep().

◆ Reset()

template<typename state , typename CmpKey , class dataStructure >
void AStarOpenClosed< state, CmpKey, dataStructure >::Reset ( int  val = 0)

Remove all objects from queue.

Definition at line 135 of file AStarOpenClosed.h.

Referenced by ImprovedOptimisticSearch< state, action, environment >::InitializeSearch().

◆ size()

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
size_t AStarOpenClosed< state, CmpKey, dataStructure >::size ( ) const
inline

Member Data Documentation

◆ elements

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
std::vector<dataStructure> AStarOpenClosed< state, CmpKey, dataStructure >::elements
private

◆ table

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
IndexTable AStarOpenClosed< state, CmpKey, dataStructure >::table
private

Definition at line 116 of file AStarOpenClosed.h.

◆ theHeap

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
std::vector<uint64_t> AStarOpenClosed< state, CmpKey, dataStructure >::theHeap
private

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