diff options
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend index c9d38c7d..1ee69827 100644 --- a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/GenerationTaskExecutor.xtend | |||
@@ -41,6 +41,7 @@ class GenerationTaskExecutor { | |||
41 | def executeGenerationTask( | 41 | def executeGenerationTask( |
42 | GenerationTask task, | 42 | GenerationTask task, |
43 | ScriptExecutor scriptExecutor, | 43 | ScriptExecutor scriptExecutor, |
44 | ScriptConsole.Factory scriptConsoleFactory, | ||
44 | IProgressMonitor monitor) | 45 | IProgressMonitor monitor) |
45 | { | 46 | { |
46 | monitor.subTask('''Collecting all resources''') | 47 | monitor.subTask('''Collecting all resources''') |
@@ -62,7 +63,7 @@ class GenerationTaskExecutor { | |||
62 | val memoryLimit = scriptExecutor.getMemoryLimit(configSpecification) | 63 | val memoryLimit = scriptExecutor.getMemoryLimit(configSpecification) |
63 | 64 | ||
64 | // 2. create console | 65 | // 2. create console |
65 | val console = new ScriptConsole(true,false, | 66 | val console = scriptConsoleFactory.createScriptConsole(false, |
66 | if(messageFile!==null) URI.createURI(messageFile.path) else null, | 67 | if(messageFile!==null) URI.createURI(messageFile.path) else null, |
67 | if(debugFolder!==null) URI.createURI('''«debugFolder.path»/errors.txt''') else null, | 68 | if(debugFolder!==null) URI.createURI('''«debugFolder.path»/errors.txt''') else null, |
68 | if(statisticsFile!==null) URI.createURI(statisticsFile.path) else null | 69 | if(statisticsFile!==null) URI.createURI(statisticsFile.path) else null |
@@ -132,12 +133,14 @@ class GenerationTaskExecutor { | |||
132 | // 5. create a solver and a configuration | 133 | // 5. create a solver and a configuration |
133 | // 5.1 initialize | 134 | // 5.1 initialize |
134 | val solver = solverLoader.loadSolver(task.solver,configurationMap) | 135 | val solver = solverLoader.loadSolver(task.solver,configurationMap) |
135 | val solverConfig = solverLoader.loadSolverConfig(task.solver,configurationMap,console) | 136 | val objectiveSpecification = scriptExecutor.getObjectiveSpecification(task.objectives) |
137 | val objectiveEntries = objectiveSpecification?.entries ?: emptyList | ||
138 | val solverConfig = solverLoader.loadSolverConfig(task.solver,configurationMap,objectiveEntries,console) | ||
136 | 139 | ||
137 | 140 | ||
138 | // 5.2 set values that defined directly | 141 | // 5.2 set values that defined directly |
139 | solverConfig.solutionScope = new SolutionScope => [ | 142 | solverConfig.solutionScope = new SolutionScope => [ |
140 | it.numberOfRequiredSolution = if(task.numberSpecified) { | 143 | it.numberOfRequiredSolutions = if(task.numberSpecified) { |
141 | task.number | 144 | task.number |
142 | } else { | 145 | } else { |
143 | 1 | 146 | 1 |
@@ -290,7 +293,7 @@ class GenerationTaskExecutor { | |||
290 | statistics.put("Domain to logic transformation time",domain2LogicTransformationTime/1000000) | 293 | statistics.put("Domain to logic transformation time",domain2LogicTransformationTime/1000000) |
291 | statistics.put("Logic to solver transformation time",solution.statistics.transformationTime) | 294 | statistics.put("Logic to solver transformation time",solution.statistics.transformationTime) |
292 | statistics.put("Solver time",solution.statistics.solverTime) | 295 | statistics.put("Solver time",solution.statistics.solverTime) |
293 | statistics.put("Postprocessing time",solutionVisualisationTime) | 296 | statistics.put("Postprocessing time",solutionVisualisationTime/1000000) |
294 | for(entry: solution.statistics.entries) { | 297 | for(entry: solution.statistics.entries) { |
295 | statistics.put(entry.name,statisticsUtil.readValue(entry)) | 298 | statistics.put(entry.name,statisticsUtil.readValue(entry)) |
296 | } | 299 | } |
@@ -301,7 +304,7 @@ class GenerationTaskExecutor { | |||
301 | console.flushStatistics | 304 | console.flushStatistics |
302 | console.writeMessage("Model generation finished") | 305 | console.writeMessage("Model generation finished") |
303 | } catch(Exception e) { | 306 | } catch(Exception e) { |
304 | console.writeError(''' | 307 | console.writeError(''' |
305 | Error occured («e.class.simpleName»): «e.message» | 308 | Error occured («e.class.simpleName»): «e.message» |
306 | «FOR s : e.stackTrace SEPARATOR "\n"» «s»«ENDFOR»''') | 309 | «FOR s : e.stackTrace SEPARATOR "\n"» «s»«ENDFOR»''') |
307 | } | 310 | } |
@@ -347,4 +350,4 @@ class GenerationTaskExecutor { | |||
347 | return false | 350 | return false |
348 | } | 351 | } |
349 | } | 352 | } |
350 | } \ No newline at end of file | 353 | } |