diff options
author | 2020-06-30 18:03:48 +0200 | |
---|---|---|
committer | 2020-06-30 18:03:48 +0200 | |
commit | e11bce7ad3e803e80883499fec0ad6e4540ffe43 (patch) | |
tree | ca3ad9d5b9137e9455485e43350a4a353f487f22 /Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/IDseStrategyContext.java | |
parent | Disable unrepairable match scoping for now (diff) | |
download | VIATRA-Generator-e11bce7ad3e803e80883499fec0ad6e4540ffe43.tar.gz VIATRA-Generator-e11bce7ad3e803e80883499fec0ad6e4540ffe43.tar.zst VIATRA-Generator-e11bce7ad3e803e80883499fec0ad6e4540ffe43.zip |
Add modified VIATRA-DSE version
Diffstat (limited to 'Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/IDseStrategyContext.java')
-rw-r--r-- | Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/IDseStrategyContext.java | 117 |
1 files changed, 117 insertions, 0 deletions
diff --git a/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/IDseStrategyContext.java b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/IDseStrategyContext.java new file mode 100644 index 00000000..d630964f --- /dev/null +++ b/Solvers/VIATRA-Solver/org.eclipse.viatra.dse/src/org/eclipse/viatra/dse/base/IDseStrategyContext.java | |||
@@ -0,0 +1,117 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2016, Andras Szabolcs Nagy, Zoltan Ujhelyi and Daniel Varro | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package org.eclipse.viatra.dse.base; | ||
10 | |||
11 | import java.util.Collection; | ||
12 | import java.util.List; | ||
13 | import java.util.Set; | ||
14 | |||
15 | import org.eclipse.emf.common.notify.Notifier; | ||
16 | import org.eclipse.emf.edit.domain.EditingDomain; | ||
17 | import org.eclipse.viatra.dse.api.strategy.interfaces.IStrategy; | ||
18 | import org.eclipse.viatra.dse.api.strategy.interfaces.IStrategyFactory; | ||
19 | import org.eclipse.viatra.dse.designspace.api.IDesignSpace; | ||
20 | import org.eclipse.viatra.dse.designspace.api.TrajectoryInfo; | ||
21 | import org.eclipse.viatra.dse.objectives.Fitness; | ||
22 | import org.eclipse.viatra.dse.objectives.IGlobalConstraint; | ||
23 | import org.eclipse.viatra.dse.objectives.IObjective; | ||
24 | import org.eclipse.viatra.dse.objectives.ObjectiveComparatorHelper; | ||
25 | import org.eclipse.viatra.dse.solutionstore.SolutionStore; | ||
26 | import org.eclipse.viatra.dse.statecode.IStateCoder; | ||
27 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
28 | import org.eclipse.viatra.transformation.evm.api.Activation; | ||
29 | import org.eclipse.viatra.transformation.evm.api.RuleEngine; | ||
30 | import org.eclipse.viatra.transformation.evm.api.RuleSpecification; | ||
31 | import org.eclipse.viatra.transformation.runtime.emf.rules.batch.BatchTransformationRule; | ||
32 | |||
33 | /** | ||
34 | * This interface is only to overview the required methods for exploration strategies. It is not used explicitly. | ||
35 | * | ||
36 | * @author Andras Szabolcs Nagy | ||
37 | * | ||
38 | */ | ||
39 | public interface IDseStrategyContext { | ||
40 | |||
41 | void init(); | ||
42 | |||
43 | Notifier getModel(); | ||
44 | EditingDomain getEditingDomain(); | ||
45 | ViatraQueryEngine getQueryEngine(); | ||
46 | RuleEngine getRuleEngine(); | ||
47 | IStrategy getStrategy(); | ||
48 | ExplorerThread getExplorerThread(); | ||
49 | List<IObjective> getObjectives(); | ||
50 | IObjective[][] getLeveledObjectives(); | ||
51 | List<IGlobalConstraint> getGlobalConstraints(); | ||
52 | |||
53 | SolutionStore getSolutionStore(); | ||
54 | void newSolution(); | ||
55 | // TODO void newSolution(TrajectoryFitness trajectoryFitness); | ||
56 | |||
57 | |||
58 | ObjectiveComparatorHelper getObjectiveComparatorHelper(); | ||
59 | |||
60 | GlobalContext getGlobalContext(); | ||
61 | Set<BatchTransformationRule<?, ?>> getRules(); | ||
62 | BatchTransformationRule<?, ?> getRuleByRuleSpecification(RuleSpecification<?> ruleSpecification); | ||
63 | ExplorerThread tryStartNewThread(IStrategy strategy); /*IDseStrategyContext originalContext*/ | ||
64 | ExplorerThread tryStartNewThreadWithoutModelClone(IStrategy strategy); | ||
65 | void startAllThreads(IStrategyFactory strategyFactory); | ||
66 | Object getSharedObject(); | ||
67 | void setSharedObject(Object sharedObject); | ||
68 | |||
69 | |||
70 | DesignSpaceManager getDesignSpaceManager(); | ||
71 | IStateCoder getStateCoder(); | ||
72 | IDesignSpace getDesignSpace(); | ||
73 | TrajectoryInfo getTrajectoryInfo(); | ||
74 | List<Object> getTrajectory(); | ||
75 | List<Object> getTrajectoryCopied(); | ||
76 | int getDepth(); | ||
77 | Object getCurrentStateId(); | ||
78 | |||
79 | Object getTransitionByActivation(Activation<?> activation); | ||
80 | Activation<?> getActivationById(Object activationId); | ||
81 | BatchTransformationRule<?, ?> getRuleByActivation(Activation<?> activation); | ||
82 | BatchTransformationRule<?, ?> getRuleByActivationId(Object activationId); | ||
83 | |||
84 | Collection<Object> getCurrentActivationIds(); | ||
85 | Collection<Object> getUntraversedActivationIds(); | ||
86 | // TODO Object getArbitraryActivationId(); | ||
87 | // TODO Object getArbitraryUntraversedActivationId(); | ||
88 | |||
89 | void executeAcitvationId(Object activationId); | ||
90 | boolean tryExecuteAcitvationId(Object activationId); | ||
91 | boolean executeRandomActivationId(); | ||
92 | void executeTrajectory(Object[] activationIds); | ||
93 | void executeTrajectory(Object[] activationIds, int fromIncludedIndex, int toExcludedIndex); | ||
94 | int executeTrajectoryByTrying(Object[] activationIds); | ||
95 | int executeTrajectoryByTrying(Object[] activationIds, int fromIncludedIndex, int toExcludedIndex); | ||
96 | int executeTrajectoryWithoutStateCoding(Object[] activationIds); | ||
97 | int executeTrajectoryWithoutStateCoding(Object[] activationIds, int fromIncludedIndex, int toExcludedIndex); | ||
98 | int executeTrajectoryByTryingWithoutStateCoding(Object[] activationIds); | ||
99 | int executeTrajectoryByTryingWithoutStateCoding(Object[] activationIds, int fromIncludedIndex, int toExcludedIndex); | ||
100 | void executeTrajectoryWithMinimalBacktrack(Object[] trajectory); | ||
101 | void executeTrajectoryWithMinimalBacktrack(Object[] trajectory, int toExcludedIndex); | ||
102 | void executeTrajectoryWithMinimalBacktrackWithoutStateCoding(Object[] trajectory); | ||
103 | void executeTrajectoryWithMinimalBacktrackWithoutStateCoding(Object[] trajectory, int toExcludedIndex); | ||
104 | |||
105 | boolean backtrack(); | ||
106 | // TODO int backtrack(int times); | ||
107 | void backtrackUntilLastCommonActivation(Object[] trajectory); | ||
108 | void backtrackUntilRoot(); | ||
109 | |||
110 | Fitness calculateFitness(); | ||
111 | Fitness getLastFitness(); | ||
112 | boolean checkGlobalConstraints(); | ||
113 | boolean isCurrentStateAlreadyTraversed(); | ||
114 | // this needs states stored: | ||
115 | boolean isCurrentStateInTrajectory(); | ||
116 | |||
117 | } | ||