org.eclipse.emf.henshin.statespace.impl
Class StateExplorer

java.lang.Object
  extended by org.eclipse.emf.henshin.statespace.impl.StateExplorer

public class StateExplorer
extends Object

Helper class for exploring states. This forms the bridge between a StateSpaceManager and an Engine. This class tries to minimize the number of created short living objects to improve the performance. Instances of this class must not be used concurrently!


Constructor Summary
StateExplorer(StateSpaceIndex index)
          Default constructor.
 
Method Summary
 Model deriveModel(Path path, Model sourceModel)
          Derive a model using a path and a given start model.
 Model deriveModel(State state, boolean fromInitial)
          Derive a model.
 List<Transition> doExplore(State state)
          Explore a state without actually changing the state space.
 Match getLastResultMatch()
          Get the last result match used during the derivation of a model.
 Match getMatch(Transition transition, Model sourceModel)
          Get the match for a given transition.
 boolean isGoalState(State state)
          Check whether a state is a goal state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StateExplorer

public StateExplorer(StateSpaceIndex index)
Default constructor.

Method Detail

doExplore

public List<Transition> doExplore(State state)
                           throws StateSpaceException
Explore a state without actually changing the state space. This method does not check if the state is explored already or whether any of the transitions or states exists already.

Parameters:
state - State to be explored.
Throws:
StateSpaceException - On explore errors.

isGoalState

public boolean isGoalState(State state)
                    throws StateSpaceException
Check whether a state is a goal state.

Parameters:
state - State to be checked.
Throws:
StateSpaceException

deriveModel

public Model deriveModel(State state,
                         boolean fromInitial)
                  throws StateSpaceException
Derive a model.

Parameters:
State - state.
fromInitial - Whether to derive it from an initial state.
Returns:
The derived model.
Throws:
StateSpaceException - On errors.

deriveModel

public Model deriveModel(Path path,
                         Model sourceModel)
                  throws StateSpaceException
Derive a model using a path and a given start model.

Parameters:
path - Path.
sourceModel - Source model.
Returns:
The derived model.
Throws:
StateSpaceException - On errors.

getMatch

public Match getMatch(Transition transition,
                      Model sourceModel)
               throws StateSpaceException
Get the match for a given transition.

Parameters:
transition - The transition.
sourceModel - The model of the source state.
Returns:
The match.
Throws:
StateSpaceException - On state space errors.

getLastResultMatch

public Match getLastResultMatch()
Get the last result match used during the derivation of a model.

Returns:
The last used result match.