diff options
author | 2018-01-13 19:33:26 +0100 | |
---|---|---|
committer | 2018-01-13 19:33:26 +0100 | |
commit | 7e50434905cbb7f5d03636033b698e17a9075e9d (patch) | |
tree | 10e0968c20ac55dae4f5dc6077f39cf9947e3cb9 /Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/Executor.xtend | |
parent | Test and measurement runners (diff) | |
download | VIATRA-Generator-7e50434905cbb7f5d03636033b698e17a9075e9d.tar.gz VIATRA-Generator-7e50434905cbb7f5d03636033b698e17a9075e9d.tar.zst VIATRA-Generator-7e50434905cbb7f5d03636033b698e17a9075e9d.zip |
Initial commit of the configuration language and application
Diffstat (limited to 'Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/Executor.xtend')
-rw-r--r-- | Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/Executor.xtend | 95 |
1 files changed, 95 insertions, 0 deletions
diff --git a/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/Executor.xtend b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/Executor.xtend new file mode 100644 index 00000000..4d887423 --- /dev/null +++ b/Application/hu.bme.mit.inf.dslreasoner.application/src/hu/bme/mit/inf/dslreasoner/application/execution/Executor.xtend | |||
@@ -0,0 +1,95 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.application.execution | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.ConfigurationScript | ||
4 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.Task | ||
5 | import java.util.HashMap | ||
6 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.GenerationTask | ||
7 | import hu.bme.mit.inf.dslreasoner.application.applicationConfiguration.Metamodel | ||
8 | import hu.bme.mit.inf.dslreasoner.workspace.FileSystemWorkspace | ||
9 | import java.util.List | ||
10 | import org.eclipse.emf.ecore.EClass | ||
11 | import org.eclipse.emf.ecore.EEnumLiteral | ||
12 | import org.eclipse.emf.ecore.EReference | ||
13 | import org.eclipse.emf.ecore.EEnum | ||
14 | import org.eclipse.emf.ecore.EAttribute | ||
15 | import hu.bme.mit.inf.dslreasoner.ecore2logic.EcoreMetamodelDescriptor | ||
16 | import hu.bme.mit.inf.dslreasoner.workspace.ReasonerWorkspace | ||
17 | import org.eclipse.emf.ecore.EObject | ||
18 | import java.util.LinkedHashMap | ||
19 | import hu.bme.mit.inf.dslreasoner.viatra2logic.ViatraQuerySetDescriptor | ||
20 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2Logic | ||
21 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2Logic | ||
22 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretation2logic.InstanceModel2Logic | ||
23 | import hu.bme.mit.inf.dslreasoner.ecore2logic.Ecore2LogicConfiguration | ||
24 | import hu.bme.mit.inf.dslreasoner.viatra2logic.Viatra2LogicConfiguration | ||
25 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasonerConfiguration | ||
26 | import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.TypeInferenceMethod | ||
27 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.StateCoderStrategy | ||
28 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.ViatraReasoner | ||
29 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.ModelResult | ||
30 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.partialinterpretation.PartialInterpretation | ||
31 | import hu.bme.mit.inf.dslreasoner.logic.model.logicresult.LogicResult | ||
32 | import org.eclipse.emf.ecore.resource.Resource | ||
33 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | ||
34 | import hu.bme.mit.inf.dslreasoner.viatrasolver.partialinterpretationlanguage.visualisation.PartialInterpretation2Gml | ||
35 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloySolverConfiguration | ||
36 | import hu.bme.mit.inf.dlsreasoner.alloy.reasoner.AlloySolver | ||
37 | import hu.bme.mit.inf.dslreasoner.logic2ecore.Logic2Ecore | ||
38 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicReasoner | ||
39 | import java.util.LinkedList | ||
40 | import hu.bme.mit.inf.dslreasoner.visualisation.pi2graphviz.GraphvizVisualisation | ||
41 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicStructureBuilder | ||
42 | import hu.bme.mit.inf.dslreasoner.logic.model.builder.LogicProblemBuilder | ||
43 | import org.eclipse.emf.ecore.util.EcoreUtil | ||
44 | import org.eclipse.xtext.EcoreUtil2 | ||
45 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | ||
46 | import org.eclipse.emf.ecore.resource.ResourceSet | ||
47 | import org.eclipse.emf.common.util.URI | ||
48 | import org.eclipse.emf.ecore.EPackage | ||
49 | |||
50 | class Executor { | ||
51 | public def void execute(ConfigurationScript configurationScript) { | ||
52 | val tasks = configurationScript.commands.filter(Task) | ||
53 | val numberOfModels = tasks.map[it.calculateTaskSteps].reduce[p1, p2|p1+p2] | ||
54 | } | ||
55 | |||
56 | def private dispatch calculateTaskSteps(Task task) { | ||
57 | throw new UnsupportedOperationException() | ||
58 | } | ||
59 | def private dispatch calculateTaskSteps(GenerationTask task) { | ||
60 | return task.number * task.runs | ||
61 | } | ||
62 | |||
63 | def private dispatch executeTask(Task task) { | ||
64 | throw new UnsupportedOperationException() | ||
65 | } | ||
66 | def private dispatch executeTask(GenerationTask generationTask) { | ||
67 | val metamodel = generationTask.metamodel | ||
68 | if(metamodel != null) { | ||
69 | |||
70 | } | ||
71 | } | ||
72 | |||
73 | def protected loadPackage(ResourceSet rs, String path) { | ||
74 | var EObject content = null | ||
75 | |||
76 | try { | ||
77 | val resource = rs.getResource(URI.createURI(path),true) | ||
78 | content = resource.contents.get(0) | ||
79 | } catch(IllegalArgumentException e) { | ||
80 | return null | ||
81 | } catch(RuntimeException e) { | ||
82 | return null | ||
83 | } | ||
84 | |||
85 | if(content instanceof EPackage) { | ||
86 | |||
87 | } else return null | ||
88 | } | ||
89 | |||
90 | def loadPatternModel(ResourceSet rs, String path) { | ||
91 | var model = null | ||
92 | |||
93 | |||
94 | } | ||
95 | } | ||