public class DesignSpaceManager extends java.lang.Object implements IDesignSpaceManager, IRuleApplicationChanger
IGetCertainTransitions.FilterOptions
Constructor and Description |
---|
DesignSpaceManager(ThreadContext context,
org.eclipse.emf.common.notify.Notifier model,
org.eclipse.emf.edit.domain.EditingDomain domain,
IStateCoderFactory factory,
IDesignSpace designSpace,
TrajectoryInfo trajectory,
org.eclipse.viatra.transformation.evm.api.RuleEngine ruleEngine,
org.eclipse.viatra.query.runtime.api.ViatraQueryEngine engine) |
Modifier and Type | Method and Description |
---|---|
SolutionTrajectory |
createSolutionTrajectroy()
Creates a
SolutionTrajectory object that leads to the state returned by
IDesignSpaceManager.getCurrentState() . |
void |
deregisterExploreEventHandler(IExploreEventHandler handler) |
void |
fireActivation(ITransition transition)
Calling this method will execute the transformation denoted by
transitionToFire , and updates
the DesignSpace to reflect the changes. |
org.eclipse.viatra.transformation.evm.api.Activation<?> |
getActivationByTransitionId(ITransition transition) |
IState |
getCurrentState()
Returns the
state in from the design space which corresponds to this
processing thread's working model's state. |
java.util.List<java.lang.Object> |
getTrajectoryFromRoot()
Returns the current trajectory from the root (along the "undo transitions").
|
java.util.List<java.lang.Object> |
getTrajectoryFromRootAcyclic()
Returns the current trajectory from the root without cycles in it.
|
java.util.List<java.lang.Object> |
getTrajectoryFromRootAcyclicShortest()
Returns the shortest trajectory from the root to the current state.
|
TrajectoryInfo |
getTrajectoryInfo()
Returns the
TrajectoryInfo object of this processing thread. |
ITransition |
getTransitionByActivation(org.eclipse.viatra.transformation.evm.api.Activation<?> activation) |
java.util.Collection<? extends ITransition> |
getTransitionsFromCurrentState()
Return all of the
ITransition s which start from the current IState . |
java.util.Collection<? extends ITransition> |
getTransitionsFromCurrentState(IGetCertainTransitions.FilterOptions filter)
Return the
ITransition s which start from the current IState filtered by the IGetCertainTransitions.FilterOptions . |
java.util.List<? extends ITransition> |
getUntraversedTransitionsOnBackWay(int numOfStatesBack)
|
java.util.List<? extends ITransition> |
getUntraversedTransitionsWithMaximumDistanceOf(int distance)
Returns all untraversed
ITransition s which are start from the IState s which are not farther away
then the distance . |
boolean |
isCurentStateInTrajectory() |
boolean |
isNewModelStateAlreadyTraversed()
Returns true if the given state is not owned by this crawler.
|
void |
registerActivationCostProcessor(java.lang.String name,
DSETransformationRule<?,?> rule,
ActivationFitnessProcessor activationFitnessProcessor) |
void |
registerExploreEventHandler(IExploreEventHandler handler) |
void |
saveDesignSpace()
Saves the internal state of the design space in some form.
|
void |
setiRuleApplicationNumberChanged(IRuleApplicationNumberChanged iRuleApplicationNumberChanged)
Set a listener for firing or undoing a transition.
|
boolean |
tryFireActivation(ITransition transition) |
boolean |
undoLastTransformation()
Undoes the last fired transformation.
|
void |
undoUntilRoot() |
public DesignSpaceManager(ThreadContext context, org.eclipse.emf.common.notify.Notifier model, org.eclipse.emf.edit.domain.EditingDomain domain, IStateCoderFactory factory, IDesignSpace designSpace, TrajectoryInfo trajectory, org.eclipse.viatra.transformation.evm.api.RuleEngine ruleEngine, org.eclipse.viatra.query.runtime.api.ViatraQueryEngine engine)
public void fireActivation(ITransition transition)
IDesignSpaceManager
transitionToFire
, and updates
the DesignSpace to reflect the changes.fireActivation
in interface IDesignSpaceManager
public boolean tryFireActivation(ITransition transition)
public ITransition getTransitionByActivation(org.eclipse.viatra.transformation.evm.api.Activation<?> activation)
public org.eclipse.viatra.transformation.evm.api.Activation<?> getActivationByTransitionId(ITransition transition)
public boolean isNewModelStateAlreadyTraversed()
isNewModelStateAlreadyTraversed
in interface IDesignSpaceManager
public java.util.List<java.lang.Object> getTrajectoryFromRoot()
IDesignSpaceManager
ITransition
. If the initial state is a Goal state, the
List contains no Transitions.getTrajectoryFromRoot
in interface IDesignSpaceManager
public java.util.List<java.lang.Object> getTrajectoryFromRootAcyclic()
IDesignSpaceManager
Transition
. If the initial state is a Goal state, the
List contains no Transitions.getTrajectoryFromRootAcyclic
in interface IDesignSpaceManager
public java.util.List<java.lang.Object> getTrajectoryFromRootAcyclicShortest()
IDesignSpaceManager
Transition
. If the initial state is a Goal state, the
List contains no Transitions.getTrajectoryFromRootAcyclicShortest
in interface IDesignSpaceManager
public java.util.Collection<? extends ITransition> getTransitionsFromCurrentState()
IGetCertainTransitions
ITransition
s which start from the current IState
.getTransitionsFromCurrentState
in interface IGetCertainTransitions
public java.util.Collection<? extends ITransition> getTransitionsFromCurrentState(IGetCertainTransitions.FilterOptions filter)
IGetCertainTransitions
ITransition
s which start from the current IState
filtered by the IGetCertainTransitions.FilterOptions
.getTransitionsFromCurrentState
in interface IGetCertainTransitions
filter
- Filter options.IGetCertainTransitions.FilterOptions
public java.util.List<? extends ITransition> getUntraversedTransitionsOnBackWay(int numOfStatesBack)
IGetCertainTransitions
ITransition
s which are start from the numOfStatesBack
previous
IState
s. Returns the ones along the way back too, not only the one last state's.getUntraversedTransitionsOnBackWay
in interface IGetCertainTransitions
numOfStatesBack
- The number of states to fall back.public java.util.List<? extends ITransition> getUntraversedTransitionsWithMaximumDistanceOf(int distance)
IGetCertainTransitions
ITransition
s which are start from the IState
s which are not farther away
then the distance
. Distance means hops along the transitions. If the distance is 0, it returns the same
Transition
s as IGetCertainTransitions#getUntraversedTransitionsFromCurrentState()
.getUntraversedTransitionsWithMaximumDistanceOf
in interface IGetCertainTransitions
distance
- The distance.public boolean undoLastTransformation()
IDesignSpaceManager
undoLastTransformation
in interface IDesignSpaceManager
public void undoUntilRoot()
public IState getCurrentState()
IDesignSpaceManager
state
in from the design space
which corresponds to this
processing thread's working model's state.getCurrentState
in interface IDesignSpaceManager
IState
object.public void setiRuleApplicationNumberChanged(IRuleApplicationNumberChanged iRuleApplicationNumberChanged)
IRuleApplicationChanger
setiRuleApplicationNumberChanged
in interface IRuleApplicationChanger
iRuleApplicationNumberChanged
- The listener.public SolutionTrajectory createSolutionTrajectroy()
IDesignSpaceManager
SolutionTrajectory
object that leads to the state
returned by
IDesignSpaceManager.getCurrentState()
.createSolutionTrajectroy
in interface IDesignSpaceManager
SolutionTrajectory
object.public TrajectoryInfo getTrajectoryInfo()
IDesignSpaceManager
TrajectoryInfo
object of this processing thread.getTrajectoryInfo
in interface IDesignSpaceManager
TrajectoryInfo
object.public void saveDesignSpace()
IDesignSpaceManager
saveDesignSpace
in interface IDesignSpaceManager
public void registerExploreEventHandler(IExploreEventHandler handler)
public void deregisterExploreEventHandler(IExploreEventHandler handler)
public void registerActivationCostProcessor(java.lang.String name, DSETransformationRule<?,?> rule, ActivationFitnessProcessor activationFitnessProcessor)
public boolean isCurentStateInTrajectory()