public class ThreadContext extends java.lang.Object implements IDseStrategyContext
GlobalContext
.Constructor and Description |
---|
ThreadContext(GlobalContext globalContext,
IStrategy strategy,
org.eclipse.emf.common.notify.Notifier model)
Creates a
ThreadContext and sets it up to be initialized on the given TransactionalEditingDomain |
public ThreadContext(GlobalContext globalContext, IStrategy strategy, org.eclipse.emf.common.notify.Notifier model)
ThreadContext
and sets it up to be initialized on the given TransactionalEditingDomain
globalContext
- strategyBase
- domain
- trajectoryInfoToClone
- parentGuidance
- public DseConflictResolver getConflictResolver()
public ConflictSet getConflictSet()
public void init() throws DSEException
ThreadContext
by initializing the underlying ViatraQueryEngine
and
RuleEngine
. Guidance
initialization is also happening within this method.init
in interface IDseStrategyContext
ViatraQueryException
DSEException
public Fitness calculateFitness()
calculateFitness
in interface IDseStrategyContext
public boolean checkGlobalConstraints()
checkGlobalConstraints
in interface IDseStrategyContext
public RuleEngine getRuleEngine()
getRuleEngine
in interface IDseStrategyContext
public GlobalContext getGlobalContext()
getGlobalContext
in interface IDseStrategyContext
public DesignSpaceManager getDesignSpaceManager()
getDesignSpaceManager
in interface IDseStrategyContext
public org.eclipse.emf.edit.domain.EditingDomain getEditingDomain()
getEditingDomain
in interface IDseStrategyContext
public org.eclipse.emf.common.notify.Notifier getModel()
getModel
in interface IDseStrategyContext
public ViatraQueryEngine getQueryEngine()
getQueryEngine
in interface IDseStrategyContext
public IStrategy getStrategy()
getStrategy
in interface IDseStrategyContext
public ExplorerThread getExplorerThread()
getExplorerThread
in interface IDseStrategyContext
public void setExplorerThread(ExplorerThread explorerThread)
public Fitness getLastFitness()
getLastFitness
in interface IDseStrategyContext
public ObjectiveComparatorHelper getObjectiveComparatorHelper()
getObjectiveComparatorHelper
in interface IDseStrategyContext
public IObjective[][] getLeveledObjectives()
getLeveledObjectives
in interface IDseStrategyContext
public java.util.List<IObjective> getObjectives()
getObjectives
in interface IDseStrategyContext
public java.util.List<IGlobalConstraint> getGlobalConstraints()
getGlobalConstraints
in interface IDseStrategyContext
public SolutionStore getSolutionStore()
getSolutionStore
in interface IDseStrategyContext
public void newSolution()
newSolution
in interface IDseStrategyContext
public java.lang.Object getSharedObject()
getSharedObject
in interface IDseStrategyContext
public void setSharedObject(java.lang.Object sharedObject)
setSharedObject
in interface IDseStrategyContext
public java.util.Set<BatchTransformationRule<?,?>> getRules()
getRules
in interface IDseStrategyContext
public BatchTransformationRule<?,?> getRuleByRuleSpecification(RuleSpecification<?> ruleSpecification)
getRuleByRuleSpecification
in interface IDseStrategyContext
public ExplorerThread tryStartNewThread(IStrategy strategy)
tryStartNewThread
in interface IDseStrategyContext
public ExplorerThread tryStartNewThreadWithoutModelClone(IStrategy strategy)
tryStartNewThreadWithoutModelClone
in interface IDseStrategyContext
public void startAllThreads(IStrategyFactory strategyFactory)
startAllThreads
in interface IDseStrategyContext
public IStateCoder getStateCoder()
getStateCoder
in interface IDseStrategyContext
public IDesignSpace getDesignSpace()
getDesignSpace
in interface IDseStrategyContext
public TrajectoryInfo getTrajectoryInfo()
getTrajectoryInfo
in interface IDseStrategyContext
public java.util.List<java.lang.Object> getTrajectory()
getTrajectory
in interface IDseStrategyContext
public java.util.List<java.lang.Object> getTrajectoryCopied()
getTrajectoryCopied
in interface IDseStrategyContext
public int getDepth()
getDepth
in interface IDseStrategyContext
public java.lang.Object getCurrentStateId()
getCurrentStateId
in interface IDseStrategyContext
public java.lang.Object getTransitionByActivation(Activation<?> activation)
getTransitionByActivation
in interface IDseStrategyContext
public Activation<?> getActivationById(java.lang.Object activationId)
getActivationById
in interface IDseStrategyContext
public BatchTransformationRule<?,?> getRuleByActivation(Activation<?> activation)
getRuleByActivation
in interface IDseStrategyContext
public BatchTransformationRule<?,?> getRuleByActivationId(java.lang.Object activationId)
getRuleByActivationId
in interface IDseStrategyContext
public java.util.Collection<java.lang.Object> getCurrentActivationIds()
getCurrentActivationIds
in interface IDseStrategyContext
public java.util.Collection<java.lang.Object> getUntraversedActivationIds()
getUntraversedActivationIds
in interface IDseStrategyContext
public void executeAcitvationId(java.lang.Object activationId)
executeAcitvationId
in interface IDseStrategyContext
public boolean tryExecuteAcitvationId(java.lang.Object activationId)
tryExecuteAcitvationId
in interface IDseStrategyContext
public boolean executeRandomActivationId()
executeRandomActivationId
in interface IDseStrategyContext
public void executeTrajectory(java.lang.Object[] activationIds)
executeTrajectory
in interface IDseStrategyContext
public void executeTrajectory(java.lang.Object[] activationIds, int fromIncludedIndex, int toExcludedIndex)
executeTrajectory
in interface IDseStrategyContext
public int executeTrajectoryByTrying(java.lang.Object[] activationIds)
executeTrajectoryByTrying
in interface IDseStrategyContext
public int executeTrajectoryByTrying(java.lang.Object[] activationIds, int fromIncludedIndex, int toExcludedIndex)
executeTrajectoryByTrying
in interface IDseStrategyContext
public int executeTrajectoryWithoutStateCoding(java.lang.Object[] activationIds)
executeTrajectoryWithoutStateCoding
in interface IDseStrategyContext
public int executeTrajectoryWithoutStateCoding(java.lang.Object[] activationIds, int fromIncludedIndex, int toExcludedIndex)
executeTrajectoryWithoutStateCoding
in interface IDseStrategyContext
public int executeTrajectoryByTryingWithoutStateCoding(java.lang.Object[] activationIds)
executeTrajectoryByTryingWithoutStateCoding
in interface IDseStrategyContext
public int executeTrajectoryByTryingWithoutStateCoding(java.lang.Object[] activationIds, int fromIncludedIndex, int toExcludedIndex)
executeTrajectoryByTryingWithoutStateCoding
in interface IDseStrategyContext
public void executeTrajectoryWithMinimalBacktrack(java.lang.Object[] trajectory)
executeTrajectoryWithMinimalBacktrack
in interface IDseStrategyContext
public void executeTrajectoryWithMinimalBacktrack(java.lang.Object[] trajectory, int toExcludedIndex)
executeTrajectoryWithMinimalBacktrack
in interface IDseStrategyContext
public void executeTrajectoryWithMinimalBacktrackWithoutStateCoding(java.lang.Object[] trajectory)
executeTrajectoryWithMinimalBacktrackWithoutStateCoding
in interface IDseStrategyContext
public void executeTrajectoryWithMinimalBacktrackWithoutStateCoding(java.lang.Object[] trajectory, int toExcludedIndex)
executeTrajectoryWithMinimalBacktrackWithoutStateCoding
in interface IDseStrategyContext
public boolean backtrack()
backtrack
in interface IDseStrategyContext
public void backtrackUntilLastCommonActivation(java.lang.Object[] trajectory)
backtrackUntilLastCommonActivation
in interface IDseStrategyContext
public void backtrackUntilRoot()
backtrackUntilRoot
in interface IDseStrategyContext
public boolean isCurrentStateAlreadyTraversed()
isCurrentStateAlreadyTraversed
in interface IDseStrategyContext
public boolean isCurrentStateInTrajectory()
isCurrentStateInTrajectory
in interface IDseStrategyContext
public ActivationCodesConflictSet getActivationCodesConflictSet()
public void changeActivationOrdering(ChangeableConflictSet activationOrderingConflictSet)
public void changeActivationOrderingBack()