diff options
author | Kristóf Marussy <kris7topher@gmail.com> | 2019-04-08 00:58:00 +0200 |
---|---|---|
committer | Kristóf Marussy <kris7topher@gmail.com> | 2019-04-08 00:58:00 +0200 |
commit | c1f185fd8fc2c3dfc123d9271726c588963c7c01 (patch) | |
tree | 88a5bb94017e7d3f0fbce0a51a78c2549b0977bd /Tests | |
parent | Infrastructure for objective functions (diff) | |
download | VIATRA-Generator-c1f185fd8fc2c3dfc123d9271726c588963c7c01.tar.gz VIATRA-Generator-c1f185fd8fc2c3dfc123d9271726c588963c7c01.tar.zst VIATRA-Generator-c1f185fd8fc2c3dfc123d9271726c588963c7c01.zip |
Objective POC implementation
Diffstat (limited to 'Tests')
8 files changed, 103 insertions, 33 deletions
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.classpath b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.classpath index 1c96fe2f..4a3597ed 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.classpath +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.classpath | |||
@@ -1,8 +1,9 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <classpath> | 2 | <classpath> |
3 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | 3 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> |
4 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | 4 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> |
5 | <classpathentry kind="src" path="src"/> | 5 | <classpathentry kind="src" path="src"/> |
6 | <classpathentry kind="src" path="xtend-gen"/> | 6 | <classpathentry kind="src" path="xtend-gen"/> |
7 | <classpathentry kind="output" path="bin"/> | 7 | <classpathentry kind="src" path="src-gen"/> |
8 | </classpath> | 8 | <classpathentry kind="output" path="bin"/> |
9 | </classpath> | ||
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.project b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.project index 86c19a90..2917d28f 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.project +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/.project | |||
@@ -11,6 +11,11 @@ | |||
11 | </arguments> | 11 | </arguments> |
12 | </buildCommand> | 12 | </buildCommand> |
13 | <buildCommand> | 13 | <buildCommand> |
14 | <name>org.eclipse.viatra.query.tooling.ui.projectbuilder</name> | ||
15 | <arguments> | ||
16 | </arguments> | ||
17 | </buildCommand> | ||
18 | <buildCommand> | ||
14 | <name>org.eclipse.jdt.core.javabuilder</name> | 19 | <name>org.eclipse.jdt.core.javabuilder</name> |
15 | <arguments> | 20 | <arguments> |
16 | </arguments> | 21 | </arguments> |
@@ -29,6 +34,7 @@ | |||
29 | <natures> | 34 | <natures> |
30 | <nature>org.eclipse.pde.PluginNature</nature> | 35 | <nature>org.eclipse.pde.PluginNature</nature> |
31 | <nature>org.eclipse.jdt.core.javanature</nature> | 36 | <nature>org.eclipse.jdt.core.javanature</nature> |
37 | <nature>org.eclipse.viatra.query.projectnature</nature> | ||
32 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | 38 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> |
33 | </natures> | 39 | </natures> |
34 | </projectDescription> | 40 | </projectDescription> |
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/META-INF/MANIFEST.MF b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/META-INF/MANIFEST.MF index dc9f3788..290b5a22 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/META-INF/MANIFEST.MF +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/META-INF/MANIFEST.MF | |||
@@ -1,15 +1,19 @@ | |||
1 | Manifest-Version: 1.0 | 1 | Manifest-Version: 1.0 |
2 | Bundle-ManifestVersion: 2 | 2 | Bundle-ManifestVersion: 2 |
3 | Bundle-Name: FAMTest | 3 | Bundle-Name: FAMTest |
4 | Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.application.FAMTest;singleton:=true | 4 | Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.application.FAMTest;singleton:=true |
5 | Bundle-Version: 1.0.0.qualifier | 5 | Bundle-Version: 1.0.0.qualifier |
6 | Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.application.FAMTest | 6 | Export-Package: hu.bme.mit.inf.dslreasoner.application.FAMTest |
7 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | 7 | Require-Bundle: org.eclipse.emf.ecore, |
8 | Require-Bundle: com.google.guava, | 8 | org.eclipse.viatra.query.runtime, |
9 | org.eclipse.xtext.xbase.lib, | 9 | org.eclipse.viatra.query.runtime.rete, |
10 | org.eclipse.xtend.lib, | 10 | org.eclipse.viatra.query.runtime.localsearch, |
11 | org.eclipse.xtend.lib.macro, | 11 | com.google.guava, |
12 | hu.bme.mit.inf.dslreasoner.application;bundle-version="1.0.0";visibility:=reexport | 12 | org.eclipse.xtext.xbase.lib, |
13 | Import-Package: org.apache.log4j;version="1.2.15", | 13 | org.eclipse.xtend.lib, |
14 | org.junit;version="4.12.0" | 14 | org.eclipse.xtend.lib.macro, |
15 | Export-Package: hu.bme.mit.inf.dslreasoner.application.FAMTest | 15 | hu.bme.mit.inf.dslreasoner.application;bundle-version="1.0.0";visibility:=reexport |
16 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
17 | Import-Package: org.apache.log4j;version="1.2.15", | ||
18 | org.junit;version="4.12.0" | ||
19 | Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.application.FAMTest | ||
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/build.properties b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/build.properties index 466224af..ce900fd9 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/build.properties +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/build.properties | |||
@@ -1,7 +1,8 @@ | |||
1 | source.. = src/,\ | 1 | bin.includes = META-INF/,\ |
2 | xtend-gen/ | 2 | . |
3 | output.. = bin/ | 3 | additional.bundles = org.apache.log4j,\ |
4 | bin.includes = META-INF/,\ | 4 | org.junit |
5 | . | 5 | source.. = src/,\ |
6 | additional.bundles = org.apache.log4j,\ | 6 | xtend-gen/,\ |
7 | org.junit | 7 | src-gen/ |
8 | output.. = bin/ | ||
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/configs/generation.vsconfig b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/configs/generation.vsconfig index 490d6942..c29d234a 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/configs/generation.vsconfig +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/configs/generation.vsconfig | |||
@@ -7,7 +7,12 @@ generate { | |||
7 | partial-model = { "inputs/FamInstance.xmi"} | 7 | partial-model = { "inputs/FamInstance.xmi"} |
8 | solver = ViatraSolver | 8 | solver = ViatraSolver |
9 | scope = { | 9 | scope = { |
10 | #node = 500 | 10 | #node = 5 |
11 | } | ||
12 | objectives = { | ||
13 | minimize cost { | ||
14 | hu.bme.mit.inf.dslreasoner.domains.fam::informationLink = 1 | ||
15 | } | ||
11 | } | 16 | } |
12 | 17 | ||
13 | config = { | 18 | config = { |
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/generator.vqgen b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/generator.vqgen new file mode 100644 index 00000000..daba017b --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/generator.vqgen | |||
@@ -0,0 +1 @@ | |||
genmodel "platform:/resource/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamMetamodel.genmodel" \ No newline at end of file | |||
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamMetamodel.genmodel b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamMetamodel.genmodel new file mode 100644 index 00000000..b325a20c --- /dev/null +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamMetamodel.genmodel | |||
@@ -0,0 +1,48 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <genmodel:GenModel xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" | ||
3 | xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" modelDirectory="/hu.bme.mit.inf.dslreasoner.application.FAMTest/src" | ||
4 | modelPluginID="hu.bme.mit.inf.dslreasoner.application.FAMTest" modelName="FamMetamodel" | ||
5 | rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" importerID="org.eclipse.emf.importer.ecore" | ||
6 | complianceLevel="8.0" copyrightFields="false" operationReflection="true" importOrganizing="true"> | ||
7 | <foreignModel>FamMetamodel.ecore</foreignModel> | ||
8 | <genPackages prefix="Functionalarchitecture" disposableProviderFactory="true" ecorePackage="FamMetamodel.ecore#/"> | ||
9 | <genEnums typeSafeEnumCompatible="false" ecoreEnum="FamMetamodel.ecore#//FunctionType"> | ||
10 | <genEnumLiterals ecoreEnumLiteral="FamMetamodel.ecore#//FunctionType/Root"/> | ||
11 | <genEnumLiterals ecoreEnumLiteral="FamMetamodel.ecore#//FunctionType/Intermediate"/> | ||
12 | <genEnumLiterals ecoreEnumLiteral="FamMetamodel.ecore#//FunctionType/Leaf"/> | ||
13 | </genEnums> | ||
14 | <genClasses image="false" ecoreClass="FamMetamodel.ecore#//FunctionalElement"> | ||
15 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalElement/interface"/> | ||
16 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalElement/model"/> | ||
17 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalElement/parent"/> | ||
18 | </genClasses> | ||
19 | <genClasses ecoreClass="FamMetamodel.ecore#//FunctionalArchitectureModel"> | ||
20 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalArchitectureModel/rootElements"/> | ||
21 | </genClasses> | ||
22 | <genClasses ecoreClass="FamMetamodel.ecore#//Function"> | ||
23 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//Function/subElements"/> | ||
24 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute FamMetamodel.ecore#//Function/type"/> | ||
25 | </genClasses> | ||
26 | <genClasses ecoreClass="FamMetamodel.ecore#//FAMTerminator"> | ||
27 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FAMTerminator/data"/> | ||
28 | </genClasses> | ||
29 | <genClasses ecoreClass="FamMetamodel.ecore#//InformationLink"> | ||
30 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference FamMetamodel.ecore#//InformationLink/from"/> | ||
31 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//InformationLink/to"/> | ||
32 | </genClasses> | ||
33 | <genClasses ecoreClass="FamMetamodel.ecore#//FunctionalInterface"> | ||
34 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalInterface/data"/> | ||
35 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalInterface/element"/> | ||
36 | </genClasses> | ||
37 | <genClasses ecoreClass="FamMetamodel.ecore#//FunctionalInput"> | ||
38 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalInput/IncomingLinks"/> | ||
39 | </genClasses> | ||
40 | <genClasses ecoreClass="FamMetamodel.ecore#//FunctionalOutput"> | ||
41 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalOutput/outgoingLinks"/> | ||
42 | </genClasses> | ||
43 | <genClasses image="false" ecoreClass="FamMetamodel.ecore#//FunctionalData"> | ||
44 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalData/terminator"/> | ||
45 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference FamMetamodel.ecore#//FunctionalData/interface"/> | ||
46 | </genClasses> | ||
47 | </genPackages> | ||
48 | </genmodel:GenModel> | ||
diff --git a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamPatterns.vql b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamPatterns.vql index 013d0419..31b9286e 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamPatterns.vql +++ b/Tests/hu.bme.mit.inf.dslreasoner.application.FAMTest/inputs/FamPatterns.vql | |||
@@ -5,8 +5,12 @@ import epackage "http://www.inf.mit.bme.hu/viatrasolver/example/fam" | |||
5 | @Constraint(message="terminatorAndInformation", severity="error", key={T}) | 5 | @Constraint(message="terminatorAndInformation", severity="error", key={T}) |
6 | pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { | 6 | pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { |
7 | FunctionalOutput.outgoingLinks(Out,I); | 7 | FunctionalOutput.outgoingLinks(Out,I); |
8 | FunctionalOutput.terminator(Out,T); | 8 | FunctionalOutput.terminator(Out,T); |
9 | } or { | 9 | } or { |
10 | InformationLink.to(I,In); | 10 | InformationLink.to(I,In); |
11 | FunctionalInput.terminator(In,T); | 11 | FunctionalInput.terminator(In,T); |
12 | } \ No newline at end of file | 12 | } |
13 | |||
14 | pattern informationLink(I : InformationLink) { | ||
15 | InformationLink(I); | ||
16 | } | ||