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

#include <BDOpenClosed.h>

Public Member Functions

 BDOpenClosed ()
 
 ~BDOpenClosed ()
 
void Reset (int)
 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::unordered_map< uint64_t, size_t > table
 
std::vector< dataStructure > elements
 

Detailed Description

template<typename state, typename CmpKey0, typename CmpKey1, class dataStructure = BDOpenClosedData<state>>
class BDOpenClosed< state, CmpKey0, CmpKey1, dataStructure >

Definition at line 48 of file BDOpenClosed.h.

Constructor & Destructor Documentation

◆ BDOpenClosed()

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

Definition at line 150 of file BDOpenClosed.h.

◆ ~BDOpenClosed()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
BDOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::~BDOpenClosed

Definition at line 161 of file BDOpenClosed.h.

Member Function Documentation

◆ AddClosedNode()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
uint64_t BDOpenClosed< 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 215 of file BDOpenClosed.h.

References kClosed, and kTBDNoNode.

◆ AddOpenNode()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
uint64_t BDOpenClosed< 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 183 of file BDOpenClosed.h.

References kOpenReady, kOpenWaiting, and kTBDNoNode.

◆ Close()

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

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

Definition at line 333 of file BDOpenClosed.h.

References kClosed, and kOpenReady.

◆ ClosedSize()

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

◆ GetOpenItem()

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

◆ HeapifyDown()

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

Definition at line 421 of file BDOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ HeapifyUp()

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure >
bool BDOpenClosed< 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 382 of file BDOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ KeyChanged()

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

Indicate that the key for a particular object has changed.

Definition at line 230 of file BDOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ Lookat()

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

◆ Lookup() [1/2]

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

‍**

Returns location of object as well as object key.

Definition at line 282 of file BDOpenClosed.h.

References kUnseen.

◆ Lookup() [2/2]

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

◆ OpenReadySize()

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

◆ OpenSize()

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

◆ OpenWaitingSize()

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

◆ Peek()

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

Peek at the next item to be expanded.

Definition at line 297 of file BDOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ PeekAt()

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

Peek at the next item to be expanded.

Definition at line 314 of file BDOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ PutToReady()

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

Definition at line 349 of file BDOpenClosed.h.

References kOpenReady, and kOpenWaiting.

◆ Remove()

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

Definition at line 249 of file BDOpenClosed.h.

References kClosed.

◆ Reset()

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

Remove all objects from queue.

Definition at line 169 of file BDOpenClosed.h.

◆ size()

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

◆ ValidateOpenReady()

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

◆ ValidateOpenWaiting()

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

◆ verifyData()

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

Member Data Documentation

◆ elements

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

◆ priorityQueues

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

◆ table

template<typename state , typename CmpKey0 , typename CmpKey1 , class dataStructure = BDOpenClosedData<state>>
std::unordered_map<uint64_t, size_t> BDOpenClosed< state, CmpKey0, CmpKey1, dataStructure >::table
private

Definition at line 127 of file BDOpenClosed.h.


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