org.eclipse.emf.henshin.statespace
Interface StateSpaceManager

All Superinterfaces:
StateSpaceIndex
All Known Implementing Classes:
BasicStateSpaceManager, ParallelStateSpaceManager, ProfilingStateSpaceManager

public interface StateSpaceManager
extends StateSpaceIndex

Interface for state space managers. State managers are used to modify and explore state spaces. They extend the functionality of state space indexes.


Field Summary
static boolean DEBUG_ENFORCE_DETERMINISM
          Debug flag: enforces deterministic behavior of state space manager.
 
Method Summary
 State createInitialState(Model model)
          Create a new initial state to the state space.
 List<State> exploreStates(List<State> states, boolean generateLocations)
          Explore a state.
 int getNumThreads()
          Get the number of threads used by this state manager.
 int getStateDistance(State state)
          Get the shortest distance of a state from an arbitrary initial state.
 List<State> mergeTerminalStates()
          Merge all terminal states
 List<State> removeState(State state)
          Remove a state from the state space.
 void resetStateSpace(boolean removeInitial)
          Reset the state space managed by this instance.
 void shutdown()
          Shutdown this state space manager.
 
Methods inherited from interface org.eclipse.emf.henshin.statespace.StateSpaceIndex
clearCache, getCachedModel, getModel, getState, getStateSpace
 

Field Detail

DEBUG_ENFORCE_DETERMINISM

static final boolean DEBUG_ENFORCE_DETERMINISM
Debug flag: enforces deterministic behavior of state space manager.

See Also:
Constant Field Values
Method Detail

createInitialState

State createInitialState(Model model)
                         throws StateSpaceException
Create a new initial state to the state space. This throws a runtime exception if the state is not contained in a resource. If there is already a state for it, it is returned instead.

Parameters:
model - Model of the initial state.
Returns:
The newly created state.
Throws:
StateSpaceException - If the state space contains errors.

removeState

List<State> removeState(State state)
                        throws StateSpaceException
Remove a state from the state space. Unreachable states are automatically removed afterwards and the open-attributes are updated.

Parameters:
state - State to be removed.
Returns:
List of removed states.
Throws:
StateSpaceException - If the state space contains errors.

mergeTerminalStates

List<State> mergeTerminalStates()
                                throws StateSpaceException
Merge all terminal states

Returns:
List of removed states.
Throws:
StateSpaceException - If the state space contains errors.

exploreStates

List<State> exploreStates(List<State> states,
                          boolean generateLocations)
                          throws StateSpaceException
Explore a state. This computes all outgoing transitions and their target states and adds them to the state space if they do not exist yet.

Parameters:
state - State to be explored.
generateLocation - Whether to generate a location for the new states.
Returns:
List of newly created successor states.
Throws:
StateSpaceException - If the state space contains errors.

getStateDistance

int getStateDistance(State state)
Get the shortest distance of a state from an arbitrary initial state. Implementations should provide this method if the maximum state distance property of the state space is non-negative.

Parameters:
state - State.
Returns:
Its distance from an initial state.

resetStateSpace

void resetStateSpace(boolean removeInitial)
                     throws StateSpaceException
Reset the state space managed by this instance. This removes all derived states and all transitions.

Parameters:
remobeInitial - Determines whether also initial states should be removed.
Throws:
StateSpaceException - On errors.

getNumThreads

int getNumThreads()
Get the number of threads used by this state manager.

Returns:
The number of used threads.

shutdown

void shutdown()
Shutdown this state space manager.