HOG2
|
#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, AHash64 > | IndexTable |
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 |
Definition at line 74 of file AStarOpenClosed.h.
|
private |
Definition at line 115 of file AStarOpenClosed.h.
AStarOpenClosed< state, CmpKey, dataStructure >::AStarOpenClosed |
Definition at line 122 of file AStarOpenClosed.h.
AStarOpenClosed< state, CmpKey, dataStructure >::~AStarOpenClosed |
Definition at line 127 of file AStarOpenClosed.h.
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.
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.
uint64_t AStarOpenClosed< 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 146 of file AStarOpenClosed.h.
Referenced by ImprovedOptimisticSearch< state, action, environment >::AddAdditionalStartState(), ImprovedOptimisticSearch< state, action, environment >::DoGreedyStep(), ImprovedOptimisticSearch< state, action, environment >::DoOptimalStep(), and ImprovedOptimisticSearch< state, action, environment >::InitializeSearch().
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.
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.
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().
|
inline |
Definition at line 94 of file AStarOpenClosed.h.
Referenced by ImprovedOptimisticSearch< state, action, environment >::DoGreedyStep().
|
inline |
Definition at line 102 of file AStarOpenClosed.h.
Referenced by ImprovedOptimisticSearch< state, action, environment >::PrintStats().
|
inline |
Definition at line 104 of file AStarOpenClosed.h.
|
inline |
Definition at line 100 of file AStarOpenClosed.h.
Referenced by AStarEpsilon< state, action, environment >::GetFocalItem(), OptimisticSearch< state, action, environment >::GetFocalItem(), AStarEpsilon< state, action, environment >::GetOpenItem(), OptimisticSearch< state, action, environment >::GetOpenItem(), ImprovedOptimisticSearch< state, action, environment >::GetOpenItem(), PEAStar< state, action, environment >::GetOpenItem(), and EPEAStar< state, action, environment >::GetOpenItem().
|
private |
Definition at line 363 of file AStarOpenClosed.h.
|
private |
Moves a node up the heap.
Returns true if the node was moved, false otherwise.
Definition at line 343 of file AStarOpenClosed.h.
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().
|
inline |
Definition at line 87 of file AStarOpenClosed.h.
Referenced by ImprovedOptimisticSearch< state, action, environment >::Draw(), ImprovedOptimisticSearch< state, action, environment >::GetClosedListGCost(), AStarEpsilon< state, action, environment >::GetFocalItem(), OptimisticSearch< state, action, environment >::GetFocalItem(), AStarEpsilon< state, action, environment >::GetItem(), PEAStar< state, action, environment >::GetItem(), OptimisticSearch< state, action, environment >::GetItem(), EPEAStar< state, action, environment >::GetItem(), AStarEpsilon< state, action, environment >::GetOpenItem(), OptimisticSearch< state, action, environment >::GetOpenItem(), PEAStar< state, action, environment >::GetOpenItem(), EPEAStar< state, action, environment >::GetOpenItem(), and ImprovedOptimisticSearch< state, action, environment >::GetOpenListGCost().
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().
|
inline |
Definition at line 86 of file AStarOpenClosed.h.
|
inline |
Definition at line 101 of file AStarOpenClosed.h.
Referenced by AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::ClosedSize(), ImprovedOptimisticSearch< state, action, environment >::DoSingleSearchStep(), ImprovedOptimisticSearch< state, action, environment >::Draw(), AStarEpsilon< state, action, environment >::GetNumFocalItems(), OptimisticSearch< state, action, environment >::GetNumFocalItems(), AStarEpsilon< state, action, environment >::GetNumOpenItems(), OptimisticSearch< state, action, environment >::GetNumOpenItems(), ImprovedOptimisticSearch< state, action, environment >::GetNumOpenItems(), PEAStar< state, action, environment >::GetNumOpenItems(), EPEAStar< state, action, environment >::GetNumOpenItems(), and ImprovedOptimisticSearch< state, action, environment >::PrintStats().
uint64_t AStarOpenClosed< state, CmpKey, dataStructure >::Peek |
Peek at the next item to be expanded.
Definition at line 280 of file AStarOpenClosed.h.
Referenced by OptimisticSearch< state, action, environment >::CheckNextFocalNode(), ImprovedOptimisticSearch< state, action, environment >::CheckNextNode(), OptimisticSearch< state, action, environment >::CheckNextOpenNode(), and ImprovedOptimisticSearch< state, action, environment >::Draw().
void AStarOpenClosed< state, CmpKey, dataStructure >::Remove | ( | uint64_t | hash | ) |
Remove item from open/closed.
Definition at line 237 of file AStarOpenClosed.h.
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().
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().
|
inline |
Definition at line 103 of file AStarOpenClosed.h.
Referenced by AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::ClosedSize(), ImprovedOptimisticSearch< state, action, environment >::Draw(), ImprovedOptimisticSearch< state, action, environment >::GetMemoryUsage(), AStarEpsilon< state, action, environment >::GetNumItems(), ImprovedOptimisticSearch< state, action, environment >::GetNumItems(), PEAStar< state, action, environment >::GetNumItems(), OptimisticSearch< state, action, environment >::GetNumItems(), and EPEAStar< state, action, environment >::GetNumItems().
|
private |
Definition at line 117 of file AStarOpenClosed.h.
Referenced by AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::CloseAllOnOpen(), AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::Lookat(), AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::Lookup(), and AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::size().
|
private |
Definition at line 116 of file AStarOpenClosed.h.
|
private |
Definition at line 112 of file AStarOpenClosed.h.
Referenced by AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::CloseAllOnOpen(), AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::empty(), AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::GetOpenItem(), and AStarOpenClosed< state, IOSCompare< state >, IOSOpenClosedData< state > >::OpenSize().