diff options
Diffstat (limited to 'subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstExplorer.java')
-rw-r--r-- | subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstExplorer.java | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstExplorer.java b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstExplorer.java index 72bbbc55..a2b6268f 100644 --- a/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstExplorer.java +++ b/subprojects/store-dse/src/main/java/tools/refinery/store/dse/strategy/BestFirstExplorer.java | |||
@@ -5,7 +5,6 @@ | |||
5 | */ | 5 | */ |
6 | package tools.refinery.store.dse.strategy; | 6 | package tools.refinery.store.dse.strategy; |
7 | 7 | ||
8 | import tools.refinery.store.dse.transition.ObjectiveValue; | ||
9 | import tools.refinery.store.dse.transition.VersionWithObjectiveValue; | 8 | import tools.refinery.store.dse.transition.VersionWithObjectiveValue; |
10 | import tools.refinery.store.model.Model; | 9 | import tools.refinery.store.model.Model; |
11 | 10 | ||
@@ -32,13 +31,11 @@ public class BestFirstExplorer extends BestFirstWorker { | |||
32 | public void explore() { | 31 | public void explore() { |
33 | VersionWithObjectiveValue lastVisited = submit().newVersion(); | 32 | VersionWithObjectiveValue lastVisited = submit().newVersion(); |
34 | 33 | ||
35 | mainLoop: while (shouldRun()) { | 34 | while (shouldRun()) { |
36 | 35 | ||
37 | if (lastVisited == null) { | 36 | if (lastVisited == null) { |
38 | var restored = this.restoreToBest(); | 37 | lastVisited = this.restoreToBest(); |
39 | if(restored != null) { | 38 | if(lastVisited == null) { |
40 | lastVisited = restored; | ||
41 | } else { | ||
42 | return; | 39 | return; |
43 | } | 40 | } |
44 | } | 41 | } |
@@ -47,7 +44,7 @@ public class BestFirstExplorer extends BestFirstWorker { | |||
47 | while(tryActivation && shouldRun()) { | 44 | while(tryActivation && shouldRun()) { |
48 | RandomVisitResult randomVisitResult = this.visitRandomUnvisited(random); | 45 | RandomVisitResult randomVisitResult = this.visitRandomUnvisited(random); |
49 | 46 | ||
50 | tryActivation &= randomVisitResult.shouldRetry(); | 47 | tryActivation = randomVisitResult.shouldRetry(); |
51 | var newSubmit = randomVisitResult.submitResult(); | 48 | var newSubmit = randomVisitResult.submitResult(); |
52 | if(newSubmit != null) { | 49 | if(newSubmit != null) { |
53 | if(!newSubmit.include()) { | 50 | if(!newSubmit.include()) { |
@@ -57,10 +54,14 @@ public class BestFirstExplorer extends BestFirstWorker { | |||
57 | int compareResult = compare(lastVisited,newVisit); | 54 | int compareResult = compare(lastVisited,newVisit); |
58 | if(compareResult >= 0) { | 55 | if(compareResult >= 0) { |
59 | lastVisited = newVisit; | 56 | lastVisited = newVisit; |
60 | continue mainLoop; | 57 | break; |
61 | } | 58 | } |
62 | } | 59 | } |
63 | } | 60 | } |
61 | else { | ||
62 | lastVisited = null; | ||
63 | break; | ||
64 | } | ||
64 | } | 65 | } |
65 | 66 | ||
66 | //final ObjectiveComparatorHelper objectiveComparatorHelper = dseAdapter.getObjectiveComparatorHelper(); | 67 | //final ObjectiveComparatorHelper objectiveComparatorHelper = dseAdapter.getObjectiveComparatorHelper(); |
@@ -160,5 +161,6 @@ public class BestFirstExplorer extends BestFirstWorker { | |||
160 | */ | 161 | */ |
161 | } | 162 | } |
162 | // Interrupted. | 163 | // Interrupted. |
164 | |||
163 | } | 165 | } |
164 | } | 166 | } |