spot
1.2.6
|
A straightforward implementation of numbered_state_heap with a hash map. More...
#include <tgbaalgos/gtec/nsheap.hh>
Public Types | |
typedef Sgi::hash_map< const state *, int, state_ptr_hash, state_ptr_equal > | hash_type |
typedef std::pair< const state *, int * > | state_index_p |
typedef std::pair< const state *, int > | state_index |
Public Member Functions | |
virtual state_index | find (const state *s) const |
Is state in the heap? More... | |
virtual state_index_p | find (const state *s) |
virtual state_index | index (const state *s) const |
Return the index of an existing state. More... | |
virtual state_index_p | index (const state *s) |
virtual void | insert (const state *s, int index) |
Add a new state s with index index. More... | |
virtual int | size () const |
The number of stored states. More... | |
virtual numbered_state_heap_const_iterator * | iterator () const |
Return an iterator on the states/indexes pairs. More... | |
Protected Attributes | |
hash_type | h |
Map of visited states. More... | |
A straightforward implementation of numbered_state_heap with a hash map.
|
virtual |
Is state in the heap?
Returns a pair (0,0) if s is not in the heap. or a pair (p, i) if there is a clone p of s i in the heap with index. If s is in the heap and is different from p it will be freed.
These functions are called by the algorithm to check whether a successor is a new state to explore or an already visited state.
These functions can be redefined to search for more than an equal match. For example we could redefine it to check state inclusion.
Implements spot::numbered_state_heap.
|
virtual |
Return the index of an existing state.
This is mostly similar to find(), except it will be called for state which we know are already in the heap, or for state which may not be in the heap but for which it is always OK to do equality checks.
Implements spot::numbered_state_heap.
|
virtual |
Add a new state s with index index.
Implements spot::numbered_state_heap.
|
virtual |
Return an iterator on the states/indexes pairs.
Implements spot::numbered_state_heap.
|
virtual |
The number of stored states.
Implements spot::numbered_state_heap.
|
protected |
Map of visited states.