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

#include <IndexOpenClosed.h>

Public Member Functions

 IndexOpenClosed ()
 
 ~IndexOpenClosed ()
 
void Reset (int maxID)
 Remove all objects from queue. 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 AddOpenNode (const state &val, uint64_t hash, double f, double g, double h, uint64_t parent=kTAStarNoNode)
 
uint64_t AddClosedNode (state &val, uint64_t hash, double g, double h, uint64_t parent=kTAStarNoNode)
 Add object into closed 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...
 
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
 
uint64_t GetRound () const
 
uint64_t Peek () const
 Peek at the next item to be expanded. 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...
 
uint64_t GetOpenItem (unsigned int which) const
 
size_t OpenSize () const
 
size_t ClosedSize () const
 
size_t size () const
 

Private Member Functions

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

Private Attributes

uint64_t currentRound
 
std::vector< uint64_t > theHeap
 
std::vector< dataStructure > elements
 

Detailed Description

template<typename state, typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
class IndexOpenClosed< state, CmpKey, dataStructure >

Definition at line 80 of file IndexOpenClosed.h.

Constructor & Destructor Documentation

◆ IndexOpenClosed()

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

Definition at line 115 of file IndexOpenClosed.h.

◆ ~IndexOpenClosed()

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

Definition at line 124 of file IndexOpenClosed.h.

Member Function Documentation

◆ AddClosedNode() [1/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t IndexOpenClosed< 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 200 of file IndexOpenClosed.h.

References kClosedList, and kTAStarNoNode.

◆ AddClosedNode() [2/2]

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

Add object into closed list.

Definition at line 185 of file IndexOpenClosed.h.

References kClosedList, and kTAStarNoNode.

◆ AddOpenNode() [1/2]

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

Definition at line 165 of file IndexOpenClosed.h.

References kOpenList, and kTAStarNoNode.

◆ AddOpenNode() [2/2]

template<typename state , typename CmpKey , class dataStructure >
uint64_t IndexOpenClosed< 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 148 of file IndexOpenClosed.h.

References kOpenList, and kTAStarNoNode.

◆ Close()

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

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

Definition at line 249 of file IndexOpenClosed.h.

References kClosedList.

◆ ClosedSize()

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
size_t IndexOpenClosed< state, CmpKey, dataStructure >::ClosedSize ( ) const
inline

◆ GetOpenItem()

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
uint64_t IndexOpenClosed< state, CmpKey, dataStructure >::GetOpenItem ( unsigned int  which) const
inline

◆ GetRound()

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
uint64_t IndexOpenClosed< state, CmpKey, dataStructure >::GetRound ( ) const
inline

◆ HeapifyDown()

template<typename state , typename CmpKey , class dataStructure >
void IndexOpenClosed< state, CmpKey, dataStructure >::HeapifyDown ( unsigned int  index)
private

Definition at line 302 of file IndexOpenClosed.h.

◆ HeapifyUp()

template<typename state , typename CmpKey , class dataStructure >
bool IndexOpenClosed< state, CmpKey, dataStructure >::HeapifyUp ( unsigned int  index)
private

Moves a node up the heap.

Returns true if the node was moved, false otherwise.

Definition at line 282 of file IndexOpenClosed.h.

◆ KeyChanged()

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

Indicate that the key for a particular object has changed.

Definition at line 215 of file IndexOpenClosed.h.

◆ Lookat()

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
const dataStructure& IndexOpenClosed< state, CmpKey, dataStructure >::Lookat ( uint64_t  objKey) const
inline

◆ Lookup() [1/2]

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

Returns location of object as well as object key.

Definition at line 225 of file IndexOpenClosed.h.

References kNotFound.

◆ Lookup() [2/2]

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
dataStructure& IndexOpenClosed< state, CmpKey, dataStructure >::Lookup ( uint64_t  objKey)
inline

◆ OpenSize()

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
size_t IndexOpenClosed< state, CmpKey, dataStructure >::OpenSize ( ) const
inline

◆ Peek()

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

Peek at the next item to be expanded.

Definition at line 238 of file IndexOpenClosed.h.

◆ Reopen()

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

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

Definition at line 267 of file IndexOpenClosed.h.

References kClosedList, and kOpenList.

◆ Reset()

template<typename state , typename CmpKey , class dataStructure >
void IndexOpenClosed< state, CmpKey, dataStructure >::Reset ( int  maxID)

Remove all objects from queue.

Definition at line 132 of file IndexOpenClosed.h.

◆ size()

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
size_t IndexOpenClosed< state, CmpKey, dataStructure >::size ( ) const
inline

Member Data Documentation

◆ currentRound

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
uint64_t IndexOpenClosed< state, CmpKey, dataStructure >::currentRound
private

◆ elements

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
std::vector<dataStructure> IndexOpenClosed< state, CmpKey, dataStructure >::elements
private

◆ theHeap

template<typename state , typename CmpKey = IndexCompareWithF<state>, class dataStructure = IndexOpenClosedDataWithF<state>>
std::vector<uint64_t> IndexOpenClosed< state, CmpKey, dataStructure >::theHeap
private

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