HOG2
Public Member Functions | Private Member Functions | Private Attributes | List of all members
BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure > Class Template Reference

#include <BDIndexOpenClosed.h>

Public Member Functions

 BDIndexOpenClosed ()
 
void Reset (int max)
 Remove all objects from queue. More...
 
uint64_t AddOpenNode (const state &val, uint64_t hash, double g, double h, uint64_t parent=kTBDNoNode, stateLocation whichQueue=kOpenWaiting)
 Add object into open list. More...
 
uint64_t AddClosedNode (state &val, uint64_t hash, double g, double h, uint64_t parent=kTBDNoNode)
 Add object into closed list. More...
 
void KeyChanged (uint64_t objKey)
 Indicate that the key for a particular object has changed. More...
 
void Remove (uint64_t objKey)
 
stateLocation Lookup (uint64_t hashKey, uint64_t &objKey) const
 ‍** More...
 
dataStructure & Lookup (uint64_t objKey)
 
const dataStructure & Lookat (uint64_t objKey) const
 
uint64_t Peek (stateLocation whichQueue) const
 Peek at the next item to be expanded. More...
 
const dataStructure & PeekAt (stateLocation whichQueue) 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...
 
uint64_t PutToReady ()
 
uint64_t GetOpenItem (unsigned int which, stateLocation where)
 
size_t OpenReadySize () const
 
size_t OpenWaitingSize () const
 
size_t OpenSize () const
 
size_t ClosedSize () const
 
size_t size () const
 
void verifyData ()
 
bool ValidateOpenReady (int index=0)
 
bool ValidateOpenWaiting (int index=0)
 

Private Member Functions

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

Private Attributes

std::vector< std::vector< uint64_t > > priorityQueues
 
std::vector< dataStructure > elements
 
uint32_t currRound
 

Detailed Description

template<typename state, typename CmpKey0, typename CmpKey1, class dataStructure = BDIndexOpenClosedData<state>>
class BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >

Definition at line 38 of file BDIndexOpenClosed.h.

Constructor & Destructor Documentation

◆ BDIndexOpenClosed()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::BDIndexOpenClosed

Definition at line 134 of file BDIndexOpenClosed.h.

Member Function Documentation

◆ AddClosedNode()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
uint64_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::AddClosedNode ( state &  val,
uint64_t  hash,
double  g,
double  h,
uint64_t  parent = kTBDNoNode 
)

Add object into closed list.

Definition at line 194 of file BDIndexOpenClosed.h.

References kClosed, and kTBDNoNode.

◆ AddOpenNode()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
uint64_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::AddOpenNode ( const state &  val,
uint64_t  hash,
double  g,
double  h,
uint64_t  parent = kTBDNoNode,
stateLocation  whichQueue = kOpenWaiting 
)

Add object into open list.

Definition at line 163 of file BDIndexOpenClosed.h.

References kOpenReady, kOpenWaiting, and kTBDNoNode.

◆ Close()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
uint64_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::Close

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

Definition at line 311 of file BDIndexOpenClosed.h.

References kClosed, and kOpenReady.

◆ ClosedSize()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
size_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::ClosedSize ( ) const
inline

◆ GetOpenItem()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
uint64_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::GetOpenItem ( unsigned int  which,
stateLocation  where 
)
inline

◆ HeapifyDown()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
void BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::HeapifyDown ( unsigned int  index,
stateLocation  whichQueue 
)
private

Definition at line 399 of file BDIndexOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ HeapifyUp()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
bool BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::HeapifyUp ( unsigned int  index,
stateLocation  whichQueue 
)
private

Moves a node up the heap.

Returns true if the node was moved, false otherwise.

Definition at line 360 of file BDIndexOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ KeyChanged()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
void BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::KeyChanged ( uint64_t  objKey)

Indicate that the key for a particular object has changed.

Definition at line 210 of file BDIndexOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ Lookat()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
const dataStructure& BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::Lookat ( uint64_t  objKey) const
inline

◆ Lookup() [1/2]

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
stateLocation BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::Lookup ( uint64_t  hashKey,
uint64_t &  objKey 
) const

‍**

Returns location of object as well as object key.

Definition at line 262 of file BDIndexOpenClosed.h.

References kUnseen.

◆ Lookup() [2/2]

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
dataStructure& BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::Lookup ( uint64_t  objKey)
inline

◆ OpenReadySize()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
size_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::OpenReadySize ( ) const
inline

◆ OpenSize()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
size_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::OpenSize ( ) const
inline

◆ OpenWaitingSize()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
size_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::OpenWaitingSize ( ) const
inline

◆ Peek()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
uint64_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::Peek ( stateLocation  whichQueue) const

Peek at the next item to be expanded.

Definition at line 275 of file BDIndexOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ PeekAt()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
const dataStructure & BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::PeekAt ( stateLocation  whichQueue) const
inline

Peek at the next item to be expanded.

Definition at line 292 of file BDIndexOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ PutToReady()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
uint64_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::PutToReady

Definition at line 327 of file BDIndexOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ Remove()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
void BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::Remove ( uint64_t  objKey)

Definition at line 229 of file BDIndexOpenClosed.h.

References kClosed.

◆ Reset()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
void BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::Reset ( int  max)

Remove all objects from queue.

Definition at line 149 of file BDIndexOpenClosed.h.

◆ size()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
size_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::size ( ) const
inline

◆ ValidateOpenReady()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
bool BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::ValidateOpenReady ( int  index = 0)
inline

◆ ValidateOpenWaiting()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
bool BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::ValidateOpenWaiting ( int  index = 0)
inline

◆ verifyData()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
void BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::verifyData ( )

Member Data Documentation

◆ currRound

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
uint32_t BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::currRound
private

Definition at line 113 of file BDIndexOpenClosed.h.

◆ elements

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
std::vector<dataStructure> BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::elements
private

◆ priorityQueues

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDIndexOpenClosedData<state>>
std::vector<std::vector<uint64_t> > BDIndexOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::priorityQueues
private

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