public class StateEnumerator
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected Domain |
domain
The domain whose states will be enumerated
|
protected java.util.Map<HashableState,java.lang.Integer> |
enumeration
The forward state enumeration map
|
protected HashableStateFactory |
hashingFactory
The hashing factory used to hash states and perform equality tests
|
protected int |
nextEnumeratedID
The id to use for the next unique state that is added
|
protected java.util.Map<java.lang.Integer,State> |
reverseEnumerate
The reverse enumeration id to state map
|
Constructor and Description |
---|
StateEnumerator(Domain domain,
HashableStateFactory hashingFactory)
Constructs
|
Modifier and Type | Method and Description |
---|---|
void |
findReachableStatesAndEnumerate(State from)
Finds all states that are reachable from an input state and enumerates them
|
protected int |
getEnumeratedID(HashableState sh)
Get or create and get the enumeration id for a hashed state
|
int |
getEnumeratedID(State s)
Get or create and get the enumeration id for a state
|
State |
getStateForEnumerationId(int id)
Returns the state associated with the given enumeration id.
|
int |
numStatesEnumerated()
Returns the number of states that have been enumerated
|
protected Domain domain
protected HashableStateFactory hashingFactory
protected java.util.Map<HashableState,java.lang.Integer> enumeration
protected java.util.Map<java.lang.Integer,State> reverseEnumerate
protected int nextEnumeratedID
public StateEnumerator(Domain domain, HashableStateFactory hashingFactory)
domain
- the domain of the states to be enumeratedhashingFactory
- the hashing factory to usepublic void findReachableStatesAndEnumerate(State from)
from
- the state from which all reachable states should be searchedpublic int getEnumeratedID(State s)
s
- the state to get the enumeration idpublic State getStateForEnumerationId(int id)
id
- the enumeration idpublic int numStatesEnumerated()
protected int getEnumeratedID(HashableState sh)
sh
- the hased state to get the enumeration id