diff options
Diffstat (limited to 'Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyHandler.xtend')
-rw-r--r-- | Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyHandler.xtend | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyHandler.xtend b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyHandler.xtend index 9b4265b9..451aad6e 100644 --- a/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyHandler.xtend +++ b/Solvers/Alloy-Solver/hu.bme.mit.inf.dlsreasoner.alloy.reasoner/src/hu/bme/mit/inf/dlsreasoner/alloy/reasoner/builder/AlloyHandler.xtend | |||
@@ -101,15 +101,8 @@ class AlloyHandler { | |||
101 | try{ | 101 | try{ |
102 | answers = future.get(configuration.runtimeLimit,TimeUnit.SECONDS) | 102 | answers = future.get(configuration.runtimeLimit,TimeUnit.SECONDS) |
103 | finished = true | 103 | finished = true |
104 | } catch (TimeoutException ex) { | 104 | } catch (TimeoutException | InterruptedException | ExecutionException e) { |
105 | // handle the timeout | 105 | future.cancel(true) |
106 | } catch (InterruptedException e) { | ||
107 | // handle the interrupts | ||
108 | } catch (ExecutionException e) { | ||
109 | // handle other exceptions | ||
110 | } finally { | ||
111 | future.cancel(true); | ||
112 | |||
113 | answers = callable.partialAnswers | 106 | answers = callable.partialAnswers |
114 | finished = false | 107 | finished = false |
115 | } | 108 | } |
@@ -195,7 +188,7 @@ class AlloyCallerWithTimeout implements Callable<List<Pair<A4Solution,Long>>>{ | |||
195 | } else { | 188 | } else { |
196 | lastAnswer = lastAnswer.next | 189 | lastAnswer = lastAnswer.next |
197 | } | 190 | } |
198 | configuration.progressMonitor.workedBackwardTransformation(configuration.solutionScope.numberOfRequiredSolution) | 191 | configuration.progressMonitor.workedBackwardTransformation(configuration.solutionScope.numberOfRequiredSolutions) |
199 | 192 | ||
200 | val runtime = System.currentTimeMillis -startTime | 193 | val runtime = System.currentTimeMillis -startTime |
201 | synchronized(this) { | 194 | synchronized(this) { |
@@ -212,8 +205,8 @@ class AlloyCallerWithTimeout implements Callable<List<Pair<A4Solution,Long>>>{ | |||
212 | } | 205 | } |
213 | 206 | ||
214 | def hasEnoughSolution(List<?> answers) { | 207 | def hasEnoughSolution(List<?> answers) { |
215 | if(configuration.solutionScope.numberOfRequiredSolution < 0) return false | 208 | if(configuration.solutionScope.numberOfRequiredSolutions < 0) return false |
216 | else return answers.size() == configuration.solutionScope.numberOfRequiredSolution | 209 | else return answers.size() == configuration.solutionScope.numberOfRequiredSolutions |
217 | } | 210 | } |
218 | 211 | ||
219 | public def getPartialAnswers() { | 212 | public def getPartialAnswers() { |