|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object avrora.stack.StateTransitionGraph
Nested Class Summary | |
static class |
StateTransitionGraph.Edge
The Edge inner class represents a bidirectional edge between two states. |
static class |
StateTransitionGraph.EdgeList
|
static class |
StateTransitionGraph.StateInfo
The StateInfo class is a representation of both the forward and backward edge list
corresponding to a node in the state transition graph. |
static class |
StateTransitionGraph.StateList
|
Constructor Summary | |
StateTransitionGraph(Program p)
The constructor for the StateTransitionGraph class constructs a new state transition
graph, with a state cache. |
Method Summary | |
StateTransitionGraph.Edge |
addEdge(StateCache.State s,
int type,
int weight,
StateCache.State t)
The addEdge() method adds an edge between two states in the state transition graph. |
void |
addFrontierState(StateCache.State s)
The addFrontierState method adds a state to the frontier. |
void |
deleteStateSets()
|
void |
dump(Printer p)
|
StateCache.State |
getCachedState(MutableState s)
The getCachedState() method looks for the a cached, immutable state that corresponds to
the given mutable state. |
StateCache.State |
getEdenState()
|
long |
getEdgeCount()
|
long |
getExploredCount()
|
long |
getFrontierCount()
|
StateCache.State |
getNextFrontierState()
The getNextFrontierState() chooses a state off of the state frontier, removes it from the
state frontier, and returns it. |
StateCache |
getStateCache()
The getStateCache() method gets the cache of all the states in the state space. |
boolean |
isExplored(StateCache.State s)
The isExplored() method tests whether a given state has been explored before. |
boolean |
isFrontier(StateCache.State s)
The isFrontier() method tests whether a given state is currently in the frontier list of
the state transition graph. |
StateCache.Set |
newSet()
|
void |
setExplored(StateCache.State s)
The setExplored() method marks the given state as having been explored. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public StateTransitionGraph(Program p)
StateTransitionGraph
class constructs a new state transition
graph, with a state cache. The program passed is used as an approximation of the possible size of the
state space.
p
- the program to create a state transition graph for.Method Detail |
public StateCache.State getCachedState(MutableState s)
getCachedState()
method looks for the a cached, immutable state that corresponds to
the given mutable state. If there is no cached state yet, it will create and return a new one.
s
- the mutable state to look for
StateCache.State
classpublic StateTransitionGraph.Edge addEdge(StateCache.State s, int type, int weight, StateCache.State t)
addEdge()
method adds an edge between two states in the state transition graph. The
edge has a type and a weight.
s
- the source node of the edgetype
- the type of the edge as an integerweight
- the weight of the edge as an integert
- the target node of the edgepublic StateCache.State getNextFrontierState()
getNextFrontierState()
chooses a state off of the state frontier, removes it from the
state frontier, and returns it. If there are no states left on the state frontier, this method returns
null. Note that initially only the eden state is on the frontier.
public void addFrontierState(StateCache.State s)
addFrontierState
method adds a state to the frontier.
s
- the state to addpublic boolean isExplored(StateCache.State s)
isExplored()
method tests whether a given state has been explored before.
s
- the cached state to test whether it is explored
public void setExplored(StateCache.State s)
setExplored()
method marks the given state as having been explored. A state cannot
both be explored and be on the frontier; thus this method will throw a fatal error if the given state
is marked as on the frontier.
s
- the state to mark as exploredpublic boolean isFrontier(StateCache.State s)
isFrontier()
method tests whether a given state is currently in the frontier list of
the state transition graph.
s
- the state to test whether it is on the frontier
public StateCache getStateCache()
getStateCache()
method gets the cache of all the states in the state space.
public StateCache.State getEdenState()
public long getFrontierCount()
public long getEdgeCount()
public long getExploredCount()
public StateCache.Set newSet()
public void deleteStateSets()
public void dump(Printer p)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |