diff options
Diffstat (limited to 'Tests/hu.bme.mit.inf.dslreasoner.run/src/hu')
-rw-r--r-- | Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SimpleRun.xtend | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SimpleRun.xtend b/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SimpleRun.xtend index fe4dcadd..b65826ad 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SimpleRun.xtend +++ b/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SimpleRun.xtend | |||
@@ -15,6 +15,7 @@ import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore | |||
15 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic | 15 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic |
16 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration | 16 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration |
17 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor | 17 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor |
18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.cardinality.ScopePropagatorStrategy | ||
18 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic | 19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic |
19 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | 20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation |
20 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretation2Gml | 21 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretation2Gml |
@@ -60,6 +61,7 @@ class SimpleRun { | |||
60 | val modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel,new Ecore2LogicConfiguration()) | 61 | val modelGenerationProblem = ecore2Logic.transformMetamodel(metamodel,new Ecore2LogicConfiguration()) |
61 | val modelExtensionProblem = instanceModel2Logic.transform(modelGenerationProblem,partialModel) | 62 | val modelExtensionProblem = instanceModel2Logic.transform(modelGenerationProblem,partialModel) |
62 | val validModelExtensionProblem = viatra2Logic.transformQueries(queries,modelExtensionProblem,new Viatra2LogicConfiguration) | 63 | val validModelExtensionProblem = viatra2Logic.transformQueries(queries,modelExtensionProblem,new Viatra2LogicConfiguration) |
64 | // workspace.writeModel(validModelExtensionProblem.output, "generation.logicproblem") | ||
63 | 65 | ||
64 | val logicProblem = validModelExtensionProblem.output | 66 | val logicProblem = validModelExtensionProblem.output |
65 | 67 | ||
@@ -72,6 +74,7 @@ class SimpleRun { | |||
72 | it.typeScopes.maxNewElements = 40 | 74 | it.typeScopes.maxNewElements = 40 |
73 | it.typeScopes.minNewElements = 40 | 75 | it.typeScopes.minNewElements = 40 |
74 | it.solutionScope.numberOfRequiredSolutions = 1 | 76 | it.solutionScope.numberOfRequiredSolutions = 1 |
77 | // it.scopePropagatorStrategy = ScopePropagatorStrategy.BasicTypeHierarchy | ||
75 | it.documentationLevel = DocumentationLevel.NONE | 78 | it.documentationLevel = DocumentationLevel.NONE |
76 | it.debugConfiguration.partalInterpretationVisualisationFrequency = 1 | 79 | it.debugConfiguration.partalInterpretationVisualisationFrequency = 1 |
77 | it.debugConfiguration.partialInterpretatioVisualiser = new GraphvizVisualiser | 80 | it.debugConfiguration.partialInterpretatioVisualiser = new GraphvizVisualiser |
@@ -91,12 +94,14 @@ class SimpleRun { | |||
91 | 94 | ||
92 | println("Problem solved") | 95 | println("Problem solved") |
93 | 96 | ||
94 | val interpretations = reasoner.getInterpretations(solution as ModelResult) | 97 | val result = solution as ModelResult |
98 | val interpretations = reasoner.getInterpretations(result) | ||
95 | val models = new LinkedList | 99 | val models = new LinkedList |
96 | for(interpretation : interpretations) { | 100 | for(interpretation : interpretations) { |
97 | val instanceModel = logic2Ecore.transformInterpretation(interpretation,modelGenerationProblem.trace) | 101 | val instanceModel = logic2Ecore.transformInterpretation(interpretation,modelGenerationProblem.trace) |
98 | models+=instanceModel | 102 | models+=instanceModel |
99 | } | 103 | } |
104 | println(result.statistics.solverTime) | ||
100 | 105 | ||
101 | solution.writeSolution(workspace, #[]) | 106 | solution.writeSolution(workspace, #[]) |
102 | } | 107 | } |
@@ -129,7 +134,7 @@ class SimpleRun { | |||
129 | def static loadPartialModel(ReasonerWorkspace inputs) { | 134 | def static loadPartialModel(ReasonerWorkspace inputs) { |
130 | EMFPatternLanguageStandaloneSetup.doSetup | 135 | EMFPatternLanguageStandaloneSetup.doSetup |
131 | ReteEngine.getClass | 136 | ReteEngine.getClass |
132 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("xmi", new XMIResourceFactoryImpl()); | 137 | Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap().put("*", new XMIResourceFactoryImpl()); |
133 | inputs.readModel(EObject,"FAM.xmi").eResource.allContents.toList | 138 | inputs.readModel(EObject,"FAM.xmi").eResource.allContents.toList |
134 | } | 139 | } |
135 | 140 | ||