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

#include <BucketOpenClosed.h>

Classes

struct  qData
 

Public Member Functions

 BucketOpenClosed ()
 
 ~BucketOpenClosed ()
 
void Reset ()
 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 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 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)
 
size_t OpenSize () const
 
size_t ClosedSize () const
 
size_t size () const
 
void Print ()
 

Private Types

typedef std::unordered_map< uint64_t, uint64_t, AHash64IndexTable
 

Private Member Functions

void FindNewMin ()
 
uint64_t Add (uint64_t key, uint64_t fCost)
 
void Remove (uint64_t key, uint64_t fCost)
 

Private Attributes

int openCount
 
int minBucket
 
int minSubBucket
 
std::vector< qDatapQueue
 
IndexTable table
 
std::vector< dataStructure > elements
 

Detailed Description

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

Definition at line 16 of file BucketOpenClosed.h.

Member Typedef Documentation

◆ IndexTable

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

Definition at line 51 of file BucketOpenClosed.h.

Constructor & Destructor Documentation

◆ BucketOpenClosed()

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

Definition at line 57 of file BucketOpenClosed.h.

◆ ~BucketOpenClosed()

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

Definition at line 64 of file BucketOpenClosed.h.

Member Function Documentation

◆ Add()

template<typename state , typename CmpKey , class dataStructure >
uint64_t BucketOpenClosed< state, CmpKey, dataStructure >::Add ( uint64_t  key,
uint64_t  fCost 
)
private

Definition at line 310 of file BucketOpenClosed.h.

◆ AddClosedNode()

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

References kClosedList, and kTAStarNoNode.

◆ AddOpenNode()

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

Add object into open list.

Definition at line 101 of file BucketOpenClosed.h.

References kOpenList, and kTAStarNoNode.

◆ Close()

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

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

Definition at line 208 of file BucketOpenClosed.h.

References kClosedList.

◆ ClosedSize()

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

◆ FindNewMin()

template<typename state , typename CmpKey , class dataStructure >
void BucketOpenClosed< state, CmpKey, dataStructure >::FindNewMin
private

Definition at line 242 of file BucketOpenClosed.h.

◆ GetOpenItem()

template<typename state , typename CmpKey , class dataStructure >
uint64_t BucketOpenClosed< state, CmpKey, dataStructure >::GetOpenItem ( unsigned int  which)

Definition at line 274 of file BucketOpenClosed.h.

References kOpenList.

◆ KeyChanged()

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

Indicate that the key for a particular object has changed.

Definition at line 141 of file BucketOpenClosed.h.

◆ Lookat()

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

◆ Lookup() [1/2]

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

Returns location of object as well as object key.

Definition at line 176 of file BucketOpenClosed.h.

References kNotFound.

◆ Lookup() [2/2]

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

◆ OpenSize()

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

◆ Peek()

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

Peek at the next item to be expanded.

Definition at line 193 of file BucketOpenClosed.h.

◆ Print()

template<typename state , typename CmpKey , class dataStructure >
void BucketOpenClosed< state, CmpKey, dataStructure >::Print

Definition at line 290 of file BucketOpenClosed.h.

◆ Remove()

template<typename state , typename CmpKey , class dataStructure >
void BucketOpenClosed< state, CmpKey, dataStructure >::Remove ( uint64_t  key,
uint64_t  fCost 
)
private

Definition at line 335 of file BucketOpenClosed.h.

◆ Reopen()

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

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

Definition at line 229 of file BucketOpenClosed.h.

References kClosedList, and kOpenList.

◆ Reset()

template<typename state , typename CmpKey , class dataStructure >
void BucketOpenClosed< state, CmpKey, dataStructure >::Reset

Remove all objects from queue.

Definition at line 72 of file BucketOpenClosed.h.

◆ size()

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

Member Data Documentation

◆ elements

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

◆ minBucket

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
int BucketOpenClosed< state, CmpKey, dataStructure >::minBucket
private

Definition at line 43 of file BucketOpenClosed.h.

◆ minSubBucket

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
int BucketOpenClosed< state, CmpKey, dataStructure >::minSubBucket
private

Definition at line 43 of file BucketOpenClosed.h.

◆ openCount

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
int BucketOpenClosed< state, CmpKey, dataStructure >::openCount
private

◆ pQueue

template<typename state , typename CmpKey , class dataStructure = AStarOpenClosedData<state>>
std::vector<qData> BucketOpenClosed< state, CmpKey, dataStructure >::pQueue
private

Definition at line 49 of file BucketOpenClosed.h.

◆ table

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

Definition at line 52 of file BucketOpenClosed.h.


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