diff options
Diffstat (limited to 'subprojects/store-dse/src')
3 files changed, 7 insertions, 8 deletions
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/DesignSpaceExplorationAdapter.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/DesignSpaceExplorationAdapter.java index c45f088a..5aed5298 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/DesignSpaceExplorationAdapter.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/DesignSpaceExplorationAdapter.java | |||
@@ -50,7 +50,7 @@ public interface DesignSpaceExplorationAdapter extends ModelAdapter { | |||
50 | 50 | ||
51 | public boolean fireActivation(Activation activation); | 51 | public boolean fireActivation(Activation activation); |
52 | 52 | ||
53 | public void fireRandomActivation(); | 53 | public boolean fireRandomActivation(); |
54 | 54 | ||
55 | public List<Version> getTrajectory(); | 55 | public List<Version> getTrajectory(); |
56 | 56 | ||
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java index 04bba885..220f0b2d 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/internal/DesignSpaceExplorationAdapterImpl.java | |||
@@ -252,7 +252,6 @@ public class DesignSpaceExplorationAdapterImpl implements DesignSpaceExploration | |||
252 | if (isNewState) { | 252 | if (isNewState) { |
253 | modelVisualizerAdapter.addState(newState, getFitness().values()); | 253 | modelVisualizerAdapter.addState(newState, getFitness().values()); |
254 | } | 254 | } |
255 | // TODO: Change to this: | ||
256 | modelVisualizerAdapter.addTransition(previousState, newState, activation.transformationRule().getName(), | 255 | modelVisualizerAdapter.addTransition(previousState, newState, activation.transformationRule().getName(), |
257 | activation.activation()); | 256 | activation.activation()); |
258 | } | 257 | } |
@@ -260,11 +259,10 @@ public class DesignSpaceExplorationAdapterImpl implements DesignSpaceExploration | |||
260 | } | 259 | } |
261 | 260 | ||
262 | @Override | 261 | @Override |
263 | public void fireRandomActivation() { | 262 | public boolean fireRandomActivation() { |
264 | var activations = getUntraversedActivations(); | 263 | var activations = getUntraversedActivations(); |
265 | if (activations.isEmpty()) { | 264 | if (activations.isEmpty()) { |
266 | // TODO: throw exception | 265 | return false; |
267 | return; | ||
268 | } | 266 | } |
269 | int index = random.nextInt(activations.size()); | 267 | int index = random.nextInt(activations.size()); |
270 | var iterator = activations.iterator(); | 268 | var iterator = activations.iterator(); |
@@ -272,7 +270,7 @@ public class DesignSpaceExplorationAdapterImpl implements DesignSpaceExploration | |||
272 | iterator.next(); | 270 | iterator.next(); |
273 | } | 271 | } |
274 | var activationId = iterator.next(); | 272 | var activationId = iterator.next(); |
275 | fireActivation(activationId); | 273 | return fireActivation(activationId); |
276 | } | 274 | } |
277 | 275 | ||
278 | public List<Activation> getAllActivations() { | 276 | public List<Activation> getAllActivations() { |
@@ -284,7 +282,6 @@ public class DesignSpaceExplorationAdapterImpl implements DesignSpaceExploration | |||
284 | } | 282 | } |
285 | 283 | ||
286 | public boolean isCurrentStateAlreadyTraversed() { | 284 | public boolean isCurrentStateAlreadyTraversed() { |
287 | // TODO: check isomorphism? | ||
288 | return !isNewState; | 285 | return !isNewState; |
289 | } | 286 | } |
290 | 287 | ||
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/DepthFirstStrategy.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/DepthFirstStrategy.java index 5f7f61b8..0a0caa7e 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/DepthFirstStrategy.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/DepthFirstStrategy.java | |||
@@ -67,7 +67,9 @@ public class DepthFirstStrategy implements Strategy { | |||
67 | return; | 67 | return; |
68 | } | 68 | } |
69 | 69 | ||
70 | dseAdapter.fireRandomActivation(); | 70 | if (!dseAdapter.fireRandomActivation()) { |
71 | return; | ||
72 | } | ||
71 | } | 73 | } |
72 | } | 74 | } |
73 | 75 | ||