aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kris7topher@gmail.com>2019-05-15 13:46:38 -0400
committerLibravatar Kristóf Marussy <kris7topher@gmail.com>2019-05-15 13:46:38 -0400
commite904f9d4b1d2d15ab4ec6d72ee881f4c7de34eef (patch)
tree42cb23ff8839308345c0859cdf99469c930af03b
parentMerge remote-tracking branch 'origin/master' into kris (diff)
downloadVIATRA-Generator-e904f9d4b1d2d15ab4ec6d72ee881f4c7de34eef.tar.gz
VIATRA-Generator-e904f9d4b1d2d15ab4ec6d72ee881f4c7de34eef.tar.zst
VIATRA-Generator-e904f9d4b1d2d15ab4ec6d72ee881f4c7de34eef.zip
Formalize CPS case study for optimization
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.gitignore1
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project12
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF22
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/build.properties9
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationInstance.java110
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationType.java61
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsFactory.java105
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsPackage.java1253
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CyberPhysicalSystem.java112
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostInstance.java141
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostType.java125
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Request.java44
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Requirement.java127
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ResourceRequirement.java104
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java405
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java209
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java188
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java765
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java289
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java355
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java356
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java169
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java387
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java291
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsAdapterFactory.java252
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsSwitch.java266
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird1167
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore53
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel5
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.properties4
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml44
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/.gitignore16
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AllocationWithoutResourceRequirement.java717
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java743
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java743
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeHddMetric.java540
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeMemoryMetric.java540
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CostMetric.java540
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java705
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsCost.java738
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsHosts.java705
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.java207
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/InstanceDoesNotSatisfyRequirement.java716
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableHdd.java579
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableMemory.java579
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java597
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalHdd.java706
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java706
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/.gitignore11
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsQueriesAll.java105
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeHddPercentage.java172
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeMemoryPercentage.java172
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HddRequirement.java151
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HostInstanceCost.java153
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/MemoryRequirement.java151
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/ResourceRequirement.java168
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/SatisfyingInstance.java153
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql132
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml9
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CostMetric.java544
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CoverageMetric.java552
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java33
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/TimeMetric.java544
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AdditionalCommSubsystemCost.java173
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java195
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IncomingData.java145
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/InterferometryPayloadCost.java175
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCost.java183
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCoverage.java183
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionTime.java183
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java48
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/ScienceData.java179
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java209
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftUplink.java171
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithTwoCommSubsystems.java146
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitRate.java277
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitTime.java200
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql9
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/.SatelliteGeneratorMain.xtendbinbin2931 -> 0 bytes
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.java15
81 files changed, 22860 insertions, 191 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath
index 22f30643..00cbac94 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath
@@ -1,7 +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="src" path="ecore-gen"/>
3 <classpathentry kind="src" path="src"/> 4 <classpathentry kind="src" path="src"/>
4 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> 5 <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
5 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> 6 <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
7 <classpathentry kind="src" path="src-gen"/>
6 <classpathentry kind="output" path="bin"/> 8 <classpathentry kind="output" path="bin"/>
7</classpath> 9</classpath>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.gitignore
new file mode 100644
index 00000000..ae3c1726
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.gitignore
@@ -0,0 +1 @@
/bin/
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project
index 994e7632..69c44278 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project
@@ -6,6 +6,16 @@
6 </projects> 6 </projects>
7 <buildSpec> 7 <buildSpec>
8 <buildCommand> 8 <buildCommand>
9 <name>org.eclipse.viatra.query.tooling.ui.projectbuilder</name>
10 <arguments>
11 </arguments>
12 </buildCommand>
13 <buildCommand>
14 <name>org.eclipse.xtext.ui.shared.xtextBuilder</name>
15 <arguments>
16 </arguments>
17 </buildCommand>
18 <buildCommand>
9 <name>org.eclipse.jdt.core.javabuilder</name> 19 <name>org.eclipse.jdt.core.javabuilder</name>
10 <arguments> 20 <arguments>
11 </arguments> 21 </arguments>
@@ -25,5 +35,7 @@
25 <nature>org.eclipse.sirius.nature.modelingproject</nature> 35 <nature>org.eclipse.sirius.nature.modelingproject</nature>
26 <nature>org.eclipse.jdt.core.javanature</nature> 36 <nature>org.eclipse.jdt.core.javanature</nature>
27 <nature>org.eclipse.pde.PluginNature</nature> 37 <nature>org.eclipse.pde.PluginNature</nature>
38 <nature>org.eclipse.viatra.query.projectnature</nature>
39 <nature>org.eclipse.xtext.ui.shared.xtextNature</nature>
28 </natures> 40 </natures>
29</projectDescription> 41</projectDescription>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF
index 4d2fd769..7fd7252c 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF
@@ -1,7 +1,23 @@
1Manifest-Version: 1.0 1Manifest-Version: 1.0
2Bundle-ManifestVersion: 2 2Bundle-ManifestVersion: 2
3Bundle-Name: hu.bme.mit.inf.dslreasoner.domains.cps 3Bundle-Name: %pluginName
4Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.domains.cps; singleton:=true 4Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.domains.cps;singleton:=true
5Bundle-Version: 0.1.0.qualifier 5Bundle-Version: 0.1.0.qualifier
6Require-Bundle: org.eclipse.emf.ecore;visibility:=reexport, 6Bundle-ClassPath: .
7Bundle-Vendor: %providerName
8Bundle-Localization: plugin
9Export-Package: hu.bme.mit.inf.dslreasoner.domains.cps,
10 hu.bme.mit.inf.dslreasoner.domains.cps.impl,
11 hu.bme.mit.inf.dslreasoner.domains.cps.queries,
12 hu.bme.mit.inf.dslreasoner.domains.cps.util
13Require-Bundle: org.eclipse.viatra.addon.querybasedfeatures.runtime,
14 org.eclipse.viatra.query.runtime,
15 org.eclipse.viatra.query.runtime.rete,
16 org.eclipse.viatra.query.runtime.localsearch,
17 org.eclipse.xtext.xbase.lib,
18 org.eclipse.emf.ecore;visibility:=reexport,
7 org.eclipse.core.runtime 19 org.eclipse.core.runtime
20Import-Package: org.apache.log4j
21Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.domains.cps
22Bundle-ActivationPolicy: lazy
23Bundle-RequiredExecutionEnvironment: JavaSE-1.8
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/build.properties b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/build.properties
new file mode 100644
index 00000000..37a7e53b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/build.properties
@@ -0,0 +1,9 @@
1bin.includes = .,\
2 model/,\
3 META-INF/,\
4 plugin.xml,\
5 plugin.properties
6jars.compile.order = .
7source.. = ecore-gen/,\
8 src-gen/
9output.. = bin/
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationInstance.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationInstance.java
new file mode 100644
index 00000000..dc9426f2
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationInstance.java
@@ -0,0 +1,110 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.ecore.EObject;
6
7/**
8 * <!-- begin-user-doc -->
9 * A representation of the model object '<em><b>Application Instance</b></em>'.
10 * <!-- end-user-doc -->
11 *
12 * <p>
13 * The following features are supported:
14 * </p>
15 * <ul>
16 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement <em>Requirement</em>}</li>
17 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType <em>Type</em>}</li>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}</li>
19 * </ul>
20 *
21 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getApplicationInstance()
22 * @model
23 * @generated
24 */
25public interface ApplicationInstance extends EObject {
26 /**
27 * Returns the value of the '<em><b>Requirement</b></em>' reference.
28 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getInstances <em>Instances</em>}'.
29 * <!-- begin-user-doc -->
30 * <p>
31 * If the meaning of the '<em>Requirement</em>' reference isn't clear,
32 * there really should be more of a description here...
33 * </p>
34 * <!-- end-user-doc -->
35 * @return the value of the '<em>Requirement</em>' reference.
36 * @see #setRequirement(Requirement)
37 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getApplicationInstance_Requirement()
38 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getInstances
39 * @model opposite="instances"
40 * @generated
41 */
42 Requirement getRequirement();
43
44 /**
45 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement <em>Requirement</em>}' reference.
46 * <!-- begin-user-doc -->
47 * <!-- end-user-doc -->
48 * @param value the new value of the '<em>Requirement</em>' reference.
49 * @see #getRequirement()
50 * @generated
51 */
52 void setRequirement(Requirement value);
53
54 /**
55 * Returns the value of the '<em><b>Type</b></em>' container reference.
56 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getInstances <em>Instances</em>}'.
57 * <!-- begin-user-doc -->
58 * <p>
59 * If the meaning of the '<em>Type</em>' container reference isn't clear,
60 * there really should be more of a description here...
61 * </p>
62 * <!-- end-user-doc -->
63 * @return the value of the '<em>Type</em>' container reference.
64 * @see #setType(ApplicationType)
65 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getApplicationInstance_Type()
66 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getInstances
67 * @model opposite="instances" required="true" transient="false"
68 * @generated
69 */
70 ApplicationType getType();
71
72 /**
73 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType <em>Type</em>}' container reference.
74 * <!-- begin-user-doc -->
75 * <!-- end-user-doc -->
76 * @param value the new value of the '<em>Type</em>' container reference.
77 * @see #getType()
78 * @generated
79 */
80 void setType(ApplicationType value);
81
82 /**
83 * Returns the value of the '<em><b>Allocated To</b></em>' reference.
84 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}'.
85 * <!-- begin-user-doc -->
86 * <p>
87 * If the meaning of the '<em>Allocated To</em>' reference isn't clear,
88 * there really should be more of a description here...
89 * </p>
90 * <!-- end-user-doc -->
91 * @return the value of the '<em>Allocated To</em>' reference.
92 * @see #setAllocatedTo(HostInstance)
93 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getApplicationInstance_AllocatedTo()
94 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications
95 * @model opposite="applications" required="true"
96 * @generated
97 */
98 HostInstance getAllocatedTo();
99
100 /**
101 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}' reference.
102 * <!-- begin-user-doc -->
103 * <!-- end-user-doc -->
104 * @param value the new value of the '<em>Allocated To</em>' reference.
105 * @see #getAllocatedTo()
106 * @generated
107 */
108 void setAllocatedTo(HostInstance value);
109
110} // ApplicationInstance
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationType.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationType.java
new file mode 100644
index 00000000..f44287ae
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ApplicationType.java
@@ -0,0 +1,61 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.common.util.EList;
6
7import org.eclipse.emf.ecore.EObject;
8
9/**
10 * <!-- begin-user-doc -->
11 * A representation of the model object '<em><b>Application Type</b></em>'.
12 * <!-- end-user-doc -->
13 *
14 * <p>
15 * The following features are supported:
16 * </p>
17 * <ul>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getInstances <em>Instances</em>}</li>
19 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getRequirements <em>Requirements</em>}</li>
20 * </ul>
21 *
22 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getApplicationType()
23 * @model
24 * @generated
25 */
26public interface ApplicationType extends EObject {
27 /**
28 * Returns the value of the '<em><b>Instances</b></em>' containment reference list.
29 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}.
30 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType <em>Type</em>}'.
31 * <!-- begin-user-doc -->
32 * <p>
33 * If the meaning of the '<em>Instances</em>' containment reference list isn't clear,
34 * there really should be more of a description here...
35 * </p>
36 * <!-- end-user-doc -->
37 * @return the value of the '<em>Instances</em>' containment reference list.
38 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getApplicationType_Instances()
39 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType
40 * @model opposite="type" containment="true"
41 * @generated
42 */
43 EList<ApplicationInstance> getInstances();
44
45 /**
46 * Returns the value of the '<em><b>Requirements</b></em>' containment reference list.
47 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement}.
48 * <!-- begin-user-doc -->
49 * <p>
50 * If the meaning of the '<em>Requirements</em>' containment reference list isn't clear,
51 * there really should be more of a description here...
52 * </p>
53 * <!-- end-user-doc -->
54 * @return the value of the '<em>Requirements</em>' containment reference list.
55 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getApplicationType_Requirements()
56 * @model containment="true"
57 * @generated
58 */
59 EList<ResourceRequirement> getRequirements();
60
61} // ApplicationType
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsFactory.java
new file mode 100644
index 00000000..93a5fc95
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsFactory.java
@@ -0,0 +1,105 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.ecore.EFactory;
6
7/**
8 * <!-- begin-user-doc -->
9 * The <b>Factory</b> for the model.
10 * It provides a create method for each non-abstract class of the model.
11 * <!-- end-user-doc -->
12 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage
13 * @generated
14 */
15public interface CpsFactory extends EFactory {
16 /**
17 * The singleton instance of the factory.
18 * <!-- begin-user-doc -->
19 * <!-- end-user-doc -->
20 * @generated
21 */
22 CpsFactory eINSTANCE = hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsFactoryImpl.init();
23
24 /**
25 * Returns a new object of class '<em>Cyber Physical System</em>'.
26 * <!-- begin-user-doc -->
27 * <!-- end-user-doc -->
28 * @return a new object of class '<em>Cyber Physical System</em>'.
29 * @generated
30 */
31 CyberPhysicalSystem createCyberPhysicalSystem();
32
33 /**
34 * Returns a new object of class '<em>Application Type</em>'.
35 * <!-- begin-user-doc -->
36 * <!-- end-user-doc -->
37 * @return a new object of class '<em>Application Type</em>'.
38 * @generated
39 */
40 ApplicationType createApplicationType();
41
42 /**
43 * Returns a new object of class '<em>Host Type</em>'.
44 * <!-- begin-user-doc -->
45 * <!-- end-user-doc -->
46 * @return a new object of class '<em>Host Type</em>'.
47 * @generated
48 */
49 HostType createHostType();
50
51 /**
52 * Returns a new object of class '<em>Request</em>'.
53 * <!-- begin-user-doc -->
54 * <!-- end-user-doc -->
55 * @return a new object of class '<em>Request</em>'.
56 * @generated
57 */
58 Request createRequest();
59
60 /**
61 * Returns a new object of class '<em>Requirement</em>'.
62 * <!-- begin-user-doc -->
63 * <!-- end-user-doc -->
64 * @return a new object of class '<em>Requirement</em>'.
65 * @generated
66 */
67 Requirement createRequirement();
68
69 /**
70 * Returns a new object of class '<em>Application Instance</em>'.
71 * <!-- begin-user-doc -->
72 * <!-- end-user-doc -->
73 * @return a new object of class '<em>Application Instance</em>'.
74 * @generated
75 */
76 ApplicationInstance createApplicationInstance();
77
78 /**
79 * Returns a new object of class '<em>Resource Requirement</em>'.
80 * <!-- begin-user-doc -->
81 * <!-- end-user-doc -->
82 * @return a new object of class '<em>Resource Requirement</em>'.
83 * @generated
84 */
85 ResourceRequirement createResourceRequirement();
86
87 /**
88 * Returns a new object of class '<em>Host Instance</em>'.
89 * <!-- begin-user-doc -->
90 * <!-- end-user-doc -->
91 * @return a new object of class '<em>Host Instance</em>'.
92 * @generated
93 */
94 HostInstance createHostInstance();
95
96 /**
97 * Returns the package supported by this factory.
98 * <!-- begin-user-doc -->
99 * <!-- end-user-doc -->
100 * @return the package supported by this factory.
101 * @generated
102 */
103 CpsPackage getCpsPackage();
104
105} //CpsFactory
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsPackage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsPackage.java
new file mode 100644
index 00000000..2d7e0660
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsPackage.java
@@ -0,0 +1,1253 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.ecore.EAttribute;
6import org.eclipse.emf.ecore.EClass;
7import org.eclipse.emf.ecore.EPackage;
8import org.eclipse.emf.ecore.EReference;
9
10/**
11 * <!-- begin-user-doc -->
12 * The <b>Package</b> for the model.
13 * It contains accessors for the meta objects to represent
14 * <ul>
15 * <li>each class,</li>
16 * <li>each feature of each class,</li>
17 * <li>each operation of each class,</li>
18 * <li>each enum,</li>
19 * <li>and each data type</li>
20 * </ul>
21 * <!-- end-user-doc -->
22 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory
23 * @model kind="package"
24 * annotation="http://www.eclipse.org/emf/2002/Ecore settingDelegates='org.eclipse.viatra.query.querybasedfeature'"
25 * @generated
26 */
27public interface CpsPackage extends EPackage {
28 /**
29 * The package name.
30 * <!-- begin-user-doc -->
31 * <!-- end-user-doc -->
32 * @generated
33 */
34 String eNAME = "cps";
35
36 /**
37 * The package namespace URI.
38 * <!-- begin-user-doc -->
39 * <!-- end-user-doc -->
40 * @generated
41 */
42 String eNS_URI = "http://www.example.org/cps";
43
44 /**
45 * The package namespace name.
46 * <!-- begin-user-doc -->
47 * <!-- end-user-doc -->
48 * @generated
49 */
50 String eNS_PREFIX = "cps";
51
52 /**
53 * The singleton instance of the package.
54 * <!-- begin-user-doc -->
55 * <!-- end-user-doc -->
56 * @generated
57 */
58 CpsPackage eINSTANCE = hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl.init();
59
60 /**
61 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl <em>Cyber Physical System</em>}' class.
62 * <!-- begin-user-doc -->
63 * <!-- end-user-doc -->
64 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl
65 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getCyberPhysicalSystem()
66 * @generated
67 */
68 int CYBER_PHYSICAL_SYSTEM = 0;
69
70 /**
71 * The feature id for the '<em><b>Requests</b></em>' containment reference list.
72 * <!-- begin-user-doc -->
73 * <!-- end-user-doc -->
74 * @generated
75 * @ordered
76 */
77 int CYBER_PHYSICAL_SYSTEM__REQUESTS = 0;
78
79 /**
80 * The feature id for the '<em><b>Application Types</b></em>' containment reference list.
81 * <!-- begin-user-doc -->
82 * <!-- end-user-doc -->
83 * @generated
84 * @ordered
85 */
86 int CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES = 1;
87
88 /**
89 * The feature id for the '<em><b>Host Types</b></em>' containment reference list.
90 * <!-- begin-user-doc -->
91 * <!-- end-user-doc -->
92 * @generated
93 * @ordered
94 */
95 int CYBER_PHYSICAL_SYSTEM__HOST_TYPES = 2;
96
97 /**
98 * The feature id for the '<em><b>Hosts</b></em>' reference list.
99 * <!-- begin-user-doc -->
100 * <!-- end-user-doc -->
101 * @generated
102 * @ordered
103 */
104 int CYBER_PHYSICAL_SYSTEM__HOSTS = 3;
105
106 /**
107 * The feature id for the '<em><b>Applications</b></em>' reference list.
108 * <!-- begin-user-doc -->
109 * <!-- end-user-doc -->
110 * @generated
111 * @ordered
112 */
113 int CYBER_PHYSICAL_SYSTEM__APPLICATIONS = 4;
114
115 /**
116 * The number of structural features of the '<em>Cyber Physical System</em>' class.
117 * <!-- begin-user-doc -->
118 * <!-- end-user-doc -->
119 * @generated
120 * @ordered
121 */
122 int CYBER_PHYSICAL_SYSTEM_FEATURE_COUNT = 5;
123
124 /**
125 * The number of operations of the '<em>Cyber Physical System</em>' class.
126 * <!-- begin-user-doc -->
127 * <!-- end-user-doc -->
128 * @generated
129 * @ordered
130 */
131 int CYBER_PHYSICAL_SYSTEM_OPERATION_COUNT = 0;
132
133 /**
134 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl <em>Application Type</em>}' class.
135 * <!-- begin-user-doc -->
136 * <!-- end-user-doc -->
137 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl
138 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationType()
139 * @generated
140 */
141 int APPLICATION_TYPE = 1;
142
143 /**
144 * The feature id for the '<em><b>Instances</b></em>' containment reference list.
145 * <!-- begin-user-doc -->
146 * <!-- end-user-doc -->
147 * @generated
148 * @ordered
149 */
150 int APPLICATION_TYPE__INSTANCES = 0;
151
152 /**
153 * The feature id for the '<em><b>Requirements</b></em>' containment reference list.
154 * <!-- begin-user-doc -->
155 * <!-- end-user-doc -->
156 * @generated
157 * @ordered
158 */
159 int APPLICATION_TYPE__REQUIREMENTS = 1;
160
161 /**
162 * The number of structural features of the '<em>Application Type</em>' class.
163 * <!-- begin-user-doc -->
164 * <!-- end-user-doc -->
165 * @generated
166 * @ordered
167 */
168 int APPLICATION_TYPE_FEATURE_COUNT = 2;
169
170 /**
171 * The number of operations of the '<em>Application Type</em>' class.
172 * <!-- begin-user-doc -->
173 * <!-- end-user-doc -->
174 * @generated
175 * @ordered
176 */
177 int APPLICATION_TYPE_OPERATION_COUNT = 0;
178
179 /**
180 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl <em>Host Type</em>}' class.
181 * <!-- begin-user-doc -->
182 * <!-- end-user-doc -->
183 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl
184 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostType()
185 * @generated
186 */
187 int HOST_TYPE = 2;
188
189 /**
190 * The feature id for the '<em><b>Default Memory</b></em>' attribute.
191 * <!-- begin-user-doc -->
192 * <!-- end-user-doc -->
193 * @generated
194 * @ordered
195 */
196 int HOST_TYPE__DEFAULT_MEMORY = 0;
197
198 /**
199 * The feature id for the '<em><b>Default Hdd</b></em>' attribute.
200 * <!-- begin-user-doc -->
201 * <!-- end-user-doc -->
202 * @generated
203 * @ordered
204 */
205 int HOST_TYPE__DEFAULT_HDD = 1;
206
207 /**
208 * The feature id for the '<em><b>Instances</b></em>' containment reference list.
209 * <!-- begin-user-doc -->
210 * <!-- end-user-doc -->
211 * @generated
212 * @ordered
213 */
214 int HOST_TYPE__INSTANCES = 2;
215
216 /**
217 * The feature id for the '<em><b>Cost</b></em>' attribute.
218 * <!-- begin-user-doc -->
219 * <!-- end-user-doc -->
220 * @generated
221 * @ordered
222 */
223 int HOST_TYPE__COST = 3;
224
225 /**
226 * The number of structural features of the '<em>Host Type</em>' class.
227 * <!-- begin-user-doc -->
228 * <!-- end-user-doc -->
229 * @generated
230 * @ordered
231 */
232 int HOST_TYPE_FEATURE_COUNT = 4;
233
234 /**
235 * The number of operations of the '<em>Host Type</em>' class.
236 * <!-- begin-user-doc -->
237 * <!-- end-user-doc -->
238 * @generated
239 * @ordered
240 */
241 int HOST_TYPE_OPERATION_COUNT = 0;
242
243 /**
244 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl <em>Request</em>}' class.
245 * <!-- begin-user-doc -->
246 * <!-- end-user-doc -->
247 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl
248 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequest()
249 * @generated
250 */
251 int REQUEST = 3;
252
253 /**
254 * The feature id for the '<em><b>Requirements</b></em>' containment reference list.
255 * <!-- begin-user-doc -->
256 * <!-- end-user-doc -->
257 * @generated
258 * @ordered
259 */
260 int REQUEST__REQUIREMENTS = 0;
261
262 /**
263 * The number of structural features of the '<em>Request</em>' class.
264 * <!-- begin-user-doc -->
265 * <!-- end-user-doc -->
266 * @generated
267 * @ordered
268 */
269 int REQUEST_FEATURE_COUNT = 1;
270
271 /**
272 * The number of operations of the '<em>Request</em>' class.
273 * <!-- begin-user-doc -->
274 * <!-- end-user-doc -->
275 * @generated
276 * @ordered
277 */
278 int REQUEST_OPERATION_COUNT = 0;
279
280 /**
281 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl <em>Requirement</em>}' class.
282 * <!-- begin-user-doc -->
283 * <!-- end-user-doc -->
284 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl
285 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequirement()
286 * @generated
287 */
288 int REQUIREMENT = 4;
289
290 /**
291 * The feature id for the '<em><b>Request</b></em>' container reference.
292 * <!-- begin-user-doc -->
293 * <!-- end-user-doc -->
294 * @generated
295 * @ordered
296 */
297 int REQUIREMENT__REQUEST = 0;
298
299 /**
300 * The feature id for the '<em><b>Count</b></em>' attribute.
301 * <!-- begin-user-doc -->
302 * <!-- end-user-doc -->
303 * @generated
304 * @ordered
305 */
306 int REQUIREMENT__COUNT = 1;
307
308 /**
309 * The feature id for the '<em><b>Type</b></em>' reference.
310 * <!-- begin-user-doc -->
311 * <!-- end-user-doc -->
312 * @generated
313 * @ordered
314 */
315 int REQUIREMENT__TYPE = 2;
316
317 /**
318 * The feature id for the '<em><b>Instances</b></em>' reference list.
319 * <!-- begin-user-doc -->
320 * <!-- end-user-doc -->
321 * @generated
322 * @ordered
323 */
324 int REQUIREMENT__INSTANCES = 3;
325
326 /**
327 * The number of structural features of the '<em>Requirement</em>' class.
328 * <!-- begin-user-doc -->
329 * <!-- end-user-doc -->
330 * @generated
331 * @ordered
332 */
333 int REQUIREMENT_FEATURE_COUNT = 4;
334
335 /**
336 * The number of operations of the '<em>Requirement</em>' class.
337 * <!-- begin-user-doc -->
338 * <!-- end-user-doc -->
339 * @generated
340 * @ordered
341 */
342 int REQUIREMENT_OPERATION_COUNT = 0;
343
344 /**
345 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl <em>Application Instance</em>}' class.
346 * <!-- begin-user-doc -->
347 * <!-- end-user-doc -->
348 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl
349 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationInstance()
350 * @generated
351 */
352 int APPLICATION_INSTANCE = 5;
353
354 /**
355 * The feature id for the '<em><b>Requirement</b></em>' reference.
356 * <!-- begin-user-doc -->
357 * <!-- end-user-doc -->
358 * @generated
359 * @ordered
360 */
361 int APPLICATION_INSTANCE__REQUIREMENT = 0;
362
363 /**
364 * The feature id for the '<em><b>Type</b></em>' container reference.
365 * <!-- begin-user-doc -->
366 * <!-- end-user-doc -->
367 * @generated
368 * @ordered
369 */
370 int APPLICATION_INSTANCE__TYPE = 1;
371
372 /**
373 * The feature id for the '<em><b>Allocated To</b></em>' reference.
374 * <!-- begin-user-doc -->
375 * <!-- end-user-doc -->
376 * @generated
377 * @ordered
378 */
379 int APPLICATION_INSTANCE__ALLOCATED_TO = 2;
380
381 /**
382 * The number of structural features of the '<em>Application Instance</em>' class.
383 * <!-- begin-user-doc -->
384 * <!-- end-user-doc -->
385 * @generated
386 * @ordered
387 */
388 int APPLICATION_INSTANCE_FEATURE_COUNT = 3;
389
390 /**
391 * The number of operations of the '<em>Application Instance</em>' class.
392 * <!-- begin-user-doc -->
393 * <!-- end-user-doc -->
394 * @generated
395 * @ordered
396 */
397 int APPLICATION_INSTANCE_OPERATION_COUNT = 0;
398
399 /**
400 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl <em>Resource Requirement</em>}' class.
401 * <!-- begin-user-doc -->
402 * <!-- end-user-doc -->
403 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl
404 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getResourceRequirement()
405 * @generated
406 */
407 int RESOURCE_REQUIREMENT = 6;
408
409 /**
410 * The feature id for the '<em><b>Required Memory</b></em>' attribute.
411 * <!-- begin-user-doc -->
412 * <!-- end-user-doc -->
413 * @generated
414 * @ordered
415 */
416 int RESOURCE_REQUIREMENT__REQUIRED_MEMORY = 0;
417
418 /**
419 * The feature id for the '<em><b>Required Hdd</b></em>' attribute.
420 * <!-- begin-user-doc -->
421 * <!-- end-user-doc -->
422 * @generated
423 * @ordered
424 */
425 int RESOURCE_REQUIREMENT__REQUIRED_HDD = 1;
426
427 /**
428 * The feature id for the '<em><b>Host Type</b></em>' reference.
429 * <!-- begin-user-doc -->
430 * <!-- end-user-doc -->
431 * @generated
432 * @ordered
433 */
434 int RESOURCE_REQUIREMENT__HOST_TYPE = 2;
435
436 /**
437 * The number of structural features of the '<em>Resource Requirement</em>' class.
438 * <!-- begin-user-doc -->
439 * <!-- end-user-doc -->
440 * @generated
441 * @ordered
442 */
443 int RESOURCE_REQUIREMENT_FEATURE_COUNT = 3;
444
445 /**
446 * The number of operations of the '<em>Resource Requirement</em>' class.
447 * <!-- begin-user-doc -->
448 * <!-- end-user-doc -->
449 * @generated
450 * @ordered
451 */
452 int RESOURCE_REQUIREMENT_OPERATION_COUNT = 0;
453
454 /**
455 * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl <em>Host Instance</em>}' class.
456 * <!-- begin-user-doc -->
457 * <!-- end-user-doc -->
458 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl
459 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostInstance()
460 * @generated
461 */
462 int HOST_INSTANCE = 7;
463
464 /**
465 * The feature id for the '<em><b>Type</b></em>' container reference.
466 * <!-- begin-user-doc -->
467 * <!-- end-user-doc -->
468 * @generated
469 * @ordered
470 */
471 int HOST_INSTANCE__TYPE = 0;
472
473 /**
474 * The feature id for the '<em><b>Available Memory</b></em>' attribute.
475 * <!-- begin-user-doc -->
476 * <!-- end-user-doc -->
477 * @generated
478 * @ordered
479 */
480 int HOST_INSTANCE__AVAILABLE_MEMORY = 1;
481
482 /**
483 * The feature id for the '<em><b>Available Hdd</b></em>' attribute.
484 * <!-- begin-user-doc -->
485 * <!-- end-user-doc -->
486 * @generated
487 * @ordered
488 */
489 int HOST_INSTANCE__AVAILABLE_HDD = 2;
490
491 /**
492 * The feature id for the '<em><b>Total Memory</b></em>' attribute.
493 * <!-- begin-user-doc -->
494 * <!-- end-user-doc -->
495 * @generated
496 * @ordered
497 */
498 int HOST_INSTANCE__TOTAL_MEMORY = 3;
499
500 /**
501 * The feature id for the '<em><b>Total Hdd</b></em>' attribute.
502 * <!-- begin-user-doc -->
503 * <!-- end-user-doc -->
504 * @generated
505 * @ordered
506 */
507 int HOST_INSTANCE__TOTAL_HDD = 4;
508
509 /**
510 * The feature id for the '<em><b>Applications</b></em>' reference list.
511 * <!-- begin-user-doc -->
512 * <!-- end-user-doc -->
513 * @generated
514 * @ordered
515 */
516 int HOST_INSTANCE__APPLICATIONS = 5;
517
518 /**
519 * The number of structural features of the '<em>Host Instance</em>' class.
520 * <!-- begin-user-doc -->
521 * <!-- end-user-doc -->
522 * @generated
523 * @ordered
524 */
525 int HOST_INSTANCE_FEATURE_COUNT = 6;
526
527 /**
528 * The number of operations of the '<em>Host Instance</em>' class.
529 * <!-- begin-user-doc -->
530 * <!-- end-user-doc -->
531 * @generated
532 * @ordered
533 */
534 int HOST_INSTANCE_OPERATION_COUNT = 0;
535
536 /**
537 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem <em>Cyber Physical System</em>}'.
538 * <!-- begin-user-doc -->
539 * <!-- end-user-doc -->
540 * @return the meta object for class '<em>Cyber Physical System</em>'.
541 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem
542 * @generated
543 */
544 EClass getCyberPhysicalSystem();
545
546 /**
547 * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getRequests <em>Requests</em>}'.
548 * <!-- begin-user-doc -->
549 * <!-- end-user-doc -->
550 * @return the meta object for the containment reference list '<em>Requests</em>'.
551 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getRequests()
552 * @see #getCyberPhysicalSystem()
553 * @generated
554 */
555 EReference getCyberPhysicalSystem_Requests();
556
557 /**
558 * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplicationTypes <em>Application Types</em>}'.
559 * <!-- begin-user-doc -->
560 * <!-- end-user-doc -->
561 * @return the meta object for the containment reference list '<em>Application Types</em>'.
562 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplicationTypes()
563 * @see #getCyberPhysicalSystem()
564 * @generated
565 */
566 EReference getCyberPhysicalSystem_ApplicationTypes();
567
568 /**
569 * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHostTypes <em>Host Types</em>}'.
570 * <!-- begin-user-doc -->
571 * <!-- end-user-doc -->
572 * @return the meta object for the containment reference list '<em>Host Types</em>'.
573 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHostTypes()
574 * @see #getCyberPhysicalSystem()
575 * @generated
576 */
577 EReference getCyberPhysicalSystem_HostTypes();
578
579 /**
580 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHosts <em>Hosts</em>}'.
581 * <!-- begin-user-doc -->
582 * <!-- end-user-doc -->
583 * @return the meta object for the reference list '<em>Hosts</em>'.
584 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHosts()
585 * @see #getCyberPhysicalSystem()
586 * @generated
587 */
588 EReference getCyberPhysicalSystem_Hosts();
589
590 /**
591 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplications <em>Applications</em>}'.
592 * <!-- begin-user-doc -->
593 * <!-- end-user-doc -->
594 * @return the meta object for the reference list '<em>Applications</em>'.
595 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplications()
596 * @see #getCyberPhysicalSystem()
597 * @generated
598 */
599 EReference getCyberPhysicalSystem_Applications();
600
601 /**
602 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType <em>Application Type</em>}'.
603 * <!-- begin-user-doc -->
604 * <!-- end-user-doc -->
605 * @return the meta object for class '<em>Application Type</em>'.
606 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType
607 * @generated
608 */
609 EClass getApplicationType();
610
611 /**
612 * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getInstances <em>Instances</em>}'.
613 * <!-- begin-user-doc -->
614 * <!-- end-user-doc -->
615 * @return the meta object for the containment reference list '<em>Instances</em>'.
616 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getInstances()
617 * @see #getApplicationType()
618 * @generated
619 */
620 EReference getApplicationType_Instances();
621
622 /**
623 * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getRequirements <em>Requirements</em>}'.
624 * <!-- begin-user-doc -->
625 * <!-- end-user-doc -->
626 * @return the meta object for the containment reference list '<em>Requirements</em>'.
627 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getRequirements()
628 * @see #getApplicationType()
629 * @generated
630 */
631 EReference getApplicationType_Requirements();
632
633 /**
634 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType <em>Host Type</em>}'.
635 * <!-- begin-user-doc -->
636 * <!-- end-user-doc -->
637 * @return the meta object for class '<em>Host Type</em>'.
638 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType
639 * @generated
640 */
641 EClass getHostType();
642
643 /**
644 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultMemory <em>Default Memory</em>}'.
645 * <!-- begin-user-doc -->
646 * <!-- end-user-doc -->
647 * @return the meta object for the attribute '<em>Default Memory</em>'.
648 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultMemory()
649 * @see #getHostType()
650 * @generated
651 */
652 EAttribute getHostType_DefaultMemory();
653
654 /**
655 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultHdd <em>Default Hdd</em>}'.
656 * <!-- begin-user-doc -->
657 * <!-- end-user-doc -->
658 * @return the meta object for the attribute '<em>Default Hdd</em>'.
659 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultHdd()
660 * @see #getHostType()
661 * @generated
662 */
663 EAttribute getHostType_DefaultHdd();
664
665 /**
666 * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances <em>Instances</em>}'.
667 * <!-- begin-user-doc -->
668 * <!-- end-user-doc -->
669 * @return the meta object for the containment reference list '<em>Instances</em>'.
670 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances()
671 * @see #getHostType()
672 * @generated
673 */
674 EReference getHostType_Instances();
675
676 /**
677 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getCost <em>Cost</em>}'.
678 * <!-- begin-user-doc -->
679 * <!-- end-user-doc -->
680 * @return the meta object for the attribute '<em>Cost</em>'.
681 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getCost()
682 * @see #getHostType()
683 * @generated
684 */
685 EAttribute getHostType_Cost();
686
687 /**
688 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Request <em>Request</em>}'.
689 * <!-- begin-user-doc -->
690 * <!-- end-user-doc -->
691 * @return the meta object for class '<em>Request</em>'.
692 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Request
693 * @generated
694 */
695 EClass getRequest();
696
697 /**
698 * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Request#getRequirements <em>Requirements</em>}'.
699 * <!-- begin-user-doc -->
700 * <!-- end-user-doc -->
701 * @return the meta object for the containment reference list '<em>Requirements</em>'.
702 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Request#getRequirements()
703 * @see #getRequest()
704 * @generated
705 */
706 EReference getRequest_Requirements();
707
708 /**
709 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement <em>Requirement</em>}'.
710 * <!-- begin-user-doc -->
711 * <!-- end-user-doc -->
712 * @return the meta object for class '<em>Requirement</em>'.
713 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement
714 * @generated
715 */
716 EClass getRequirement();
717
718 /**
719 * Returns the meta object for the container reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest <em>Request</em>}'.
720 * <!-- begin-user-doc -->
721 * <!-- end-user-doc -->
722 * @return the meta object for the container reference '<em>Request</em>'.
723 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest()
724 * @see #getRequirement()
725 * @generated
726 */
727 EReference getRequirement_Request();
728
729 /**
730 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getCount <em>Count</em>}'.
731 * <!-- begin-user-doc -->
732 * <!-- end-user-doc -->
733 * @return the meta object for the attribute '<em>Count</em>'.
734 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getCount()
735 * @see #getRequirement()
736 * @generated
737 */
738 EAttribute getRequirement_Count();
739
740 /**
741 * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getType <em>Type</em>}'.
742 * <!-- begin-user-doc -->
743 * <!-- end-user-doc -->
744 * @return the meta object for the reference '<em>Type</em>'.
745 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getType()
746 * @see #getRequirement()
747 * @generated
748 */
749 EReference getRequirement_Type();
750
751 /**
752 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getInstances <em>Instances</em>}'.
753 * <!-- begin-user-doc -->
754 * <!-- end-user-doc -->
755 * @return the meta object for the reference list '<em>Instances</em>'.
756 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getInstances()
757 * @see #getRequirement()
758 * @generated
759 */
760 EReference getRequirement_Instances();
761
762 /**
763 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance <em>Application Instance</em>}'.
764 * <!-- begin-user-doc -->
765 * <!-- end-user-doc -->
766 * @return the meta object for class '<em>Application Instance</em>'.
767 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance
768 * @generated
769 */
770 EClass getApplicationInstance();
771
772 /**
773 * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement <em>Requirement</em>}'.
774 * <!-- begin-user-doc -->
775 * <!-- end-user-doc -->
776 * @return the meta object for the reference '<em>Requirement</em>'.
777 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement()
778 * @see #getApplicationInstance()
779 * @generated
780 */
781 EReference getApplicationInstance_Requirement();
782
783 /**
784 * Returns the meta object for the container reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType <em>Type</em>}'.
785 * <!-- begin-user-doc -->
786 * <!-- end-user-doc -->
787 * @return the meta object for the container reference '<em>Type</em>'.
788 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType()
789 * @see #getApplicationInstance()
790 * @generated
791 */
792 EReference getApplicationInstance_Type();
793
794 /**
795 * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}'.
796 * <!-- begin-user-doc -->
797 * <!-- end-user-doc -->
798 * @return the meta object for the reference '<em>Allocated To</em>'.
799 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo()
800 * @see #getApplicationInstance()
801 * @generated
802 */
803 EReference getApplicationInstance_AllocatedTo();
804
805 /**
806 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement <em>Resource Requirement</em>}'.
807 * <!-- begin-user-doc -->
808 * <!-- end-user-doc -->
809 * @return the meta object for class '<em>Resource Requirement</em>'.
810 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement
811 * @generated
812 */
813 EClass getResourceRequirement();
814
815 /**
816 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredMemory <em>Required Memory</em>}'.
817 * <!-- begin-user-doc -->
818 * <!-- end-user-doc -->
819 * @return the meta object for the attribute '<em>Required Memory</em>'.
820 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredMemory()
821 * @see #getResourceRequirement()
822 * @generated
823 */
824 EAttribute getResourceRequirement_RequiredMemory();
825
826 /**
827 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredHdd <em>Required Hdd</em>}'.
828 * <!-- begin-user-doc -->
829 * <!-- end-user-doc -->
830 * @return the meta object for the attribute '<em>Required Hdd</em>'.
831 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredHdd()
832 * @see #getResourceRequirement()
833 * @generated
834 */
835 EAttribute getResourceRequirement_RequiredHdd();
836
837 /**
838 * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getHostType <em>Host Type</em>}'.
839 * <!-- begin-user-doc -->
840 * <!-- end-user-doc -->
841 * @return the meta object for the reference '<em>Host Type</em>'.
842 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getHostType()
843 * @see #getResourceRequirement()
844 * @generated
845 */
846 EReference getResourceRequirement_HostType();
847
848 /**
849 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance <em>Host Instance</em>}'.
850 * <!-- begin-user-doc -->
851 * <!-- end-user-doc -->
852 * @return the meta object for class '<em>Host Instance</em>'.
853 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance
854 * @generated
855 */
856 EClass getHostInstance();
857
858 /**
859 * Returns the meta object for the container reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}'.
860 * <!-- begin-user-doc -->
861 * <!-- end-user-doc -->
862 * @return the meta object for the container reference '<em>Type</em>'.
863 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType()
864 * @see #getHostInstance()
865 * @generated
866 */
867 EReference getHostInstance_Type();
868
869 /**
870 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableMemory <em>Available Memory</em>}'.
871 * <!-- begin-user-doc -->
872 * <!-- end-user-doc -->
873 * @return the meta object for the attribute '<em>Available Memory</em>'.
874 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableMemory()
875 * @see #getHostInstance()
876 * @generated
877 */
878 EAttribute getHostInstance_AvailableMemory();
879
880 /**
881 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableHdd <em>Available Hdd</em>}'.
882 * <!-- begin-user-doc -->
883 * <!-- end-user-doc -->
884 * @return the meta object for the attribute '<em>Available Hdd</em>'.
885 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableHdd()
886 * @see #getHostInstance()
887 * @generated
888 */
889 EAttribute getHostInstance_AvailableHdd();
890
891 /**
892 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalMemory <em>Total Memory</em>}'.
893 * <!-- begin-user-doc -->
894 * <!-- end-user-doc -->
895 * @return the meta object for the attribute '<em>Total Memory</em>'.
896 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalMemory()
897 * @see #getHostInstance()
898 * @generated
899 */
900 EAttribute getHostInstance_TotalMemory();
901
902 /**
903 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalHdd <em>Total Hdd</em>}'.
904 * <!-- begin-user-doc -->
905 * <!-- end-user-doc -->
906 * @return the meta object for the attribute '<em>Total Hdd</em>'.
907 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalHdd()
908 * @see #getHostInstance()
909 * @generated
910 */
911 EAttribute getHostInstance_TotalHdd();
912
913 /**
914 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}'.
915 * <!-- begin-user-doc -->
916 * <!-- end-user-doc -->
917 * @return the meta object for the reference list '<em>Applications</em>'.
918 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications()
919 * @see #getHostInstance()
920 * @generated
921 */
922 EReference getHostInstance_Applications();
923
924 /**
925 * Returns the factory that creates the instances of the model.
926 * <!-- begin-user-doc -->
927 * <!-- end-user-doc -->
928 * @return the factory that creates the instances of the model.
929 * @generated
930 */
931 CpsFactory getCpsFactory();
932
933 /**
934 * <!-- begin-user-doc -->
935 * Defines literals for the meta objects that represent
936 * <ul>
937 * <li>each class,</li>
938 * <li>each feature of each class,</li>
939 * <li>each operation of each class,</li>
940 * <li>each enum,</li>
941 * <li>and each data type</li>
942 * </ul>
943 * <!-- end-user-doc -->
944 * @generated
945 */
946 interface Literals {
947 /**
948 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl <em>Cyber Physical System</em>}' class.
949 * <!-- begin-user-doc -->
950 * <!-- end-user-doc -->
951 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl
952 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getCyberPhysicalSystem()
953 * @generated
954 */
955 EClass CYBER_PHYSICAL_SYSTEM = eINSTANCE.getCyberPhysicalSystem();
956
957 /**
958 * The meta object literal for the '<em><b>Requests</b></em>' containment reference list feature.
959 * <!-- begin-user-doc -->
960 * <!-- end-user-doc -->
961 * @generated
962 */
963 EReference CYBER_PHYSICAL_SYSTEM__REQUESTS = eINSTANCE.getCyberPhysicalSystem_Requests();
964
965 /**
966 * The meta object literal for the '<em><b>Application Types</b></em>' containment reference list feature.
967 * <!-- begin-user-doc -->
968 * <!-- end-user-doc -->
969 * @generated
970 */
971 EReference CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES = eINSTANCE.getCyberPhysicalSystem_ApplicationTypes();
972
973 /**
974 * The meta object literal for the '<em><b>Host Types</b></em>' containment reference list feature.
975 * <!-- begin-user-doc -->
976 * <!-- end-user-doc -->
977 * @generated
978 */
979 EReference CYBER_PHYSICAL_SYSTEM__HOST_TYPES = eINSTANCE.getCyberPhysicalSystem_HostTypes();
980
981 /**
982 * The meta object literal for the '<em><b>Hosts</b></em>' reference list feature.
983 * <!-- begin-user-doc -->
984 * <!-- end-user-doc -->
985 * @generated
986 */
987 EReference CYBER_PHYSICAL_SYSTEM__HOSTS = eINSTANCE.getCyberPhysicalSystem_Hosts();
988
989 /**
990 * The meta object literal for the '<em><b>Applications</b></em>' reference list feature.
991 * <!-- begin-user-doc -->
992 * <!-- end-user-doc -->
993 * @generated
994 */
995 EReference CYBER_PHYSICAL_SYSTEM__APPLICATIONS = eINSTANCE.getCyberPhysicalSystem_Applications();
996
997 /**
998 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl <em>Application Type</em>}' class.
999 * <!-- begin-user-doc -->
1000 * <!-- end-user-doc -->
1001 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl
1002 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationType()
1003 * @generated
1004 */
1005 EClass APPLICATION_TYPE = eINSTANCE.getApplicationType();
1006
1007 /**
1008 * The meta object literal for the '<em><b>Instances</b></em>' containment reference list feature.
1009 * <!-- begin-user-doc -->
1010 * <!-- end-user-doc -->
1011 * @generated
1012 */
1013 EReference APPLICATION_TYPE__INSTANCES = eINSTANCE.getApplicationType_Instances();
1014
1015 /**
1016 * The meta object literal for the '<em><b>Requirements</b></em>' containment reference list feature.
1017 * <!-- begin-user-doc -->
1018 * <!-- end-user-doc -->
1019 * @generated
1020 */
1021 EReference APPLICATION_TYPE__REQUIREMENTS = eINSTANCE.getApplicationType_Requirements();
1022
1023 /**
1024 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl <em>Host Type</em>}' class.
1025 * <!-- begin-user-doc -->
1026 * <!-- end-user-doc -->
1027 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl
1028 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostType()
1029 * @generated
1030 */
1031 EClass HOST_TYPE = eINSTANCE.getHostType();
1032
1033 /**
1034 * The meta object literal for the '<em><b>Default Memory</b></em>' attribute feature.
1035 * <!-- begin-user-doc -->
1036 * <!-- end-user-doc -->
1037 * @generated
1038 */
1039 EAttribute HOST_TYPE__DEFAULT_MEMORY = eINSTANCE.getHostType_DefaultMemory();
1040
1041 /**
1042 * The meta object literal for the '<em><b>Default Hdd</b></em>' attribute feature.
1043 * <!-- begin-user-doc -->
1044 * <!-- end-user-doc -->
1045 * @generated
1046 */
1047 EAttribute HOST_TYPE__DEFAULT_HDD = eINSTANCE.getHostType_DefaultHdd();
1048
1049 /**
1050 * The meta object literal for the '<em><b>Instances</b></em>' containment reference list feature.
1051 * <!-- begin-user-doc -->
1052 * <!-- end-user-doc -->
1053 * @generated
1054 */
1055 EReference HOST_TYPE__INSTANCES = eINSTANCE.getHostType_Instances();
1056
1057 /**
1058 * The meta object literal for the '<em><b>Cost</b></em>' attribute feature.
1059 * <!-- begin-user-doc -->
1060 * <!-- end-user-doc -->
1061 * @generated
1062 */
1063 EAttribute HOST_TYPE__COST = eINSTANCE.getHostType_Cost();
1064
1065 /**
1066 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl <em>Request</em>}' class.
1067 * <!-- begin-user-doc -->
1068 * <!-- end-user-doc -->
1069 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl
1070 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequest()
1071 * @generated
1072 */
1073 EClass REQUEST = eINSTANCE.getRequest();
1074
1075 /**
1076 * The meta object literal for the '<em><b>Requirements</b></em>' containment reference list feature.
1077 * <!-- begin-user-doc -->
1078 * <!-- end-user-doc -->
1079 * @generated
1080 */
1081 EReference REQUEST__REQUIREMENTS = eINSTANCE.getRequest_Requirements();
1082
1083 /**
1084 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl <em>Requirement</em>}' class.
1085 * <!-- begin-user-doc -->
1086 * <!-- end-user-doc -->
1087 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl
1088 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequirement()
1089 * @generated
1090 */
1091 EClass REQUIREMENT = eINSTANCE.getRequirement();
1092
1093 /**
1094 * The meta object literal for the '<em><b>Request</b></em>' container reference feature.
1095 * <!-- begin-user-doc -->
1096 * <!-- end-user-doc -->
1097 * @generated
1098 */
1099 EReference REQUIREMENT__REQUEST = eINSTANCE.getRequirement_Request();
1100
1101 /**
1102 * The meta object literal for the '<em><b>Count</b></em>' attribute feature.
1103 * <!-- begin-user-doc -->
1104 * <!-- end-user-doc -->
1105 * @generated
1106 */
1107 EAttribute REQUIREMENT__COUNT = eINSTANCE.getRequirement_Count();
1108
1109 /**
1110 * The meta object literal for the '<em><b>Type</b></em>' reference feature.
1111 * <!-- begin-user-doc -->
1112 * <!-- end-user-doc -->
1113 * @generated
1114 */
1115 EReference REQUIREMENT__TYPE = eINSTANCE.getRequirement_Type();
1116
1117 /**
1118 * The meta object literal for the '<em><b>Instances</b></em>' reference list feature.
1119 * <!-- begin-user-doc -->
1120 * <!-- end-user-doc -->
1121 * @generated
1122 */
1123 EReference REQUIREMENT__INSTANCES = eINSTANCE.getRequirement_Instances();
1124
1125 /**
1126 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl <em>Application Instance</em>}' class.
1127 * <!-- begin-user-doc -->
1128 * <!-- end-user-doc -->
1129 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl
1130 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationInstance()
1131 * @generated
1132 */
1133 EClass APPLICATION_INSTANCE = eINSTANCE.getApplicationInstance();
1134
1135 /**
1136 * The meta object literal for the '<em><b>Requirement</b></em>' reference feature.
1137 * <!-- begin-user-doc -->
1138 * <!-- end-user-doc -->
1139 * @generated
1140 */
1141 EReference APPLICATION_INSTANCE__REQUIREMENT = eINSTANCE.getApplicationInstance_Requirement();
1142
1143 /**
1144 * The meta object literal for the '<em><b>Type</b></em>' container reference feature.
1145 * <!-- begin-user-doc -->
1146 * <!-- end-user-doc -->
1147 * @generated
1148 */
1149 EReference APPLICATION_INSTANCE__TYPE = eINSTANCE.getApplicationInstance_Type();
1150
1151 /**
1152 * The meta object literal for the '<em><b>Allocated To</b></em>' reference feature.
1153 * <!-- begin-user-doc -->
1154 * <!-- end-user-doc -->
1155 * @generated
1156 */
1157 EReference APPLICATION_INSTANCE__ALLOCATED_TO = eINSTANCE.getApplicationInstance_AllocatedTo();
1158
1159 /**
1160 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl <em>Resource Requirement</em>}' class.
1161 * <!-- begin-user-doc -->
1162 * <!-- end-user-doc -->
1163 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl
1164 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getResourceRequirement()
1165 * @generated
1166 */
1167 EClass RESOURCE_REQUIREMENT = eINSTANCE.getResourceRequirement();
1168
1169 /**
1170 * The meta object literal for the '<em><b>Required Memory</b></em>' attribute feature.
1171 * <!-- begin-user-doc -->
1172 * <!-- end-user-doc -->
1173 * @generated
1174 */
1175 EAttribute RESOURCE_REQUIREMENT__REQUIRED_MEMORY = eINSTANCE.getResourceRequirement_RequiredMemory();
1176
1177 /**
1178 * The meta object literal for the '<em><b>Required Hdd</b></em>' attribute feature.
1179 * <!-- begin-user-doc -->
1180 * <!-- end-user-doc -->
1181 * @generated
1182 */
1183 EAttribute RESOURCE_REQUIREMENT__REQUIRED_HDD = eINSTANCE.getResourceRequirement_RequiredHdd();
1184
1185 /**
1186 * The meta object literal for the '<em><b>Host Type</b></em>' reference feature.
1187 * <!-- begin-user-doc -->
1188 * <!-- end-user-doc -->
1189 * @generated
1190 */
1191 EReference RESOURCE_REQUIREMENT__HOST_TYPE = eINSTANCE.getResourceRequirement_HostType();
1192
1193 /**
1194 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl <em>Host Instance</em>}' class.
1195 * <!-- begin-user-doc -->
1196 * <!-- end-user-doc -->
1197 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl
1198 * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostInstance()
1199 * @generated
1200 */
1201 EClass HOST_INSTANCE = eINSTANCE.getHostInstance();
1202
1203 /**
1204 * The meta object literal for the '<em><b>Type</b></em>' container reference feature.
1205 * <!-- begin-user-doc -->
1206 * <!-- end-user-doc -->
1207 * @generated
1208 */
1209 EReference HOST_INSTANCE__TYPE = eINSTANCE.getHostInstance_Type();
1210
1211 /**
1212 * The meta object literal for the '<em><b>Available Memory</b></em>' attribute feature.
1213 * <!-- begin-user-doc -->
1214 * <!-- end-user-doc -->
1215 * @generated
1216 */
1217 EAttribute HOST_INSTANCE__AVAILABLE_MEMORY = eINSTANCE.getHostInstance_AvailableMemory();
1218
1219 /**
1220 * The meta object literal for the '<em><b>Available Hdd</b></em>' attribute feature.
1221 * <!-- begin-user-doc -->
1222 * <!-- end-user-doc -->
1223 * @generated
1224 */
1225 EAttribute HOST_INSTANCE__AVAILABLE_HDD = eINSTANCE.getHostInstance_AvailableHdd();
1226
1227 /**
1228 * The meta object literal for the '<em><b>Total Memory</b></em>' attribute feature.
1229 * <!-- begin-user-doc -->
1230 * <!-- end-user-doc -->
1231 * @generated
1232 */
1233 EAttribute HOST_INSTANCE__TOTAL_MEMORY = eINSTANCE.getHostInstance_TotalMemory();
1234
1235 /**
1236 * The meta object literal for the '<em><b>Total Hdd</b></em>' attribute feature.
1237 * <!-- begin-user-doc -->
1238 * <!-- end-user-doc -->
1239 * @generated
1240 */
1241 EAttribute HOST_INSTANCE__TOTAL_HDD = eINSTANCE.getHostInstance_TotalHdd();
1242
1243 /**
1244 * The meta object literal for the '<em><b>Applications</b></em>' reference list feature.
1245 * <!-- begin-user-doc -->
1246 * <!-- end-user-doc -->
1247 * @generated
1248 */
1249 EReference HOST_INSTANCE__APPLICATIONS = eINSTANCE.getHostInstance_Applications();
1250
1251 }
1252
1253} //CpsPackage
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CyberPhysicalSystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CyberPhysicalSystem.java
new file mode 100644
index 00000000..541916ba
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CyberPhysicalSystem.java
@@ -0,0 +1,112 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.common.util.EList;
6
7import org.eclipse.emf.ecore.EObject;
8
9/**
10 * <!-- begin-user-doc -->
11 * A representation of the model object '<em><b>Cyber Physical System</b></em>'.
12 * <!-- end-user-doc -->
13 *
14 * <p>
15 * The following features are supported:
16 * </p>
17 * <ul>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getRequests <em>Requests</em>}</li>
19 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplicationTypes <em>Application Types</em>}</li>
20 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHostTypes <em>Host Types</em>}</li>
21 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHosts <em>Hosts</em>}</li>
22 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplications <em>Applications</em>}</li>
23 * </ul>
24 *
25 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem()
26 * @model
27 * @generated
28 */
29public interface CyberPhysicalSystem extends EObject {
30 /**
31 * Returns the value of the '<em><b>Requests</b></em>' containment reference list.
32 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.Request}.
33 * <!-- begin-user-doc -->
34 * <p>
35 * If the meaning of the '<em>Requests</em>' containment reference list isn't clear,
36 * there really should be more of a description here...
37 * </p>
38 * <!-- end-user-doc -->
39 * @return the value of the '<em>Requests</em>' containment reference list.
40 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_Requests()
41 * @model containment="true"
42 * @generated
43 */
44 EList<Request> getRequests();
45
46 /**
47 * Returns the value of the '<em><b>Application Types</b></em>' containment reference list.
48 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType}.
49 * <!-- begin-user-doc -->
50 * <p>
51 * If the meaning of the '<em>Application Types</em>' containment reference list isn't clear,
52 * there really should be more of a description here...
53 * </p>
54 * <!-- end-user-doc -->
55 * @return the value of the '<em>Application Types</em>' containment reference list.
56 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_ApplicationTypes()
57 * @model containment="true"
58 * @generated
59 */
60 EList<ApplicationType> getApplicationTypes();
61
62 /**
63 * Returns the value of the '<em><b>Host Types</b></em>' containment reference list.
64 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType}.
65 * <!-- begin-user-doc -->
66 * <p>
67 * If the meaning of the '<em>Host Types</em>' containment reference list isn't clear,
68 * there really should be more of a description here...
69 * </p>
70 * <!-- end-user-doc -->
71 * @return the value of the '<em>Host Types</em>' containment reference list.
72 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_HostTypes()
73 * @model containment="true"
74 * @generated
75 */
76 EList<HostType> getHostTypes();
77
78 /**
79 * Returns the value of the '<em><b>Hosts</b></em>' reference list.
80 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance}.
81 * <!-- begin-user-doc -->
82 * <p>
83 * If the meaning of the '<em>Hosts</em>' reference list isn't clear,
84 * there really should be more of a description here...
85 * </p>
86 * <!-- end-user-doc -->
87 * @return the value of the '<em>Hosts</em>' reference list.
88 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_Hosts()
89 * @model transient="true" changeable="false" volatile="true" derived="true"
90 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts'"
91 * @generated
92 */
93 EList<HostInstance> getHosts();
94
95 /**
96 * Returns the value of the '<em><b>Applications</b></em>' reference list.
97 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}.
98 * <!-- begin-user-doc -->
99 * <p>
100 * If the meaning of the '<em>Applications</em>' reference list isn't clear,
101 * there really should be more of a description here...
102 * </p>
103 * <!-- end-user-doc -->
104 * @return the value of the '<em>Applications</em>' reference list.
105 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_Applications()
106 * @model transient="true" changeable="false" volatile="true" derived="true"
107 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications'"
108 * @generated
109 */
110 EList<ApplicationInstance> getApplications();
111
112} // CyberPhysicalSystem
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostInstance.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostInstance.java
new file mode 100644
index 00000000..43379e0f
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostInstance.java
@@ -0,0 +1,141 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.common.util.EList;
6
7import org.eclipse.emf.ecore.EObject;
8
9/**
10 * <!-- begin-user-doc -->
11 * A representation of the model object '<em><b>Host Instance</b></em>'.
12 * <!-- end-user-doc -->
13 *
14 * <p>
15 * The following features are supported:
16 * </p>
17 * <ul>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}</li>
19 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableMemory <em>Available Memory</em>}</li>
20 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableHdd <em>Available Hdd</em>}</li>
21 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalMemory <em>Total Memory</em>}</li>
22 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalHdd <em>Total Hdd</em>}</li>
23 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}</li>
24 * </ul>
25 *
26 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance()
27 * @model
28 * @generated
29 */
30public interface HostInstance extends EObject {
31 /**
32 * Returns the value of the '<em><b>Type</b></em>' container reference.
33 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances <em>Instances</em>}'.
34 * <!-- begin-user-doc -->
35 * <p>
36 * If the meaning of the '<em>Type</em>' container reference isn't clear,
37 * there really should be more of a description here...
38 * </p>
39 * <!-- end-user-doc -->
40 * @return the value of the '<em>Type</em>' container reference.
41 * @see #setType(HostType)
42 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_Type()
43 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances
44 * @model opposite="instances" required="true" transient="false"
45 * @generated
46 */
47 HostType getType();
48
49 /**
50 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}' container reference.
51 * <!-- begin-user-doc -->
52 * <!-- end-user-doc -->
53 * @param value the new value of the '<em>Type</em>' container reference.
54 * @see #getType()
55 * @generated
56 */
57 void setType(HostType value);
58
59 /**
60 * Returns the value of the '<em><b>Available Memory</b></em>' attribute.
61 * <!-- begin-user-doc -->
62 * <p>
63 * If the meaning of the '<em>Available Memory</em>' attribute isn't clear,
64 * there really should be more of a description here...
65 * </p>
66 * <!-- end-user-doc -->
67 * @return the value of the '<em>Available Memory</em>' attribute.
68 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_AvailableMemory()
69 * @model transient="true" changeable="false" volatile="true" derived="true"
70 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory'"
71 * @generated
72 */
73 int getAvailableMemory();
74
75 /**
76 * Returns the value of the '<em><b>Available Hdd</b></em>' attribute.
77 * <!-- begin-user-doc -->
78 * <p>
79 * If the meaning of the '<em>Available Hdd</em>' attribute isn't clear,
80 * there really should be more of a description here...
81 * </p>
82 * <!-- end-user-doc -->
83 * @return the value of the '<em>Available Hdd</em>' attribute.
84 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_AvailableHdd()
85 * @model transient="true" changeable="false" volatile="true" derived="true"
86 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd'"
87 * @generated
88 */
89 int getAvailableHdd();
90
91 /**
92 * Returns the value of the '<em><b>Total Memory</b></em>' attribute.
93 * <!-- begin-user-doc -->
94 * <p>
95 * If the meaning of the '<em>Total Memory</em>' attribute isn't clear,
96 * there really should be more of a description here...
97 * </p>
98 * <!-- end-user-doc -->
99 * @return the value of the '<em>Total Memory</em>' attribute.
100 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_TotalMemory()
101 * @model transient="true" changeable="false" volatile="true" derived="true"
102 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory'"
103 * @generated
104 */
105 int getTotalMemory();
106
107 /**
108 * Returns the value of the '<em><b>Total Hdd</b></em>' attribute.
109 * <!-- begin-user-doc -->
110 * <p>
111 * If the meaning of the '<em>Total Hdd</em>' attribute isn't clear,
112 * there really should be more of a description here...
113 * </p>
114 * <!-- end-user-doc -->
115 * @return the value of the '<em>Total Hdd</em>' attribute.
116 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_TotalHdd()
117 * @model transient="true" changeable="false" volatile="true" derived="true"
118 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd'"
119 * @generated
120 */
121 int getTotalHdd();
122
123 /**
124 * Returns the value of the '<em><b>Applications</b></em>' reference list.
125 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}.
126 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}'.
127 * <!-- begin-user-doc -->
128 * <p>
129 * If the meaning of the '<em>Applications</em>' reference list isn't clear,
130 * there really should be more of a description here...
131 * </p>
132 * <!-- end-user-doc -->
133 * @return the value of the '<em>Applications</em>' reference list.
134 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_Applications()
135 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo
136 * @model opposite="allocatedTo"
137 * @generated
138 */
139 EList<ApplicationInstance> getApplications();
140
141} // HostInstance
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostType.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostType.java
new file mode 100644
index 00000000..45201930
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostType.java
@@ -0,0 +1,125 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.common.util.EList;
6
7import org.eclipse.emf.ecore.EObject;
8
9/**
10 * <!-- begin-user-doc -->
11 * A representation of the model object '<em><b>Host Type</b></em>'.
12 * <!-- end-user-doc -->
13 *
14 * <p>
15 * The following features are supported:
16 * </p>
17 * <ul>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultMemory <em>Default Memory</em>}</li>
19 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultHdd <em>Default Hdd</em>}</li>
20 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances <em>Instances</em>}</li>
21 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getCost <em>Cost</em>}</li>
22 * </ul>
23 *
24 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostType()
25 * @model
26 * @generated
27 */
28public interface HostType extends EObject {
29 /**
30 * Returns the value of the '<em><b>Default Memory</b></em>' attribute.
31 * <!-- begin-user-doc -->
32 * <p>
33 * If the meaning of the '<em>Default Memory</em>' attribute isn't clear,
34 * there really should be more of a description here...
35 * </p>
36 * <!-- end-user-doc -->
37 * @return the value of the '<em>Default Memory</em>' attribute.
38 * @see #setDefaultMemory(int)
39 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostType_DefaultMemory()
40 * @model required="true"
41 * @generated
42 */
43 int getDefaultMemory();
44
45 /**
46 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultMemory <em>Default Memory</em>}' attribute.
47 * <!-- begin-user-doc -->
48 * <!-- end-user-doc -->
49 * @param value the new value of the '<em>Default Memory</em>' attribute.
50 * @see #getDefaultMemory()
51 * @generated
52 */
53 void setDefaultMemory(int value);
54
55 /**
56 * Returns the value of the '<em><b>Default Hdd</b></em>' attribute.
57 * <!-- begin-user-doc -->
58 * <p>
59 * If the meaning of the '<em>Default Hdd</em>' attribute isn't clear,
60 * there really should be more of a description here...
61 * </p>
62 * <!-- end-user-doc -->
63 * @return the value of the '<em>Default Hdd</em>' attribute.
64 * @see #setDefaultHdd(int)
65 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostType_DefaultHdd()
66 * @model required="true"
67 * @generated
68 */
69 int getDefaultHdd();
70
71 /**
72 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultHdd <em>Default Hdd</em>}' attribute.
73 * <!-- begin-user-doc -->
74 * <!-- end-user-doc -->
75 * @param value the new value of the '<em>Default Hdd</em>' attribute.
76 * @see #getDefaultHdd()
77 * @generated
78 */
79 void setDefaultHdd(int value);
80
81 /**
82 * Returns the value of the '<em><b>Instances</b></em>' containment reference list.
83 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance}.
84 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}'.
85 * <!-- begin-user-doc -->
86 * <p>
87 * If the meaning of the '<em>Instances</em>' containment reference list isn't clear,
88 * there really should be more of a description here...
89 * </p>
90 * <!-- end-user-doc -->
91 * @return the value of the '<em>Instances</em>' containment reference list.
92 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostType_Instances()
93 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType
94 * @model opposite="type" containment="true"
95 * @generated
96 */
97 EList<HostInstance> getInstances();
98
99 /**
100 * Returns the value of the '<em><b>Cost</b></em>' attribute.
101 * <!-- begin-user-doc -->
102 * <p>
103 * If the meaning of the '<em>Cost</em>' attribute isn't clear,
104 * there really should be more of a description here...
105 * </p>
106 * <!-- end-user-doc -->
107 * @return the value of the '<em>Cost</em>' attribute.
108 * @see #setCost(int)
109 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostType_Cost()
110 * @model required="true"
111 * @generated
112 */
113 int getCost();
114
115 /**
116 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getCost <em>Cost</em>}' attribute.
117 * <!-- begin-user-doc -->
118 * <!-- end-user-doc -->
119 * @param value the new value of the '<em>Cost</em>' attribute.
120 * @see #getCost()
121 * @generated
122 */
123 void setCost(int value);
124
125} // HostType
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Request.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Request.java
new file mode 100644
index 00000000..261562a0
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Request.java
@@ -0,0 +1,44 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.common.util.EList;
6
7import org.eclipse.emf.ecore.EObject;
8
9/**
10 * <!-- begin-user-doc -->
11 * A representation of the model object '<em><b>Request</b></em>'.
12 * <!-- end-user-doc -->
13 *
14 * <p>
15 * The following features are supported:
16 * </p>
17 * <ul>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.Request#getRequirements <em>Requirements</em>}</li>
19 * </ul>
20 *
21 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getRequest()
22 * @model
23 * @generated
24 */
25public interface Request extends EObject {
26 /**
27 * Returns the value of the '<em><b>Requirements</b></em>' containment reference list.
28 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement}.
29 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest <em>Request</em>}'.
30 * <!-- begin-user-doc -->
31 * <p>
32 * If the meaning of the '<em>Requirements</em>' containment reference list isn't clear,
33 * there really should be more of a description here...
34 * </p>
35 * <!-- end-user-doc -->
36 * @return the value of the '<em>Requirements</em>' containment reference list.
37 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getRequest_Requirements()
38 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest
39 * @model opposite="request" containment="true"
40 * @generated
41 */
42 EList<Requirement> getRequirements();
43
44} // Request
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Requirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Requirement.java
new file mode 100644
index 00000000..a1d494e4
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/Requirement.java
@@ -0,0 +1,127 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.common.util.EList;
6
7import org.eclipse.emf.ecore.EObject;
8
9/**
10 * <!-- begin-user-doc -->
11 * A representation of the model object '<em><b>Requirement</b></em>'.
12 * <!-- end-user-doc -->
13 *
14 * <p>
15 * The following features are supported:
16 * </p>
17 * <ul>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest <em>Request</em>}</li>
19 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getCount <em>Count</em>}</li>
20 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getType <em>Type</em>}</li>
21 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getInstances <em>Instances</em>}</li>
22 * </ul>
23 *
24 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getRequirement()
25 * @model
26 * @generated
27 */
28public interface Requirement extends EObject {
29 /**
30 * Returns the value of the '<em><b>Request</b></em>' container reference.
31 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Request#getRequirements <em>Requirements</em>}'.
32 * <!-- begin-user-doc -->
33 * <p>
34 * If the meaning of the '<em>Request</em>' container reference isn't clear,
35 * there really should be more of a description here...
36 * </p>
37 * <!-- end-user-doc -->
38 * @return the value of the '<em>Request</em>' container reference.
39 * @see #setRequest(Request)
40 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getRequirement_Request()
41 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Request#getRequirements
42 * @model opposite="requirements" required="true" transient="false"
43 * @generated
44 */
45 Request getRequest();
46
47 /**
48 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest <em>Request</em>}' container reference.
49 * <!-- begin-user-doc -->
50 * <!-- end-user-doc -->
51 * @param value the new value of the '<em>Request</em>' container reference.
52 * @see #getRequest()
53 * @generated
54 */
55 void setRequest(Request value);
56
57 /**
58 * Returns the value of the '<em><b>Count</b></em>' attribute.
59 * <!-- begin-user-doc -->
60 * <p>
61 * If the meaning of the '<em>Count</em>' attribute isn't clear,
62 * there really should be more of a description here...
63 * </p>
64 * <!-- end-user-doc -->
65 * @return the value of the '<em>Count</em>' attribute.
66 * @see #setCount(int)
67 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getRequirement_Count()
68 * @model required="true"
69 * @generated
70 */
71 int getCount();
72
73 /**
74 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getCount <em>Count</em>}' attribute.
75 * <!-- begin-user-doc -->
76 * <!-- end-user-doc -->
77 * @param value the new value of the '<em>Count</em>' attribute.
78 * @see #getCount()
79 * @generated
80 */
81 void setCount(int value);
82
83 /**
84 * Returns the value of the '<em><b>Type</b></em>' reference.
85 * <!-- begin-user-doc -->
86 * <p>
87 * If the meaning of the '<em>Type</em>' reference isn't clear,
88 * there really should be more of a description here...
89 * </p>
90 * <!-- end-user-doc -->
91 * @return the value of the '<em>Type</em>' reference.
92 * @see #setType(ApplicationType)
93 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getRequirement_Type()
94 * @model
95 * @generated
96 */
97 ApplicationType getType();
98
99 /**
100 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getType <em>Type</em>}' reference.
101 * <!-- begin-user-doc -->
102 * <!-- end-user-doc -->
103 * @param value the new value of the '<em>Type</em>' reference.
104 * @see #getType()
105 * @generated
106 */
107 void setType(ApplicationType value);
108
109 /**
110 * Returns the value of the '<em><b>Instances</b></em>' reference list.
111 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}.
112 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement <em>Requirement</em>}'.
113 * <!-- begin-user-doc -->
114 * <p>
115 * If the meaning of the '<em>Instances</em>' reference list isn't clear,
116 * there really should be more of a description here...
117 * </p>
118 * <!-- end-user-doc -->
119 * @return the value of the '<em>Instances</em>' reference list.
120 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getRequirement_Instances()
121 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement
122 * @model opposite="requirement"
123 * @generated
124 */
125 EList<ApplicationInstance> getInstances();
126
127} // Requirement
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ResourceRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ResourceRequirement.java
new file mode 100644
index 00000000..a99cc12e
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/ResourceRequirement.java
@@ -0,0 +1,104 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps;
4
5import org.eclipse.emf.ecore.EObject;
6
7/**
8 * <!-- begin-user-doc -->
9 * A representation of the model object '<em><b>Resource Requirement</b></em>'.
10 * <!-- end-user-doc -->
11 *
12 * <p>
13 * The following features are supported:
14 * </p>
15 * <ul>
16 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredMemory <em>Required Memory</em>}</li>
17 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredHdd <em>Required Hdd</em>}</li>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getHostType <em>Host Type</em>}</li>
19 * </ul>
20 *
21 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getResourceRequirement()
22 * @model
23 * @generated
24 */
25public interface ResourceRequirement extends EObject {
26 /**
27 * Returns the value of the '<em><b>Required Memory</b></em>' attribute.
28 * <!-- begin-user-doc -->
29 * <p>
30 * If the meaning of the '<em>Required Memory</em>' attribute isn't clear,
31 * there really should be more of a description here...
32 * </p>
33 * <!-- end-user-doc -->
34 * @return the value of the '<em>Required Memory</em>' attribute.
35 * @see #setRequiredMemory(int)
36 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getResourceRequirement_RequiredMemory()
37 * @model required="true"
38 * @generated
39 */
40 int getRequiredMemory();
41
42 /**
43 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredMemory <em>Required Memory</em>}' attribute.
44 * <!-- begin-user-doc -->
45 * <!-- end-user-doc -->
46 * @param value the new value of the '<em>Required Memory</em>' attribute.
47 * @see #getRequiredMemory()
48 * @generated
49 */
50 void setRequiredMemory(int value);
51
52 /**
53 * Returns the value of the '<em><b>Required Hdd</b></em>' attribute.
54 * <!-- begin-user-doc -->
55 * <p>
56 * If the meaning of the '<em>Required Hdd</em>' attribute isn't clear,
57 * there really should be more of a description here...
58 * </p>
59 * <!-- end-user-doc -->
60 * @return the value of the '<em>Required Hdd</em>' attribute.
61 * @see #setRequiredHdd(int)
62 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getResourceRequirement_RequiredHdd()
63 * @model required="true"
64 * @generated
65 */
66 int getRequiredHdd();
67
68 /**
69 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredHdd <em>Required Hdd</em>}' attribute.
70 * <!-- begin-user-doc -->
71 * <!-- end-user-doc -->
72 * @param value the new value of the '<em>Required Hdd</em>' attribute.
73 * @see #getRequiredHdd()
74 * @generated
75 */
76 void setRequiredHdd(int value);
77
78 /**
79 * Returns the value of the '<em><b>Host Type</b></em>' reference.
80 * <!-- begin-user-doc -->
81 * <p>
82 * If the meaning of the '<em>Host Type</em>' reference isn't clear,
83 * there really should be more of a description here...
84 * </p>
85 * <!-- end-user-doc -->
86 * @return the value of the '<em>Host Type</em>' reference.
87 * @see #setHostType(HostType)
88 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getResourceRequirement_HostType()
89 * @model required="true"
90 * @generated
91 */
92 HostType getHostType();
93
94 /**
95 * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getHostType <em>Host Type</em>}' reference.
96 * <!-- begin-user-doc -->
97 * <!-- end-user-doc -->
98 * @param value the new value of the '<em>Host Type</em>' reference.
99 * @see #getHostType()
100 * @generated
101 */
102 void setHostType(HostType value);
103
104} // ResourceRequirement
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java
new file mode 100644
index 00000000..cea2d6f4
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationInstanceImpl.java
@@ -0,0 +1,405 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
8import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
9import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
10
11import org.eclipse.emf.common.notify.Notification;
12import org.eclipse.emf.common.notify.NotificationChain;
13
14import org.eclipse.emf.ecore.EClass;
15import org.eclipse.emf.ecore.InternalEObject;
16
17import org.eclipse.emf.ecore.impl.ENotificationImpl;
18import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
19
20import org.eclipse.emf.ecore.util.EcoreUtil;
21
22/**
23 * <!-- begin-user-doc -->
24 * An implementation of the model object '<em><b>Application Instance</b></em>'.
25 * <!-- end-user-doc -->
26 * <p>
27 * The following features are implemented:
28 * </p>
29 * <ul>
30 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl#getRequirement <em>Requirement</em>}</li>
31 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl#getType <em>Type</em>}</li>
32 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl#getAllocatedTo <em>Allocated To</em>}</li>
33 * </ul>
34 *
35 * @generated
36 */
37public class ApplicationInstanceImpl extends MinimalEObjectImpl.Container implements ApplicationInstance {
38 /**
39 * The cached value of the '{@link #getRequirement() <em>Requirement</em>}' reference.
40 * <!-- begin-user-doc -->
41 * <!-- end-user-doc -->
42 * @see #getRequirement()
43 * @generated
44 * @ordered
45 */
46 protected Requirement requirement;
47
48 /**
49 * The cached value of the '{@link #getAllocatedTo() <em>Allocated To</em>}' reference.
50 * <!-- begin-user-doc -->
51 * <!-- end-user-doc -->
52 * @see #getAllocatedTo()
53 * @generated
54 * @ordered
55 */
56 protected HostInstance allocatedTo;
57
58 /**
59 * <!-- begin-user-doc -->
60 * <!-- end-user-doc -->
61 * @generated
62 */
63 protected ApplicationInstanceImpl() {
64 super();
65 }
66
67 /**
68 * <!-- begin-user-doc -->
69 * <!-- end-user-doc -->
70 * @generated
71 */
72 @Override
73 protected EClass eStaticClass() {
74 return CpsPackage.Literals.APPLICATION_INSTANCE;
75 }
76
77 /**
78 * <!-- begin-user-doc -->
79 * <!-- end-user-doc -->
80 * @generated
81 */
82 @Override
83 public Requirement getRequirement() {
84 if (requirement != null && requirement.eIsProxy()) {
85 InternalEObject oldRequirement = (InternalEObject) requirement;
86 requirement = (Requirement) eResolveProxy(oldRequirement);
87 if (requirement != oldRequirement) {
88 if (eNotificationRequired())
89 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
90 CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, oldRequirement, requirement));
91 }
92 }
93 return requirement;
94 }
95
96 /**
97 * <!-- begin-user-doc -->
98 * <!-- end-user-doc -->
99 * @generated
100 */
101 public Requirement basicGetRequirement() {
102 return requirement;
103 }
104
105 /**
106 * <!-- begin-user-doc -->
107 * <!-- end-user-doc -->
108 * @generated
109 */
110 public NotificationChain basicSetRequirement(Requirement newRequirement, NotificationChain msgs) {
111 Requirement oldRequirement = requirement;
112 requirement = newRequirement;
113 if (eNotificationRequired()) {
114 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
115 CpsPackage.APPLICATION_INSTANCE__REQUIREMENT, oldRequirement, newRequirement);
116 if (msgs == null)
117 msgs = notification;
118 else
119 msgs.add(notification);
120 }
121 return msgs;
122 }
123
124 /**
125 * <!-- begin-user-doc -->
126 * <!-- end-user-doc -->
127 * @generated
128 */
129 @Override
130 public void setRequirement(Requirement newRequirement) {
131 if (newRequirement != requirement) {
132 NotificationChain msgs = null;
133 if (requirement != null)
134 msgs = ((InternalEObject) requirement).eInverseRemove(this, CpsPackage.REQUIREMENT__INSTANCES,
135 Requirement.class, msgs);
136 if (newRequirement != null)
137 msgs = ((InternalEObject) newRequirement).eInverseAdd(this, CpsPackage.REQUIREMENT__INSTANCES,
138 Requirement.class, msgs);
139 msgs = basicSetRequirement(newRequirement, msgs);
140 if (msgs != null)
141 msgs.dispatch();
142 } else if (eNotificationRequired())
143 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__REQUIREMENT,
144 newRequirement, newRequirement));
145 }
146
147 /**
148 * <!-- begin-user-doc -->
149 * <!-- end-user-doc -->
150 * @generated
151 */
152 @Override
153 public ApplicationType getType() {
154 if (eContainerFeatureID() != CpsPackage.APPLICATION_INSTANCE__TYPE)
155 return null;
156 return (ApplicationType) eInternalContainer();
157 }
158
159 /**
160 * <!-- begin-user-doc -->
161 * <!-- end-user-doc -->
162 * @generated
163 */
164 public NotificationChain basicSetType(ApplicationType newType, NotificationChain msgs) {
165 msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.APPLICATION_INSTANCE__TYPE, msgs);
166 return msgs;
167 }
168
169 /**
170 * <!-- begin-user-doc -->
171 * <!-- end-user-doc -->
172 * @generated
173 */
174 @Override
175 public void setType(ApplicationType newType) {
176 if (newType != eInternalContainer()
177 || (eContainerFeatureID() != CpsPackage.APPLICATION_INSTANCE__TYPE && newType != null)) {
178 if (EcoreUtil.isAncestor(this, newType))
179 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
180 NotificationChain msgs = null;
181 if (eInternalContainer() != null)
182 msgs = eBasicRemoveFromContainer(msgs);
183 if (newType != null)
184 msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.APPLICATION_TYPE__INSTANCES,
185 ApplicationType.class, msgs);
186 msgs = basicSetType(newType, msgs);
187 if (msgs != null)
188 msgs.dispatch();
189 } else if (eNotificationRequired())
190 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__TYPE, newType,
191 newType));
192 }
193
194 /**
195 * <!-- begin-user-doc -->
196 * <!-- end-user-doc -->
197 * @generated
198 */
199 @Override
200 public HostInstance getAllocatedTo() {
201 if (allocatedTo != null && allocatedTo.eIsProxy()) {
202 InternalEObject oldAllocatedTo = (InternalEObject) allocatedTo;
203 allocatedTo = (HostInstance) eResolveProxy(oldAllocatedTo);
204 if (allocatedTo != oldAllocatedTo) {
205 if (eNotificationRequired())
206 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
207 CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, oldAllocatedTo, allocatedTo));
208 }
209 }
210 return allocatedTo;
211 }
212
213 /**
214 * <!-- begin-user-doc -->
215 * <!-- end-user-doc -->
216 * @generated
217 */
218 public HostInstance basicGetAllocatedTo() {
219 return allocatedTo;
220 }
221
222 /**
223 * <!-- begin-user-doc -->
224 * <!-- end-user-doc -->
225 * @generated
226 */
227 public NotificationChain basicSetAllocatedTo(HostInstance newAllocatedTo, NotificationChain msgs) {
228 HostInstance oldAllocatedTo = allocatedTo;
229 allocatedTo = newAllocatedTo;
230 if (eNotificationRequired()) {
231 ENotificationImpl notification = new ENotificationImpl(this, Notification.SET,
232 CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO, oldAllocatedTo, newAllocatedTo);
233 if (msgs == null)
234 msgs = notification;
235 else
236 msgs.add(notification);
237 }
238 return msgs;
239 }
240
241 /**
242 * <!-- begin-user-doc -->
243 * <!-- end-user-doc -->
244 * @generated
245 */
246 @Override
247 public void setAllocatedTo(HostInstance newAllocatedTo) {
248 if (newAllocatedTo != allocatedTo) {
249 NotificationChain msgs = null;
250 if (allocatedTo != null)
251 msgs = ((InternalEObject) allocatedTo).eInverseRemove(this, CpsPackage.HOST_INSTANCE__APPLICATIONS,
252 HostInstance.class, msgs);
253 if (newAllocatedTo != null)
254 msgs = ((InternalEObject) newAllocatedTo).eInverseAdd(this, CpsPackage.HOST_INSTANCE__APPLICATIONS,
255 HostInstance.class, msgs);
256 msgs = basicSetAllocatedTo(newAllocatedTo, msgs);
257 if (msgs != null)
258 msgs.dispatch();
259 } else if (eNotificationRequired())
260 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO,
261 newAllocatedTo, newAllocatedTo));
262 }
263
264 /**
265 * <!-- begin-user-doc -->
266 * <!-- end-user-doc -->
267 * @generated
268 */
269 @Override
270 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
271 switch (featureID) {
272 case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT:
273 if (requirement != null)
274 msgs = ((InternalEObject) requirement).eInverseRemove(this, CpsPackage.REQUIREMENT__INSTANCES,
275 Requirement.class, msgs);
276 return basicSetRequirement((Requirement) otherEnd, msgs);
277 case CpsPackage.APPLICATION_INSTANCE__TYPE:
278 if (eInternalContainer() != null)
279 msgs = eBasicRemoveFromContainer(msgs);
280 return basicSetType((ApplicationType) otherEnd, msgs);
281 case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO:
282 if (allocatedTo != null)
283 msgs = ((InternalEObject) allocatedTo).eInverseRemove(this, CpsPackage.HOST_INSTANCE__APPLICATIONS,
284 HostInstance.class, msgs);
285 return basicSetAllocatedTo((HostInstance) otherEnd, msgs);
286 }
287 return super.eInverseAdd(otherEnd, featureID, msgs);
288 }
289
290 /**
291 * <!-- begin-user-doc -->
292 * <!-- end-user-doc -->
293 * @generated
294 */
295 @Override
296 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
297 switch (featureID) {
298 case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT:
299 return basicSetRequirement(null, msgs);
300 case CpsPackage.APPLICATION_INSTANCE__TYPE:
301 return basicSetType(null, msgs);
302 case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO:
303 return basicSetAllocatedTo(null, msgs);
304 }
305 return super.eInverseRemove(otherEnd, featureID, msgs);
306 }
307
308 /**
309 * <!-- begin-user-doc -->
310 * <!-- end-user-doc -->
311 * @generated
312 */
313 @Override
314 public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
315 switch (eContainerFeatureID()) {
316 case CpsPackage.APPLICATION_INSTANCE__TYPE:
317 return eInternalContainer().eInverseRemove(this, CpsPackage.APPLICATION_TYPE__INSTANCES,
318 ApplicationType.class, msgs);
319 }
320 return super.eBasicRemoveFromContainerFeature(msgs);
321 }
322
323 /**
324 * <!-- begin-user-doc -->
325 * <!-- end-user-doc -->
326 * @generated
327 */
328 @Override
329 public Object eGet(int featureID, boolean resolve, boolean coreType) {
330 switch (featureID) {
331 case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT:
332 if (resolve)
333 return getRequirement();
334 return basicGetRequirement();
335 case CpsPackage.APPLICATION_INSTANCE__TYPE:
336 return getType();
337 case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO:
338 if (resolve)
339 return getAllocatedTo();
340 return basicGetAllocatedTo();
341 }
342 return super.eGet(featureID, resolve, coreType);
343 }
344
345 /**
346 * <!-- begin-user-doc -->
347 * <!-- end-user-doc -->
348 * @generated
349 */
350 @Override
351 public void eSet(int featureID, Object newValue) {
352 switch (featureID) {
353 case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT:
354 setRequirement((Requirement) newValue);
355 return;
356 case CpsPackage.APPLICATION_INSTANCE__TYPE:
357 setType((ApplicationType) newValue);
358 return;
359 case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO:
360 setAllocatedTo((HostInstance) newValue);
361 return;
362 }
363 super.eSet(featureID, newValue);
364 }
365
366 /**
367 * <!-- begin-user-doc -->
368 * <!-- end-user-doc -->
369 * @generated
370 */
371 @Override
372 public void eUnset(int featureID) {
373 switch (featureID) {
374 case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT:
375 setRequirement((Requirement) null);
376 return;
377 case CpsPackage.APPLICATION_INSTANCE__TYPE:
378 setType((ApplicationType) null);
379 return;
380 case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO:
381 setAllocatedTo((HostInstance) null);
382 return;
383 }
384 super.eUnset(featureID);
385 }
386
387 /**
388 * <!-- begin-user-doc -->
389 * <!-- end-user-doc -->
390 * @generated
391 */
392 @Override
393 public boolean eIsSet(int featureID) {
394 switch (featureID) {
395 case CpsPackage.APPLICATION_INSTANCE__REQUIREMENT:
396 return requirement != null;
397 case CpsPackage.APPLICATION_INSTANCE__TYPE:
398 return getType() != null;
399 case CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO:
400 return allocatedTo != null;
401 }
402 return super.eIsSet(featureID);
403 }
404
405} //ApplicationInstanceImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java
new file mode 100644
index 00000000..f8793e30
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ApplicationTypeImpl.java
@@ -0,0 +1,209 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
8import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement;
9
10import java.util.Collection;
11
12import org.eclipse.emf.common.notify.NotificationChain;
13
14import org.eclipse.emf.common.util.EList;
15
16import org.eclipse.emf.ecore.EClass;
17import org.eclipse.emf.ecore.InternalEObject;
18
19import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
20
21import org.eclipse.emf.ecore.util.EObjectContainmentEList;
22import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
23import org.eclipse.emf.ecore.util.InternalEList;
24
25/**
26 * <!-- begin-user-doc -->
27 * An implementation of the model object '<em><b>Application Type</b></em>'.
28 * <!-- end-user-doc -->
29 * <p>
30 * The following features are implemented:
31 * </p>
32 * <ul>
33 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl#getInstances <em>Instances</em>}</li>
34 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl#getRequirements <em>Requirements</em>}</li>
35 * </ul>
36 *
37 * @generated
38 */
39public class ApplicationTypeImpl extends MinimalEObjectImpl.Container implements ApplicationType {
40 /**
41 * The cached value of the '{@link #getInstances() <em>Instances</em>}' containment reference list.
42 * <!-- begin-user-doc -->
43 * <!-- end-user-doc -->
44 * @see #getInstances()
45 * @generated
46 * @ordered
47 */
48 protected EList<ApplicationInstance> instances;
49
50 /**
51 * The cached value of the '{@link #getRequirements() <em>Requirements</em>}' containment reference list.
52 * <!-- begin-user-doc -->
53 * <!-- end-user-doc -->
54 * @see #getRequirements()
55 * @generated
56 * @ordered
57 */
58 protected EList<ResourceRequirement> requirements;
59
60 /**
61 * <!-- begin-user-doc -->
62 * <!-- end-user-doc -->
63 * @generated
64 */
65 protected ApplicationTypeImpl() {
66 super();
67 }
68
69 /**
70 * <!-- begin-user-doc -->
71 * <!-- end-user-doc -->
72 * @generated
73 */
74 @Override
75 protected EClass eStaticClass() {
76 return CpsPackage.Literals.APPLICATION_TYPE;
77 }
78
79 /**
80 * <!-- begin-user-doc -->
81 * <!-- end-user-doc -->
82 * @generated
83 */
84 @Override
85 public EList<ApplicationInstance> getInstances() {
86 if (instances == null) {
87 instances = new EObjectContainmentWithInverseEList<ApplicationInstance>(ApplicationInstance.class, this,
88 CpsPackage.APPLICATION_TYPE__INSTANCES, CpsPackage.APPLICATION_INSTANCE__TYPE);
89 }
90 return instances;
91 }
92
93 /**
94 * <!-- begin-user-doc -->
95 * <!-- end-user-doc -->
96 * @generated
97 */
98 @Override
99 public EList<ResourceRequirement> getRequirements() {
100 if (requirements == null) {
101 requirements = new EObjectContainmentEList<ResourceRequirement>(ResourceRequirement.class, this,
102 CpsPackage.APPLICATION_TYPE__REQUIREMENTS);
103 }
104 return requirements;
105 }
106
107 /**
108 * <!-- begin-user-doc -->
109 * <!-- end-user-doc -->
110 * @generated
111 */
112 @SuppressWarnings("unchecked")
113 @Override
114 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
115 switch (featureID) {
116 case CpsPackage.APPLICATION_TYPE__INSTANCES:
117 return ((InternalEList<InternalEObject>) (InternalEList<?>) getInstances()).basicAdd(otherEnd, msgs);
118 }
119 return super.eInverseAdd(otherEnd, featureID, msgs);
120 }
121
122 /**
123 * <!-- begin-user-doc -->
124 * <!-- end-user-doc -->
125 * @generated
126 */
127 @Override
128 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
129 switch (featureID) {
130 case CpsPackage.APPLICATION_TYPE__INSTANCES:
131 return ((InternalEList<?>) getInstances()).basicRemove(otherEnd, msgs);
132 case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
133 return ((InternalEList<?>) getRequirements()).basicRemove(otherEnd, msgs);
134 }
135 return super.eInverseRemove(otherEnd, featureID, msgs);
136 }
137
138 /**
139 * <!-- begin-user-doc -->
140 * <!-- end-user-doc -->
141 * @generated
142 */
143 @Override
144 public Object eGet(int featureID, boolean resolve, boolean coreType) {
145 switch (featureID) {
146 case CpsPackage.APPLICATION_TYPE__INSTANCES:
147 return getInstances();
148 case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
149 return getRequirements();
150 }
151 return super.eGet(featureID, resolve, coreType);
152 }
153
154 /**
155 * <!-- begin-user-doc -->
156 * <!-- end-user-doc -->
157 * @generated
158 */
159 @SuppressWarnings("unchecked")
160 @Override
161 public void eSet(int featureID, Object newValue) {
162 switch (featureID) {
163 case CpsPackage.APPLICATION_TYPE__INSTANCES:
164 getInstances().clear();
165 getInstances().addAll((Collection<? extends ApplicationInstance>) newValue);
166 return;
167 case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
168 getRequirements().clear();
169 getRequirements().addAll((Collection<? extends ResourceRequirement>) newValue);
170 return;
171 }
172 super.eSet(featureID, newValue);
173 }
174
175 /**
176 * <!-- begin-user-doc -->
177 * <!-- end-user-doc -->
178 * @generated
179 */
180 @Override
181 public void eUnset(int featureID) {
182 switch (featureID) {
183 case CpsPackage.APPLICATION_TYPE__INSTANCES:
184 getInstances().clear();
185 return;
186 case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
187 getRequirements().clear();
188 return;
189 }
190 super.eUnset(featureID);
191 }
192
193 /**
194 * <!-- begin-user-doc -->
195 * <!-- end-user-doc -->
196 * @generated
197 */
198 @Override
199 public boolean eIsSet(int featureID) {
200 switch (featureID) {
201 case CpsPackage.APPLICATION_TYPE__INSTANCES:
202 return instances != null && !instances.isEmpty();
203 case CpsPackage.APPLICATION_TYPE__REQUIREMENTS:
204 return requirements != null && !requirements.isEmpty();
205 }
206 return super.eIsSet(featureID);
207 }
208
209} //ApplicationTypeImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java
new file mode 100644
index 00000000..110f5abb
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsFactoryImpl.java
@@ -0,0 +1,188 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.*;
6
7import org.eclipse.emf.ecore.EClass;
8import org.eclipse.emf.ecore.EObject;
9import org.eclipse.emf.ecore.EPackage;
10
11import org.eclipse.emf.ecore.impl.EFactoryImpl;
12
13import org.eclipse.emf.ecore.plugin.EcorePlugin;
14
15/**
16 * <!-- begin-user-doc -->
17 * An implementation of the model <b>Factory</b>.
18 * <!-- end-user-doc -->
19 * @generated
20 */
21public class CpsFactoryImpl extends EFactoryImpl implements CpsFactory {
22 /**
23 * Creates the default factory implementation.
24 * <!-- begin-user-doc -->
25 * <!-- end-user-doc -->
26 * @generated
27 */
28 public static CpsFactory init() {
29 try {
30 CpsFactory theCpsFactory = (CpsFactory) EPackage.Registry.INSTANCE.getEFactory(CpsPackage.eNS_URI);
31 if (theCpsFactory != null) {
32 return theCpsFactory;
33 }
34 } catch (Exception exception) {
35 EcorePlugin.INSTANCE.log(exception);
36 }
37 return new CpsFactoryImpl();
38 }
39
40 /**
41 * Creates an instance of the factory.
42 * <!-- begin-user-doc -->
43 * <!-- end-user-doc -->
44 * @generated
45 */
46 public CpsFactoryImpl() {
47 super();
48 }
49
50 /**
51 * <!-- begin-user-doc -->
52 * <!-- end-user-doc -->
53 * @generated
54 */
55 @Override
56 public EObject create(EClass eClass) {
57 switch (eClass.getClassifierID()) {
58 case CpsPackage.CYBER_PHYSICAL_SYSTEM:
59 return createCyberPhysicalSystem();
60 case CpsPackage.APPLICATION_TYPE:
61 return createApplicationType();
62 case CpsPackage.HOST_TYPE:
63 return createHostType();
64 case CpsPackage.REQUEST:
65 return createRequest();
66 case CpsPackage.REQUIREMENT:
67 return createRequirement();
68 case CpsPackage.APPLICATION_INSTANCE:
69 return createApplicationInstance();
70 case CpsPackage.RESOURCE_REQUIREMENT:
71 return createResourceRequirement();
72 case CpsPackage.HOST_INSTANCE:
73 return createHostInstance();
74 default:
75 throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
76 }
77 }
78
79 /**
80 * <!-- begin-user-doc -->
81 * <!-- end-user-doc -->
82 * @generated
83 */
84 @Override
85 public CyberPhysicalSystem createCyberPhysicalSystem() {
86 CyberPhysicalSystemImpl cyberPhysicalSystem = new CyberPhysicalSystemImpl();
87 return cyberPhysicalSystem;
88 }
89
90 /**
91 * <!-- begin-user-doc -->
92 * <!-- end-user-doc -->
93 * @generated
94 */
95 @Override
96 public ApplicationType createApplicationType() {
97 ApplicationTypeImpl applicationType = new ApplicationTypeImpl();
98 return applicationType;
99 }
100
101 /**
102 * <!-- begin-user-doc -->
103 * <!-- end-user-doc -->
104 * @generated
105 */
106 @Override
107 public HostType createHostType() {
108 HostTypeImpl hostType = new HostTypeImpl();
109 return hostType;
110 }
111
112 /**
113 * <!-- begin-user-doc -->
114 * <!-- end-user-doc -->
115 * @generated
116 */
117 @Override
118 public Request createRequest() {
119 RequestImpl request = new RequestImpl();
120 return request;
121 }
122
123 /**
124 * <!-- begin-user-doc -->
125 * <!-- end-user-doc -->
126 * @generated
127 */
128 @Override
129 public Requirement createRequirement() {
130 RequirementImpl requirement = new RequirementImpl();
131 return requirement;
132 }
133
134 /**
135 * <!-- begin-user-doc -->
136 * <!-- end-user-doc -->
137 * @generated
138 */
139 @Override
140 public ApplicationInstance createApplicationInstance() {
141 ApplicationInstanceImpl applicationInstance = new ApplicationInstanceImpl();
142 return applicationInstance;
143 }
144
145 /**
146 * <!-- begin-user-doc -->
147 * <!-- end-user-doc -->
148 * @generated
149 */
150 @Override
151 public ResourceRequirement createResourceRequirement() {
152 ResourceRequirementImpl resourceRequirement = new ResourceRequirementImpl();
153 return resourceRequirement;
154 }
155
156 /**
157 * <!-- begin-user-doc -->
158 * <!-- end-user-doc -->
159 * @generated
160 */
161 @Override
162 public HostInstance createHostInstance() {
163 HostInstanceImpl hostInstance = new HostInstanceImpl();
164 return hostInstance;
165 }
166
167 /**
168 * <!-- begin-user-doc -->
169 * <!-- end-user-doc -->
170 * @generated
171 */
172 @Override
173 public CpsPackage getCpsPackage() {
174 return (CpsPackage) getEPackage();
175 }
176
177 /**
178 * <!-- begin-user-doc -->
179 * <!-- end-user-doc -->
180 * @deprecated
181 * @generated
182 */
183 @Deprecated
184 public static CpsPackage getPackage() {
185 return CpsPackage.eINSTANCE;
186 }
187
188} //CpsFactoryImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java
new file mode 100644
index 00000000..1f143a64
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java
@@ -0,0 +1,765 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory;
8import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
9import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
10import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
11import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
12import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
13import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
14import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement;
15
16import org.eclipse.emf.ecore.EAttribute;
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.emf.ecore.EPackage;
19import org.eclipse.emf.ecore.EReference;
20
21import org.eclipse.emf.ecore.impl.EPackageImpl;
22
23/**
24 * <!-- begin-user-doc -->
25 * An implementation of the model <b>Package</b>.
26 * <!-- end-user-doc -->
27 * @generated
28 */
29public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
30 /**
31 * <!-- begin-user-doc -->
32 * <!-- end-user-doc -->
33 * @generated
34 */
35 private EClass cyberPhysicalSystemEClass = null;
36
37 /**
38 * <!-- begin-user-doc -->
39 * <!-- end-user-doc -->
40 * @generated
41 */
42 private EClass applicationTypeEClass = null;
43
44 /**
45 * <!-- begin-user-doc -->
46 * <!-- end-user-doc -->
47 * @generated
48 */
49 private EClass hostTypeEClass = null;
50
51 /**
52 * <!-- begin-user-doc -->
53 * <!-- end-user-doc -->
54 * @generated
55 */
56 private EClass requestEClass = null;
57
58 /**
59 * <!-- begin-user-doc -->
60 * <!-- end-user-doc -->
61 * @generated
62 */
63 private EClass requirementEClass = null;
64
65 /**
66 * <!-- begin-user-doc -->
67 * <!-- end-user-doc -->
68 * @generated
69 */
70 private EClass applicationInstanceEClass = null;
71
72 /**
73 * <!-- begin-user-doc -->
74 * <!-- end-user-doc -->
75 * @generated
76 */
77 private EClass resourceRequirementEClass = null;
78
79 /**
80 * <!-- begin-user-doc -->
81 * <!-- end-user-doc -->
82 * @generated
83 */
84 private EClass hostInstanceEClass = null;
85
86 /**
87 * Creates an instance of the model <b>Package</b>, registered with
88 * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package
89 * package URI value.
90 * <p>Note: the correct way to create the package is via the static
91 * factory method {@link #init init()}, which also performs
92 * initialization of the package, or returns the registered package,
93 * if one already exists.
94 * <!-- begin-user-doc -->
95 * <!-- end-user-doc -->
96 * @see org.eclipse.emf.ecore.EPackage.Registry
97 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#eNS_URI
98 * @see #init()
99 * @generated
100 */
101 private CpsPackageImpl() {
102 super(eNS_URI, CpsFactory.eINSTANCE);
103 }
104
105 /**
106 * <!-- begin-user-doc -->
107 * <!-- end-user-doc -->
108 * @generated
109 */
110 private static boolean isInited = false;
111
112 /**
113 * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends.
114 *
115 * <p>This method is used to initialize {@link CpsPackage#eINSTANCE} when that field is accessed.
116 * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package.
117 * <!-- begin-user-doc -->
118 * <!-- end-user-doc -->
119 * @see #eNS_URI
120 * @see #createPackageContents()
121 * @see #initializePackageContents()
122 * @generated
123 */
124 public static CpsPackage init() {
125 if (isInited)
126 return (CpsPackage) EPackage.Registry.INSTANCE.getEPackage(CpsPackage.eNS_URI);
127
128 // Obtain or create and register package
129 Object registeredCpsPackage = EPackage.Registry.INSTANCE.get(eNS_URI);
130 CpsPackageImpl theCpsPackage = registeredCpsPackage instanceof CpsPackageImpl
131 ? (CpsPackageImpl) registeredCpsPackage
132 : new CpsPackageImpl();
133
134 isInited = true;
135
136 // Create package meta-data objects
137 theCpsPackage.createPackageContents();
138
139 // Initialize created meta-data
140 theCpsPackage.initializePackageContents();
141
142 // Mark meta-data to indicate it can't be changed
143 theCpsPackage.freeze();
144
145 // Update the registry and return the package
146 EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, theCpsPackage);
147 return theCpsPackage;
148 }
149
150 /**
151 * <!-- begin-user-doc -->
152 * <!-- end-user-doc -->
153 * @generated
154 */
155 @Override
156 public EClass getCyberPhysicalSystem() {
157 return cyberPhysicalSystemEClass;
158 }
159
160 /**
161 * <!-- begin-user-doc -->
162 * <!-- end-user-doc -->
163 * @generated
164 */
165 @Override
166 public EReference getCyberPhysicalSystem_Requests() {
167 return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(0);
168 }
169
170 /**
171 * <!-- begin-user-doc -->
172 * <!-- end-user-doc -->
173 * @generated
174 */
175 @Override
176 public EReference getCyberPhysicalSystem_ApplicationTypes() {
177 return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(1);
178 }
179
180 /**
181 * <!-- begin-user-doc -->
182 * <!-- end-user-doc -->
183 * @generated
184 */
185 @Override
186 public EReference getCyberPhysicalSystem_HostTypes() {
187 return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(2);
188 }
189
190 /**
191 * <!-- begin-user-doc -->
192 * <!-- end-user-doc -->
193 * @generated
194 */
195 @Override
196 public EReference getCyberPhysicalSystem_Hosts() {
197 return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(3);
198 }
199
200 /**
201 * <!-- begin-user-doc -->
202 * <!-- end-user-doc -->
203 * @generated
204 */
205 @Override
206 public EReference getCyberPhysicalSystem_Applications() {
207 return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(4);
208 }
209
210 /**
211 * <!-- begin-user-doc -->
212 * <!-- end-user-doc -->
213 * @generated
214 */
215 @Override
216 public EClass getApplicationType() {
217 return applicationTypeEClass;
218 }
219
220 /**
221 * <!-- begin-user-doc -->
222 * <!-- end-user-doc -->
223 * @generated
224 */
225 @Override
226 public EReference getApplicationType_Instances() {
227 return (EReference) applicationTypeEClass.getEStructuralFeatures().get(0);
228 }
229
230 /**
231 * <!-- begin-user-doc -->
232 * <!-- end-user-doc -->
233 * @generated
234 */
235 @Override
236 public EReference getApplicationType_Requirements() {
237 return (EReference) applicationTypeEClass.getEStructuralFeatures().get(1);
238 }
239
240 /**
241 * <!-- begin-user-doc -->
242 * <!-- end-user-doc -->
243 * @generated
244 */
245 @Override
246 public EClass getHostType() {
247 return hostTypeEClass;
248 }
249
250 /**
251 * <!-- begin-user-doc -->
252 * <!-- end-user-doc -->
253 * @generated
254 */
255 @Override
256 public EAttribute getHostType_DefaultMemory() {
257 return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(0);
258 }
259
260 /**
261 * <!-- begin-user-doc -->
262 * <!-- end-user-doc -->
263 * @generated
264 */
265 @Override
266 public EAttribute getHostType_DefaultHdd() {
267 return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(1);
268 }
269
270 /**
271 * <!-- begin-user-doc -->
272 * <!-- end-user-doc -->
273 * @generated
274 */
275 @Override
276 public EReference getHostType_Instances() {
277 return (EReference) hostTypeEClass.getEStructuralFeatures().get(2);
278 }
279
280 /**
281 * <!-- begin-user-doc -->
282 * <!-- end-user-doc -->
283 * @generated
284 */
285 @Override
286 public EAttribute getHostType_Cost() {
287 return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(3);
288 }
289
290 /**
291 * <!-- begin-user-doc -->
292 * <!-- end-user-doc -->
293 * @generated
294 */
295 @Override
296 public EClass getRequest() {
297 return requestEClass;
298 }
299
300 /**
301 * <!-- begin-user-doc -->
302 * <!-- end-user-doc -->
303 * @generated
304 */
305 @Override
306 public EReference getRequest_Requirements() {
307 return (EReference) requestEClass.getEStructuralFeatures().get(0);
308 }
309
310 /**
311 * <!-- begin-user-doc -->
312 * <!-- end-user-doc -->
313 * @generated
314 */
315 @Override
316 public EClass getRequirement() {
317 return requirementEClass;
318 }
319
320 /**
321 * <!-- begin-user-doc -->
322 * <!-- end-user-doc -->
323 * @generated
324 */
325 @Override
326 public EReference getRequirement_Request() {
327 return (EReference) requirementEClass.getEStructuralFeatures().get(0);
328 }
329
330 /**
331 * <!-- begin-user-doc -->
332 * <!-- end-user-doc -->
333 * @generated
334 */
335 @Override
336 public EAttribute getRequirement_Count() {
337 return (EAttribute) requirementEClass.getEStructuralFeatures().get(1);
338 }
339
340 /**
341 * <!-- begin-user-doc -->
342 * <!-- end-user-doc -->
343 * @generated
344 */
345 @Override
346 public EReference getRequirement_Type() {
347 return (EReference) requirementEClass.getEStructuralFeatures().get(2);
348 }
349
350 /**
351 * <!-- begin-user-doc -->
352 * <!-- end-user-doc -->
353 * @generated
354 */
355 @Override
356 public EReference getRequirement_Instances() {
357 return (EReference) requirementEClass.getEStructuralFeatures().get(3);
358 }
359
360 /**
361 * <!-- begin-user-doc -->
362 * <!-- end-user-doc -->
363 * @generated
364 */
365 @Override
366 public EClass getApplicationInstance() {
367 return applicationInstanceEClass;
368 }
369
370 /**
371 * <!-- begin-user-doc -->
372 * <!-- end-user-doc -->
373 * @generated
374 */
375 @Override
376 public EReference getApplicationInstance_Requirement() {
377 return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(0);
378 }
379
380 /**
381 * <!-- begin-user-doc -->
382 * <!-- end-user-doc -->
383 * @generated
384 */
385 @Override
386 public EReference getApplicationInstance_Type() {
387 return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(1);
388 }
389
390 /**
391 * <!-- begin-user-doc -->
392 * <!-- end-user-doc -->
393 * @generated
394 */
395 @Override
396 public EReference getApplicationInstance_AllocatedTo() {
397 return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(2);
398 }
399
400 /**
401 * <!-- begin-user-doc -->
402 * <!-- end-user-doc -->
403 * @generated
404 */
405 @Override
406 public EClass getResourceRequirement() {
407 return resourceRequirementEClass;
408 }
409
410 /**
411 * <!-- begin-user-doc -->
412 * <!-- end-user-doc -->
413 * @generated
414 */
415 @Override
416 public EAttribute getResourceRequirement_RequiredMemory() {
417 return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(0);
418 }
419
420 /**
421 * <!-- begin-user-doc -->
422 * <!-- end-user-doc -->
423 * @generated
424 */
425 @Override
426 public EAttribute getResourceRequirement_RequiredHdd() {
427 return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(1);
428 }
429
430 /**
431 * <!-- begin-user-doc -->
432 * <!-- end-user-doc -->
433 * @generated
434 */
435 @Override
436 public EReference getResourceRequirement_HostType() {
437 return (EReference) resourceRequirementEClass.getEStructuralFeatures().get(2);
438 }
439
440 /**
441 * <!-- begin-user-doc -->
442 * <!-- end-user-doc -->
443 * @generated
444 */
445 @Override
446 public EClass getHostInstance() {
447 return hostInstanceEClass;
448 }
449
450 /**
451 * <!-- begin-user-doc -->
452 * <!-- end-user-doc -->
453 * @generated
454 */
455 @Override
456 public EReference getHostInstance_Type() {
457 return (EReference) hostInstanceEClass.getEStructuralFeatures().get(0);
458 }
459
460 /**
461 * <!-- begin-user-doc -->
462 * <!-- end-user-doc -->
463 * @generated
464 */
465 @Override
466 public EAttribute getHostInstance_AvailableMemory() {
467 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(1);
468 }
469
470 /**
471 * <!-- begin-user-doc -->
472 * <!-- end-user-doc -->
473 * @generated
474 */
475 @Override
476 public EAttribute getHostInstance_AvailableHdd() {
477 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(2);
478 }
479
480 /**
481 * <!-- begin-user-doc -->
482 * <!-- end-user-doc -->
483 * @generated
484 */
485 @Override
486 public EAttribute getHostInstance_TotalMemory() {
487 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(3);
488 }
489
490 /**
491 * <!-- begin-user-doc -->
492 * <!-- end-user-doc -->
493 * @generated
494 */
495 @Override
496 public EAttribute getHostInstance_TotalHdd() {
497 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(4);
498 }
499
500 /**
501 * <!-- begin-user-doc -->
502 * <!-- end-user-doc -->
503 * @generated
504 */
505 @Override
506 public EReference getHostInstance_Applications() {
507 return (EReference) hostInstanceEClass.getEStructuralFeatures().get(5);
508 }
509
510 /**
511 * <!-- begin-user-doc -->
512 * <!-- end-user-doc -->
513 * @generated
514 */
515 @Override
516 public CpsFactory getCpsFactory() {
517 return (CpsFactory) getEFactoryInstance();
518 }
519
520 /**
521 * <!-- begin-user-doc -->
522 * <!-- end-user-doc -->
523 * @generated
524 */
525 private boolean isCreated = false;
526
527 /**
528 * Creates the meta-model objects for the package. This method is
529 * guarded to have no affect on any invocation but its first.
530 * <!-- begin-user-doc -->
531 * <!-- end-user-doc -->
532 * @generated
533 */
534 public void createPackageContents() {
535 if (isCreated)
536 return;
537 isCreated = true;
538
539 // Create classes and their features
540 cyberPhysicalSystemEClass = createEClass(CYBER_PHYSICAL_SYSTEM);
541 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__REQUESTS);
542 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES);
543 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOST_TYPES);
544 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOSTS);
545 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATIONS);
546
547 applicationTypeEClass = createEClass(APPLICATION_TYPE);
548 createEReference(applicationTypeEClass, APPLICATION_TYPE__INSTANCES);
549 createEReference(applicationTypeEClass, APPLICATION_TYPE__REQUIREMENTS);
550
551 hostTypeEClass = createEClass(HOST_TYPE);
552 createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_MEMORY);
553 createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_HDD);
554 createEReference(hostTypeEClass, HOST_TYPE__INSTANCES);
555 createEAttribute(hostTypeEClass, HOST_TYPE__COST);
556
557 requestEClass = createEClass(REQUEST);
558 createEReference(requestEClass, REQUEST__REQUIREMENTS);
559
560 requirementEClass = createEClass(REQUIREMENT);
561 createEReference(requirementEClass, REQUIREMENT__REQUEST);
562 createEAttribute(requirementEClass, REQUIREMENT__COUNT);
563 createEReference(requirementEClass, REQUIREMENT__TYPE);
564 createEReference(requirementEClass, REQUIREMENT__INSTANCES);
565
566 applicationInstanceEClass = createEClass(APPLICATION_INSTANCE);
567 createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__REQUIREMENT);
568 createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__TYPE);
569 createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__ALLOCATED_TO);
570
571 resourceRequirementEClass = createEClass(RESOURCE_REQUIREMENT);
572 createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_MEMORY);
573 createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_HDD);
574 createEReference(resourceRequirementEClass, RESOURCE_REQUIREMENT__HOST_TYPE);
575
576 hostInstanceEClass = createEClass(HOST_INSTANCE);
577 createEReference(hostInstanceEClass, HOST_INSTANCE__TYPE);
578 createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_MEMORY);
579 createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_HDD);
580 createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_MEMORY);
581 createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_HDD);
582 createEReference(hostInstanceEClass, HOST_INSTANCE__APPLICATIONS);
583 }
584
585 /**
586 * <!-- begin-user-doc -->
587 * <!-- end-user-doc -->
588 * @generated
589 */
590 private boolean isInitialized = false;
591
592 /**
593 * Complete the initialization of the package and its meta-model. This
594 * method is guarded to have no affect on any invocation but its first.
595 * <!-- begin-user-doc -->
596 * <!-- end-user-doc -->
597 * @generated
598 */
599 public void initializePackageContents() {
600 if (isInitialized)
601 return;
602 isInitialized = true;
603
604 // Initialize package
605 setName(eNAME);
606 setNsPrefix(eNS_PREFIX);
607 setNsURI(eNS_URI);
608
609 // Create type parameters
610
611 // Set bounds for type parameters
612
613 // Add supertypes to classes
614
615 // Initialize classes, features, and operations; add parameters
616 initEClass(cyberPhysicalSystemEClass, CyberPhysicalSystem.class, "CyberPhysicalSystem", !IS_ABSTRACT,
617 !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
618 initEReference(getCyberPhysicalSystem_Requests(), this.getRequest(), null, "requests", null, 0, -1,
619 CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
620 !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
621 initEReference(getCyberPhysicalSystem_ApplicationTypes(), this.getApplicationType(), null, "applicationTypes",
622 null, 0, -1, CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
623 !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
624 initEReference(getCyberPhysicalSystem_HostTypes(), this.getHostType(), null, "hostTypes", null, 0, -1,
625 CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
626 !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
627 initEReference(getCyberPhysicalSystem_Hosts(), this.getHostInstance(), null, "hosts", null, 0, -1,
628 CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
629 !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
630 initEReference(getCyberPhysicalSystem_Applications(), this.getApplicationInstance(), null, "applications", null,
631 0, -1, CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE,
632 IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
633
634 initEClass(applicationTypeEClass, ApplicationType.class, "ApplicationType", !IS_ABSTRACT, !IS_INTERFACE,
635 IS_GENERATED_INSTANCE_CLASS);
636 initEReference(getApplicationType_Instances(), this.getApplicationInstance(),
637 this.getApplicationInstance_Type(), "instances", null, 0, -1, ApplicationType.class, !IS_TRANSIENT,
638 !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
639 IS_ORDERED);
640 initEReference(getApplicationType_Requirements(), this.getResourceRequirement(), null, "requirements", null, 0,
641 -1, ApplicationType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
642 !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
643
644 initEClass(hostTypeEClass, HostType.class, "HostType", !IS_ABSTRACT, !IS_INTERFACE,
645 IS_GENERATED_INSTANCE_CLASS);
646 initEAttribute(getHostType_DefaultMemory(), ecorePackage.getEInt(), "defaultMemory", null, 1, 1, HostType.class,
647 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
648 initEAttribute(getHostType_DefaultHdd(), ecorePackage.getEInt(), "defaultHdd", null, 1, 1, HostType.class,
649 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
650 initEReference(getHostType_Instances(), this.getHostInstance(), this.getHostInstance_Type(), "instances", null,
651 0, -1, HostType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES,
652 !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
653 initEAttribute(getHostType_Cost(), ecorePackage.getEInt(), "cost", null, 1, 1, HostType.class, !IS_TRANSIENT,
654 !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
655
656 initEClass(requestEClass, Request.class, "Request", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
657 initEReference(getRequest_Requirements(), this.getRequirement(), this.getRequirement_Request(), "requirements",
658 null, 0, -1, Request.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
659 !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
660
661 initEClass(requirementEClass, Requirement.class, "Requirement", !IS_ABSTRACT, !IS_INTERFACE,
662 IS_GENERATED_INSTANCE_CLASS);
663 initEReference(getRequirement_Request(), this.getRequest(), this.getRequest_Requirements(), "request", null, 1,
664 1, Requirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
665 !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
666 initEAttribute(getRequirement_Count(), ecorePackage.getEInt(), "count", null, 1, 1, Requirement.class,
667 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
668 initEReference(getRequirement_Type(), this.getApplicationType(), null, "type", null, 0, 1, Requirement.class,
669 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
670 IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
671 initEReference(getRequirement_Instances(), this.getApplicationInstance(),
672 this.getApplicationInstance_Requirement(), "instances", null, 0, -1, Requirement.class, !IS_TRANSIENT,
673 !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED,
674 IS_ORDERED);
675
676 initEClass(applicationInstanceEClass, ApplicationInstance.class, "ApplicationInstance", !IS_ABSTRACT,
677 !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
678 initEReference(getApplicationInstance_Requirement(), this.getRequirement(), this.getRequirement_Instances(),
679 "requirement", null, 0, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
680 !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
681 initEReference(getApplicationInstance_Type(), this.getApplicationType(), this.getApplicationType_Instances(),
682 "type", null, 1, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE,
683 !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
684 initEReference(getApplicationInstance_AllocatedTo(), this.getHostInstance(),
685 this.getHostInstance_Applications(), "allocatedTo", null, 1, 1, ApplicationInstance.class,
686 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
687 IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
688
689 initEClass(resourceRequirementEClass, ResourceRequirement.class, "ResourceRequirement", !IS_ABSTRACT,
690 !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
691 initEAttribute(getResourceRequirement_RequiredMemory(), ecorePackage.getEInt(), "requiredMemory", null, 1, 1,
692 ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
693 IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
694 initEAttribute(getResourceRequirement_RequiredHdd(), ecorePackage.getEInt(), "requiredHdd", null, 1, 1,
695 ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID,
696 IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
697 initEReference(getResourceRequirement_HostType(), this.getHostType(), null, "hostType", null, 1, 1,
698 ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE,
699 IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
700
701 initEClass(hostInstanceEClass, HostInstance.class, "HostInstance", !IS_ABSTRACT, !IS_INTERFACE,
702 IS_GENERATED_INSTANCE_CLASS);
703 initEReference(getHostInstance_Type(), this.getHostType(), this.getHostType_Instances(), "type", null, 1, 1,
704 HostInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
705 !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
706 initEAttribute(getHostInstance_AvailableMemory(), ecorePackage.getEInt(), "availableMemory", null, 0, 1,
707 HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
708 IS_DERIVED, IS_ORDERED);
709 initEAttribute(getHostInstance_AvailableHdd(), ecorePackage.getEInt(), "availableHdd", null, 0, 1,
710 HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
711 IS_DERIVED, IS_ORDERED);
712 initEAttribute(getHostInstance_TotalMemory(), ecorePackage.getEInt(), "totalMemory", null, 0, 1,
713 HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
714 IS_DERIVED, IS_ORDERED);
715 initEAttribute(getHostInstance_TotalHdd(), ecorePackage.getEInt(), "totalHdd", null, 0, 1, HostInstance.class,
716 IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
717 initEReference(getHostInstance_Applications(), this.getApplicationInstance(),
718 this.getApplicationInstance_AllocatedTo(), "applications", null, 0, -1, HostInstance.class,
719 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
720 IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
721
722 // Create resource
723 createResource(eNS_URI);
724
725 // Create annotations
726 // http://www.eclipse.org/emf/2002/Ecore
727 createEcoreAnnotations();
728 // org.eclipse.viatra.query.querybasedfeature
729 createOrgAnnotations();
730 }
731
732 /**
733 * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
734 * <!-- begin-user-doc -->
735 * <!-- end-user-doc -->
736 * @generated
737 */
738 protected void createEcoreAnnotations() {
739 String source = "http://www.eclipse.org/emf/2002/Ecore";
740 addAnnotation(this, source, new String[] { "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" });
741 }
742
743 /**
744 * Initializes the annotations for <b>org.eclipse.viatra.query.querybasedfeature</b>.
745 * <!-- begin-user-doc -->
746 * <!-- end-user-doc -->
747 * @generated
748 */
749 protected void createOrgAnnotations() {
750 String source = "org.eclipse.viatra.query.querybasedfeature";
751 addAnnotation(getCyberPhysicalSystem_Hosts(), source,
752 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts" });
753 addAnnotation(getCyberPhysicalSystem_Applications(), source,
754 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications" });
755 addAnnotation(getHostInstance_AvailableMemory(), source,
756 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory" });
757 addAnnotation(getHostInstance_AvailableHdd(), source,
758 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd" });
759 addAnnotation(getHostInstance_TotalMemory(), source,
760 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory" });
761 addAnnotation(getHostInstance_TotalHdd(), source,
762 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd" });
763 }
764
765} //CpsPackageImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java
new file mode 100644
index 00000000..4d254f25
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java
@@ -0,0 +1,289 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
8import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
9import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
10import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
11import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
12
13import java.util.Collection;
14
15import org.eclipse.emf.common.notify.NotificationChain;
16
17import org.eclipse.emf.common.util.EList;
18
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.emf.ecore.EStructuralFeature;
21import org.eclipse.emf.ecore.InternalEObject;
22
23import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
24
25import org.eclipse.emf.ecore.util.EObjectContainmentEList;
26import org.eclipse.emf.ecore.util.InternalEList;
27
28/**
29 * <!-- begin-user-doc -->
30 * An implementation of the model object '<em><b>Cyber Physical System</b></em>'.
31 * <!-- end-user-doc -->
32 * <p>
33 * The following features are implemented:
34 * </p>
35 * <ul>
36 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getRequests <em>Requests</em>}</li>
37 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplicationTypes <em>Application Types</em>}</li>
38 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHostTypes <em>Host Types</em>}</li>
39 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHosts <em>Hosts</em>}</li>
40 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplications <em>Applications</em>}</li>
41 * </ul>
42 *
43 * @generated
44 */
45public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implements CyberPhysicalSystem {
46 /**
47 * The cached value of the '{@link #getRequests() <em>Requests</em>}' containment reference list.
48 * <!-- begin-user-doc -->
49 * <!-- end-user-doc -->
50 * @see #getRequests()
51 * @generated
52 * @ordered
53 */
54 protected EList<Request> requests;
55
56 /**
57 * The cached value of the '{@link #getApplicationTypes() <em>Application Types</em>}' containment reference list.
58 * <!-- begin-user-doc -->
59 * <!-- end-user-doc -->
60 * @see #getApplicationTypes()
61 * @generated
62 * @ordered
63 */
64 protected EList<ApplicationType> applicationTypes;
65
66 /**
67 * The cached value of the '{@link #getHostTypes() <em>Host Types</em>}' containment reference list.
68 * <!-- begin-user-doc -->
69 * <!-- end-user-doc -->
70 * @see #getHostTypes()
71 * @generated
72 * @ordered
73 */
74 protected EList<HostType> hostTypes;
75
76 /**
77 * The cached setting delegate for the '{@link #getHosts() <em>Hosts</em>}' reference list.
78 * <!-- begin-user-doc -->
79 * <!-- end-user-doc -->
80 * @see #getHosts()
81 * @generated
82 * @ordered
83 */
84 protected EStructuralFeature.Internal.SettingDelegate HOSTS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__HOSTS)
85 .getSettingDelegate();
86
87 /**
88 * The cached setting delegate for the '{@link #getApplications() <em>Applications</em>}' reference list.
89 * <!-- begin-user-doc -->
90 * <!-- end-user-doc -->
91 * @see #getApplications()
92 * @generated
93 * @ordered
94 */
95 protected EStructuralFeature.Internal.SettingDelegate APPLICATIONS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__APPLICATIONS)
96 .getSettingDelegate();
97
98 /**
99 * <!-- begin-user-doc -->
100 * <!-- end-user-doc -->
101 * @generated
102 */
103 protected CyberPhysicalSystemImpl() {
104 super();
105 }
106
107 /**
108 * <!-- begin-user-doc -->
109 * <!-- end-user-doc -->
110 * @generated
111 */
112 @Override
113 protected EClass eStaticClass() {
114 return CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM;
115 }
116
117 /**
118 * <!-- begin-user-doc -->
119 * <!-- end-user-doc -->
120 * @generated
121 */
122 @Override
123 public EList<Request> getRequests() {
124 if (requests == null) {
125 requests = new EObjectContainmentEList<Request>(Request.class, this,
126 CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS);
127 }
128 return requests;
129 }
130
131 /**
132 * <!-- begin-user-doc -->
133 * <!-- end-user-doc -->
134 * @generated
135 */
136 @Override
137 public EList<ApplicationType> getApplicationTypes() {
138 if (applicationTypes == null) {
139 applicationTypes = new EObjectContainmentEList<ApplicationType>(ApplicationType.class, this,
140 CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES);
141 }
142 return applicationTypes;
143 }
144
145 /**
146 * <!-- begin-user-doc -->
147 * <!-- end-user-doc -->
148 * @generated
149 */
150 @Override
151 public EList<HostType> getHostTypes() {
152 if (hostTypes == null) {
153 hostTypes = new EObjectContainmentEList<HostType>(HostType.class, this,
154 CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES);
155 }
156 return hostTypes;
157 }
158
159 /**
160 * <!-- begin-user-doc -->
161 * <!-- end-user-doc -->
162 * @generated
163 */
164 @SuppressWarnings("unchecked")
165 @Override
166 public EList<HostInstance> getHosts() {
167 return (EList<HostInstance>) HOSTS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
168 }
169
170 /**
171 * <!-- begin-user-doc -->
172 * <!-- end-user-doc -->
173 * @generated
174 */
175 @SuppressWarnings("unchecked")
176 @Override
177 public EList<ApplicationInstance> getApplications() {
178 return (EList<ApplicationInstance>) APPLICATIONS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
179 }
180
181 /**
182 * <!-- begin-user-doc -->
183 * <!-- end-user-doc -->
184 * @generated
185 */
186 @Override
187 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
188 switch (featureID) {
189 case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
190 return ((InternalEList<?>) getRequests()).basicRemove(otherEnd, msgs);
191 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
192 return ((InternalEList<?>) getApplicationTypes()).basicRemove(otherEnd, msgs);
193 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
194 return ((InternalEList<?>) getHostTypes()).basicRemove(otherEnd, msgs);
195 }
196 return super.eInverseRemove(otherEnd, featureID, msgs);
197 }
198
199 /**
200 * <!-- begin-user-doc -->
201 * <!-- end-user-doc -->
202 * @generated
203 */
204 @Override
205 public Object eGet(int featureID, boolean resolve, boolean coreType) {
206 switch (featureID) {
207 case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
208 return getRequests();
209 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
210 return getApplicationTypes();
211 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
212 return getHostTypes();
213 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS:
214 return getHosts();
215 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS:
216 return getApplications();
217 }
218 return super.eGet(featureID, resolve, coreType);
219 }
220
221 /**
222 * <!-- begin-user-doc -->
223 * <!-- end-user-doc -->
224 * @generated
225 */
226 @SuppressWarnings("unchecked")
227 @Override
228 public void eSet(int featureID, Object newValue) {
229 switch (featureID) {
230 case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
231 getRequests().clear();
232 getRequests().addAll((Collection<? extends Request>) newValue);
233 return;
234 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
235 getApplicationTypes().clear();
236 getApplicationTypes().addAll((Collection<? extends ApplicationType>) newValue);
237 return;
238 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
239 getHostTypes().clear();
240 getHostTypes().addAll((Collection<? extends HostType>) newValue);
241 return;
242 }
243 super.eSet(featureID, newValue);
244 }
245
246 /**
247 * <!-- begin-user-doc -->
248 * <!-- end-user-doc -->
249 * @generated
250 */
251 @Override
252 public void eUnset(int featureID) {
253 switch (featureID) {
254 case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
255 getRequests().clear();
256 return;
257 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
258 getApplicationTypes().clear();
259 return;
260 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
261 getHostTypes().clear();
262 return;
263 }
264 super.eUnset(featureID);
265 }
266
267 /**
268 * <!-- begin-user-doc -->
269 * <!-- end-user-doc -->
270 * @generated
271 */
272 @Override
273 public boolean eIsSet(int featureID) {
274 switch (featureID) {
275 case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS:
276 return requests != null && !requests.isEmpty();
277 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES:
278 return applicationTypes != null && !applicationTypes.isEmpty();
279 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
280 return hostTypes != null && !hostTypes.isEmpty();
281 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS:
282 return HOSTS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
283 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS:
284 return APPLICATIONS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
285 }
286 return super.eIsSet(featureID);
287 }
288
289} //CyberPhysicalSystemImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java
new file mode 100644
index 00000000..bbaca59c
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java
@@ -0,0 +1,355 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
9
10import java.util.Collection;
11
12import org.eclipse.emf.common.notify.Notification;
13import org.eclipse.emf.common.notify.NotificationChain;
14
15import org.eclipse.emf.common.util.EList;
16
17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.emf.ecore.EStructuralFeature;
19import org.eclipse.emf.ecore.InternalEObject;
20
21import org.eclipse.emf.ecore.impl.ENotificationImpl;
22import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
23
24import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
25import org.eclipse.emf.ecore.util.EcoreUtil;
26import org.eclipse.emf.ecore.util.InternalEList;
27
28/**
29 * <!-- begin-user-doc -->
30 * An implementation of the model object '<em><b>Host Instance</b></em>'.
31 * <!-- end-user-doc -->
32 * <p>
33 * The following features are implemented:
34 * </p>
35 * <ul>
36 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getType <em>Type</em>}</li>
37 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableMemory <em>Available Memory</em>}</li>
38 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableHdd <em>Available Hdd</em>}</li>
39 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalMemory <em>Total Memory</em>}</li>
40 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalHdd <em>Total Hdd</em>}</li>
41 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getApplications <em>Applications</em>}</li>
42 * </ul>
43 *
44 * @generated
45 */
46public class HostInstanceImpl extends MinimalEObjectImpl.Container implements HostInstance {
47 /**
48 * The cached setting delegate for the '{@link #getAvailableMemory() <em>Available Memory</em>}' attribute.
49 * <!-- begin-user-doc -->
50 * <!-- end-user-doc -->
51 * @see #getAvailableMemory()
52 * @generated
53 * @ordered
54 */
55 protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_MEMORY)
56 .getSettingDelegate();
57
58 /**
59 * The cached setting delegate for the '{@link #getAvailableHdd() <em>Available Hdd</em>}' attribute.
60 * <!-- begin-user-doc -->
61 * <!-- end-user-doc -->
62 * @see #getAvailableHdd()
63 * @generated
64 * @ordered
65 */
66 protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_HDD)
67 .getSettingDelegate();
68
69 /**
70 * The cached setting delegate for the '{@link #getTotalMemory() <em>Total Memory</em>}' attribute.
71 * <!-- begin-user-doc -->
72 * <!-- end-user-doc -->
73 * @see #getTotalMemory()
74 * @generated
75 * @ordered
76 */
77 protected EStructuralFeature.Internal.SettingDelegate TOTAL_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_MEMORY)
78 .getSettingDelegate();
79
80 /**
81 * The cached setting delegate for the '{@link #getTotalHdd() <em>Total Hdd</em>}' attribute.
82 * <!-- begin-user-doc -->
83 * <!-- end-user-doc -->
84 * @see #getTotalHdd()
85 * @generated
86 * @ordered
87 */
88 protected EStructuralFeature.Internal.SettingDelegate TOTAL_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_HDD)
89 .getSettingDelegate();
90
91 /**
92 * The cached value of the '{@link #getApplications() <em>Applications</em>}' reference list.
93 * <!-- begin-user-doc -->
94 * <!-- end-user-doc -->
95 * @see #getApplications()
96 * @generated
97 * @ordered
98 */
99 protected EList<ApplicationInstance> applications;
100
101 /**
102 * <!-- begin-user-doc -->
103 * <!-- end-user-doc -->
104 * @generated
105 */
106 protected HostInstanceImpl() {
107 super();
108 }
109
110 /**
111 * <!-- begin-user-doc -->
112 * <!-- end-user-doc -->
113 * @generated
114 */
115 @Override
116 protected EClass eStaticClass() {
117 return CpsPackage.Literals.HOST_INSTANCE;
118 }
119
120 /**
121 * <!-- begin-user-doc -->
122 * <!-- end-user-doc -->
123 * @generated
124 */
125 @Override
126 public HostType getType() {
127 if (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE)
128 return null;
129 return (HostType) eInternalContainer();
130 }
131
132 /**
133 * <!-- begin-user-doc -->
134 * <!-- end-user-doc -->
135 * @generated
136 */
137 public NotificationChain basicSetType(HostType newType, NotificationChain msgs) {
138 msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.HOST_INSTANCE__TYPE, msgs);
139 return msgs;
140 }
141
142 /**
143 * <!-- begin-user-doc -->
144 * <!-- end-user-doc -->
145 * @generated
146 */
147 @Override
148 public void setType(HostType newType) {
149 if (newType != eInternalContainer()
150 || (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE && newType != null)) {
151 if (EcoreUtil.isAncestor(this, newType))
152 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
153 NotificationChain msgs = null;
154 if (eInternalContainer() != null)
155 msgs = eBasicRemoveFromContainer(msgs);
156 if (newType != null)
157 msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class,
158 msgs);
159 msgs = basicSetType(newType, msgs);
160 if (msgs != null)
161 msgs.dispatch();
162 } else if (eNotificationRequired())
163 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_INSTANCE__TYPE, newType, newType));
164 }
165
166 /**
167 * <!-- begin-user-doc -->
168 * <!-- end-user-doc -->
169 * @generated
170 */
171 @Override
172 public int getAvailableMemory() {
173 return (Integer) AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
174 }
175
176 /**
177 * <!-- begin-user-doc -->
178 * <!-- end-user-doc -->
179 * @generated
180 */
181 @Override
182 public int getAvailableHdd() {
183 return (Integer) AVAILABLE_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
184 }
185
186 /**
187 * <!-- begin-user-doc -->
188 * <!-- end-user-doc -->
189 * @generated
190 */
191 @Override
192 public int getTotalMemory() {
193 return (Integer) TOTAL_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
194 }
195
196 /**
197 * <!-- begin-user-doc -->
198 * <!-- end-user-doc -->
199 * @generated
200 */
201 @Override
202 public int getTotalHdd() {
203 return (Integer) TOTAL_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
204 }
205
206 /**
207 * <!-- begin-user-doc -->
208 * <!-- end-user-doc -->
209 * @generated
210 */
211 @Override
212 public EList<ApplicationInstance> getApplications() {
213 if (applications == null) {
214 applications = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this,
215 CpsPackage.HOST_INSTANCE__APPLICATIONS, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO);
216 }
217 return applications;
218 }
219
220 /**
221 * <!-- begin-user-doc -->
222 * <!-- end-user-doc -->
223 * @generated
224 */
225 @SuppressWarnings("unchecked")
226 @Override
227 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
228 switch (featureID) {
229 case CpsPackage.HOST_INSTANCE__TYPE:
230 if (eInternalContainer() != null)
231 msgs = eBasicRemoveFromContainer(msgs);
232 return basicSetType((HostType) otherEnd, msgs);
233 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
234 return ((InternalEList<InternalEObject>) (InternalEList<?>) getApplications()).basicAdd(otherEnd, msgs);
235 }
236 return super.eInverseAdd(otherEnd, featureID, msgs);
237 }
238
239 /**
240 * <!-- begin-user-doc -->
241 * <!-- end-user-doc -->
242 * @generated
243 */
244 @Override
245 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
246 switch (featureID) {
247 case CpsPackage.HOST_INSTANCE__TYPE:
248 return basicSetType(null, msgs);
249 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
250 return ((InternalEList<?>) getApplications()).basicRemove(otherEnd, msgs);
251 }
252 return super.eInverseRemove(otherEnd, featureID, msgs);
253 }
254
255 /**
256 * <!-- begin-user-doc -->
257 * <!-- end-user-doc -->
258 * @generated
259 */
260 @Override
261 public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
262 switch (eContainerFeatureID()) {
263 case CpsPackage.HOST_INSTANCE__TYPE:
264 return eInternalContainer().eInverseRemove(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, msgs);
265 }
266 return super.eBasicRemoveFromContainerFeature(msgs);
267 }
268
269 /**
270 * <!-- begin-user-doc -->
271 * <!-- end-user-doc -->
272 * @generated
273 */
274 @Override
275 public Object eGet(int featureID, boolean resolve, boolean coreType) {
276 switch (featureID) {
277 case CpsPackage.HOST_INSTANCE__TYPE:
278 return getType();
279 case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY:
280 return getAvailableMemory();
281 case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD:
282 return getAvailableHdd();
283 case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY:
284 return getTotalMemory();
285 case CpsPackage.HOST_INSTANCE__TOTAL_HDD:
286 return getTotalHdd();
287 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
288 return getApplications();
289 }
290 return super.eGet(featureID, resolve, coreType);
291 }
292
293 /**
294 * <!-- begin-user-doc -->
295 * <!-- end-user-doc -->
296 * @generated
297 */
298 @SuppressWarnings("unchecked")
299 @Override
300 public void eSet(int featureID, Object newValue) {
301 switch (featureID) {
302 case CpsPackage.HOST_INSTANCE__TYPE:
303 setType((HostType) newValue);
304 return;
305 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
306 getApplications().clear();
307 getApplications().addAll((Collection<? extends ApplicationInstance>) newValue);
308 return;
309 }
310 super.eSet(featureID, newValue);
311 }
312
313 /**
314 * <!-- begin-user-doc -->
315 * <!-- end-user-doc -->
316 * @generated
317 */
318 @Override
319 public void eUnset(int featureID) {
320 switch (featureID) {
321 case CpsPackage.HOST_INSTANCE__TYPE:
322 setType((HostType) null);
323 return;
324 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
325 getApplications().clear();
326 return;
327 }
328 super.eUnset(featureID);
329 }
330
331 /**
332 * <!-- begin-user-doc -->
333 * <!-- end-user-doc -->
334 * @generated
335 */
336 @Override
337 public boolean eIsSet(int featureID) {
338 switch (featureID) {
339 case CpsPackage.HOST_INSTANCE__TYPE:
340 return getType() != null;
341 case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY:
342 return AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
343 case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD:
344 return AVAILABLE_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
345 case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY:
346 return TOTAL_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
347 case CpsPackage.HOST_INSTANCE__TOTAL_HDD:
348 return TOTAL_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
349 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
350 return applications != null && !applications.isEmpty();
351 }
352 return super.eIsSet(featureID);
353 }
354
355} //HostInstanceImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java
new file mode 100644
index 00000000..c3d5b3dc
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostTypeImpl.java
@@ -0,0 +1,356 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
8
9import java.util.Collection;
10
11import org.eclipse.emf.common.notify.Notification;
12import org.eclipse.emf.common.notify.NotificationChain;
13
14import org.eclipse.emf.common.util.EList;
15
16import org.eclipse.emf.ecore.EClass;
17import org.eclipse.emf.ecore.InternalEObject;
18
19import org.eclipse.emf.ecore.impl.ENotificationImpl;
20import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
21
22import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
23import org.eclipse.emf.ecore.util.InternalEList;
24
25/**
26 * <!-- begin-user-doc -->
27 * An implementation of the model object '<em><b>Host Type</b></em>'.
28 * <!-- end-user-doc -->
29 * <p>
30 * The following features are implemented:
31 * </p>
32 * <ul>
33 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getDefaultMemory <em>Default Memory</em>}</li>
34 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getDefaultHdd <em>Default Hdd</em>}</li>
35 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getInstances <em>Instances</em>}</li>
36 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl#getCost <em>Cost</em>}</li>
37 * </ul>
38 *
39 * @generated
40 */
41public class HostTypeImpl extends MinimalEObjectImpl.Container implements HostType {
42 /**
43 * The default value of the '{@link #getDefaultMemory() <em>Default Memory</em>}' attribute.
44 * <!-- begin-user-doc -->
45 * <!-- end-user-doc -->
46 * @see #getDefaultMemory()
47 * @generated
48 * @ordered
49 */
50 protected static final int DEFAULT_MEMORY_EDEFAULT = 0;
51
52 /**
53 * The cached value of the '{@link #getDefaultMemory() <em>Default Memory</em>}' attribute.
54 * <!-- begin-user-doc -->
55 * <!-- end-user-doc -->
56 * @see #getDefaultMemory()
57 * @generated
58 * @ordered
59 */
60 protected int defaultMemory = DEFAULT_MEMORY_EDEFAULT;
61
62 /**
63 * The default value of the '{@link #getDefaultHdd() <em>Default Hdd</em>}' attribute.
64 * <!-- begin-user-doc -->
65 * <!-- end-user-doc -->
66 * @see #getDefaultHdd()
67 * @generated
68 * @ordered
69 */
70 protected static final int DEFAULT_HDD_EDEFAULT = 0;
71
72 /**
73 * The cached value of the '{@link #getDefaultHdd() <em>Default Hdd</em>}' attribute.
74 * <!-- begin-user-doc -->
75 * <!-- end-user-doc -->
76 * @see #getDefaultHdd()
77 * @generated
78 * @ordered
79 */
80 protected int defaultHdd = DEFAULT_HDD_EDEFAULT;
81
82 /**
83 * The cached value of the '{@link #getInstances() <em>Instances</em>}' containment reference list.
84 * <!-- begin-user-doc -->
85 * <!-- end-user-doc -->
86 * @see #getInstances()
87 * @generated
88 * @ordered
89 */
90 protected EList<HostInstance> instances;
91
92 /**
93 * The default value of the '{@link #getCost() <em>Cost</em>}' attribute.
94 * <!-- begin-user-doc -->
95 * <!-- end-user-doc -->
96 * @see #getCost()
97 * @generated
98 * @ordered
99 */
100 protected static final int COST_EDEFAULT = 0;
101
102 /**
103 * The cached value of the '{@link #getCost() <em>Cost</em>}' attribute.
104 * <!-- begin-user-doc -->
105 * <!-- end-user-doc -->
106 * @see #getCost()
107 * @generated
108 * @ordered
109 */
110 protected int cost = COST_EDEFAULT;
111
112 /**
113 * <!-- begin-user-doc -->
114 * <!-- end-user-doc -->
115 * @generated
116 */
117 protected HostTypeImpl() {
118 super();
119 }
120
121 /**
122 * <!-- begin-user-doc -->
123 * <!-- end-user-doc -->
124 * @generated
125 */
126 @Override
127 protected EClass eStaticClass() {
128 return CpsPackage.Literals.HOST_TYPE;
129 }
130
131 /**
132 * <!-- begin-user-doc -->
133 * <!-- end-user-doc -->
134 * @generated
135 */
136 @Override
137 public int getDefaultMemory() {
138 return defaultMemory;
139 }
140
141 /**
142 * <!-- begin-user-doc -->
143 * <!-- end-user-doc -->
144 * @generated
145 */
146 @Override
147 public void setDefaultMemory(int newDefaultMemory) {
148 int oldDefaultMemory = defaultMemory;
149 defaultMemory = newDefaultMemory;
150 if (eNotificationRequired())
151 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__DEFAULT_MEMORY,
152 oldDefaultMemory, defaultMemory));
153 }
154
155 /**
156 * <!-- begin-user-doc -->
157 * <!-- end-user-doc -->
158 * @generated
159 */
160 @Override
161 public int getDefaultHdd() {
162 return defaultHdd;
163 }
164
165 /**
166 * <!-- begin-user-doc -->
167 * <!-- end-user-doc -->
168 * @generated
169 */
170 @Override
171 public void setDefaultHdd(int newDefaultHdd) {
172 int oldDefaultHdd = defaultHdd;
173 defaultHdd = newDefaultHdd;
174 if (eNotificationRequired())
175 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__DEFAULT_HDD, oldDefaultHdd,
176 defaultHdd));
177 }
178
179 /**
180 * <!-- begin-user-doc -->
181 * <!-- end-user-doc -->
182 * @generated
183 */
184 @Override
185 public EList<HostInstance> getInstances() {
186 if (instances == null) {
187 instances = new EObjectContainmentWithInverseEList<HostInstance>(HostInstance.class, this,
188 CpsPackage.HOST_TYPE__INSTANCES, CpsPackage.HOST_INSTANCE__TYPE);
189 }
190 return instances;
191 }
192
193 /**
194 * <!-- begin-user-doc -->
195 * <!-- end-user-doc -->
196 * @generated
197 */
198 @Override
199 public int getCost() {
200 return cost;
201 }
202
203 /**
204 * <!-- begin-user-doc -->
205 * <!-- end-user-doc -->
206 * @generated
207 */
208 @Override
209 public void setCost(int newCost) {
210 int oldCost = cost;
211 cost = newCost;
212 if (eNotificationRequired())
213 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_TYPE__COST, oldCost, cost));
214 }
215
216 /**
217 * <!-- begin-user-doc -->
218 * <!-- end-user-doc -->
219 * @generated
220 */
221 @SuppressWarnings("unchecked")
222 @Override
223 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
224 switch (featureID) {
225 case CpsPackage.HOST_TYPE__INSTANCES:
226 return ((InternalEList<InternalEObject>) (InternalEList<?>) getInstances()).basicAdd(otherEnd, msgs);
227 }
228 return super.eInverseAdd(otherEnd, featureID, msgs);
229 }
230
231 /**
232 * <!-- begin-user-doc -->
233 * <!-- end-user-doc -->
234 * @generated
235 */
236 @Override
237 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
238 switch (featureID) {
239 case CpsPackage.HOST_TYPE__INSTANCES:
240 return ((InternalEList<?>) getInstances()).basicRemove(otherEnd, msgs);
241 }
242 return super.eInverseRemove(otherEnd, featureID, msgs);
243 }
244
245 /**
246 * <!-- begin-user-doc -->
247 * <!-- end-user-doc -->
248 * @generated
249 */
250 @Override
251 public Object eGet(int featureID, boolean resolve, boolean coreType) {
252 switch (featureID) {
253 case CpsPackage.HOST_TYPE__DEFAULT_MEMORY:
254 return getDefaultMemory();
255 case CpsPackage.HOST_TYPE__DEFAULT_HDD:
256 return getDefaultHdd();
257 case CpsPackage.HOST_TYPE__INSTANCES:
258 return getInstances();
259 case CpsPackage.HOST_TYPE__COST:
260 return getCost();
261 }
262 return super.eGet(featureID, resolve, coreType);
263 }
264
265 /**
266 * <!-- begin-user-doc -->
267 * <!-- end-user-doc -->
268 * @generated
269 */
270 @SuppressWarnings("unchecked")
271 @Override
272 public void eSet(int featureID, Object newValue) {
273 switch (featureID) {
274 case CpsPackage.HOST_TYPE__DEFAULT_MEMORY:
275 setDefaultMemory((Integer) newValue);
276 return;
277 case CpsPackage.HOST_TYPE__DEFAULT_HDD:
278 setDefaultHdd((Integer) newValue);
279 return;
280 case CpsPackage.HOST_TYPE__INSTANCES:
281 getInstances().clear();
282 getInstances().addAll((Collection<? extends HostInstance>) newValue);
283 return;
284 case CpsPackage.HOST_TYPE__COST:
285 setCost((Integer) newValue);
286 return;
287 }
288 super.eSet(featureID, newValue);
289 }
290
291 /**
292 * <!-- begin-user-doc -->
293 * <!-- end-user-doc -->
294 * @generated
295 */
296 @Override
297 public void eUnset(int featureID) {
298 switch (featureID) {
299 case CpsPackage.HOST_TYPE__DEFAULT_MEMORY:
300 setDefaultMemory(DEFAULT_MEMORY_EDEFAULT);
301 return;
302 case CpsPackage.HOST_TYPE__DEFAULT_HDD:
303 setDefaultHdd(DEFAULT_HDD_EDEFAULT);
304 return;
305 case CpsPackage.HOST_TYPE__INSTANCES:
306 getInstances().clear();
307 return;
308 case CpsPackage.HOST_TYPE__COST:
309 setCost(COST_EDEFAULT);
310 return;
311 }
312 super.eUnset(featureID);
313 }
314
315 /**
316 * <!-- begin-user-doc -->
317 * <!-- end-user-doc -->
318 * @generated
319 */
320 @Override
321 public boolean eIsSet(int featureID) {
322 switch (featureID) {
323 case CpsPackage.HOST_TYPE__DEFAULT_MEMORY:
324 return defaultMemory != DEFAULT_MEMORY_EDEFAULT;
325 case CpsPackage.HOST_TYPE__DEFAULT_HDD:
326 return defaultHdd != DEFAULT_HDD_EDEFAULT;
327 case CpsPackage.HOST_TYPE__INSTANCES:
328 return instances != null && !instances.isEmpty();
329 case CpsPackage.HOST_TYPE__COST:
330 return cost != COST_EDEFAULT;
331 }
332 return super.eIsSet(featureID);
333 }
334
335 /**
336 * <!-- begin-user-doc -->
337 * <!-- end-user-doc -->
338 * @generated
339 */
340 @Override
341 public String toString() {
342 if (eIsProxy())
343 return super.toString();
344
345 StringBuilder result = new StringBuilder(super.toString());
346 result.append(" (defaultMemory: ");
347 result.append(defaultMemory);
348 result.append(", defaultHdd: ");
349 result.append(defaultHdd);
350 result.append(", cost: ");
351 result.append(cost);
352 result.append(')');
353 return result.toString();
354 }
355
356} //HostTypeImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java
new file mode 100644
index 00000000..72b4c732
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequestImpl.java
@@ -0,0 +1,169 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
6import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
7import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
8
9import java.util.Collection;
10
11import org.eclipse.emf.common.notify.NotificationChain;
12
13import org.eclipse.emf.common.util.EList;
14
15import org.eclipse.emf.ecore.EClass;
16import org.eclipse.emf.ecore.InternalEObject;
17
18import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
19
20import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList;
21import org.eclipse.emf.ecore.util.InternalEList;
22
23/**
24 * <!-- begin-user-doc -->
25 * An implementation of the model object '<em><b>Request</b></em>'.
26 * <!-- end-user-doc -->
27 * <p>
28 * The following features are implemented:
29 * </p>
30 * <ul>
31 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl#getRequirements <em>Requirements</em>}</li>
32 * </ul>
33 *
34 * @generated
35 */
36public class RequestImpl extends MinimalEObjectImpl.Container implements Request {
37 /**
38 * The cached value of the '{@link #getRequirements() <em>Requirements</em>}' containment reference list.
39 * <!-- begin-user-doc -->
40 * <!-- end-user-doc -->
41 * @see #getRequirements()
42 * @generated
43 * @ordered
44 */
45 protected EList<Requirement> requirements;
46
47 /**
48 * <!-- begin-user-doc -->
49 * <!-- end-user-doc -->
50 * @generated
51 */
52 protected RequestImpl() {
53 super();
54 }
55
56 /**
57 * <!-- begin-user-doc -->
58 * <!-- end-user-doc -->
59 * @generated
60 */
61 @Override
62 protected EClass eStaticClass() {
63 return CpsPackage.Literals.REQUEST;
64 }
65
66 /**
67 * <!-- begin-user-doc -->
68 * <!-- end-user-doc -->
69 * @generated
70 */
71 @Override
72 public EList<Requirement> getRequirements() {
73 if (requirements == null) {
74 requirements = new EObjectContainmentWithInverseEList<Requirement>(Requirement.class, this,
75 CpsPackage.REQUEST__REQUIREMENTS, CpsPackage.REQUIREMENT__REQUEST);
76 }
77 return requirements;
78 }
79
80 /**
81 * <!-- begin-user-doc -->
82 * <!-- end-user-doc -->
83 * @generated
84 */
85 @SuppressWarnings("unchecked")
86 @Override
87 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
88 switch (featureID) {
89 case CpsPackage.REQUEST__REQUIREMENTS:
90 return ((InternalEList<InternalEObject>) (InternalEList<?>) getRequirements()).basicAdd(otherEnd, msgs);
91 }
92 return super.eInverseAdd(otherEnd, featureID, msgs);
93 }
94
95 /**
96 * <!-- begin-user-doc -->
97 * <!-- end-user-doc -->
98 * @generated
99 */
100 @Override
101 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
102 switch (featureID) {
103 case CpsPackage.REQUEST__REQUIREMENTS:
104 return ((InternalEList<?>) getRequirements()).basicRemove(otherEnd, msgs);
105 }
106 return super.eInverseRemove(otherEnd, featureID, msgs);
107 }
108
109 /**
110 * <!-- begin-user-doc -->
111 * <!-- end-user-doc -->
112 * @generated
113 */
114 @Override
115 public Object eGet(int featureID, boolean resolve, boolean coreType) {
116 switch (featureID) {
117 case CpsPackage.REQUEST__REQUIREMENTS:
118 return getRequirements();
119 }
120 return super.eGet(featureID, resolve, coreType);
121 }
122
123 /**
124 * <!-- begin-user-doc -->
125 * <!-- end-user-doc -->
126 * @generated
127 */
128 @SuppressWarnings("unchecked")
129 @Override
130 public void eSet(int featureID, Object newValue) {
131 switch (featureID) {
132 case CpsPackage.REQUEST__REQUIREMENTS:
133 getRequirements().clear();
134 getRequirements().addAll((Collection<? extends Requirement>) newValue);
135 return;
136 }
137 super.eSet(featureID, newValue);
138 }
139
140 /**
141 * <!-- begin-user-doc -->
142 * <!-- end-user-doc -->
143 * @generated
144 */
145 @Override
146 public void eUnset(int featureID) {
147 switch (featureID) {
148 case CpsPackage.REQUEST__REQUIREMENTS:
149 getRequirements().clear();
150 return;
151 }
152 super.eUnset(featureID);
153 }
154
155 /**
156 * <!-- begin-user-doc -->
157 * <!-- end-user-doc -->
158 * @generated
159 */
160 @Override
161 public boolean eIsSet(int featureID) {
162 switch (featureID) {
163 case CpsPackage.REQUEST__REQUIREMENTS:
164 return requirements != null && !requirements.isEmpty();
165 }
166 return super.eIsSet(featureID);
167 }
168
169} //RequestImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java
new file mode 100644
index 00000000..79dc4f62
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/RequirementImpl.java
@@ -0,0 +1,387 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
8import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
9import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
10
11import java.util.Collection;
12
13import org.eclipse.emf.common.notify.Notification;
14import org.eclipse.emf.common.notify.NotificationChain;
15
16import org.eclipse.emf.common.util.EList;
17
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.emf.ecore.InternalEObject;
20
21import org.eclipse.emf.ecore.impl.ENotificationImpl;
22import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
23
24import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList;
25import org.eclipse.emf.ecore.util.EcoreUtil;
26import org.eclipse.emf.ecore.util.InternalEList;
27
28/**
29 * <!-- begin-user-doc -->
30 * An implementation of the model object '<em><b>Requirement</b></em>'.
31 * <!-- end-user-doc -->
32 * <p>
33 * The following features are implemented:
34 * </p>
35 * <ul>
36 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getRequest <em>Request</em>}</li>
37 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getCount <em>Count</em>}</li>
38 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getType <em>Type</em>}</li>
39 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl#getInstances <em>Instances</em>}</li>
40 * </ul>
41 *
42 * @generated
43 */
44public class RequirementImpl extends MinimalEObjectImpl.Container implements Requirement {
45 /**
46 * The default value of the '{@link #getCount() <em>Count</em>}' attribute.
47 * <!-- begin-user-doc -->
48 * <!-- end-user-doc -->
49 * @see #getCount()
50 * @generated
51 * @ordered
52 */
53 protected static final int COUNT_EDEFAULT = 0;
54
55 /**
56 * The cached value of the '{@link #getCount() <em>Count</em>}' attribute.
57 * <!-- begin-user-doc -->
58 * <!-- end-user-doc -->
59 * @see #getCount()
60 * @generated
61 * @ordered
62 */
63 protected int count = COUNT_EDEFAULT;
64
65 /**
66 * The cached value of the '{@link #getType() <em>Type</em>}' reference.
67 * <!-- begin-user-doc -->
68 * <!-- end-user-doc -->
69 * @see #getType()
70 * @generated
71 * @ordered
72 */
73 protected ApplicationType type;
74
75 /**
76 * The cached value of the '{@link #getInstances() <em>Instances</em>}' reference list.
77 * <!-- begin-user-doc -->
78 * <!-- end-user-doc -->
79 * @see #getInstances()
80 * @generated
81 * @ordered
82 */
83 protected EList<ApplicationInstance> instances;
84
85 /**
86 * <!-- begin-user-doc -->
87 * <!-- end-user-doc -->
88 * @generated
89 */
90 protected RequirementImpl() {
91 super();
92 }
93
94 /**
95 * <!-- begin-user-doc -->
96 * <!-- end-user-doc -->
97 * @generated
98 */
99 @Override
100 protected EClass eStaticClass() {
101 return CpsPackage.Literals.REQUIREMENT;
102 }
103
104 /**
105 * <!-- begin-user-doc -->
106 * <!-- end-user-doc -->
107 * @generated
108 */
109 @Override
110 public Request getRequest() {
111 if (eContainerFeatureID() != CpsPackage.REQUIREMENT__REQUEST)
112 return null;
113 return (Request) eInternalContainer();
114 }
115
116 /**
117 * <!-- begin-user-doc -->
118 * <!-- end-user-doc -->
119 * @generated
120 */
121 public NotificationChain basicSetRequest(Request newRequest, NotificationChain msgs) {
122 msgs = eBasicSetContainer((InternalEObject) newRequest, CpsPackage.REQUIREMENT__REQUEST, msgs);
123 return msgs;
124 }
125
126 /**
127 * <!-- begin-user-doc -->
128 * <!-- end-user-doc -->
129 * @generated
130 */
131 @Override
132 public void setRequest(Request newRequest) {
133 if (newRequest != eInternalContainer()
134 || (eContainerFeatureID() != CpsPackage.REQUIREMENT__REQUEST && newRequest != null)) {
135 if (EcoreUtil.isAncestor(this, newRequest))
136 throw new IllegalArgumentException("Recursive containment not allowed for " + toString());
137 NotificationChain msgs = null;
138 if (eInternalContainer() != null)
139 msgs = eBasicRemoveFromContainer(msgs);
140 if (newRequest != null)
141 msgs = ((InternalEObject) newRequest).eInverseAdd(this, CpsPackage.REQUEST__REQUIREMENTS, Request.class,
142 msgs);
143 msgs = basicSetRequest(newRequest, msgs);
144 if (msgs != null)
145 msgs.dispatch();
146 } else if (eNotificationRequired())
147 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__REQUEST, newRequest,
148 newRequest));
149 }
150
151 /**
152 * <!-- begin-user-doc -->
153 * <!-- end-user-doc -->
154 * @generated
155 */
156 @Override
157 public int getCount() {
158 return count;
159 }
160
161 /**
162 * <!-- begin-user-doc -->
163 * <!-- end-user-doc -->
164 * @generated
165 */
166 @Override
167 public void setCount(int newCount) {
168 int oldCount = count;
169 count = newCount;
170 if (eNotificationRequired())
171 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__COUNT, oldCount, count));
172 }
173
174 /**
175 * <!-- begin-user-doc -->
176 * <!-- end-user-doc -->
177 * @generated
178 */
179 @Override
180 public ApplicationType getType() {
181 if (type != null && type.eIsProxy()) {
182 InternalEObject oldType = (InternalEObject) type;
183 type = (ApplicationType) eResolveProxy(oldType);
184 if (type != oldType) {
185 if (eNotificationRequired())
186 eNotify(new ENotificationImpl(this, Notification.RESOLVE, CpsPackage.REQUIREMENT__TYPE, oldType,
187 type));
188 }
189 }
190 return type;
191 }
192
193 /**
194 * <!-- begin-user-doc -->
195 * <!-- end-user-doc -->
196 * @generated
197 */
198 public ApplicationType basicGetType() {
199 return type;
200 }
201
202 /**
203 * <!-- begin-user-doc -->
204 * <!-- end-user-doc -->
205 * @generated
206 */
207 @Override
208 public void setType(ApplicationType newType) {
209 ApplicationType oldType = type;
210 type = newType;
211 if (eNotificationRequired())
212 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.REQUIREMENT__TYPE, oldType, type));
213 }
214
215 /**
216 * <!-- begin-user-doc -->
217 * <!-- end-user-doc -->
218 * @generated
219 */
220 @Override
221 public EList<ApplicationInstance> getInstances() {
222 if (instances == null) {
223 instances = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this,
224 CpsPackage.REQUIREMENT__INSTANCES, CpsPackage.APPLICATION_INSTANCE__REQUIREMENT);
225 }
226 return instances;
227 }
228
229 /**
230 * <!-- begin-user-doc -->
231 * <!-- end-user-doc -->
232 * @generated
233 */
234 @SuppressWarnings("unchecked")
235 @Override
236 public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
237 switch (featureID) {
238 case CpsPackage.REQUIREMENT__REQUEST:
239 if (eInternalContainer() != null)
240 msgs = eBasicRemoveFromContainer(msgs);
241 return basicSetRequest((Request) otherEnd, msgs);
242 case CpsPackage.REQUIREMENT__INSTANCES:
243 return ((InternalEList<InternalEObject>) (InternalEList<?>) getInstances()).basicAdd(otherEnd, msgs);
244 }
245 return super.eInverseAdd(otherEnd, featureID, msgs);
246 }
247
248 /**
249 * <!-- begin-user-doc -->
250 * <!-- end-user-doc -->
251 * @generated
252 */
253 @Override
254 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
255 switch (featureID) {
256 case CpsPackage.REQUIREMENT__REQUEST:
257 return basicSetRequest(null, msgs);
258 case CpsPackage.REQUIREMENT__INSTANCES:
259 return ((InternalEList<?>) getInstances()).basicRemove(otherEnd, msgs);
260 }
261 return super.eInverseRemove(otherEnd, featureID, msgs);
262 }
263
264 /**
265 * <!-- begin-user-doc -->
266 * <!-- end-user-doc -->
267 * @generated
268 */
269 @Override
270 public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) {
271 switch (eContainerFeatureID()) {
272 case CpsPackage.REQUIREMENT__REQUEST:
273 return eInternalContainer().eInverseRemove(this, CpsPackage.REQUEST__REQUIREMENTS, Request.class, msgs);
274 }
275 return super.eBasicRemoveFromContainerFeature(msgs);
276 }
277
278 /**
279 * <!-- begin-user-doc -->
280 * <!-- end-user-doc -->
281 * @generated
282 */
283 @Override
284 public Object eGet(int featureID, boolean resolve, boolean coreType) {
285 switch (featureID) {
286 case CpsPackage.REQUIREMENT__REQUEST:
287 return getRequest();
288 case CpsPackage.REQUIREMENT__COUNT:
289 return getCount();
290 case CpsPackage.REQUIREMENT__TYPE:
291 if (resolve)
292 return getType();
293 return basicGetType();
294 case CpsPackage.REQUIREMENT__INSTANCES:
295 return getInstances();
296 }
297 return super.eGet(featureID, resolve, coreType);
298 }
299
300 /**
301 * <!-- begin-user-doc -->
302 * <!-- end-user-doc -->
303 * @generated
304 */
305 @SuppressWarnings("unchecked")
306 @Override
307 public void eSet(int featureID, Object newValue) {
308 switch (featureID) {
309 case CpsPackage.REQUIREMENT__REQUEST:
310 setRequest((Request) newValue);
311 return;
312 case CpsPackage.REQUIREMENT__COUNT:
313 setCount((Integer) newValue);
314 return;
315 case CpsPackage.REQUIREMENT__TYPE:
316 setType((ApplicationType) newValue);
317 return;
318 case CpsPackage.REQUIREMENT__INSTANCES:
319 getInstances().clear();
320 getInstances().addAll((Collection<? extends ApplicationInstance>) newValue);
321 return;
322 }
323 super.eSet(featureID, newValue);
324 }
325
326 /**
327 * <!-- begin-user-doc -->
328 * <!-- end-user-doc -->
329 * @generated
330 */
331 @Override
332 public void eUnset(int featureID) {
333 switch (featureID) {
334 case CpsPackage.REQUIREMENT__REQUEST:
335 setRequest((Request) null);
336 return;
337 case CpsPackage.REQUIREMENT__COUNT:
338 setCount(COUNT_EDEFAULT);
339 return;
340 case CpsPackage.REQUIREMENT__TYPE:
341 setType((ApplicationType) null);
342 return;
343 case CpsPackage.REQUIREMENT__INSTANCES:
344 getInstances().clear();
345 return;
346 }
347 super.eUnset(featureID);
348 }
349
350 /**
351 * <!-- begin-user-doc -->
352 * <!-- end-user-doc -->
353 * @generated
354 */
355 @Override
356 public boolean eIsSet(int featureID) {
357 switch (featureID) {
358 case CpsPackage.REQUIREMENT__REQUEST:
359 return getRequest() != null;
360 case CpsPackage.REQUIREMENT__COUNT:
361 return count != COUNT_EDEFAULT;
362 case CpsPackage.REQUIREMENT__TYPE:
363 return type != null;
364 case CpsPackage.REQUIREMENT__INSTANCES:
365 return instances != null && !instances.isEmpty();
366 }
367 return super.eIsSet(featureID);
368 }
369
370 /**
371 * <!-- begin-user-doc -->
372 * <!-- end-user-doc -->
373 * @generated
374 */
375 @Override
376 public String toString() {
377 if (eIsProxy())
378 return super.toString();
379
380 StringBuilder result = new StringBuilder(super.toString());
381 result.append(" (count: ");
382 result.append(count);
383 result.append(')');
384 return result.toString();
385 }
386
387} //RequirementImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java
new file mode 100644
index 00000000..f4deb575
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/ResourceRequirementImpl.java
@@ -0,0 +1,291 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement;
8
9import org.eclipse.emf.common.notify.Notification;
10
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.InternalEObject;
13
14import org.eclipse.emf.ecore.impl.ENotificationImpl;
15import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
16
17/**
18 * <!-- begin-user-doc -->
19 * An implementation of the model object '<em><b>Resource Requirement</b></em>'.
20 * <!-- end-user-doc -->
21 * <p>
22 * The following features are implemented:
23 * </p>
24 * <ul>
25 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getRequiredMemory <em>Required Memory</em>}</li>
26 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getRequiredHdd <em>Required Hdd</em>}</li>
27 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl#getHostType <em>Host Type</em>}</li>
28 * </ul>
29 *
30 * @generated
31 */
32public class ResourceRequirementImpl extends MinimalEObjectImpl.Container implements ResourceRequirement {
33 /**
34 * The default value of the '{@link #getRequiredMemory() <em>Required Memory</em>}' attribute.
35 * <!-- begin-user-doc -->
36 * <!-- end-user-doc -->
37 * @see #getRequiredMemory()
38 * @generated
39 * @ordered
40 */
41 protected static final int REQUIRED_MEMORY_EDEFAULT = 0;
42
43 /**
44 * The cached value of the '{@link #getRequiredMemory() <em>Required Memory</em>}' attribute.
45 * <!-- begin-user-doc -->
46 * <!-- end-user-doc -->
47 * @see #getRequiredMemory()
48 * @generated
49 * @ordered
50 */
51 protected int requiredMemory = REQUIRED_MEMORY_EDEFAULT;
52
53 /**
54 * The default value of the '{@link #getRequiredHdd() <em>Required Hdd</em>}' attribute.
55 * <!-- begin-user-doc -->
56 * <!-- end-user-doc -->
57 * @see #getRequiredHdd()
58 * @generated
59 * @ordered
60 */
61 protected static final int REQUIRED_HDD_EDEFAULT = 0;
62
63 /**
64 * The cached value of the '{@link #getRequiredHdd() <em>Required Hdd</em>}' attribute.
65 * <!-- begin-user-doc -->
66 * <!-- end-user-doc -->
67 * @see #getRequiredHdd()
68 * @generated
69 * @ordered
70 */
71 protected int requiredHdd = REQUIRED_HDD_EDEFAULT;
72
73 /**
74 * The cached value of the '{@link #getHostType() <em>Host Type</em>}' reference.
75 * <!-- begin-user-doc -->
76 * <!-- end-user-doc -->
77 * @see #getHostType()
78 * @generated
79 * @ordered
80 */
81 protected HostType hostType;
82
83 /**
84 * <!-- begin-user-doc -->
85 * <!-- end-user-doc -->
86 * @generated
87 */
88 protected ResourceRequirementImpl() {
89 super();
90 }
91
92 /**
93 * <!-- begin-user-doc -->
94 * <!-- end-user-doc -->
95 * @generated
96 */
97 @Override
98 protected EClass eStaticClass() {
99 return CpsPackage.Literals.RESOURCE_REQUIREMENT;
100 }
101
102 /**
103 * <!-- begin-user-doc -->
104 * <!-- end-user-doc -->
105 * @generated
106 */
107 @Override
108 public int getRequiredMemory() {
109 return requiredMemory;
110 }
111
112 /**
113 * <!-- begin-user-doc -->
114 * <!-- end-user-doc -->
115 * @generated
116 */
117 @Override
118 public void setRequiredMemory(int newRequiredMemory) {
119 int oldRequiredMemory = requiredMemory;
120 requiredMemory = newRequiredMemory;
121 if (eNotificationRequired())
122 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY,
123 oldRequiredMemory, requiredMemory));
124 }
125
126 /**
127 * <!-- begin-user-doc -->
128 * <!-- end-user-doc -->
129 * @generated
130 */
131 @Override
132 public int getRequiredHdd() {
133 return requiredHdd;
134 }
135
136 /**
137 * <!-- begin-user-doc -->
138 * <!-- end-user-doc -->
139 * @generated
140 */
141 @Override
142 public void setRequiredHdd(int newRequiredHdd) {
143 int oldRequiredHdd = requiredHdd;
144 requiredHdd = newRequiredHdd;
145 if (eNotificationRequired())
146 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD,
147 oldRequiredHdd, requiredHdd));
148 }
149
150 /**
151 * <!-- begin-user-doc -->
152 * <!-- end-user-doc -->
153 * @generated
154 */
155 @Override
156 public HostType getHostType() {
157 if (hostType != null && hostType.eIsProxy()) {
158 InternalEObject oldHostType = (InternalEObject) hostType;
159 hostType = (HostType) eResolveProxy(oldHostType);
160 if (hostType != oldHostType) {
161 if (eNotificationRequired())
162 eNotify(new ENotificationImpl(this, Notification.RESOLVE,
163 CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE, oldHostType, hostType));
164 }
165 }
166 return hostType;
167 }
168
169 /**
170 * <!-- begin-user-doc -->
171 * <!-- end-user-doc -->
172 * @generated
173 */
174 public HostType basicGetHostType() {
175 return hostType;
176 }
177
178 /**
179 * <!-- begin-user-doc -->
180 * <!-- end-user-doc -->
181 * @generated
182 */
183 @Override
184 public void setHostType(HostType newHostType) {
185 HostType oldHostType = hostType;
186 hostType = newHostType;
187 if (eNotificationRequired())
188 eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE,
189 oldHostType, hostType));
190 }
191
192 /**
193 * <!-- begin-user-doc -->
194 * <!-- end-user-doc -->
195 * @generated
196 */
197 @Override
198 public Object eGet(int featureID, boolean resolve, boolean coreType) {
199 switch (featureID) {
200 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY:
201 return getRequiredMemory();
202 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD:
203 return getRequiredHdd();
204 case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE:
205 if (resolve)
206 return getHostType();
207 return basicGetHostType();
208 }
209 return super.eGet(featureID, resolve, coreType);
210 }
211
212 /**
213 * <!-- begin-user-doc -->
214 * <!-- end-user-doc -->
215 * @generated
216 */
217 @Override
218 public void eSet(int featureID, Object newValue) {
219 switch (featureID) {
220 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY:
221 setRequiredMemory((Integer) newValue);
222 return;
223 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD:
224 setRequiredHdd((Integer) newValue);
225 return;
226 case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE:
227 setHostType((HostType) newValue);
228 return;
229 }
230 super.eSet(featureID, newValue);
231 }
232
233 /**
234 * <!-- begin-user-doc -->
235 * <!-- end-user-doc -->
236 * @generated
237 */
238 @Override
239 public void eUnset(int featureID) {
240 switch (featureID) {
241 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY:
242 setRequiredMemory(REQUIRED_MEMORY_EDEFAULT);
243 return;
244 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD:
245 setRequiredHdd(REQUIRED_HDD_EDEFAULT);
246 return;
247 case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE:
248 setHostType((HostType) null);
249 return;
250 }
251 super.eUnset(featureID);
252 }
253
254 /**
255 * <!-- begin-user-doc -->
256 * <!-- end-user-doc -->
257 * @generated
258 */
259 @Override
260 public boolean eIsSet(int featureID) {
261 switch (featureID) {
262 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_MEMORY:
263 return requiredMemory != REQUIRED_MEMORY_EDEFAULT;
264 case CpsPackage.RESOURCE_REQUIREMENT__REQUIRED_HDD:
265 return requiredHdd != REQUIRED_HDD_EDEFAULT;
266 case CpsPackage.RESOURCE_REQUIREMENT__HOST_TYPE:
267 return hostType != null;
268 }
269 return super.eIsSet(featureID);
270 }
271
272 /**
273 * <!-- begin-user-doc -->
274 * <!-- end-user-doc -->
275 * @generated
276 */
277 @Override
278 public String toString() {
279 if (eIsProxy())
280 return super.toString();
281
282 StringBuilder result = new StringBuilder(super.toString());
283 result.append(" (requiredMemory: ");
284 result.append(requiredMemory);
285 result.append(", requiredHdd: ");
286 result.append(requiredHdd);
287 result.append(')');
288 return result.toString();
289 }
290
291} //ResourceRequirementImpl
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsAdapterFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsAdapterFactory.java
new file mode 100644
index 00000000..83e984a6
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsAdapterFactory.java
@@ -0,0 +1,252 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.util;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.*;
6
7import org.eclipse.emf.common.notify.Adapter;
8import org.eclipse.emf.common.notify.Notifier;
9
10import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl;
11
12import org.eclipse.emf.ecore.EObject;
13
14/**
15 * <!-- begin-user-doc -->
16 * The <b>Adapter Factory</b> for the model.
17 * It provides an adapter <code>createXXX</code> method for each class of the model.
18 * <!-- end-user-doc -->
19 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage
20 * @generated
21 */
22public class CpsAdapterFactory extends AdapterFactoryImpl {
23 /**
24 * The cached model package.
25 * <!-- begin-user-doc -->
26 * <!-- end-user-doc -->
27 * @generated
28 */
29 protected static CpsPackage modelPackage;
30
31 /**
32 * Creates an instance of the adapter factory.
33 * <!-- begin-user-doc -->
34 * <!-- end-user-doc -->
35 * @generated
36 */
37 public CpsAdapterFactory() {
38 if (modelPackage == null) {
39 modelPackage = CpsPackage.eINSTANCE;
40 }
41 }
42
43 /**
44 * Returns whether this factory is applicable for the type of the object.
45 * <!-- begin-user-doc -->
46 * This implementation returns <code>true</code> if the object is either the model's package or is an instance object of the model.
47 * <!-- end-user-doc -->
48 * @return whether this factory is applicable for the type of the object.
49 * @generated
50 */
51 @Override
52 public boolean isFactoryForType(Object object) {
53 if (object == modelPackage) {
54 return true;
55 }
56 if (object instanceof EObject) {
57 return ((EObject) object).eClass().getEPackage() == modelPackage;
58 }
59 return false;
60 }
61
62 /**
63 * The switch that delegates to the <code>createXXX</code> methods.
64 * <!-- begin-user-doc -->
65 * <!-- end-user-doc -->
66 * @generated
67 */
68 protected CpsSwitch<Adapter> modelSwitch = new CpsSwitch<Adapter>() {
69 @Override
70 public Adapter caseCyberPhysicalSystem(CyberPhysicalSystem object) {
71 return createCyberPhysicalSystemAdapter();
72 }
73
74 @Override
75 public Adapter caseApplicationType(ApplicationType object) {
76 return createApplicationTypeAdapter();
77 }
78
79 @Override
80 public Adapter caseHostType(HostType object) {
81 return createHostTypeAdapter();
82 }
83
84 @Override
85 public Adapter caseRequest(Request object) {
86 return createRequestAdapter();
87 }
88
89 @Override
90 public Adapter caseRequirement(Requirement object) {
91 return createRequirementAdapter();
92 }
93
94 @Override
95 public Adapter caseApplicationInstance(ApplicationInstance object) {
96 return createApplicationInstanceAdapter();
97 }
98
99 @Override
100 public Adapter caseResourceRequirement(ResourceRequirement object) {
101 return createResourceRequirementAdapter();
102 }
103
104 @Override
105 public Adapter caseHostInstance(HostInstance object) {
106 return createHostInstanceAdapter();
107 }
108
109 @Override
110 public Adapter defaultCase(EObject object) {
111 return createEObjectAdapter();
112 }
113 };
114
115 /**
116 * Creates an adapter for the <code>target</code>.
117 * <!-- begin-user-doc -->
118 * <!-- end-user-doc -->
119 * @param target the object to adapt.
120 * @return the adapter for the <code>target</code>.
121 * @generated
122 */
123 @Override
124 public Adapter createAdapter(Notifier target) {
125 return modelSwitch.doSwitch((EObject) target);
126 }
127
128 /**
129 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem <em>Cyber Physical System</em>}'.
130 * <!-- begin-user-doc -->
131 * This default implementation returns null so that we can easily ignore cases;
132 * it's useful to ignore a case when inheritance will catch all the cases anyway.
133 * <!-- end-user-doc -->
134 * @return the new adapter.
135 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem
136 * @generated
137 */
138 public Adapter createCyberPhysicalSystemAdapter() {
139 return null;
140 }
141
142 /**
143 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType <em>Application Type</em>}'.
144 * <!-- begin-user-doc -->
145 * This default implementation returns null so that we can easily ignore cases;
146 * it's useful to ignore a case when inheritance will catch all the cases anyway.
147 * <!-- end-user-doc -->
148 * @return the new adapter.
149 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType
150 * @generated
151 */
152 public Adapter createApplicationTypeAdapter() {
153 return null;
154 }
155
156 /**
157 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType <em>Host Type</em>}'.
158 * <!-- begin-user-doc -->
159 * This default implementation returns null so that we can easily ignore cases;
160 * it's useful to ignore a case when inheritance will catch all the cases anyway.
161 * <!-- end-user-doc -->
162 * @return the new adapter.
163 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType
164 * @generated
165 */
166 public Adapter createHostTypeAdapter() {
167 return null;
168 }
169
170 /**
171 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Request <em>Request</em>}'.
172 * <!-- begin-user-doc -->
173 * This default implementation returns null so that we can easily ignore cases;
174 * it's useful to ignore a case when inheritance will catch all the cases anyway.
175 * <!-- end-user-doc -->
176 * @return the new adapter.
177 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Request
178 * @generated
179 */
180 public Adapter createRequestAdapter() {
181 return null;
182 }
183
184 /**
185 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement <em>Requirement</em>}'.
186 * <!-- begin-user-doc -->
187 * This default implementation returns null so that we can easily ignore cases;
188 * it's useful to ignore a case when inheritance will catch all the cases anyway.
189 * <!-- end-user-doc -->
190 * @return the new adapter.
191 * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement
192 * @generated
193 */
194 public Adapter createRequirementAdapter() {
195 return null;
196 }
197
198 /**
199 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance <em>Application Instance</em>}'.
200 * <!-- begin-user-doc -->
201 * This default implementation returns null so that we can easily ignore cases;
202 * it's useful to ignore a case when inheritance will catch all the cases anyway.
203 * <!-- end-user-doc -->
204 * @return the new adapter.
205 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance
206 * @generated
207 */
208 public Adapter createApplicationInstanceAdapter() {
209 return null;
210 }
211
212 /**
213 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement <em>Resource Requirement</em>}'.
214 * <!-- begin-user-doc -->
215 * This default implementation returns null so that we can easily ignore cases;
216 * it's useful to ignore a case when inheritance will catch all the cases anyway.
217 * <!-- end-user-doc -->
218 * @return the new adapter.
219 * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement
220 * @generated
221 */
222 public Adapter createResourceRequirementAdapter() {
223 return null;
224 }
225
226 /**
227 * Creates a new adapter for an object of class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance <em>Host Instance</em>}'.
228 * <!-- begin-user-doc -->
229 * This default implementation returns null so that we can easily ignore cases;
230 * it's useful to ignore a case when inheritance will catch all the cases anyway.
231 * <!-- end-user-doc -->
232 * @return the new adapter.
233 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance
234 * @generated
235 */
236 public Adapter createHostInstanceAdapter() {
237 return null;
238 }
239
240 /**
241 * Creates a new adapter for the default case.
242 * <!-- begin-user-doc -->
243 * This default implementation returns null.
244 * <!-- end-user-doc -->
245 * @return the new adapter.
246 * @generated
247 */
248 public Adapter createEObjectAdapter() {
249 return null;
250 }
251
252} //CpsAdapterFactory
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsSwitch.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsSwitch.java
new file mode 100644
index 00000000..28b630a9
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/util/CpsSwitch.java
@@ -0,0 +1,266 @@
1/**
2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.util;
4
5import hu.bme.mit.inf.dslreasoner.domains.cps.*;
6
7import org.eclipse.emf.ecore.EObject;
8import org.eclipse.emf.ecore.EPackage;
9
10import org.eclipse.emf.ecore.util.Switch;
11
12/**
13 * <!-- begin-user-doc -->
14 * The <b>Switch</b> for the model's inheritance hierarchy.
15 * It supports the call {@link #doSwitch(EObject) doSwitch(object)}
16 * to invoke the <code>caseXXX</code> method for each class of the model,
17 * starting with the actual class of the object
18 * and proceeding up the inheritance hierarchy
19 * until a non-null result is returned,
20 * which is the result of the switch.
21 * <!-- end-user-doc -->
22 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage
23 * @generated
24 */
25public class CpsSwitch<T> extends Switch<T> {
26 /**
27 * The cached model package
28 * <!-- begin-user-doc -->
29 * <!-- end-user-doc -->
30 * @generated
31 */
32 protected static CpsPackage modelPackage;
33
34 /**
35 * Creates an instance of the switch.
36 * <!-- begin-user-doc -->
37 * <!-- end-user-doc -->
38 * @generated
39 */
40 public CpsSwitch() {
41 if (modelPackage == null) {
42 modelPackage = CpsPackage.eINSTANCE;
43 }
44 }
45
46 /**
47 * Checks whether this is a switch for the given package.
48 * <!-- begin-user-doc -->
49 * <!-- end-user-doc -->
50 * @param ePackage the package in question.
51 * @return whether this is a switch for the given package.
52 * @generated
53 */
54 @Override
55 protected boolean isSwitchFor(EPackage ePackage) {
56 return ePackage == modelPackage;
57 }
58
59 /**
60 * Calls <code>caseXXX</code> for each class of the model until one returns a non null result; it yields that result.
61 * <!-- begin-user-doc -->
62 * <!-- end-user-doc -->
63 * @return the first non-null result returned by a <code>caseXXX</code> call.
64 * @generated
65 */
66 @Override
67 protected T doSwitch(int classifierID, EObject theEObject) {
68 switch (classifierID) {
69 case CpsPackage.CYBER_PHYSICAL_SYSTEM: {
70 CyberPhysicalSystem cyberPhysicalSystem = (CyberPhysicalSystem) theEObject;
71 T result = caseCyberPhysicalSystem(cyberPhysicalSystem);
72 if (result == null)
73 result = defaultCase(theEObject);
74 return result;
75 }
76 case CpsPackage.APPLICATION_TYPE: {
77 ApplicationType applicationType = (ApplicationType) theEObject;
78 T result = caseApplicationType(applicationType);
79 if (result == null)
80 result = defaultCase(theEObject);
81 return result;
82 }
83 case CpsPackage.HOST_TYPE: {
84 HostType hostType = (HostType) theEObject;
85 T result = caseHostType(hostType);
86 if (result == null)
87 result = defaultCase(theEObject);
88 return result;
89 }
90 case CpsPackage.REQUEST: {
91 Request request = (Request) theEObject;
92 T result = caseRequest(request);
93 if (result == null)
94 result = defaultCase(theEObject);
95 return result;
96 }
97 case CpsPackage.REQUIREMENT: {
98 Requirement requirement = (Requirement) theEObject;
99 T result = caseRequirement(requirement);
100 if (result == null)
101 result = defaultCase(theEObject);
102 return result;
103 }
104 case CpsPackage.APPLICATION_INSTANCE: {
105 ApplicationInstance applicationInstance = (ApplicationInstance) theEObject;
106 T result = caseApplicationInstance(applicationInstance);
107 if (result == null)
108 result = defaultCase(theEObject);
109 return result;
110 }
111 case CpsPackage.RESOURCE_REQUIREMENT: {
112 ResourceRequirement resourceRequirement = (ResourceRequirement) theEObject;
113 T result = caseResourceRequirement(resourceRequirement);
114 if (result == null)
115 result = defaultCase(theEObject);
116 return result;
117 }
118 case CpsPackage.HOST_INSTANCE: {
119 HostInstance hostInstance = (HostInstance) theEObject;
120 T result = caseHostInstance(hostInstance);
121 if (result == null)
122 result = defaultCase(theEObject);
123 return result;
124 }
125 default:
126 return defaultCase(theEObject);
127 }
128 }
129
130 /**
131 * Returns the result of interpreting the object as an instance of '<em>Cyber Physical System</em>'.
132 * <!-- begin-user-doc -->
133 * This implementation returns null;
134 * returning a non-null result will terminate the switch.
135 * <!-- end-user-doc -->
136 * @param object the target of the switch.
137 * @return the result of interpreting the object as an instance of '<em>Cyber Physical System</em>'.
138 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
139 * @generated
140 */
141 public T caseCyberPhysicalSystem(CyberPhysicalSystem object) {
142 return null;
143 }
144
145 /**
146 * Returns the result of interpreting the object as an instance of '<em>Application Type</em>'.
147 * <!-- begin-user-doc -->
148 * This implementation returns null;
149 * returning a non-null result will terminate the switch.
150 * <!-- end-user-doc -->
151 * @param object the target of the switch.
152 * @return the result of interpreting the object as an instance of '<em>Application Type</em>'.
153 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
154 * @generated
155 */
156 public T caseApplicationType(ApplicationType object) {
157 return null;
158 }
159
160 /**
161 * Returns the result of interpreting the object as an instance of '<em>Host Type</em>'.
162 * <!-- begin-user-doc -->
163 * This implementation returns null;
164 * returning a non-null result will terminate the switch.
165 * <!-- end-user-doc -->
166 * @param object the target of the switch.
167 * @return the result of interpreting the object as an instance of '<em>Host Type</em>'.
168 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
169 * @generated
170 */
171 public T caseHostType(HostType object) {
172 return null;
173 }
174
175 /**
176 * Returns the result of interpreting the object as an instance of '<em>Request</em>'.
177 * <!-- begin-user-doc -->
178 * This implementation returns null;
179 * returning a non-null result will terminate the switch.
180 * <!-- end-user-doc -->
181 * @param object the target of the switch.
182 * @return the result of interpreting the object as an instance of '<em>Request</em>'.
183 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
184 * @generated
185 */
186 public T caseRequest(Request object) {
187 return null;
188 }
189
190 /**
191 * Returns the result of interpreting the object as an instance of '<em>Requirement</em>'.
192 * <!-- begin-user-doc -->
193 * This implementation returns null;
194 * returning a non-null result will terminate the switch.
195 * <!-- end-user-doc -->
196 * @param object the target of the switch.
197 * @return the result of interpreting the object as an instance of '<em>Requirement</em>'.
198 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
199 * @generated
200 */
201 public T caseRequirement(Requirement object) {
202 return null;
203 }
204
205 /**
206 * Returns the result of interpreting the object as an instance of '<em>Application Instance</em>'.
207 * <!-- begin-user-doc -->
208 * This implementation returns null;
209 * returning a non-null result will terminate the switch.
210 * <!-- end-user-doc -->
211 * @param object the target of the switch.
212 * @return the result of interpreting the object as an instance of '<em>Application Instance</em>'.
213 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
214 * @generated
215 */
216 public T caseApplicationInstance(ApplicationInstance object) {
217 return null;
218 }
219
220 /**
221 * Returns the result of interpreting the object as an instance of '<em>Resource Requirement</em>'.
222 * <!-- begin-user-doc -->
223 * This implementation returns null;
224 * returning a non-null result will terminate the switch.
225 * <!-- end-user-doc -->
226 * @param object the target of the switch.
227 * @return the result of interpreting the object as an instance of '<em>Resource Requirement</em>'.
228 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
229 * @generated
230 */
231 public T caseResourceRequirement(ResourceRequirement object) {
232 return null;
233 }
234
235 /**
236 * Returns the result of interpreting the object as an instance of '<em>Host Instance</em>'.
237 * <!-- begin-user-doc -->
238 * This implementation returns null;
239 * returning a non-null result will terminate the switch.
240 * <!-- end-user-doc -->
241 * @param object the target of the switch.
242 * @return the result of interpreting the object as an instance of '<em>Host Instance</em>'.
243 * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
244 * @generated
245 */
246 public T caseHostInstance(HostInstance object) {
247 return null;
248 }
249
250 /**
251 * Returns the result of interpreting the object as an instance of '<em>EObject</em>'.
252 * <!-- begin-user-doc -->
253 * This implementation returns null;
254 * returning a non-null result will terminate the switch, but this is the last case anyway.
255 * <!-- end-user-doc -->
256 * @param object the target of the switch.
257 * @return the result of interpreting the object as an instance of '<em>EObject</em>'.
258 * @see #doSwitch(org.eclipse.emf.ecore.EObject)
259 * @generated
260 */
261 @Override
262 public T defaultCase(EObject object) {
263 return null;
264 }
265
266} //CpsSwitch
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird
index d94d68b4..3f1b0301 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird
@@ -3,6 +3,991 @@
3 <viewpoint:DAnalysis uid="_kQWZMFvMEemLJtrAOuDPFQ" selectedViews="_kSYZgFvMEemLJtrAOuDPFQ" version="14.1.0.201810161215"> 3 <viewpoint:DAnalysis uid="_kQWZMFvMEemLJtrAOuDPFQ" selectedViews="_kSYZgFvMEemLJtrAOuDPFQ" version="14.1.0.201810161215">
4 <semanticResources>cps.ecore</semanticResources> 4 <semanticResources>cps.ecore</semanticResources>
5 <semanticResources>cps.genmodel</semanticResources> 5 <semanticResources>cps.genmodel</semanticResources>
6 <semanticResources>../src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql</semanticResources>
7 <semanticResources>http://www.eclipse.org/emf/2002/Ecore</semanticResources>
8 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch</semanticResources>
9 <semanticResources>java:/Objects/java.lang.Object</semanticResources>
10 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IPatternMatch</semanticResources>
11 <semanticResources>java:/Primitives</semanticResources>
12 <semanticResources>java:/Objects/java.lang.SafeVarargs</semanticResources>
13 <semanticResources>java:/Objects/java.util.List</semanticResources>
14 <semanticResources>java:/Objects/java.lang.String</semanticResources>
15 <semanticResources>java:/Objects/java.lang.CloneNotSupportedException</semanticResources>
16 <semanticResources>java:/Objects/java.lang.Throwable</semanticResources>
17 <semanticResources>java:/Objects/java.lang.Class</semanticResources>
18 <semanticResources>java:/Objects/java.lang.InterruptedException</semanticResources>
19 <semanticResources>java:/Objects/java.lang.Exception</semanticResources>
20 <semanticResources>java:/Objects/java.io.Serializable</semanticResources>
21 <semanticResources>java:/Objects/java.io.PrintWriter</semanticResources>
22 <semanticResources>java:/Objects/java.io.PrintStream</semanticResources>
23 <semanticResources>java:/Objects/java.lang.StackTraceElement</semanticResources>
24 <semanticResources>java:/Objects/java.util.Set</semanticResources>
25 <semanticResources>java:/Objects/java.io.ObjectInputStream</semanticResources>
26 <semanticResources>java:/Objects/java.io.IOException</semanticResources>
27 <semanticResources>java:/Objects/java.lang.ClassNotFoundException</semanticResources>
28 <semanticResources>java:/Objects/java.io.ObjectOutputStream</semanticResources>
29 <semanticResources>java:/Objects/java.io.Writer</semanticResources>
30 <semanticResources>java:/Objects/java.io.OutputStream</semanticResources>
31 <semanticResources>java:/Objects/java.io.FileNotFoundException</semanticResources>
32 <semanticResources>java:/Objects/java.io.File</semanticResources>
33 <semanticResources>java:/Objects/java.nio.charset.Charset</semanticResources>
34 <semanticResources>java:/Objects/java.io.UnsupportedEncodingException</semanticResources>
35 <semanticResources>java:/Objects/java.lang.CharSequence</semanticResources>
36 <semanticResources>java:/Objects/java.util.Locale</semanticResources>
37 <semanticResources>java:/Objects/java.util.Formatter</semanticResources>
38 <semanticResources>java:/Objects/java.lang.Appendable</semanticResources>
39 <semanticResources>java:/Objects/java.io.Closeable</semanticResources>
40 <semanticResources>java:/Objects/java.io.Flushable</semanticResources>
41 <semanticResources>java:/Objects/java.lang.AutoCloseable</semanticResources>
42 <semanticResources>java:/Objects/java.lang.Comparable</semanticResources>
43 <semanticResources>java:/Objects/java.security.SecureRandom</semanticResources>
44 <semanticResources>java:/Objects/java.lang.Enum</semanticResources>
45 <semanticResources>java:/Objects/java.net.URI</semanticResources>
46 <semanticResources>java:/Objects/java.io.FilenameFilter</semanticResources>
47 <semanticResources>java:/Objects/java.io.FileFilter</semanticResources>
48 <semanticResources>java:/Objects/java.nio.file.Path</semanticResources>
49 <semanticResources>java:/Objects/java.lang.Deprecated</semanticResources>
50 <semanticResources>java:/Objects/java.net.MalformedURLException</semanticResources>
51 <semanticResources>java:/Objects/java.net.URL</semanticResources>
52 <semanticResources>java:/Objects/sun.misc.Unsafe</semanticResources>
53 <semanticResources>java:/Objects/java.io.FileSystem</semanticResources>
54 <semanticResources>java:/Objects/java.util.Random</semanticResources>
55 <semanticResources>java:/Objects/java.util.regex.Pattern</semanticResources>
56 <semanticResources>java:/Objects/java.security.SecureRandomSpi</semanticResources>
57 <semanticResources>java:/Objects/java.security.Provider</semanticResources>
58 <semanticResources>java:/Objects/java.security.NoSuchAlgorithmException</semanticResources>
59 <semanticResources>java:/Objects/java.security.NoSuchProviderException</semanticResources>
60 <semanticResources>java:/Objects/java.security.MessageDigest</semanticResources>
61 <semanticResources>java:/Objects/sun.security.util.Debug</semanticResources>
62 <semanticResources>java:/Objects/java.util.Spliterator</semanticResources>
63 <semanticResources>java:/Objects/java.util.function.DoubleConsumer</semanticResources>
64 <semanticResources>java:/Objects/java.util.function.LongConsumer</semanticResources>
65 <semanticResources>java:/Objects/java.util.function.IntConsumer</semanticResources>
66 <semanticResources>java:/Objects/java.util.stream.DoubleStream</semanticResources>
67 <semanticResources>java:/Objects/java.util.stream.IntStream</semanticResources>
68 <semanticResources>java:/Objects/java.util.stream.LongStream</semanticResources>
69 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicLong</semanticResources>
70 <semanticResources>java:/Objects/java.io.ObjectStreamField</semanticResources>
71 <semanticResources>java:/Objects/java.lang.Double</semanticResources>
72 <semanticResources>java:/Objects/java.util.function.Consumer</semanticResources>
73 <semanticResources>java:/Objects/java.lang.Long</semanticResources>
74 <semanticResources>java:/Objects/java.lang.Integer</semanticResources>
75 <semanticResources>java:/Objects/java.util.Comparator</semanticResources>
76 <semanticResources>java:/Objects/java.lang.Number</semanticResources>
77 <semanticResources>java:/Objects/java.lang.NumberFormatException</semanticResources>
78 <semanticResources>java:/Objects/java.lang.IllegalArgumentException</semanticResources>
79 <semanticResources>java:/Objects/java.lang.RuntimeException</semanticResources>
80 <semanticResources>java:/Objects/java.lang.FunctionalInterface</semanticResources>
81 <semanticResources>java:/Objects/java.lang.annotation.Target</semanticResources>
82 <semanticResources>java:/Objects/java.lang.annotation.ElementType</semanticResources>
83 <semanticResources>java:/Objects/java.lang.annotation.Retention</semanticResources>
84 <semanticResources>java:/Objects/java.lang.annotation.RetentionPolicy</semanticResources>
85 <semanticResources>java:/Objects/java.lang.annotation.Documented</semanticResources>
86 <semanticResources>java:/Objects/java.lang.annotation.Annotation</semanticResources>
87 <semanticResources>java:/Objects/java.math.BigInteger</semanticResources>
88 <semanticResources>java:/Objects/java.lang.StringBuilder</semanticResources>
89 <semanticResources>java:/Objects/java.lang.AbstractStringBuilder</semanticResources>
90 <semanticResources>java:/Objects/java.lang.StringBuffer</semanticResources>
91 <semanticResources>java:/Objects/java.util.function.Function</semanticResources>
92 <semanticResources>java:/Objects/java.util.function.ToDoubleFunction</semanticResources>
93 <semanticResources>java:/Objects/java.util.function.ToIntFunction</semanticResources>
94 <semanticResources>java:/Objects/java.util.function.ToLongFunction</semanticResources>
95 <semanticResources>java:/Objects/java.util.stream.BaseStream</semanticResources>
96 <semanticResources>java:/Objects/java.util.function.DoublePredicate</semanticResources>
97 <semanticResources>java:/Objects/java.util.OptionalDouble</semanticResources>
98 <semanticResources>java:/Objects/java.util.stream.Stream</semanticResources>
99 <semanticResources>java:/Objects/java.util.function.Supplier</semanticResources>
100 <semanticResources>java:/Objects/java.util.function.ObjDoubleConsumer</semanticResources>
101 <semanticResources>java:/Objects/java.util.function.BiConsumer</semanticResources>
102 <semanticResources>java:/Objects/java.util.function.DoubleFunction</semanticResources>
103 <semanticResources>java:/Objects/java.util.function.DoubleSupplier</semanticResources>
104 <semanticResources>java:/Objects/java.util.function.DoubleUnaryOperator</semanticResources>
105 <semanticResources>java:/Objects/java.util.PrimitiveIterator</semanticResources>
106 <semanticResources>java:/Objects/java.util.function.DoubleToIntFunction</semanticResources>
107 <semanticResources>java:/Objects/java.util.function.DoubleToLongFunction</semanticResources>
108 <semanticResources>java:/Objects/java.util.function.DoubleBinaryOperator</semanticResources>
109 <semanticResources>java:/Objects/java.util.DoubleSummaryStatistics</semanticResources>
110 <semanticResources>java:/Objects/java.util.Iterator</semanticResources>
111 <semanticResources>java:/Objects/java.lang.Runnable</semanticResources>
112 <semanticResources>java:/Objects/java.util.function.Predicate</semanticResources>
113 <semanticResources>java:/Objects/java.util.stream.Collector</semanticResources>
114 <semanticResources>java:/Objects/java.util.Optional</semanticResources>
115 <semanticResources>java:/Objects/java.util.function.UnaryOperator</semanticResources>
116 <semanticResources>java:/Objects/java.util.function.BinaryOperator</semanticResources>
117 <semanticResources>java:/Objects/java.util.function.BiFunction</semanticResources>
118 <semanticResources>java:/Objects/java.util.function.IntFunction</semanticResources>
119 <semanticResources>java:/Objects/java.util.function.IntPredicate</semanticResources>
120 <semanticResources>java:/Objects/java.util.function.ObjIntConsumer</semanticResources>
121 <semanticResources>java:/Objects/java.util.OptionalInt</semanticResources>
122 <semanticResources>java:/Objects/java.util.function.IntSupplier</semanticResources>
123 <semanticResources>java:/Objects/java.util.function.IntUnaryOperator</semanticResources>
124 <semanticResources>java:/Objects/java.util.function.IntToDoubleFunction</semanticResources>
125 <semanticResources>java:/Objects/java.util.function.IntToLongFunction</semanticResources>
126 <semanticResources>java:/Objects/java.util.function.IntBinaryOperator</semanticResources>
127 <semanticResources>java:/Objects/java.util.IntSummaryStatistics</semanticResources>
128 <semanticResources>java:/Objects/java.util.function.LongPredicate</semanticResources>
129 <semanticResources>java:/Objects/java.util.function.ObjLongConsumer</semanticResources>
130 <semanticResources>java:/Objects/java.util.OptionalLong</semanticResources>
131 <semanticResources>java:/Objects/java.util.function.LongFunction</semanticResources>
132 <semanticResources>java:/Objects/java.util.function.LongSupplier</semanticResources>
133 <semanticResources>java:/Objects/java.util.function.LongUnaryOperator</semanticResources>
134 <semanticResources>java:/Objects/java.util.function.LongToDoubleFunction</semanticResources>
135 <semanticResources>java:/Objects/java.util.function.LongToIntFunction</semanticResources>
136 <semanticResources>java:/Objects/java.util.function.LongBinaryOperator</semanticResources>
137 <semanticResources>java:/Objects/java.util.LongSummaryStatistics</semanticResources>
138 <semanticResources>java:/Objects/java.lang.reflect.Field</semanticResources>
139 <semanticResources>java:/Objects/sun.reflect.CallerSensitive</semanticResources>
140 <semanticResources>java:/Objects/java.lang.reflect.AccessibleObject</semanticResources>
141 <semanticResources>java:/Objects/java.lang.reflect.Member</semanticResources>
142 <semanticResources>java:/Objects/sun.reflect.FieldAccessor</semanticResources>
143 <semanticResources>java:/Objects/java.util.Map</semanticResources>
144 <semanticResources>java:/Objects/java.lang.IllegalAccessException</semanticResources>
145 <semanticResources>java:/Objects/java.lang.reflect.AnnotatedType</semanticResources>
146 <semanticResources>java:/Objects/sun.reflect.generics.factory.GenericsFactory</semanticResources>
147 <semanticResources>java:/Objects/sun.reflect.generics.repository.FieldRepository</semanticResources>
148 <semanticResources>java:/Objects/java.lang.reflect.Type</semanticResources>
149 <semanticResources>java:/Objects/java.lang.reflect.AnnotatedElement</semanticResources>
150 <semanticResources>java:/Objects/java.lang.SecurityException</semanticResources>
151 <semanticResources>java:/Objects/java.security.Permission</semanticResources>
152 <semanticResources>java:/Objects/sun.reflect.ReflectionFactory</semanticResources>
153 <semanticResources>java:/Objects/java.security.Guard</semanticResources>
154 <semanticResources>java:/Objects/java.security.PermissionCollection</semanticResources>
155 <semanticResources>java:/Objects/java.util.Enumeration</semanticResources>
156 <semanticResources>java:/Objects/java.security.PrivilegedAction</semanticResources>
157 <semanticResources>java:/Objects/java.lang.reflect.Constructor</semanticResources>
158 <semanticResources>java:/Objects/java.lang.reflect.Method</semanticResources>
159 <semanticResources>java:/Objects/java.lang.invoke.MethodHandle</semanticResources>
160 <semanticResources>java:/Objects/sun.reflect.ConstructorAccessor</semanticResources>
161 <semanticResources>java:/Objects/java.lang.reflect.Executable</semanticResources>
162 <semanticResources>java:/Objects/sun.reflect.MethodAccessor</semanticResources>
163 <semanticResources>java:/Objects/sun.reflect.LangReflectAccess</semanticResources>
164 <semanticResources>java:/Objects/java.io.OptionalDataException</semanticResources>
165 <semanticResources>java:/Objects/sun.reflect.generics.repository.ConstructorRepository</semanticResources>
166 <semanticResources>java:/Objects/java.lang.reflect.TypeVariable</semanticResources>
167 <semanticResources>java:/Objects/java.lang.InstantiationException</semanticResources>
168 <semanticResources>java:/Objects/java.lang.reflect.InvocationTargetException</semanticResources>
169 <semanticResources>java:/Objects/sun.reflect.generics.repository.GenericDeclRepository</semanticResources>
170 <semanticResources>java:/Objects/sun.reflect.generics.tree.MethodTypeSignature</semanticResources>
171 <semanticResources>java:/Objects/sun.reflect.generics.repository.AbstractRepository</semanticResources>
172 <semanticResources>java:/Objects/sun.reflect.generics.tree.Signature</semanticResources>
173 <semanticResources>java:/Objects/sun.reflect.generics.visitor.Reifier</semanticResources>
174 <semanticResources>java:/Objects/sun.reflect.generics.tree.Tree</semanticResources>
175 <semanticResources>java:/Objects/sun.reflect.generics.visitor.TypeTreeVisitor</semanticResources>
176 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeArgument</semanticResources>
177 <semanticResources>java:/Objects/sun.reflect.generics.tree.ArrayTypeSignature</semanticResources>
178 <semanticResources>java:/Objects/sun.reflect.generics.tree.BooleanSignature</semanticResources>
179 <semanticResources>java:/Objects/sun.reflect.generics.tree.BottomSignature</semanticResources>
180 <semanticResources>java:/Objects/sun.reflect.generics.tree.ByteSignature</semanticResources>
181 <semanticResources>java:/Objects/sun.reflect.generics.tree.CharSignature</semanticResources>
182 <semanticResources>java:/Objects/sun.reflect.generics.tree.ClassTypeSignature</semanticResources>
183 <semanticResources>java:/Objects/sun.reflect.generics.tree.DoubleSignature</semanticResources>
184 <semanticResources>java:/Objects/sun.reflect.generics.tree.FloatSignature</semanticResources>
185 <semanticResources>java:/Objects/sun.reflect.generics.tree.FormalTypeParameter</semanticResources>
186 <semanticResources>java:/Objects/sun.reflect.generics.tree.IntSignature</semanticResources>
187 <semanticResources>java:/Objects/sun.reflect.generics.tree.LongSignature</semanticResources>
188 <semanticResources>java:/Objects/sun.reflect.generics.tree.ShortSignature</semanticResources>
189 <semanticResources>java:/Objects/sun.reflect.generics.tree.SimpleClassTypeSignature</semanticResources>
190 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeVariableSignature</semanticResources>
191 <semanticResources>java:/Objects/sun.reflect.generics.tree.VoidDescriptor</semanticResources>
192 <semanticResources>java:/Objects/sun.reflect.generics.tree.Wildcard</semanticResources>
193 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeTree</semanticResources>
194 <semanticResources>java:/Objects/sun.reflect.generics.tree.FieldTypeSignature</semanticResources>
195 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeSignature</semanticResources>
196 <semanticResources>java:/Objects/sun.reflect.generics.tree.BaseType</semanticResources>
197 <semanticResources>java:/Objects/sun.reflect.generics.tree.ReturnType</semanticResources>
198 <semanticResources>java:/Objects/sun.reflect.generics.visitor.Visitor</semanticResources>
199 <semanticResources>java:/Objects/sun.reflect.generics.tree.ClassSignature</semanticResources>
200 <semanticResources>java:/Objects/java.lang.reflect.GenericDeclaration</semanticResources>
201 <semanticResources>java:/Objects/java.lang.ReflectiveOperationException</semanticResources>
202 <semanticResources>java:/Objects/sun.reflect.generics.repository.MethodRepository</semanticResources>
203 <semanticResources>java:/Objects/java.lang.invoke.MethodType</semanticResources>
204 <semanticResources>java:/Objects/java.lang.invoke.LambdaForm</semanticResources>
205 <semanticResources>java:/Objects/java.lang.invoke.BoundMethodHandle</semanticResources>
206 <semanticResources>java:/Objects/java.lang.invoke.MemberName</semanticResources>
207 <semanticResources>java:/Objects/java.lang.invoke.MethodHandleImpl</semanticResources>
208 <semanticResources>java:/Objects/java.lang.ref.WeakReference</semanticResources>
209 <semanticResources>java:/Objects/java.lang.ref.ReferenceQueue</semanticResources>
210 <semanticResources>java:/Objects/java.util.concurrent.ConcurrentMap</semanticResources>
211 <semanticResources>java:/Objects/java.lang.invoke.MethodTypeForm</semanticResources>
212 <semanticResources>java:/Objects/java.lang.ClassLoader</semanticResources>
213 <semanticResources>java:/Objects/java.lang.TypeNotPresentException</semanticResources>
214 <semanticResources>java:/Objects/java.lang.invoke.Invokers</semanticResources>
215 <semanticResources>java:/Objects/java.lang.IndexOutOfBoundsException</semanticResources>
216 <semanticResources>java:/Objects/java.lang.invoke.Stable</semanticResources>
217 <semanticResources>java:/Objects/java.lang.ref.Reference</semanticResources>
218 <semanticResources>java:/Objects/java.lang.Thread</semanticResources>
219 <semanticResources>java:/Objects/java.lang.ThreadGroup</semanticResources>
220 <semanticResources>java:/Objects/java.lang.Boolean</semanticResources>
221 <semanticResources>java:/Objects/java.security.AccessControlContext</semanticResources>
222 <semanticResources>java:/Objects/sun.nio.ch.Interruptible</semanticResources>
223 <semanticResources>java:/Objects/java.lang.RuntimePermission</semanticResources>
224 <semanticResources>java:/Objects/java.lang.ThreadLocal</semanticResources>
225 <semanticResources>java:/Objects/sun.misc.Contended</semanticResources>
226 <semanticResources>java:/Objects/java.security.ProtectionDomain</semanticResources>
227 <semanticResources>java:/Objects/java.security.DomainCombiner</semanticResources>
228 <semanticResources>java:/Objects/java.security.AccessControlException</semanticResources>
229 <semanticResources>java:/Objects/sun.misc.JavaSecurityAccess</semanticResources>
230 <semanticResources>java:/Objects/java.security.CodeSource</semanticResources>
231 <semanticResources>java:/Objects/java.security.Principal</semanticResources>
232 <semanticResources>java:/Objects/java.security.cert.Certificate</semanticResources>
233 <semanticResources>java:/Objects/java.security.CodeSigner</semanticResources>
234 <semanticResources>java:/Objects/java.security.cert.CertificateFactory</semanticResources>
235 <semanticResources>java:/Objects/java.net.SocketPermission</semanticResources>
236 <semanticResources>java:/Objects/java.io.ObjectStreamException</semanticResources>
237 <semanticResources>java:/Objects/java.security.cert.CertificateEncodingException</semanticResources>
238 <semanticResources>java:/Objects/java.security.PublicKey</semanticResources>
239 <semanticResources>java:/Objects/java.security.cert.CertificateException</semanticResources>
240 <semanticResources>java:/Objects/java.security.InvalidKeyException</semanticResources>
241 <semanticResources>java:/Objects/java.security.SignatureException</semanticResources>
242 <semanticResources>java:/Objects/java.security.Key</semanticResources>
243 <semanticResources>java:/Objects/java.security.GeneralSecurityException</semanticResources>
244 <semanticResources>java:/Objects/java.security.KeyException</semanticResources>
245 <semanticResources>java:/Objects/java.security.cert.CertPath</semanticResources>
246 <semanticResources>java:/Objects/java.security.Timestamp</semanticResources>
247 <semanticResources>java:/Objects/java.util.Date</semanticResources>
248 <semanticResources>java:/Objects/java.lang.Cloneable</semanticResources>
249 <semanticResources>java:/Objects/java.time.Instant</semanticResources>
250 <semanticResources>java:/Objects/sun.util.calendar.BaseCalendar</semanticResources>
251 <semanticResources>java:/Objects/java.time.temporal.Temporal</semanticResources>
252 <semanticResources>java:/Objects/java.time.temporal.TemporalAdjuster</semanticResources>
253 <semanticResources>java:/Objects/java.time.ZoneOffset</semanticResources>
254 <semanticResources>java:/Objects/java.time.OffsetDateTime</semanticResources>
255 <semanticResources>java:/Objects/java.time.ZoneId</semanticResources>
256 <semanticResources>java:/Objects/java.time.ZonedDateTime</semanticResources>
257 <semanticResources>java:/Objects/java.time.temporal.TemporalAccessor</semanticResources>
258 <semanticResources>java:/Objects/java.time.temporal.TemporalField</semanticResources>
259 <semanticResources>java:/Objects/java.time.temporal.TemporalUnit</semanticResources>
260 <semanticResources>java:/Objects/java.time.temporal.TemporalAmount</semanticResources>
261 <semanticResources>java:/Objects/java.time.Clock</semanticResources>
262 <semanticResources>java:/Objects/java.time.temporal.TemporalQuery</semanticResources>
263 <semanticResources>java:/Objects/java.time.temporal.ValueRange</semanticResources>
264 <semanticResources>java:/Objects/java.io.DataInput</semanticResources>
265 <semanticResources>java:/Objects/java.io.InvalidObjectException</semanticResources>
266 <semanticResources>java:/Objects/java.io.DataOutput</semanticResources>
267 <semanticResources>java:/Objects/java.time.zone.ZoneRules</semanticResources>
268 <semanticResources>java:/Objects/java.time.zone.ZoneOffsetTransition</semanticResources>
269 <semanticResources>java:/Objects/java.time.zone.ZoneOffsetTransitionRule</semanticResources>
270 <semanticResources>java:/Objects/java.time.LocalDateTime</semanticResources>
271 <semanticResources>java:/Objects/java.time.Duration</semanticResources>
272 <semanticResources>java:/Objects/java.time.Month</semanticResources>
273 <semanticResources>java:/Objects/java.time.DayOfWeek</semanticResources>
274 <semanticResources>java:/Objects/java.time.LocalTime</semanticResources>
275 <semanticResources>java:/Objects/java.time.format.TextStyle</semanticResources>
276 <semanticResources>java:/Objects/java.time.LocalDate</semanticResources>
277 <semanticResources>java:/Objects/java.time.OffsetTime</semanticResources>
278 <semanticResources>java:/Objects/java.time.format.DateTimeFormatter</semanticResources>
279 <semanticResources>java:/Objects/java.time.chrono.ChronoLocalDate</semanticResources>
280 <semanticResources>java:/Objects/java.time.chrono.IsoChronology</semanticResources>
281 <semanticResources>java:/Objects/java.time.chrono.Era</semanticResources>
282 <semanticResources>java:/Objects/java.time.Period</semanticResources>
283 <semanticResources>java:/Objects/java.time.chrono.ChronoLocalDateTime</semanticResources>
284 <semanticResources>java:/Objects/java.time.chrono.Chronology</semanticResources>
285 <semanticResources>java:/Objects/java.time.chrono.ChronoPeriod</semanticResources>
286 <semanticResources>java:/Objects/java.time.chrono.ChronoZonedDateTime</semanticResources>
287 <semanticResources>java:/Objects/java.time.temporal.ChronoField</semanticResources>
288 <semanticResources>java:/Objects/java.time.format.ResolverStyle</semanticResources>
289 <semanticResources>java:/Objects/java.time.chrono.AbstractChronology</semanticResources>
290 <semanticResources>java:/Objects/java.time.chrono.IsoEra</semanticResources>
291 <semanticResources>java:/Objects/java.util.concurrent.ConcurrentHashMap</semanticResources>
292 <semanticResources>java:/Objects/java.util.AbstractMap</semanticResources>
293 <semanticResources>java:/Objects/java.util.function.ToIntBiFunction</semanticResources>
294 <semanticResources>java:/Objects/java.util.function.ToLongBiFunction</semanticResources>
295 <semanticResources>java:/Objects/java.util.function.ToDoubleBiFunction</semanticResources>
296 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicReference</semanticResources>
297 <semanticResources>java:/Objects/java.lang.Void</semanticResources>
298 <semanticResources>java:/Objects/java.util.concurrent.CountedCompleter</semanticResources>
299 <semanticResources>java:/Objects/java.util.Collection</semanticResources>
300 <semanticResources>java:/Objects/java.util.concurrent.locks.ReentrantLock</semanticResources>
301 <semanticResources>java:/Objects/java.util.concurrent.ForkJoinTask</semanticResources>
302 <semanticResources>java:/Objects/java.util.concurrent.Future</semanticResources>
303 <semanticResources>java:/Objects/java.util.concurrent.RunnableFuture</semanticResources>
304 <semanticResources>java:/Objects/java.util.concurrent.Callable</semanticResources>
305 <semanticResources>java:/Objects/java.util.concurrent.ExecutionException</semanticResources>
306 <semanticResources>java:/Objects/java.util.concurrent.TimeUnit</semanticResources>
307 <semanticResources>java:/Objects/java.util.concurrent.TimeoutException</semanticResources>
308 <semanticResources>java:/Objects/java.util.concurrent.ForkJoinPool</semanticResources>
309 <semanticResources>java:/Objects/java.util.concurrent.AbstractExecutorService</semanticResources>
310 <semanticResources>java:/Objects/java.util.concurrent.ForkJoinWorkerThread</semanticResources>
311 <semanticResources>java:/Objects/java.util.concurrent.ExecutorService</semanticResources>
312 <semanticResources>java:/Objects/java.util.concurrent.Executor</semanticResources>
313 <semanticResources>java:/Objects/java.lang.Iterable</semanticResources>
314 <semanticResources>java:/Objects/java.util.concurrent.locks.Lock</semanticResources>
315 <semanticResources>java:/Objects/java.util.concurrent.locks.AbstractQueuedSynchronizer</semanticResources>
316 <semanticResources>java:/Objects/java.util.concurrent.locks.Condition</semanticResources>
317 <semanticResources>java:/Objects/java.util.concurrent.locks.AbstractOwnableSynchronizer</semanticResources>
318 <semanticResources>java:/Objects/java.lang.NullPointerException</semanticResources>
319 <semanticResources>java:/Objects/java.io.ObjectInput</semanticResources>
320 <semanticResources>java:/Objects/java.io.ObjectOutput</semanticResources>
321 <semanticResources>java:/Objects/java.text.Format</semanticResources>
322 <semanticResources>java:/Objects/java.text.FieldPosition</semanticResources>
323 <semanticResources>java:/Objects/java.text.ParseException</semanticResources>
324 <semanticResources>java:/Objects/java.text.ParsePosition</semanticResources>
325 <semanticResources>java:/Objects/java.time.format.DateTimeFormatterBuilder</semanticResources>
326 <semanticResources>java:/Objects/java.time.format.DecimalStyle</semanticResources>
327 <semanticResources>java:/Objects/java.time.format.DateTimeParseException</semanticResources>
328 <semanticResources>java:/Objects/java.time.format.FormatStyle</semanticResources>
329 <semanticResources>java:/Objects/java.time.format.DateTimeParseContext</semanticResources>
330 <semanticResources>java:/Objects/java.text.AttributedCharacterIterator</semanticResources>
331 <semanticResources>java:/Objects/java.text.CharacterIterator</semanticResources>
332 <semanticResources>java:/Objects/java.time.format.DateTimePrintContext</semanticResources>
333 <semanticResources>java:/Objects/java.lang.ref.SoftReference</semanticResources>
334 <semanticResources>java:/Objects/java.time.format.DateTimeTextProvider</semanticResources>
335 <semanticResources>java:/Objects/java.math.BigDecimal</semanticResources>
336 <semanticResources>java:/Objects/java.time.format.SignStyle</semanticResources>
337 <semanticResources>java:/Objects/java.lang.Character</semanticResources>
338 <semanticResources>java:/Objects/java.math.MathContext</semanticResources>
339 <semanticResources>java:/Objects/java.math.RoundingMode</semanticResources>
340 <semanticResources>java:/Objects/java.math.MutableBigInteger</semanticResources>
341 <semanticResources>java:/Objects/java.util.HashMap</semanticResources>
342 <semanticResources>java:/Objects/java.util.LinkedHashMap</semanticResources>
343 <semanticResources>java:/Objects/java.util.AbstractSet</semanticResources>
344 <semanticResources>java:/Objects/java.util.AbstractCollection</semanticResources>
345 <semanticResources>java:/Objects/java.time.DateTimeException</semanticResources>
346 <semanticResources>java:/Objects/java.time.format.Parsed</semanticResources>
347 <semanticResources>java:/Objects/java.util.ArrayList</semanticResources>
348 <semanticResources>java:/Objects/java.util.AbstractList</semanticResources>
349 <semanticResources>java:/Objects/java.util.RandomAccess</semanticResources>
350 <semanticResources>java:/Objects/java.util.ListIterator</semanticResources>
351 <semanticResources>java:/Objects/sun.util.calendar.AbstractCalendar</semanticResources>
352 <semanticResources>java:/Objects/sun.util.calendar.CalendarDate</semanticResources>
353 <semanticResources>java:/Objects/java.util.TimeZone</semanticResources>
354 <semanticResources>java:/Objects/sun.util.calendar.CalendarSystem</semanticResources>
355 <semanticResources>java:/Objects/sun.util.calendar.Era</semanticResources>
356 <semanticResources>java:/Objects/java.util.Properties</semanticResources>
357 <semanticResources>java:/Objects/sun.util.calendar.Gregorian</semanticResources>
358 <semanticResources>java:/Objects/java.util.Hashtable</semanticResources>
359 <semanticResources>java:/Objects/java.io.InputStream</semanticResources>
360 <semanticResources>java:/Objects/java.util.InvalidPropertiesFormatException</semanticResources>
361 <semanticResources>java:/Objects/sun.util.spi.XmlPropertiesProvider</semanticResources>
362 <semanticResources>java:/Objects/java.io.Reader</semanticResources>
363 <semanticResources>java:/Objects/java.io.BufferedWriter</semanticResources>
364 <semanticResources>java:/Objects/java.util.Dictionary</semanticResources>
365 <semanticResources>java:/Objects/java.io.StreamCorruptedException</semanticResources>
366 <semanticResources>java:/Objects/java.io.NotSerializableException</semanticResources>
367 <semanticResources>java:/Objects/java.lang.Readable</semanticResources>
368 <semanticResources>java:/Objects/java.nio.CharBuffer</semanticResources>
369 <semanticResources>java:/Objects/java.nio.Buffer</semanticResources>
370 <semanticResources>java:/Objects/java.nio.ByteOrder</semanticResources>
371 <semanticResources>java:/Objects/java.security.cert.CertificateFactorySpi</semanticResources>
372 <semanticResources>java:/Objects/java.security.cert.CRLException</semanticResources>
373 <semanticResources>java:/Objects/java.security.cert.CRL</semanticResources>
374 <semanticResources>java:/Objects/java.net.UnknownHostException</semanticResources>
375 <semanticResources>java:/Objects/java.net.InetAddress</semanticResources>
376 <semanticResources>java:/Objects/sun.net.spi.nameservice.NameService</semanticResources>
377 <semanticResources>java:/Objects/java.net.NetworkInterface</semanticResources>
378 <semanticResources>java:/Objects/java.net.InetAddressImpl</semanticResources>
379 <semanticResources>java:/Objects/java.net.SocketException</semanticResources>
380 <semanticResources>java:/Objects/java.net.InterfaceAddress</semanticResources>
381 <semanticResources>java:/Objects/java.net.Inet4Address</semanticResources>
382 <semanticResources>java:/Objects/javax.security.auth.Subject</semanticResources>
383 <semanticResources>java:/Objects/javax.security.auth.AuthPermission</semanticResources>
384 <semanticResources>java:/Objects/java.util.LinkedList</semanticResources>
385 <semanticResources>java:/Objects/java.security.PrivilegedExceptionAction</semanticResources>
386 <semanticResources>java:/Objects/java.security.PrivilegedActionException</semanticResources>
387 <semanticResources>java:/Objects/java.security.BasicPermission</semanticResources>
388 <semanticResources>java:/Objects/java.util.AbstractSequentialList</semanticResources>
389 <semanticResources>java:/Objects/java.util.Deque</semanticResources>
390 <semanticResources>java:/Objects/java.util.Queue</semanticResources>
391 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicInteger</semanticResources>
392 <semanticResources>java:/Objects/java.lang.ClassFormatError</semanticResources>
393 <semanticResources>java:/Objects/java.nio.ByteBuffer</semanticResources>
394 <semanticResources>java:/Objects/java.lang.Package</semanticResources>
395 <semanticResources>java:/Objects/sun.misc.URLClassPath</semanticResources>
396 <semanticResources>java:/Objects/java.lang.AssertionStatusDirectives</semanticResources>
397 <semanticResources>java:/Objects/java.util.Vector</semanticResources>
398 <semanticResources>java:/Objects/java.util.Stack</semanticResources>
399 <semanticResources>java:/Objects/java.lang.LinkageError</semanticResources>
400 <semanticResources>java:/Objects/java.lang.Error</semanticResources>
401 <semanticResources>java:/Objects/java.nio.DoubleBuffer</semanticResources>
402 <semanticResources>java:/Objects/java.nio.FloatBuffer</semanticResources>
403 <semanticResources>java:/Objects/java.nio.IntBuffer</semanticResources>
404 <semanticResources>java:/Objects/java.nio.LongBuffer</semanticResources>
405 <semanticResources>java:/Objects/java.nio.ShortBuffer</semanticResources>
406 <semanticResources>java:/Objects/java.util.jar.Manifest</semanticResources>
407 <semanticResources>java:/Objects/java.io.FilterInputStream</semanticResources>
408 <semanticResources>java:/Objects/java.util.jar.JarVerifier</semanticResources>
409 <semanticResources>java:/Objects/java.util.jar.Attributes</semanticResources>
410 <semanticResources>java:/Objects/java.util.jar.JarEntry</semanticResources>
411 <semanticResources>java:/Objects/sun.security.util.ManifestEntryVerifier</semanticResources>
412 <semanticResources>java:/Objects/java.util.jar.JarFile</semanticResources>
413 <semanticResources>java:/Objects/java.util.zip.ZipEntry</semanticResources>
414 <semanticResources>java:/Objects/java.io.ByteArrayOutputStream</semanticResources>
415 <semanticResources>java:/Objects/sun.security.util.ManifestDigester</semanticResources>
416 <semanticResources>java:/Objects/sun.security.util.SignatureFileVerifier</semanticResources>
417 <semanticResources>java:/Objects/java.util.jar.JarException</semanticResources>
418 <semanticResources>java:/Objects/java.util.zip.ZipException</semanticResources>
419 <semanticResources>java:/Objects/java.util.zip.ZipFile</semanticResources>
420 <semanticResources>java:/Objects/java.util.zip.ZipConstants</semanticResources>
421 <semanticResources>java:/Objects/java.util.zip.InflaterInputStream</semanticResources>
422 <semanticResources>java:/Objects/java.util.zip.Inflater</semanticResources>
423 <semanticResources>java:/Objects/java.util.zip.ZipCoder</semanticResources>
424 <semanticResources>java:/Objects/java.util.zip.DataFormatException</semanticResources>
425 <semanticResources>java:/Objects/java.util.zip.ZStreamRef</semanticResources>
426 <semanticResources>java:/Objects/java.nio.charset.CharsetDecoder</semanticResources>
427 <semanticResources>java:/Objects/java.nio.charset.CharsetEncoder</semanticResources>
428 <semanticResources>java:/Objects/java.nio.charset.CharacterCodingException</semanticResources>
429 <semanticResources>java:/Objects/java.nio.charset.CoderResult</semanticResources>
430 <semanticResources>java:/Objects/java.nio.charset.CodingErrorAction</semanticResources>
431 <semanticResources>java:/Objects/java.nio.file.attribute.FileTime</semanticResources>
432 <semanticResources>java:/Objects/sun.security.pkcs.SignerInfo</semanticResources>
433 <semanticResources>java:/Objects/sun.security.pkcs.PKCS7</semanticResources>
434 <semanticResources>java:/Objects/sun.security.util.DisabledAlgorithmConstraints</semanticResources>
435 <semanticResources>java:/Objects/sun.security.util.DerEncoder</semanticResources>
436 <semanticResources>java:/Objects/sun.security.util.DerInputStream</semanticResources>
437 <semanticResources>java:/Objects/sun.security.pkcs.ParsingException</semanticResources>
438 <semanticResources>java:/Objects/sun.security.x509.X500Name</semanticResources>
439 <semanticResources>java:/Objects/sun.security.x509.AlgorithmId</semanticResources>
440 <semanticResources>java:/Objects/sun.security.pkcs.PKCS9Attributes</semanticResources>
441 <semanticResources>java:/Objects/sun.security.util.DerOutputStream</semanticResources>
442 <semanticResources>java:/Objects/java.security.cert.X509Certificate</semanticResources>
443 <semanticResources>java:/Objects/sun.security.timestamp.TimestampToken</semanticResources>
444 <semanticResources>java:/Objects/java.security.CryptoPrimitive</semanticResources>
445 <semanticResources>java:/Objects/sun.security.util.DerInputBuffer</semanticResources>
446 <semanticResources>java:/Objects/sun.security.util.DerValue</semanticResources>
447 <semanticResources>java:/Objects/sun.security.util.ObjectIdentifier</semanticResources>
448 <semanticResources>java:/Objects/sun.security.util.BitArray</semanticResources>
449 <semanticResources>java:/Objects/java.io.ByteArrayInputStream</semanticResources>
450 <semanticResources>java:/Objects/java.lang.ArrayIndexOutOfBoundsException</semanticResources>
451 <semanticResources>java:/Objects/sun.security.x509.GeneralNameInterface</semanticResources>
452 <semanticResources>java:/Objects/sun.security.x509.RDN</semanticResources>
453 <semanticResources>java:/Objects/sun.security.x509.AVA</semanticResources>
454 <semanticResources>java:/Objects/javax.security.auth.x500.X500Principal</semanticResources>
455 <semanticResources>java:/Objects/java.lang.UnsupportedOperationException</semanticResources>
456 <semanticResources>java:/Objects/java.lang.Byte</semanticResources>
457 <semanticResources>java:/Objects/java.io.NotActiveException</semanticResources>
458 <semanticResources>java:/Objects/java.security.AlgorithmParameters</semanticResources>
459 <semanticResources>java:/Objects/java.security.AlgorithmParametersSpi</semanticResources>
460 <semanticResources>java:/Objects/java.security.spec.AlgorithmParameterSpec</semanticResources>
461 <semanticResources>java:/Objects/java.security.spec.InvalidParameterSpecException</semanticResources>
462 <semanticResources>java:/Objects/sun.security.pkcs.PKCS9Attribute</semanticResources>
463 <semanticResources>java:/Objects/sun.security.util.ByteArrayLexOrder</semanticResources>
464 <semanticResources>java:/Objects/sun.security.util.ByteArrayTagOrder</semanticResources>
465 <semanticResources>java:/Objects/java.security.cert.X509Extension</semanticResources>
466 <semanticResources>java:/Objects/java.security.cert.CertificateExpiredException</semanticResources>
467 <semanticResources>java:/Objects/java.security.cert.CertificateNotYetValidException</semanticResources>
468 <semanticResources>java:/Objects/java.security.cert.CertificateParsingException</semanticResources>
469 <semanticResources>java:/Objects/sun.security.pkcs.ContentInfo</semanticResources>
470 <semanticResources>java:/Objects/java.security.cert.X509CRL</semanticResources>
471 <semanticResources>java:/Objects/sun.security.timestamp.Timestamper</semanticResources>
472 <semanticResources>java:/Objects/java.security.cert.X509CRLEntry</semanticResources>
473 <semanticResources>java:/Objects/java.security.cert.CRLReason</semanticResources>
474 <semanticResources>java:/Objects/sun.security.timestamp.TSRequest</semanticResources>
475 <semanticResources>java:/Objects/sun.security.timestamp.TSResponse</semanticResources>
476 <semanticResources>java:/Objects/sun.security.util.AbstractAlgorithmConstraints</semanticResources>
477 <semanticResources>java:/Objects/sun.security.util.ConstraintsParameters</semanticResources>
478 <semanticResources>java:/Objects/java.security.cert.CertPathValidatorException</semanticResources>
479 <semanticResources>java:/Objects/java.text.SimpleDateFormat</semanticResources>
480 <semanticResources>java:/Objects/sun.security.util.AlgorithmDecomposer</semanticResources>
481 <semanticResources>java:/Objects/java.security.AlgorithmConstraints</semanticResources>
482 <semanticResources>java:/Objects/java.text.DateFormat</semanticResources>
483 <semanticResources>java:/Objects/java.text.DateFormatSymbols</semanticResources>
484 <semanticResources>java:/Objects/java.text.CalendarBuilder</semanticResources>
485 <semanticResources>java:/Objects/java.text.NumberFormat</semanticResources>
486 <semanticResources>java:/Objects/sun.util.locale.provider.LocaleProviderAdapter</semanticResources>
487 <semanticResources>java:/Objects/java.util.Calendar</semanticResources>
488 <semanticResources>java:/Objects/java.util.spi.LocaleServiceProvider</semanticResources>
489 <semanticResources>java:/Objects/java.text.spi.BreakIteratorProvider</semanticResources>
490 <semanticResources>java:/Objects/java.util.spi.CalendarDataProvider</semanticResources>
491 <semanticResources>java:/Objects/java.util.spi.CalendarNameProvider</semanticResources>
492 <semanticResources>java:/Objects/sun.util.spi.CalendarProvider</semanticResources>
493 <semanticResources>java:/Objects/java.text.spi.CollatorProvider</semanticResources>
494 <semanticResources>java:/Objects/java.util.spi.CurrencyNameProvider</semanticResources>
495 <semanticResources>java:/Objects/java.text.spi.DateFormatProvider</semanticResources>
496 <semanticResources>java:/Objects/java.text.spi.DateFormatSymbolsProvider</semanticResources>
497 <semanticResources>java:/Objects/java.text.spi.DecimalFormatSymbolsProvider</semanticResources>
498 <semanticResources>java:/Objects/java.util.spi.LocaleNameProvider</semanticResources>
499 <semanticResources>java:/Objects/sun.util.locale.provider.LocaleResources</semanticResources>
500 <semanticResources>java:/Objects/java.text.spi.NumberFormatProvider</semanticResources>
501 <semanticResources>java:/Objects/java.util.spi.TimeZoneNameProvider</semanticResources>
502 <semanticResources>java:/Objects/java.text.BreakIterator</semanticResources>
503 <semanticResources>java:/Objects/java.text.Collator</semanticResources>
504 <semanticResources>java:/Objects/java.text.CollationKey</semanticResources>
505 <semanticResources>java:/Objects/java.text.DecimalFormatSymbols</semanticResources>
506 <semanticResources>java:/Objects/java.util.Currency</semanticResources>
507 <semanticResources>java:/Objects/sun.util.locale.provider.LocaleServiceProviderPool</semanticResources>
508 <semanticResources>java:/Objects/java.io.DataInputStream</semanticResources>
509 <semanticResources>java:/Objects/java.util.HashSet</semanticResources>
510 <semanticResources>java:/Objects/sun.util.locale.provider.ResourceBundleBasedAdapter</semanticResources>
511 <semanticResources>java:/Objects/java.util.ResourceBundle</semanticResources>
512 <semanticResources>java:/Objects/sun.util.resources.LocaleData</semanticResources>
513 <semanticResources>java:/Objects/sun.util.locale.LocaleObjectCache</semanticResources>
514 <semanticResources>java:/Objects/sun.util.locale.BaseLocale</semanticResources>
515 <semanticResources>java:/Objects/java.util.spi.ResourceBundleControlProvider</semanticResources>
516 <semanticResources>java:/Objects/sun.util.resources.OpenListResourceBundle</semanticResources>
517 <semanticResources>java:/Objects/sun.util.resources.TimeZoneNamesBundle</semanticResources>
518 <semanticResources>java:/Objects/sun.util.resources.ParallelListResourceBundle</semanticResources>
519 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicMarkableReference</semanticResources>
520 <semanticResources>java:/Objects/java.io.DataOutputStream</semanticResources>
521 <semanticResources>java:/Objects/java.io.FilterOutputStream</semanticResources>
522 <semanticResources>java:/Objects/sun.misc.Resource</semanticResources>
523 <semanticResources>java:/Objects/java.net.URLStreamHandler</semanticResources>
524 <semanticResources>java:/Objects/sun.misc.JarIndex</semanticResources>
525 <semanticResources>java:/Objects/sun.misc.MetaIndex</semanticResources>
526 <semanticResources>java:/Objects/sun.misc.JavaUtilZipFileAccess</semanticResources>
527 <semanticResources>java:/Objects/java.net.URLStreamHandlerFactory</semanticResources>
528 <semanticResources>java:/Objects/java.net.URLConnection</semanticResources>
529 <semanticResources>java:/Objects/java.net.Proxy</semanticResources>
530 <semanticResources>java:/Objects/java.net.UnknownServiceException</semanticResources>
531 <semanticResources>java:/Objects/java.net.ContentHandler</semanticResources>
532 <semanticResources>java:/Objects/java.net.FileNameMap</semanticResources>
533 <semanticResources>java:/Objects/java.net.ContentHandlerFactory</semanticResources>
534 <semanticResources>java:/Objects/sun.net.www.MessageHeader</semanticResources>
535 <semanticResources>java:/Objects/java.net.SocketAddress</semanticResources>
536 <semanticResources>java:/Objects/java.lang.invoke.ForceInline</semanticResources>
537 <semanticResources>java:/Objects/java.lang.invoke.DontInline</semanticResources>
538 <semanticResources>java:/Objects/java.lang.invoke.WrongMethodTypeException</semanticResources>
539 <semanticResources>java:/Objects/sun.invoke.util.Wrapper</semanticResources>
540 <semanticResources>java:/Objects/java.lang.invoke.LambdaFormEditor</semanticResources>
541 <semanticResources>java:/Objects/java.lang.ClassCastException</semanticResources>
542 <semanticResources>java:/Objects/java.lang.invoke.LambdaFormBuffer</semanticResources>
543 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.MethodVisitor</semanticResources>
544 <semanticResources>java:/Objects/java.lang.invoke.MethodHandles</semanticResources>
545 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.AnnotationVisitor</semanticResources>
546 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Attribute</semanticResources>
547 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.TypePath</semanticResources>
548 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Handle</semanticResources>
549 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Label</semanticResources>
550 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassWriter</semanticResources>
551 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ByteVector</semanticResources>
552 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassReader</semanticResources>
553 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassVisitor</semanticResources>
554 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Item</semanticResources>
555 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.FieldVisitor</semanticResources>
556 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.AnnotationWriter</semanticResources>
557 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.FieldWriter</semanticResources>
558 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.MethodWriter</semanticResources>
559 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Frame</semanticResources>
560 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Handler</semanticResources>
561 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Type</semanticResources>
562 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Context</semanticResources>
563 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Edge</semanticResources>
564 <semanticResources>java:/Objects/java.lang.NoSuchMethodException</semanticResources>
565 <semanticResources>java:/Objects/java.lang.NoSuchFieldException</semanticResources>
566 <semanticResources>java:/Objects/java.lang.invoke.DirectMethodHandle</semanticResources>
567 <semanticResources>java:/Objects/java.lang.invoke.MethodHandleInfo</semanticResources>
568 <semanticResources>java:/Objects/java.lang.ClassValue</semanticResources>
569 <semanticResources>java:/Objects/java.util.WeakHashMap</semanticResources>
570 <semanticResources>java:/Objects/java.lang.invoke.DelegatingMethodHandle</semanticResources>
571 <semanticResources>java:/Objects/sun.invoke.empty.Empty</semanticResources>
572 <semanticResources>java:/Objects/java.lang.reflect.Parameter</semanticResources>
573 <semanticResources>java:/Objects/java.lang.reflect.ParameterizedType</semanticResources>
574 <semanticResources>java:/Objects/java.lang.reflect.WildcardType</semanticResources>
575 <semanticResources>java:/Objects/java.util.regex.Matcher</semanticResources>
576 <semanticResources>java:/Objects/java.util.regex.UnicodeProp</semanticResources>
577 <semanticResources>java:/Objects/java.util.regex.PatternSyntaxException</semanticResources>
578 <semanticResources>java:/Objects/java.util.regex.MatchResult</semanticResources>
579 <semanticResources>java:/Objects/java.security.MessageDigestSpi</semanticResources>
580 <semanticResources>java:/Objects/java.security.DigestException</semanticResources>
581 <semanticResources>java:/Objects/java.net.URISyntaxException</semanticResources>
582 <semanticResources>java:/Objects/java.nio.file.Watchable</semanticResources>
583 <semanticResources>java:/Objects/java.nio.file.FileSystem</semanticResources>
584 <semanticResources>java:/Objects/java.nio.file.WatchService</semanticResources>
585 <semanticResources>java:/Objects/java.nio.file.WatchEvent</semanticResources>
586 <semanticResources>java:/Objects/java.nio.file.WatchKey</semanticResources>
587 <semanticResources>java:/Objects/java.nio.file.LinkOption</semanticResources>
588 <semanticResources>java:/Objects/java.nio.file.FileStore</semanticResources>
589 <semanticResources>java:/Objects/java.nio.file.PathMatcher</semanticResources>
590 <semanticResources>java:/Objects/java.nio.file.attribute.UserPrincipalLookupService</semanticResources>
591 <semanticResources>java:/Objects/java.nio.file.spi.FileSystemProvider</semanticResources>
592 <semanticResources>java:/Objects/java.nio.file.attribute.FileStoreAttributeView</semanticResources>
593 <semanticResources>java:/Objects/java.nio.file.attribute.FileAttributeView</semanticResources>
594 <semanticResources>java:/Objects/java.nio.file.attribute.AttributeView</semanticResources>
595 <semanticResources>java:/Objects/java.nio.file.attribute.GroupPrincipal</semanticResources>
596 <semanticResources>java:/Objects/java.nio.file.attribute.UserPrincipal</semanticResources>
597 <semanticResources>java:/Objects/java.nio.file.AccessMode</semanticResources>
598 <semanticResources>java:/Objects/java.nio.file.CopyOption</semanticResources>
599 <semanticResources>java:/Objects/java.nio.file.attribute.FileAttribute</semanticResources>
600 <semanticResources>java:/Objects/java.nio.file.OpenOption</semanticResources>
601 <semanticResources>java:/Objects/java.nio.channels.AsynchronousFileChannel</semanticResources>
602 <semanticResources>java:/Objects/java.nio.channels.SeekableByteChannel</semanticResources>
603 <semanticResources>java:/Objects/java.nio.file.DirectoryStream</semanticResources>
604 <semanticResources>java:/Objects/java.nio.channels.FileChannel</semanticResources>
605 <semanticResources>java:/Objects/java.nio.file.attribute.BasicFileAttributes</semanticResources>
606 <semanticResources>java:/Objects/java.nio.channels.AsynchronousChannel</semanticResources>
607 <semanticResources>java:/Objects/java.nio.channels.FileLock</semanticResources>
608 <semanticResources>java:/Objects/java.nio.channels.CompletionHandler</semanticResources>
609 <semanticResources>java:/Objects/java.nio.channels.Channel</semanticResources>
610 <semanticResources>java:/Objects/java.nio.channels.ByteChannel</semanticResources>
611 <semanticResources>java:/Objects/java.nio.channels.ReadableByteChannel</semanticResources>
612 <semanticResources>java:/Objects/java.nio.channels.WritableByteChannel</semanticResources>
613 <semanticResources>java:/Objects/java.nio.channels.spi.AbstractInterruptibleChannel</semanticResources>
614 <semanticResources>java:/Objects/java.nio.channels.GatheringByteChannel</semanticResources>
615 <semanticResources>java:/Objects/java.nio.channels.ScatteringByteChannel</semanticResources>
616 <semanticResources>java:/Objects/java.nio.MappedByteBuffer</semanticResources>
617 <semanticResources>java:/Objects/java.nio.channels.InterruptibleChannel</semanticResources>
618 <semanticResources>java:/Objects/java.nio.channels.AsynchronousCloseException</semanticResources>
619 <semanticResources>java:/Objects/java.nio.channels.ClosedChannelException</semanticResources>
620 <semanticResources>java:/Objects/java.io.FileDescriptor</semanticResources>
621 <semanticResources>java:/Objects/java.io.SyncFailedException</semanticResources>
622 <semanticResources>java:/Objects/java.lang.SecurityManager</semanticResources>
623 <semanticResources>java:/Objects/java.net.UrlDeserializedState</semanticResources>
624 <semanticResources>java:/Objects/java.nio.charset.spi.CharsetProvider</semanticResources>
625 <semanticResources>java:/Objects/java.util.SortedMap</semanticResources>
626 <semanticResources>java:/Objects/sun.util.locale.InternalLocaleBuilder</semanticResources>
627 <semanticResources>java:/Objects/sun.util.locale.LocaleExtensions</semanticResources>
628 <semanticResources>java:/Objects/java.text.MessageFormat</semanticResources>
629 <semanticResources>java:/Objects/java.util.MissingResourceException</semanticResources>
630 <semanticResources>java:/Objects/sun.util.locale.LocaleSyntaxException</semanticResources>
631 <semanticResources>java:/Objects/sun.util.locale.LanguageTag</semanticResources>
632 <semanticResources>java:/Objects/sun.util.locale.ParseStatus</semanticResources>
633 <semanticResources>java:/Objects/sun.util.locale.StringTokenIterator</semanticResources>
634 <semanticResources>java:/Objects/sun.util.locale.Extension</semanticResources>
635 <semanticResources>java:/Objects/java.io.OutputStreamWriter</semanticResources>
636 <semanticResources>java:/Objects/sun.nio.cs.StreamEncoder</semanticResources>
637 <semanticResources>java:/Objects/java.io.ObjectStreamConstants</semanticResources>
638 <semanticResources>java:/Objects/sun.misc.ObjectInputFilter</semanticResources>
639 <semanticResources>java:/Objects/java.io.ObjectInputValidation</semanticResources>
640 <semanticResources>java:/Objects/java.io.ObjectStreamClass</semanticResources>
641 <semanticResources>java:/Objects/sun.util.logging.PlatformLogger</semanticResources>
642 <semanticResources>java:/Objects/java.io.InvalidClassException</semanticResources>
643 <semanticResources>java:/Objects/java.io.Externalizable</semanticResources>
644 <semanticResources>java:/Objects/sun.misc.ObjectStreamClassValidator</semanticResources>
645 <semanticResources>java:/Objects/java.io.SerialCallbackContext</semanticResources>
646 <semanticResources>java:/Objects/java.io.SerializablePermission</semanticResources>
647 <semanticResources>java:/Objects/sun.reflect.annotation.AnnotationType</semanticResources>
648 <semanticResources>java:/Objects/sun.reflect.ConstantPool</semanticResources>
649 <semanticResources>java:/Objects/sun.reflect.generics.repository.ClassRepository</semanticResources>
650 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IQuerySpecification</semanticResources>
651 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher</semanticResources>
652 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQueryHeader</semanticResources>
653 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery</semanticResources>
654 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngine</semanticResources>
655 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.QueryScope</semanticResources>
656 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation</semanticResources>
657 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter</semanticResources>
658 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility</semanticResources>
659 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IInputKey</semanticResources>
660 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection</semanticResources>
661 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PTraceable</semanticResources>
662 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PDisjunction</semanticResources>
663 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint</semanticResources>
664 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PProblem</semanticResources>
665 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.TypeJudgement</semanticResources>
666 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PBody</semanticResources>
667 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PVariable</semanticResources>
668 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryMetaContext</semanticResources>
669 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint</semanticResources>
670 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter</semanticResources>
671 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.InputKeyImplication</semanticResources>
672 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IPosetComparator</semanticResources>
673 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.Tuple</semanticResources>
674 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple</semanticResources>
675 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.ITuple</semanticResources>
676 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.VariableDeferredPConstraint</semanticResources>
677 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.DeferredPConstraint</semanticResources>
678 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.SubPlan</semanticResources>
679 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.BasePConstraint</semanticResources>
680 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.operations.POperation</semanticResources>
681 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.QueryHintOption</semanticResources>
682 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendFactory</semanticResources>
683 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IMatcherCapability</semanticResources>
684 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryBackendContext</semanticResources>
685 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackend</semanticResources>
686 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendHintProvider</semanticResources>
687 <semanticResources>java:/Objects/org.apache.log4j.Logger</semanticResources>
688 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.analysis.QueryAnalyzer</semanticResources>
689 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryCacheContext</semanticResources>
690 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryResultProviderAccess</semanticResources>
691 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryRuntimeContext</semanticResources>
692 <semanticResources>java:/Objects/org.apache.log4j.Category</semanticResources>
693 <semanticResources>java:/Objects/org.apache.log4j.spi.LoggerFactory</semanticResources>
694 <semanticResources>java:/Objects/org.apache.log4j.spi.AppenderAttachable</semanticResources>
695 <semanticResources>java:/Objects/org.apache.log4j.Appender</semanticResources>
696 <semanticResources>java:/Objects/org.apache.log4j.spi.LoggingEvent</semanticResources>
697 <semanticResources>java:/Objects/org.apache.log4j.Priority</semanticResources>
698 <semanticResources>java:/Objects/org.apache.log4j.spi.LoggerRepository</semanticResources>
699 <semanticResources>java:/Objects/org.apache.log4j.Level</semanticResources>
700 <semanticResources>java:/Objects/org.apache.log4j.helpers.AppenderAttachableImpl</semanticResources>
701 <semanticResources>java:/Objects/org.apache.log4j.spi.Filter</semanticResources>
702 <semanticResources>java:/Objects/org.apache.log4j.spi.ErrorHandler</semanticResources>
703 <semanticResources>java:/Objects/org.apache.log4j.Layout</semanticResources>
704 <semanticResources>java:/Objects/org.apache.log4j.spi.OptionHandler</semanticResources>
705 <semanticResources>java:/Objects/org.apache.log4j.spi.ThrowableInformation</semanticResources>
706 <semanticResources>java:/Objects/org.apache.log4j.spi.LocationInfo</semanticResources>
707 <semanticResources>java:/Objects/java.io.StringWriter</semanticResources>
708 <semanticResources>java:/Objects/org.apache.log4j.spi.HierarchyEventListener</semanticResources>
709 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryResultProvider</semanticResources>
710 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IUpdateable</semanticResources>
711 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.TupleMask</semanticResources>
712 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.util.Accuracy</semanticResources>
713 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.IModifiableTuple</semanticResources>
714 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryRuntimeContextListener</semanticResources>
715 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IndexingService</semanticResources>
716 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.QueryProcessingException</semanticResources>
717 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.ViatraQueryRuntimeException</semanticResources>
718 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IBaseIndex</semanticResources>
719 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions</semanticResources>
720 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.ViatraBaseIndexChangeListener</semanticResources>
721 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IIndexingErrorListener</semanticResources>
722 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IInstanceObserver</semanticResources>
723 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.internal.apiimpl.EngineContextFactory</semanticResources>
724 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IEngineContext</semanticResources>
725 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseMatcher</semanticResources>
726 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.internal.apiimpl.QueryResultWrapper</semanticResources>
727 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification</semanticResources>
728 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification</semanticResources>
729 <semanticResources>java:/Objects/java.lang.ExceptionInInitializerError</semanticResources>
730 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.exception.ViatraQueryException</semanticResources>
731 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException</semanticResources>
732 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup</semanticResources>
733 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseQueryGroup</semanticResources>
734 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IQueryGroup</semanticResources>
735 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.AdvancedViatraQueryEngine</semanticResources>
736 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngineLifecycleListener</semanticResources>
737 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IMatchUpdateListener</semanticResources>
738 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryModelUpdateListener</semanticResources>
739 <semanticResources>java:/Objects/java.lang.Override</semanticResources>
740 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery</semanticResources>
741 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.BasePQuery</semanticResources>
742 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EClassifier</semanticResources>
743 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EEnumLiteral</semanticResources>
744 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EStructuralFeature</semanticResources>
745 <semanticResources>java:/Objects/org.eclipse.emf.ecore.ENamedElement</semanticResources>
746 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EPackage</semanticResources>
747 <semanticResources>java:/Objects/org.eclipse.emf.common.util.EList</semanticResources>
748 <semanticResources>java:/Objects/org.eclipse.emf.ecore.ETypeParameter</semanticResources>
749 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EModelElement</semanticResources>
750 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EObject</semanticResources>
751 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EAnnotation</semanticResources>
752 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Notifier</semanticResources>
753 <semanticResources>java:/Objects/org.eclipse.emf.common.util.TreeIterator</semanticResources>
754 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EClass</semanticResources>
755 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EReference</semanticResources>
756 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EOperation</semanticResources>
757 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.Resource</semanticResources>
758 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Adapter</semanticResources>
759 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Notification</semanticResources>
760 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EAttribute</semanticResources>
761 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EGenericType</semanticResources>
762 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EDataType</semanticResources>
763 <semanticResources>java:/Objects/org.eclipse.emf.ecore.InternalEObject</semanticResources>
764 <semanticResources>java:/Objects/org.eclipse.emf.common.CommonPlugin</semanticResources>
765 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.NotificationChain</semanticResources>
766 <semanticResources>java:/Objects/org.eclipse.emf.common.util.URI</semanticResources>
767 <semanticResources>java:/Objects/org.eclipse.emf.common.util.Pool</semanticResources>
768 <semanticResources>java:/Objects/org.eclipse.emf.common.util.SegmentSequence</semanticResources>
769 <semanticResources>java:/Objects/org.eclipse.emf.common.util.CommonUtil</semanticResources>
770 <semanticResources>java:/Objects/org.eclipse.emf.common.util.WeakInterningHashSet</semanticResources>
771 <semanticResources>java:/Objects/java.util.concurrent.locks.ReentrantReadWriteLock</semanticResources>
772 <semanticResources>java:/Objects/org.eclipse.emf.common.util.InterningSet</semanticResources>
773 <semanticResources>java:/Objects/java.util.concurrent.locks.ReadWriteLock</semanticResources>
774 <semanticResources>java:/Objects/java.lang.IllegalMonitorStateException</semanticResources>
775 <semanticResources>java:/Objects/org.eclipse.emf.common.EMFPlugin</semanticResources>
776 <semanticResources>java:/Objects/org.osgi.framework.BundleActivator</semanticResources>
777 <semanticResources>java:/Objects/org.eclipse.emf.common.util.ResourceLocator</semanticResources>
778 <semanticResources>java:/Objects/org.eclipse.emf.common.util.DelegatingResourceLocator</semanticResources>
779 <semanticResources>java:/Objects/org.eclipse.emf.common.util.Logger</semanticResources>
780 <semanticResources>java:/Objects/org.eclipse.core.runtime.Plugin</semanticResources>
781 <semanticResources>java:/Objects/org.eclipse.core.runtime.IPluginDescriptor</semanticResources>
782 <semanticResources>java:/Objects/org.osgi.framework.Bundle</semanticResources>
783 <semanticResources>java:/Objects/org.eclipse.core.runtime.ILog</semanticResources>
784 <semanticResources>java:/Objects/org.osgi.framework.BundleContext</semanticResources>
785 <semanticResources>java:/Objects/org.eclipse.core.runtime.IPath</semanticResources>
786 <semanticResources>java:/Objects/org.eclipse.osgi.service.debug.DebugOptions</semanticResources>
787 <semanticResources>java:/Objects/org.eclipse.core.runtime.Preferences</semanticResources>
788 <semanticResources>java:/Objects/java.lang.IllegalStateException</semanticResources>
789 <semanticResources>java:/Objects/org.eclipse.core.runtime.CoreException</semanticResources>
790 <semanticResources>java:/Objects/org.osgi.util.tracker.ServiceTracker</semanticResources>
791 <semanticResources>java:/Objects/org.eclipse.osgi.service.debug.DebugTrace</semanticResources>
792 <semanticResources>java:/Objects/java.util.EventListener</semanticResources>
793 <semanticResources>java:/Objects/java.util.EventObject</semanticResources>
794 <semanticResources>java:/Objects/org.eclipse.core.runtime.IStatus</semanticResources>
795 <semanticResources>java:/Objects/org.eclipse.core.runtime.ListenerList</semanticResources>
796 <semanticResources>java:/Objects/org.osgi.util.tracker.ServiceTrackerCustomizer</semanticResources>
797 <semanticResources>java:/Objects/org.osgi.framework.AllServiceListener</semanticResources>
798 <semanticResources>java:/Objects/org.osgi.util.tracker.AbstractTracked</semanticResources>
799 <semanticResources>java:/Objects/org.osgi.framework.ServiceReference</semanticResources>
800 <semanticResources>java:/Objects/org.osgi.framework.ServiceEvent</semanticResources>
801 <semanticResources>java:/Objects/org.osgi.framework.ServiceListener</semanticResources>
802 <semanticResources>java:/Objects/org.osgi.framework.Filter</semanticResources>
803 <semanticResources>java:/Objects/org.osgi.framework.InvalidSyntaxException</semanticResources>
804 <semanticResources>java:/Objects/org.eclipse.core.runtime.IExtension</semanticResources>
805 <semanticResources>java:/Objects/org.eclipse.core.runtime.IExtensionPoint</semanticResources>
806 <semanticResources>java:/Objects/org.eclipse.core.runtime.IPluginPrerequisite</semanticResources>
807 <semanticResources>java:/Objects/org.eclipse.core.runtime.ILibrary</semanticResources>
808 <semanticResources>java:/Objects/org.eclipse.core.runtime.PluginVersionIdentifier</semanticResources>
809 <semanticResources>java:/Objects/org.eclipse.core.runtime.InvalidRegistryObjectException</semanticResources>
810 <semanticResources>java:/Objects/org.eclipse.core.runtime.IConfigurationElement</semanticResources>
811 <semanticResources>java:/Objects/org.eclipse.core.runtime.IContributor</semanticResources>
812 <semanticResources>java:/Objects/org.osgi.framework.Version</semanticResources>
813 <semanticResources>java:/Objects/org.osgi.framework.BundleException</semanticResources>
814 <semanticResources>java:/Objects/org.eclipse.core.runtime.ILogListener</semanticResources>
815 <semanticResources>java:/Objects/org.osgi.framework.BundleReference</semanticResources>
816 <semanticResources>java:/Objects/org.osgi.framework.BundleListener</semanticResources>
817 <semanticResources>java:/Objects/org.osgi.framework.FrameworkListener</semanticResources>
818 <semanticResources>java:/Objects/org.osgi.framework.ServiceObjects</semanticResources>
819 <semanticResources>java:/Objects/org.osgi.framework.ServiceRegistration</semanticResources>
820 <semanticResources>java:/Objects/org.osgi.framework.ServiceFactory</semanticResources>
821 <semanticResources>java:/Objects/org.osgi.framework.BundleEvent</semanticResources>
822 <semanticResources>java:/Objects/org.osgi.framework.FrameworkEvent</semanticResources>
823 <semanticResources>java:/Objects/org.eclipse.emf.ecore.ETypedElement</semanticResources>
824 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EParameter</semanticResources>
825 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.ResourceSet</semanticResources>
826 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.AdapterFactory</semanticResources>
827 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.URIConverter</semanticResources>
828 <semanticResources>java:/Objects/java.io.InputStreamReader</semanticResources>
829 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.ContentHandler</semanticResources>
830 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.URIHandler</semanticResources>
831 <semanticResources>java:/Objects/sun.nio.cs.StreamDecoder</semanticResources>
832 <semanticResources>java:/Objects/java.io.FileInputStream</semanticResources>
833 <semanticResources>java:/Objects/org.eclipse.emf.common.util.EMap</semanticResources>
834 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EFactory</semanticResources>
835 <semanticResources>java:/Objects/org.eclipse.emf.common.util.Enumerator</semanticResources>
836 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EEnum</semanticResources>
837 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.FeatureMap</semanticResources>
838 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.InternalEList</semanticResources>
839 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.EContentsEList</semanticResources>
840 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.AbstractSequentialInternalEList</semanticResources>
841 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem</semanticResources>
842 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType</semanticResources>
843 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance</semanticResources>
844 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.HostType</semanticResources>
845 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance</semanticResources>
846 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.Request</semanticResources>
847 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement</semanticResources>
848 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.Requirement</semanticResources>
849 <semanticResources>java:/Objects/java.lang.SuppressWarnings</semanticResources>
850 <semanticResources>java:/Objects/javax.annotation.Generated</semanticResources>
851 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.GenericPatternMatcher</semanticResources>
852 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.GenericPatternMatch</semanticResources>
853 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.GenericQuerySpecification</semanticResources>
854 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher</semanticResources>
855 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.aggregators.sum</semanticResources>
856 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.AggregatorType</semanticResources>
857 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.IAggregatorFactory</semanticResources>
858 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.BoundAggregator</semanticResources>
859 <semanticResources>java:/Objects/java.lang.annotation.Inherited</semanticResources>
860 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.IMultisetAggregationOperator</semanticResources>
861 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ArrayLiterals</semanticResources>
862 <semanticResources>java:/Objects/com.google.common.annotations.GwtCompatible</semanticResources>
863 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Pure</semanticResources>
864 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Inline</semanticResources>
865 <semanticResources>java:/Objects/com.google.common.annotations.Beta</semanticResources>
866 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CollectionLiterals</semanticResources>
867 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Pair</semanticResources>
868 <semanticResources>java:/Objects/java.util.LinkedHashSet</semanticResources>
869 <semanticResources>java:/Objects/java.util.TreeMap</semanticResources>
870 <semanticResources>java:/Objects/java.util.TreeSet</semanticResources>
871 <semanticResources>java:/Objects/java.util.NavigableMap</semanticResources>
872 <semanticResources>java:/Objects/java.util.NavigableSet</semanticResources>
873 <semanticResources>java:/Objects/java.util.SortedSet</semanticResources>
874 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.InputOutput</semanticResources>
875 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ArrayExtensions</semanticResources>
876 <semanticResources>java:/Objects/com.google.common.annotations.GwtIncompatible</semanticResources>
877 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BigDecimalExtensions</semanticResources>
878 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BigIntegerExtensions</semanticResources>
879 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BooleanExtensions</semanticResources>
880 <semanticResources>java:/Objects/com.google.common.primitives.Booleans</semanticResources>
881 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ByteExtensions</semanticResources>
882 <semanticResources>java:/Objects/java.lang.Math</semanticResources>
883 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CharacterExtensions</semanticResources>
884 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CollectionExtensions</semanticResources>
885 <semanticResources>java:/Objects/com.google.common.collect.Iterables</semanticResources>
886 <semanticResources>java:/Objects/com.google.common.collect.ImmutableList</semanticResources>
887 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSet</semanticResources>
888 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedSet</semanticResources>
889 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMap</semanticResources>
890 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedMap</semanticResources>
891 <semanticResources>java:/Objects/java.util.Collections</semanticResources>
892 <semanticResources>java:/Objects/com.google.common.collect.FluentIterable</semanticResources>
893 <semanticResources>java:/Objects/com.google.common.base.Predicate</semanticResources>
894 <semanticResources>java:/Objects/com.google.common.base.Function</semanticResources>
895 <semanticResources>java:/Objects/com.google.common.base.Optional</semanticResources>
896 <semanticResources>java:/Objects/com.google.common.collect.ImmutableCollection</semanticResources>
897 <semanticResources>java:/Objects/com.google.common.collect.ImmutableListMultimap</semanticResources>
898 <semanticResources>java:/Objects/com.google.common.base.Joiner</semanticResources>
899 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMultiset</semanticResources>
900 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMultimap</semanticResources>
901 <semanticResources>java:/Objects/com.google.common.collect.ListMultimap</semanticResources>
902 <semanticResources>java:/Objects/com.google.common.collect.Multimap</semanticResources>
903 <semanticResources>java:/Objects/com.google.common.collect.AbstractMultimap</semanticResources>
904 <semanticResources>java:/Objects/com.google.common.collect.UnmodifiableIterator</semanticResources>
905 <semanticResources>java:/Objects/com.google.common.collect.Serialization</semanticResources>
906 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSetMultimap</semanticResources>
907 <semanticResources>java:/Objects/com.google.common.collect.Multiset</semanticResources>
908 <semanticResources>java:/Objects/com.google.common.collect.Multimaps</semanticResources>
909 <semanticResources>java:/Objects/com.google.common.collect.Maps</semanticResources>
910 <semanticResources>java:/Objects/com.google.common.collect.AbstractListMultimap</semanticResources>
911 <semanticResources>java:/Objects/com.google.common.base.Supplier</semanticResources>
912 <semanticResources>java:/Objects/com.google.common.collect.AbstractMapBasedMultimap</semanticResources>
913 <semanticResources>java:/Objects/com.google.common.collect.AbstractSetMultimap</semanticResources>
914 <semanticResources>java:/Objects/com.google.common.collect.AbstractSortedSetMultimap</semanticResources>
915 <semanticResources>java:/Objects/com.google.common.collect.AbstractMultiset</semanticResources>
916 <semanticResources>java:/Objects/com.google.common.collect.Multisets</semanticResources>
917 <semanticResources>java:/Objects/com.google.common.collect.SetMultimap</semanticResources>
918 <semanticResources>java:/Objects/com.google.common.collect.ForwardingMultimap</semanticResources>
919 <semanticResources>java:/Objects/com.google.common.collect.SortedSetMultimap</semanticResources>
920 <semanticResources>java:/Objects/com.google.common.collect.FilteredMultimap</semanticResources>
921 <semanticResources>java:/Objects/com.google.common.collect.FilteredSetMultimap</semanticResources>
922 <semanticResources>java:/Objects/java.util.EnumMap</semanticResources>
923 <semanticResources>java:/Objects/com.google.common.base.Converter</semanticResources>
924 <semanticResources>java:/Objects/com.google.common.collect.BiMap</semanticResources>
925 <semanticResources>java:/Objects/com.google.common.collect.ForwardingMap</semanticResources>
926 <semanticResources>java:/Objects/com.google.common.collect.Ordering</semanticResources>
927 <semanticResources>java:/Objects/com.google.common.collect.Sets</semanticResources>
928 <semanticResources>java:/Objects/com.google.common.collect.ForwardingSet</semanticResources>
929 <semanticResources>java:/Objects/com.google.common.collect.AbstractNavigableMap</semanticResources>
930 <semanticResources>java:/Objects/com.google.common.collect.MapDifference</semanticResources>
931 <semanticResources>java:/Objects/com.google.common.collect.SortedMapDifference</semanticResources>
932 <semanticResources>java:/Objects/com.google.common.collect.ForwardingCollection</semanticResources>
933 <semanticResources>java:/Objects/com.google.common.collect.ForwardingSortedMap</semanticResources>
934 <semanticResources>java:/Objects/com.google.common.base.Equivalence</semanticResources>
935 <semanticResources>java:/Objects/java.util.IdentityHashMap</semanticResources>
936 <semanticResources>java:/Objects/com.google.common.collect.Range</semanticResources>
937 <semanticResources>java:/Objects/com.google.common.collect.ForwardingObject</semanticResources>
938 <semanticResources>java:/Objects/com.google.common.annotations.VisibleForTesting</semanticResources>
939 <semanticResources>java:/Objects/java.util.EnumSet</semanticResources>
940 <semanticResources>java:/Objects/com.google.common.collect.CartesianList</semanticResources>
941 <semanticResources>java:/Objects/com.google.common.collect.ForwardingNavigableSet</semanticResources>
942 <semanticResources>java:/Objects/com.google.common.collect.Collections2</semanticResources>
943 <semanticResources>java:/Objects/com.google.common.collect.ForwardingSortedSet</semanticResources>
944 <semanticResources>java:/Objects/java.util.concurrent.CopyOnWriteArraySet</semanticResources>
945 <semanticResources>java:/Objects/com.google.common.collect.AbstractIterator</semanticResources>
946 <semanticResources>java:/Objects/java.util.concurrent.CopyOnWriteArrayList</semanticResources>
947 <semanticResources>java:/Objects/java.util.function.BiPredicate</semanticResources>
948 <semanticResources>java:/Objects/com.google.common.collect.Cut</semanticResources>
949 <semanticResources>java:/Objects/com.google.common.collect.DiscreteDomain</semanticResources>
950 <semanticResources>java:/Objects/com.google.common.collect.BoundType</semanticResources>
951 <semanticResources>java:/Objects/com.google.common.collect.ForwardingMultiset</semanticResources>
952 <semanticResources>java:/Objects/com.google.common.collect.SortedMultiset</semanticResources>
953 <semanticResources>java:/Objects/com.google.common.collect.SortedMultisetBridge</semanticResources>
954 <semanticResources>java:/Objects/com.google.common.collect.SortedIterable</semanticResources>
955 <semanticResources>java:/Objects/com.google.common.collect.UnmodifiableListIterator</semanticResources>
956 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedSetFauxverideShim</semanticResources>
957 <semanticResources>java:/Objects/com.google.common.collect.RegularImmutableSortedSet</semanticResources>
958 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMapEntry</semanticResources>
959 <semanticResources>java:/Objects/com.google.common.collect.ImmutableEntry</semanticResources>
960 <semanticResources>java:/Objects/com.google.common.collect.AbstractMapEntry</semanticResources>
961 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedMapFauxverideShim</semanticResources>
962 <semanticResources>java:/Objects/java.util.AbstractQueue</semanticResources>
963 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ComparableExtensions</semanticResources>
964 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.DoubleExtensions</semanticResources>
965 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.FloatExtensions</semanticResources>
966 <semanticResources>java:/Objects/java.lang.Float</semanticResources>
967 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.FunctionExtensions</semanticResources>
968 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Functions</semanticResources>
969 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Procedures</semanticResources>
970 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IntegerExtensions</semanticResources>
971 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ExclusiveRange</semanticResources>
972 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IntegerRange</semanticResources>
973 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IterableExtensions</semanticResources>
974 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IteratorExtensions</semanticResources>
975 <semanticResources>java:/Objects/com.google.common.collect.Iterators</semanticResources>
976 <semanticResources>java:/Objects/com.google.common.collect.MultitransformedIterator</semanticResources>
977 <semanticResources>java:/Objects/com.google.common.collect.PeekingIterator</semanticResources>
978 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ListExtensions</semanticResources>
979 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.LongExtensions</semanticResources>
980 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.MapExtensions</semanticResources>
981 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.internal.UnmodifiableMergingMapView</semanticResources>
982 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ObjectExtensions</semanticResources>
983 <semanticResources>java:/Objects/com.google.common.base.Objects</semanticResources>
984 <semanticResources>java:/Objects/com.google.common.base.ExtraObjectsMethodsForWeb</semanticResources>
985 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ProcedureExtensions</semanticResources>
986 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ShortExtensions</semanticResources>
987 <semanticResources>java:/Objects/java.lang.Short</semanticResources>
988 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.StringExtensions</semanticResources>
989 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.aggregators.count</semanticResources>
990 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.aggregators.avg</semanticResources>
6 <ownedViews xmi:type="viewpoint:DView" uid="_kSYZgFvMEemLJtrAOuDPFQ"> 991 <ownedViews xmi:type="viewpoint:DView" uid="_kSYZgFvMEemLJtrAOuDPFQ">
7 <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> 992 <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/>
8 <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_kTNf8FvMEemLJtrAOuDPFQ" name="cps" repPath="#_kSw0AFvMEemLJtrAOuDPFQ"> 993 <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_kTNf8FvMEemLJtrAOuDPFQ" name="cps" repPath="#_kSw0AFvMEemLJtrAOuDPFQ">
@@ -62,6 +1047,17 @@
62 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> 1047 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
63 </endLabelStyleDescription> 1048 </endLabelStyleDescription>
64 </computedStyleDescriptions> 1049 </computedStyleDescriptions>
1050 <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_5GJwsHcmEemo29BzW_RHcw" sourceArrow="InputArrow" routingStyle="manhattan">
1051 <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1052 <beginLabelStyleDescription xmi:type="style:BeginLabelStyleDescription" xmi:id="_5GJwsXcmEemo29BzW_RHcw" showIcon="false" labelExpression="service:renderEOpposite">
1053 <labelFormat>bold</labelFormat>
1054 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1055 </beginLabelStyleDescription>
1056 <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_5GJwsncmEemo29BzW_RHcw" showIcon="false" labelExpression="service:render">
1057 <labelFormat>bold</labelFormat>
1058 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1059 </endLabelStyleDescription>
1060 </computedStyleDescriptions>
65 </data> 1061 </data>
66 </ownedAnnotationEntries> 1062 </ownedAnnotationEntries>
67 <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_kTOHAFvMEemLJtrAOuDPFQ" source="GMF_DIAGRAMS"> 1063 <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_kTOHAFvMEemLJtrAOuDPFQ" source="GMF_DIAGRAMS">
@@ -95,6 +1091,10 @@
95 <styles xmi:type="notation:FontStyle" xmi:id="_bL_qgVvREemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/> 1091 <styles xmi:type="notation:FontStyle" xmi:id="_bL_qgVvREemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
96 <layoutConstraint xmi:type="notation:Location" xmi:id="_bL_qglvREemLJtrAOuDPFQ"/> 1092 <layoutConstraint xmi:type="notation:Location" xmi:id="_bL_qglvREemLJtrAOuDPFQ"/>
97 </children> 1093 </children>
1094 <children xmi:type="notation:Node" xmi:id="_4TdfwHc3Eemo29BzW_RHcw" type="3010" element="_4TQEYHc3Eemo29BzW_RHcw">
1095 <styles xmi:type="notation:FontStyle" xmi:id="_4TdfwXc3Eemo29BzW_RHcw" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1096 <layoutConstraint xmi:type="notation:Location" xmi:id="_4Tdfwnc3Eemo29BzW_RHcw"/>
1097 </children>
98 <styles xmi:type="notation:SortingStyle" xmi:id="_FZ-QAVvOEemLJtrAOuDPFQ"/> 1098 <styles xmi:type="notation:SortingStyle" xmi:id="_FZ-QAVvOEemLJtrAOuDPFQ"/>
99 <styles xmi:type="notation:FilteringStyle" xmi:id="_FZ-QAlvOEemLJtrAOuDPFQ"/> 1099 <styles xmi:type="notation:FilteringStyle" xmi:id="_FZ-QAlvOEemLJtrAOuDPFQ"/>
100 </children> 1100 </children>
@@ -383,70 +1383,6 @@
383 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TAtKclvZEemLJtrAOuDPFQ" id="(0.0,0.6122448979591837)"/> 1383 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TAtKclvZEemLJtrAOuDPFQ" id="(0.0,0.6122448979591837)"/>
384 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TAtKc1vZEemLJtrAOuDPFQ" id="(0.39705882352941174,0.0)"/> 1384 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TAtKc1vZEemLJtrAOuDPFQ" id="(0.39705882352941174,0.0)"/>
385 </edges> 1385 </edges>
386 <edges xmi:type="notation:Edge" xmi:id="_sSYbUFvfEemLJtrAOuDPFQ" type="4001" element="_sSGHdlvfEemLJtrAOuDPFQ" source="_8icOoFvNEemLJtrAOuDPFQ" target="_8icOoFvNEemLJtrAOuDPFQ">
387 <children xmi:type="notation:Node" xmi:id="_sSYbVFvfEemLJtrAOuDPFQ" type="6001">
388 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_sSYbVVvfEemLJtrAOuDPFQ" x="22" y="-22"/>
389 </children>
390 <children xmi:type="notation:Node" xmi:id="_sSYbVlvfEemLJtrAOuDPFQ" type="6002">
391 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_sSYbV1vfEemLJtrAOuDPFQ" x="-13" y="19"/>
392 </children>
393 <children xmi:type="notation:Node" xmi:id="_sSYbWFvfEemLJtrAOuDPFQ" type="6003">
394 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_sSYbWVvfEemLJtrAOuDPFQ" x="11" y="7"/>
395 </children>
396 <styles xmi:type="notation:ConnectorStyle" xmi:id="_sSYbUVvfEemLJtrAOuDPFQ" routing="Rectilinear" lineColor="1345869"/>
397 <styles xmi:type="notation:FontStyle" xmi:id="_sSYbUlvfEemLJtrAOuDPFQ" fontColor="1345869" fontName="Noto Sans" fontHeight="8"/>
398 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_sSYbU1vfEemLJtrAOuDPFQ" points="[-118, 0, -39, 15]$[-148, 0, -69, 15]$[-148, -60, -69, -45]$[-60, -60, 19, -45]$[-60, -15, 19, 0]"/>
399 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_sSZCYFvfEemLJtrAOuDPFQ" id="(1.0,0.15306122448979592)"/>
400 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_sSZCYVvfEemLJtrAOuDPFQ" id="(0.3333333333333333,0.0)"/>
401 </edges>
402 <edges xmi:type="notation:Edge" xmi:id="_D2rzIFvgEemLJtrAOuDPFQ" type="4001" element="_D2lspFvgEemLJtrAOuDPFQ" source="_vI6r8FvREemLJtrAOuDPFQ" target="_vI6r8FvREemLJtrAOuDPFQ">
403 <children xmi:type="notation:Node" xmi:id="_D2saMFvgEemLJtrAOuDPFQ" type="6001">
404 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D2saMVvgEemLJtrAOuDPFQ" x="101" y="-7"/>
405 </children>
406 <children xmi:type="notation:Node" xmi:id="_D2saMlvgEemLJtrAOuDPFQ" type="6002">
407 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D2saM1vgEemLJtrAOuDPFQ" x="-7" y="10"/>
408 </children>
409 <children xmi:type="notation:Node" xmi:id="_D2saNFvgEemLJtrAOuDPFQ" type="6003">
410 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_D2saNVvgEemLJtrAOuDPFQ" x="7" y="10"/>
411 </children>
412 <styles xmi:type="notation:ConnectorStyle" xmi:id="_D2rzIVvgEemLJtrAOuDPFQ" routing="Rectilinear" lineColor="1345869"/>
413 <styles xmi:type="notation:FontStyle" xmi:id="_D2rzIlvgEemLJtrAOuDPFQ" fontColor="1345869" fontName="Noto Sans" fontHeight="8"/>
414 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_D2rzI1vgEemLJtrAOuDPFQ" points="[0, 98, -60, 0]$[0, 135, -60, 37]$[90, 135, 30, 37]$[90, 98, 30, 0]"/>
415 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_D2saNlvgEemLJtrAOuDPFQ" id="(0.17647058823529413,0.0)"/>
416 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_D2saN1vgEemLJtrAOuDPFQ" id="(0.6176470588235294,1.0)"/>
417 </edges>
418 <edges xmi:type="notation:Edge" xmi:id="_rSkHoFvgEemLJtrAOuDPFQ" type="4001" element="_rSSa1lvgEemLJtrAOuDPFQ" source="_FZ9o8FvOEemLJtrAOuDPFQ" target="_FZ9o8FvOEemLJtrAOuDPFQ">
419 <children xmi:type="notation:Node" xmi:id="_rSkHpFvgEemLJtrAOuDPFQ" type="6001">
420 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_rSkHpVvgEemLJtrAOuDPFQ" x="1" y="22"/>
421 </children>
422 <children xmi:type="notation:Node" xmi:id="_rSkHplvgEemLJtrAOuDPFQ" type="6002">
423 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_rSkHp1vgEemLJtrAOuDPFQ" x="-10"/>
424 </children>
425 <children xmi:type="notation:Node" xmi:id="_rSkHqFvgEemLJtrAOuDPFQ" type="6003">
426 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_rSkHqVvgEemLJtrAOuDPFQ" x="-9" y="-10"/>
427 </children>
428 <styles xmi:type="notation:ConnectorStyle" xmi:id="_rSkHoVvgEemLJtrAOuDPFQ" routing="Rectilinear" lineColor="1345869"/>
429 <styles xmi:type="notation:FontStyle" xmi:id="_rSkHolvgEemLJtrAOuDPFQ" fontColor="1345869" fontName="Noto Sans" fontHeight="8"/>
430 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_rSkHo1vgEemLJtrAOuDPFQ" points="[135, -15, -16, -15]$[135, -60, -16, -60]$[60, -60, -91, -60]$[60, -15, -91, -15]"/>
431 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_rSkusFvgEemLJtrAOuDPFQ" id="(0.0,0.15306122448979592)"/>
432 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_rSkusVvgEemLJtrAOuDPFQ" id="(1.0,0.15306122448979592)"/>
433 </edges>
434 <edges xmi:type="notation:Edge" xmi:id="_xXkXAFvgEemLJtrAOuDPFQ" type="4001" element="_xXdpelvgEemLJtrAOuDPFQ" source="_UoYsMFvUEemLJtrAOuDPFQ" target="_UoYsMFvUEemLJtrAOuDPFQ">
435 <children xmi:type="notation:Node" xmi:id="_xXkXBFvgEemLJtrAOuDPFQ" type="6001">
436 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xXkXBVvgEemLJtrAOuDPFQ" x="-104" y="-7"/>
437 </children>
438 <children xmi:type="notation:Node" xmi:id="_xXkXBlvgEemLJtrAOuDPFQ" type="6002">
439 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xXkXB1vgEemLJtrAOuDPFQ" x="1" y="8"/>
440 </children>
441 <children xmi:type="notation:Node" xmi:id="_xXk-EFvgEemLJtrAOuDPFQ" type="6003">
442 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_xXk-EVvgEemLJtrAOuDPFQ" x="-2" y="10"/>
443 </children>
444 <styles xmi:type="notation:ConnectorStyle" xmi:id="_xXkXAVvgEemLJtrAOuDPFQ" routing="Rectilinear" lineColor="1345869"/>
445 <styles xmi:type="notation:FontStyle" xmi:id="_xXkXAlvgEemLJtrAOuDPFQ" fontColor="1345869" fontName="Noto Sans" fontHeight="8"/>
446 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_xXkXA1vgEemLJtrAOuDPFQ" points="[-121, 83, 30, 83]$[-121, 120, 30, 120]$[-31, 120, 120, 120]$[-31, 83, 120, 83]"/>
447 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_xXk-ElvgEemLJtrAOuDPFQ" id="(1.0,0.15306122448979592)"/>
448 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_xXk-E1vgEemLJtrAOuDPFQ" id="(0.0,0.15306122448979592)"/>
449 </edges>
450 </data> 1386 </data>
451 </ownedAnnotationEntries> 1387 </ownedAnnotationEntries>
452 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_Itg50FvNEemLJtrAOuDPFQ" name="CyberPhysicalSystem" tooltipText="" outgoingEdges="_CU3uAFvTEemLJtrAOuDPFQ _ECuvRlvZEemLJtrAOuDPFQ _HQRCT1vZEemLJtrAOuDPFQ _Lr45GFvZEemLJtrAOuDPFQ _TAeg9lvZEemLJtrAOuDPFQ" width="12" height="10"> 1388 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_Itg50FvNEemLJtrAOuDPFQ" name="CyberPhysicalSystem" tooltipText="" outgoingEdges="_CU3uAFvTEemLJtrAOuDPFQ _ECuvRlvZEemLJtrAOuDPFQ _HQRCT1vZEemLJtrAOuDPFQ _Lr45GFvZEemLJtrAOuDPFQ _TAeg9lvZEemLJtrAOuDPFQ" width="12" height="10">
@@ -460,7 +1396,7 @@
460 </ownedStyle> 1396 </ownedStyle>
461 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> 1397 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
462 </ownedDiagramElements> 1398 </ownedDiagramElements>
463 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_8iM-EFvNEemLJtrAOuDPFQ" name="ApplicationType" tooltipText="" outgoingEdges="_jGSVo1vTEemLJtrAOuDPFQ _GOOItlvUEemLJtrAOuDPFQ _sSGHdlvfEemLJtrAOuDPFQ" incomingEdges="_Xc3bc1vTEemLJtrAOuDPFQ _ECuvRlvZEemLJtrAOuDPFQ _sSGHdlvfEemLJtrAOuDPFQ" width="12" height="10"> 1399 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_8iM-EFvNEemLJtrAOuDPFQ" name="ApplicationType" tooltipText="" outgoingEdges="_jGSVo1vTEemLJtrAOuDPFQ _GOOItlvUEemLJtrAOuDPFQ" incomingEdges="_Xc3bc1vTEemLJtrAOuDPFQ _ECuvRlvZEemLJtrAOuDPFQ" width="12" height="10">
464 <target xmi:type="ecore:EClass" href="cps.ecore#//ApplicationType"/> 1400 <target xmi:type="ecore:EClass" href="cps.ecore#//ApplicationType"/>
465 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//ApplicationType"/> 1401 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//ApplicationType"/>
466 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> 1402 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
@@ -471,13 +1407,13 @@
471 </ownedStyle> 1407 </ownedStyle>
472 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> 1408 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
473 </ownedDiagramElements> 1409 </ownedDiagramElements>
474 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_FZ1GEFvOEemLJtrAOuDPFQ" name="HostType" tooltipText="" outgoingEdges="_YawKkFvUEemLJtrAOuDPFQ _rSSa1lvgEemLJtrAOuDPFQ" incomingEdges="_OKZ8IFvUEemLJtrAOuDPFQ _HQRCT1vZEemLJtrAOuDPFQ _rSSa1lvgEemLJtrAOuDPFQ" width="12" height="10"> 1410 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_FZ1GEFvOEemLJtrAOuDPFQ" name="HostType" tooltipText="" outgoingEdges="_YawKkFvUEemLJtrAOuDPFQ" incomingEdges="_OKZ8IFvUEemLJtrAOuDPFQ _HQRCT1vZEemLJtrAOuDPFQ" width="12" height="10">
475 <target xmi:type="ecore:EClass" href="cps.ecore#//HostType"/> 1411 <target xmi:type="ecore:EClass" href="cps.ecore#//HostType"/>
476 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//HostType"/> 1412 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//HostType"/>
477 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> 1413 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
478 <arrangeConstraints>KEEP_SIZE</arrangeConstraints> 1414 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
479 <arrangeConstraints>KEEP_RATIO</arrangeConstraints> 1415 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
480 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_eEUig1vREemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> 1416 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_4ua9dXc3Eemo29BzW_RHcw" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
481 <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/> 1417 <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/>
482 </ownedStyle> 1418 </ownedStyle>
483 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/> 1419 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
@@ -497,6 +1433,14 @@
497 </ownedStyle> 1433 </ownedStyle>
498 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> 1434 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
499 </ownedElements> 1435 </ownedElements>
1436 <ownedElements xmi:type="diagram:DNodeListElement" uid="_4TQEYHc3Eemo29BzW_RHcw" name="cost : EInt" tooltipText="">
1437 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/cost"/>
1438 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/cost"/>
1439 <ownedStyle xmi:type="diagram:BundledImage" uid="_5G0PUnc3Eemo29BzW_RHcw" labelAlignment="LEFT" description="_-5WboFvNEemLJtrAOuDPFQ">
1440 <labelFormat>bold</labelFormat>
1441 </ownedStyle>
1442 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
1443 </ownedElements>
500 </ownedDiagramElements> 1444 </ownedDiagramElements>
501 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_jfFiEFvREemLJtrAOuDPFQ" name="Request" tooltipText="" outgoingEdges="_INyCIFvTEemLJtrAOuDPFQ" incomingEdges="_CU3uAFvTEemLJtrAOuDPFQ" width="12" height="10"> 1445 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_jfFiEFvREemLJtrAOuDPFQ" name="Request" tooltipText="" outgoingEdges="_INyCIFvTEemLJtrAOuDPFQ" incomingEdges="_CU3uAFvTEemLJtrAOuDPFQ" width="12" height="10">
502 <target xmi:type="ecore:EClass" href="cps.ecore#//Request"/> 1446 <target xmi:type="ecore:EClass" href="cps.ecore#//Request"/>
@@ -528,7 +1472,7 @@
528 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/> 1472 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
529 </ownedElements> 1473 </ownedElements>
530 </ownedDiagramElements> 1474 </ownedDiagramElements>
531 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_vIvs0FvREemLJtrAOuDPFQ" name="ApplicationInstance" tooltipText="" outgoingEdges="_ZlkF81vWEemLJtrAOuDPFQ _D2lspFvgEemLJtrAOuDPFQ" incomingEdges="_dUZ2kFvTEemLJtrAOuDPFQ _jGSVo1vTEemLJtrAOuDPFQ _TAeg9lvZEemLJtrAOuDPFQ _D2lspFvgEemLJtrAOuDPFQ" width="12" height="10"> 1475 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_vIvs0FvREemLJtrAOuDPFQ" name="ApplicationInstance" tooltipText="" outgoingEdges="_ZlkF81vWEemLJtrAOuDPFQ" incomingEdges="_dUZ2kFvTEemLJtrAOuDPFQ _jGSVo1vTEemLJtrAOuDPFQ _TAeg9lvZEemLJtrAOuDPFQ" width="12" height="10">
532 <target xmi:type="ecore:EClass" href="cps.ecore#//ApplicationInstance"/> 1476 <target xmi:type="ecore:EClass" href="cps.ecore#//ApplicationInstance"/>
533 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//ApplicationInstance"/> 1477 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//ApplicationInstance"/>
534 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> 1478 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
@@ -603,7 +1547,7 @@
603 </ownedStyle> 1547 </ownedStyle>
604 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> 1548 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
605 </ownedDiagramElements> 1549 </ownedDiagramElements>
606 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_dUZ2kFvTEemLJtrAOuDPFQ" sourceNode="_p05NkFvREemLJtrAOuDPFQ" targetNode="_vIvs0FvREemLJtrAOuDPFQ" beginLabel="[0..*] requirement" endLabel="[0..*] instances"> 1550 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_dUZ2kFvTEemLJtrAOuDPFQ" sourceNode="_p05NkFvREemLJtrAOuDPFQ" targetNode="_vIvs0FvREemLJtrAOuDPFQ" beginLabel="[0..1] requirement" endLabel="[0..*] instances">
607 <target xmi:type="ecore:EReference" href="cps.ecore#//Requirement/instances"/> 1551 <target xmi:type="ecore:EReference" href="cps.ecore#//Requirement/instances"/>
608 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//Requirement/instances"/> 1552 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//Requirement/instances"/>
609 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/requirement"/> 1553 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/requirement"/>
@@ -648,7 +1592,7 @@
648 </ownedStyle> 1592 </ownedStyle>
649 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> 1593 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
650 </ownedDiagramElements> 1594 </ownedDiagramElements>
651 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_UoGYUFvUEemLJtrAOuDPFQ" name="HostInstance" tooltipText="" outgoingEdges="_xXdpelvgEemLJtrAOuDPFQ" incomingEdges="_YawKkFvUEemLJtrAOuDPFQ _ZlkF81vWEemLJtrAOuDPFQ _Lr45GFvZEemLJtrAOuDPFQ _xXdpelvgEemLJtrAOuDPFQ" width="12" height="10"> 1595 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_UoGYUFvUEemLJtrAOuDPFQ" name="HostInstance" tooltipText="" incomingEdges="_YawKkFvUEemLJtrAOuDPFQ _ZlkF81vWEemLJtrAOuDPFQ _Lr45GFvZEemLJtrAOuDPFQ" width="12" height="10">
652 <target xmi:type="ecore:EClass" href="cps.ecore#//HostInstance"/> 1596 <target xmi:type="ecore:EClass" href="cps.ecore#//HostInstance"/>
653 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//HostInstance"/> 1597 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//HostInstance"/>
654 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints> 1598 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
@@ -693,14 +1637,17 @@
693 </ownedStyle> 1637 </ownedStyle>
694 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/> 1638 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/>
695 </ownedDiagramElements> 1639 </ownedDiagramElements>
696 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_ZlkF81vWEemLJtrAOuDPFQ" sourceNode="_vIvs0FvREemLJtrAOuDPFQ" targetNode="_UoGYUFvUEemLJtrAOuDPFQ" beginLabel="[0..*] applications" endLabel="[0..*] allocatedTo"> 1640 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_ZlkF81vWEemLJtrAOuDPFQ" sourceNode="_vIvs0FvREemLJtrAOuDPFQ" targetNode="_UoGYUFvUEemLJtrAOuDPFQ" beginLabel="[0..*] applications" endLabel="[1..1] allocatedTo">
697 <target xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/allocatedTo"/> 1641 <target xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/allocatedTo"/>
698 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/allocatedTo"/> 1642 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/allocatedTo"/>
699 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//HostInstance/applications"/> 1643 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//HostInstance/applications"/>
700 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_ZlktAFvWEemLJtrAOuDPFQ" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0"> 1644 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_5GJws3cmEemo29BzW_RHcw" description="_5GJwsHcmEemo29BzW_RHcw" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0">
701 <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']/@style"/> 1645 <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_5GJwtHcmEemo29BzW_RHcw" showIcon="false">
702 <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_ZlktAVvWEemLJtrAOuDPFQ" showIcon="false"/> 1646 <labelFormat>bold</labelFormat>
703 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_ZlktAlvWEemLJtrAOuDPFQ" showIcon="false"/> 1647 </beginLabelStyle>
1648 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_5GJwtXcmEemo29BzW_RHcw" showIcon="false">
1649 <labelFormat>bold</labelFormat>
1650 </endLabelStyle>
704 </ownedStyle> 1651 </ownedStyle>
705 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/> 1652 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/>
706 </ownedDiagramElements> 1653 </ownedDiagramElements>
@@ -748,76 +1695,6 @@
748 </ownedStyle> 1695 </ownedStyle>
749 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/> 1696 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
750 </ownedDiagramElements> 1697 </ownedDiagramElements>
751 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_sSGHdlvfEemLJtrAOuDPFQ" name="[0..*] dependsOn" sourceNode="_8iM-EFvNEemLJtrAOuDPFQ" targetNode="_8iM-EFvNEemLJtrAOuDPFQ">
752 <target xmi:type="ecore:EReference" href="cps.ecore#//ApplicationType/dependsOn"/>
753 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationType/dependsOn"/>
754 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_sSHVkFvfEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="77,137,20">
755 <customFeatures>strokeColor</customFeatures>
756 <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/>
757 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_sSHVklvfEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
758 <customFeatures>labelFormat</customFeatures>
759 <customFeatures>labelSize</customFeatures>
760 <customFeatures>labelColor</customFeatures>
761 </centerLabelStyle>
762 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_sSHVkVvfEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
763 <customFeatures>labelFormat</customFeatures>
764 <customFeatures>labelSize</customFeatures>
765 <customFeatures>labelColor</customFeatures>
766 </endLabelStyle>
767 </ownedStyle>
768 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
769 </ownedDiagramElements>
770 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_D2lspFvgEemLJtrAOuDPFQ" name="[0..1] dependsOn" sourceNode="_vIvs0FvREemLJtrAOuDPFQ" targetNode="_vIvs0FvREemLJtrAOuDPFQ">
771 <target xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/dependsOn"/>
772 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/dependsOn"/>
773 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_D2mTkFvgEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="77,137,20">
774 <customFeatures>strokeColor</customFeatures>
775 <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/>
776 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_D2mTklvgEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
777 <customFeatures>labelSize</customFeatures>
778 <customFeatures>labelColor</customFeatures>
779 </centerLabelStyle>
780 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_D2mTkVvgEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
781 <customFeatures>labelSize</customFeatures>
782 <customFeatures>labelColor</customFeatures>
783 </endLabelStyle>
784 </ownedStyle>
785 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
786 </ownedDiagramElements>
787 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_rSSa1lvgEemLJtrAOuDPFQ" name="[0..*] canConnectTo" sourceNode="_FZ1GEFvOEemLJtrAOuDPFQ" targetNode="_FZ1GEFvOEemLJtrAOuDPFQ">
788 <target xmi:type="ecore:EReference" href="cps.ecore#//HostType/canConnectTo"/>
789 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//HostType/canConnectTo"/>
790 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_rSTB4FvgEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="77,137,20">
791 <customFeatures>strokeColor</customFeatures>
792 <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/>
793 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_rSTB4lvgEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
794 <customFeatures>labelSize</customFeatures>
795 <customFeatures>labelColor</customFeatures>
796 </centerLabelStyle>
797 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_rSTB4VvgEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
798 <customFeatures>labelSize</customFeatures>
799 <customFeatures>labelColor</customFeatures>
800 </endLabelStyle>
801 </ownedStyle>
802 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
803 </ownedDiagramElements>
804 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_xXdpelvgEemLJtrAOuDPFQ" name="[0..*] connectedTo" sourceNode="_UoGYUFvUEemLJtrAOuDPFQ" targetNode="_UoGYUFvUEemLJtrAOuDPFQ">
805 <target xmi:type="ecore:EReference" href="cps.ecore#//HostInstance/connectedTo"/>
806 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//HostInstance/connectedTo"/>
807 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_xXeQYFvgEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="77,137,20">
808 <customFeatures>strokeColor</customFeatures>
809 <description xmi:type="style:EdgeStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']/@style"/>
810 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_xXeQYlvgEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
811 <customFeatures>labelSize</customFeatures>
812 <customFeatures>labelColor</customFeatures>
813 </centerLabelStyle>
814 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_xXeQYVvgEemLJtrAOuDPFQ" showIcon="false" labelColor="77,137,20">
815 <customFeatures>labelSize</customFeatures>
816 <customFeatures>labelColor</customFeatures>
817 </endLabelStyle>
818 </ownedStyle>
819 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
820 </ownedDiagramElements>
821 <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> 1698 <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
822 <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_kSzQQFvMEemLJtrAOuDPFQ"/> 1699 <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_kSzQQFvMEemLJtrAOuDPFQ"/>
823 <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/> 1700 <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore
index bcf0ed99..36db23be 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore
@@ -1,6 +1,9 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="cps" nsURI="http://www.example.org/cps" nsPrefix="cps"> 3 xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="cps" nsURI="http://www.example.org/cps" nsPrefix="cps">
4 <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
5 <details key="settingDelegates" value="org.eclipse.viatra.query.querybasedfeature"/>
6 </eAnnotations>
4 <eClassifiers xsi:type="ecore:EClass" name="CyberPhysicalSystem"> 7 <eClassifiers xsi:type="ecore:EClass" name="CyberPhysicalSystem">
5 <eStructuralFeatures xsi:type="ecore:EReference" name="requests" upperBound="-1" 8 <eStructuralFeatures xsi:type="ecore:EReference" name="requests" upperBound="-1"
6 eType="#//Request" containment="true"/> 9 eType="#//Request" containment="true"/>
@@ -10,18 +13,24 @@
10 eType="#//HostType" containment="true"/> 13 eType="#//HostType" containment="true"/>
11 <eStructuralFeatures xsi:type="ecore:EReference" name="hosts" upperBound="-1" 14 <eStructuralFeatures xsi:type="ecore:EReference" name="hosts" upperBound="-1"
12 eType="#//HostInstance" changeable="false" volatile="true" transient="true" 15 eType="#//HostInstance" changeable="false" volatile="true" transient="true"
13 derived="true"/> 16 derived="true">
17 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
18 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts"/>
19 </eAnnotations>
20 </eStructuralFeatures>
14 <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1" 21 <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1"
15 eType="#//ApplicationInstance" changeable="false" volatile="true" transient="true" 22 eType="#//ApplicationInstance" changeable="false" volatile="true" transient="true"
16 derived="true"/> 23 derived="true">
24 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
25 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications"/>
26 </eAnnotations>
27 </eStructuralFeatures>
17 </eClassifiers> 28 </eClassifiers>
18 <eClassifiers xsi:type="ecore:EClass" name="ApplicationType"> 29 <eClassifiers xsi:type="ecore:EClass" name="ApplicationType">
19 <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1" 30 <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1"
20 eType="#//ApplicationInstance" containment="true" eOpposite="#//ApplicationInstance/type"/> 31 eType="#//ApplicationInstance" containment="true" eOpposite="#//ApplicationInstance/type"/>
21 <eStructuralFeatures xsi:type="ecore:EReference" name="requirements" upperBound="-1" 32 <eStructuralFeatures xsi:type="ecore:EReference" name="requirements" upperBound="-1"
22 eType="#//ResourceRequirement" containment="true"/> 33 eType="#//ResourceRequirement" containment="true"/>
23 <eStructuralFeatures xsi:type="ecore:EReference" name="dependsOn" upperBound="-1"
24 eType="#//ApplicationType"/>
25 </eClassifiers> 34 </eClassifiers>
26 <eClassifiers xsi:type="ecore:EClass" name="HostType"> 35 <eClassifiers xsi:type="ecore:EClass" name="HostType">
27 <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultMemory" lowerBound="1" 36 <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultMemory" lowerBound="1"
@@ -30,8 +39,7 @@
30 eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> 39 eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
31 <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1" 40 <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1"
32 eType="#//HostInstance" containment="true" eOpposite="#//HostInstance/type"/> 41 eType="#//HostInstance" containment="true" eOpposite="#//HostInstance/type"/>
33 <eStructuralFeatures xsi:type="ecore:EReference" name="canConnectTo" upperBound="-1" 42 <eStructuralFeatures xsi:type="ecore:EAttribute" name="cost" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/>
34 eType="#//HostType"/>
35 </eClassifiers> 43 </eClassifiers>
36 <eClassifiers xsi:type="ecore:EClass" name="Request"> 44 <eClassifiers xsi:type="ecore:EClass" name="Request">
37 <eStructuralFeatures xsi:type="ecore:EReference" name="requirements" upperBound="-1" 45 <eStructuralFeatures xsi:type="ecore:EReference" name="requirements" upperBound="-1"
@@ -46,13 +54,12 @@
46 eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/requirement"/> 54 eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/requirement"/>
47 </eClassifiers> 55 </eClassifiers>
48 <eClassifiers xsi:type="ecore:EClass" name="ApplicationInstance"> 56 <eClassifiers xsi:type="ecore:EClass" name="ApplicationInstance">
49 <eStructuralFeatures xsi:type="ecore:EReference" name="requirement" upperBound="-1" 57 <eStructuralFeatures xsi:type="ecore:EReference" name="requirement" eType="#//Requirement"
50 eType="#//Requirement" eOpposite="#//Requirement/instances"/> 58 eOpposite="#//Requirement/instances"/>
51 <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//ApplicationType" 59 <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//ApplicationType"
52 eOpposite="#//ApplicationType/instances"/> 60 eOpposite="#//ApplicationType/instances"/>
53 <eStructuralFeatures xsi:type="ecore:EReference" name="allocatedTo" upperBound="-1" 61 <eStructuralFeatures xsi:type="ecore:EReference" name="allocatedTo" lowerBound="1"
54 eType="#//HostInstance" eOpposite="#//HostInstance/applications"/> 62 eType="#//HostInstance" eOpposite="#//HostInstance/applications"/>
55 <eStructuralFeatures xsi:type="ecore:EReference" name="dependsOn" eType="#//ApplicationInstance"/>
56 </eClassifiers> 63 </eClassifiers>
57 <eClassifiers xsi:type="ecore:EClass" name="ResourceRequirement"> 64 <eClassifiers xsi:type="ecore:EClass" name="ResourceRequirement">
58 <eStructuralFeatures xsi:type="ecore:EAttribute" name="requiredMemory" lowerBound="1" 65 <eStructuralFeatures xsi:type="ecore:EAttribute" name="requiredMemory" lowerBound="1"
@@ -66,16 +73,30 @@
66 <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//HostType" 73 <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//HostType"
67 eOpposite="#//HostType/instances"/> 74 eOpposite="#//HostType/instances"/>
68 <eStructuralFeatures xsi:type="ecore:EAttribute" name="availableMemory" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" 75 <eStructuralFeatures xsi:type="ecore:EAttribute" name="availableMemory" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
69 changeable="false" volatile="true" transient="true" derived="true"/> 76 changeable="false" volatile="true" transient="true" derived="true">
77 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
78 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory"/>
79 </eAnnotations>
80 </eStructuralFeatures>
70 <eStructuralFeatures xsi:type="ecore:EAttribute" name="availableHdd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" 81 <eStructuralFeatures xsi:type="ecore:EAttribute" name="availableHdd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
71 changeable="false" volatile="true" transient="true" derived="true"/> 82 changeable="false" volatile="true" transient="true" derived="true">
83 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
84 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd"/>
85 </eAnnotations>
86 </eStructuralFeatures>
72 <eStructuralFeatures xsi:type="ecore:EAttribute" name="totalMemory" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" 87 <eStructuralFeatures xsi:type="ecore:EAttribute" name="totalMemory" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
73 changeable="false" volatile="true" transient="true" derived="true"/> 88 changeable="false" volatile="true" transient="true" derived="true">
89 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
90 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory"/>
91 </eAnnotations>
92 </eStructuralFeatures>
74 <eStructuralFeatures xsi:type="ecore:EAttribute" name="totalHdd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt" 93 <eStructuralFeatures xsi:type="ecore:EAttribute" name="totalHdd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
75 changeable="false" volatile="true" transient="true" derived="true"/> 94 changeable="false" volatile="true" transient="true" derived="true">
95 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
96 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd"/>
97 </eAnnotations>
98 </eStructuralFeatures>
76 <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1" 99 <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1"
77 eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/allocatedTo"/> 100 eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/allocatedTo"/>
78 <eStructuralFeatures xsi:type="ecore:EReference" name="connectedTo" upperBound="-1"
79 eType="#//HostInstance"/>
80 </eClassifiers> 101 </eClassifiers>
81</ecore:EPackage> 102</ecore:EPackage>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel
index 679e2c49..a0ccec7f 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel
@@ -21,13 +21,12 @@
21 <genClasses ecoreClass="cps.ecore#//ApplicationType"> 21 <genClasses ecoreClass="cps.ecore#//ApplicationType">
22 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/instances"/> 22 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/instances"/>
23 <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/requirements"/> 23 <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/requirements"/>
24 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/dependsOn"/>
25 </genClasses> 24 </genClasses>
26 <genClasses ecoreClass="cps.ecore#//HostType"> 25 <genClasses ecoreClass="cps.ecore#//HostType">
27 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/defaultMemory"/> 26 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/defaultMemory"/>
28 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/defaultHdd"/> 27 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/defaultHdd"/>
29 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostType/instances"/> 28 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostType/instances"/>
30 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostType/canConnectTo"/> 29 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/cost"/>
31 </genClasses> 30 </genClasses>
32 <genClasses ecoreClass="cps.ecore#//Request"> 31 <genClasses ecoreClass="cps.ecore#//Request">
33 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//Request/requirements"/> 32 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//Request/requirements"/>
@@ -42,7 +41,6 @@
42 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/requirement"/> 41 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/requirement"/>
43 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/type"/> 42 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/type"/>
44 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/allocatedTo"/> 43 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/allocatedTo"/>
45 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/dependsOn"/>
46 </genClasses> 44 </genClasses>
47 <genClasses ecoreClass="cps.ecore#//ResourceRequirement"> 45 <genClasses ecoreClass="cps.ecore#//ResourceRequirement">
48 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//ResourceRequirement/requiredMemory"/> 46 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//ResourceRequirement/requiredMemory"/>
@@ -56,7 +54,6 @@
56 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/totalMemory"/> 54 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/totalMemory"/>
57 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/totalHdd"/> 55 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/totalHdd"/>
58 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/applications"/> 56 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/applications"/>
59 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/connectedTo"/>
60 </genClasses> 57 </genClasses>
61 </genPackages> 58 </genPackages>
62</genmodel:GenModel> 59</genmodel:GenModel>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.properties b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.properties
new file mode 100644
index 00000000..aa7cf04c
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.properties
@@ -0,0 +1,4 @@
1#
2
3pluginName = hu.bme.mit.inf.dslreasoner.domains.cps
4providerName = www.example.org
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml
new file mode 100644
index 00000000..256b967d
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml
@@ -0,0 +1,44 @@
1<?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.0"?><!--
2--><plugin>
3 <extension point="org.eclipse.emf.ecore.generated_package">
4 <!-- @generated cps -->
5 <package class="hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage" genModel="model/cps.genmodel" uri="http://www.example.org/cps"/>
6 </extension>
7 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
8 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="availableHdd" package-nsUri="http://www.example.org/cps"/>
9 </extension>
10 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
11 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="availableMemory" package-nsUri="http://www.example.org/cps"/>
12 </extension>
13 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
14 <wellbehaving-derived-feature classifier-name="CyberPhysicalSystem" feature-name="applications" package-nsUri="http://www.example.org/cps"/>
15 </extension>
16 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
17 <wellbehaving-derived-feature classifier-name="CyberPhysicalSystem" feature-name="hosts" package-nsUri="http://www.example.org/cps"/>
18 </extension>
19 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
20 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="totalHdd" package-nsUri="http://www.example.org/cps"/>
21 </extension>
22 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
23 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="totalMemory" package-nsUri="http://www.example.org/cps"/>
24 </extension>
25 <extension id="hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries" point="org.eclipse.viatra.query.runtime.queryspecification">
26 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries" id="hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries">
27 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications"/>
28 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts"/>
29 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory"/>
30 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd"/>
31 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory"/>
32 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd"/>
33 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement"/>
34 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory"/>
35 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd"/>
36 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.instanceDoesNotSatisfyRequirement"/>
37 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied"/>
38 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric"/>
39 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric"/>
40 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric"/>
41 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsCost"/>
42 </group>
43 </extension>
44</plugin>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/.gitignore
new file mode 100644
index 00000000..bd8f7d9f
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/.gitignore
@@ -0,0 +1,16 @@
1/.CpsApplications.java._trace
2/.CpsQueries.java._trace
3/.CpsHosts.java._trace
4/.TotalMemory.java._trace
5/.TotalHdd.java._trace
6/.AvailableMemory.java._trace
7/.AvailableHdd.java._trace
8/.AllocationWithoutResourceRequirement.java._trace
9/.NotEnoughAvailableMemory.java._trace
10/.NotEnoughAvailableHdd.java._trace
11/.InstanceDoesNotSatisfyRequirement.java._trace
12/.RequirementNotSatisfied.java._trace
13/.AverageFreeMemoryMetric.java._trace
14/.AverageFreeHddMetric.java._trace
15/.CostMetric.java._trace
16/.CpsCost.java._trace
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AllocationWithoutResourceRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AllocationWithoutResourceRequirement.java
new file mode 100644
index 00000000..be7488b6
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AllocationWithoutResourceRequirement.java
@@ -0,0 +1,717 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.emf.ecore.EClass;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
41import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
42import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
43import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
44import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
45
46/**
47 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
48 *
49 * <p>Original source:
50 * <code><pre>
51 * {@literal @}Constraint(severity = "error", key = {Host, App},
52 * message = "Application instance must be allocated to a supported host type.")
53 * pattern allocationWithoutResourceRequirement(Host : HostInstance, App : ApplicationInstance) {
54 * ApplicationInstance.allocatedTo(App, Host);
55 * neg find resourceRequirement(Host, App, _);
56 * }
57 * </pre></code>
58 *
59 * @see Matcher
60 * @see Match
61 *
62 */
63@SuppressWarnings("all")
64public final class AllocationWithoutResourceRequirement extends BaseGeneratedEMFQuerySpecification<AllocationWithoutResourceRequirement.Matcher> {
65 /**
66 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement pattern,
67 * to be used in conjunction with {@link Matcher}.
68 *
69 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
70 * Each instance is a (possibly partial) substitution of pattern parameters,
71 * usable to represent a match of the pattern in the result of a query,
72 * or to specify the bound (fixed) input parameters when issuing a query.
73 *
74 * @see Matcher
75 *
76 */
77 public static abstract class Match extends BasePatternMatch {
78 private HostInstance fHost;
79
80 private ApplicationInstance fApp;
81
82 private static List<String> parameterNames = makeImmutableList("Host", "App");
83
84 private Match(final HostInstance pHost, final ApplicationInstance pApp) {
85 this.fHost = pHost;
86 this.fApp = pApp;
87 }
88
89 @Override
90 public Object get(final String parameterName) {
91 if ("Host".equals(parameterName)) return this.fHost;
92 if ("App".equals(parameterName)) return this.fApp;
93 return null;
94 }
95
96 public HostInstance getHost() {
97 return this.fHost;
98 }
99
100 public ApplicationInstance getApp() {
101 return this.fApp;
102 }
103
104 @Override
105 public boolean set(final String parameterName, final Object newValue) {
106 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
107 if ("Host".equals(parameterName) ) {
108 this.fHost = (HostInstance) newValue;
109 return true;
110 }
111 if ("App".equals(parameterName) ) {
112 this.fApp = (ApplicationInstance) newValue;
113 return true;
114 }
115 return false;
116 }
117
118 public void setHost(final HostInstance pHost) {
119 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
120 this.fHost = pHost;
121 }
122
123 public void setApp(final ApplicationInstance pApp) {
124 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
125 this.fApp = pApp;
126 }
127
128 @Override
129 public String patternName() {
130 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement";
131 }
132
133 @Override
134 public List<String> parameterNames() {
135 return AllocationWithoutResourceRequirement.Match.parameterNames;
136 }
137
138 @Override
139 public Object[] toArray() {
140 return new Object[]{fHost, fApp};
141 }
142
143 @Override
144 public AllocationWithoutResourceRequirement.Match toImmutable() {
145 return isMutable() ? newMatch(fHost, fApp) : this;
146 }
147
148 @Override
149 public String prettyPrint() {
150 StringBuilder result = new StringBuilder();
151 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
152 result.append("\"App\"=" + prettyPrintValue(fApp));
153 return result.toString();
154 }
155
156 @Override
157 public int hashCode() {
158 return Objects.hash(fHost, fApp);
159 }
160
161 @Override
162 public boolean equals(final Object obj) {
163 if (this == obj)
164 return true;
165 if (obj == null) {
166 return false;
167 }
168 if ((obj instanceof AllocationWithoutResourceRequirement.Match)) {
169 AllocationWithoutResourceRequirement.Match other = (AllocationWithoutResourceRequirement.Match) obj;
170 return Objects.equals(fHost, other.fHost) && Objects.equals(fApp, other.fApp);
171 } else {
172 // this should be infrequent
173 if (!(obj instanceof IPatternMatch)) {
174 return false;
175 }
176 IPatternMatch otherSig = (IPatternMatch) obj;
177 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
178 }
179 }
180
181 @Override
182 public AllocationWithoutResourceRequirement specification() {
183 return AllocationWithoutResourceRequirement.instance();
184 }
185
186 /**
187 * Returns an empty, mutable match.
188 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
189 *
190 * @return the empty match.
191 *
192 */
193 public static AllocationWithoutResourceRequirement.Match newEmptyMatch() {
194 return new Mutable(null, null);
195 }
196
197 /**
198 * Returns a mutable (partial) match.
199 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
200 *
201 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
202 * @param pApp the fixed value of pattern parameter App, or null if not bound.
203 * @return the new, mutable (partial) match object.
204 *
205 */
206 public static AllocationWithoutResourceRequirement.Match newMutableMatch(final HostInstance pHost, final ApplicationInstance pApp) {
207 return new Mutable(pHost, pApp);
208 }
209
210 /**
211 * Returns a new (partial) match.
212 * This can be used e.g. to call the matcher with a partial match.
213 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
214 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
215 * @param pApp the fixed value of pattern parameter App, or null if not bound.
216 * @return the (partial) match object.
217 *
218 */
219 public static AllocationWithoutResourceRequirement.Match newMatch(final HostInstance pHost, final ApplicationInstance pApp) {
220 return new Immutable(pHost, pApp);
221 }
222
223 private static final class Mutable extends AllocationWithoutResourceRequirement.Match {
224 Mutable(final HostInstance pHost, final ApplicationInstance pApp) {
225 super(pHost, pApp);
226 }
227
228 @Override
229 public boolean isMutable() {
230 return true;
231 }
232 }
233
234 private static final class Immutable extends AllocationWithoutResourceRequirement.Match {
235 Immutable(final HostInstance pHost, final ApplicationInstance pApp) {
236 super(pHost, pApp);
237 }
238
239 @Override
240 public boolean isMutable() {
241 return false;
242 }
243 }
244 }
245
246 /**
247 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement pattern,
248 * providing pattern-specific query methods.
249 *
250 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
251 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
252 *
253 * <p>Matches of the pattern will be represented as {@link Match}.
254 *
255 * <p>Original source:
256 * <code><pre>
257 * {@literal @}Constraint(severity = "error", key = {Host, App},
258 * message = "Application instance must be allocated to a supported host type.")
259 * pattern allocationWithoutResourceRequirement(Host : HostInstance, App : ApplicationInstance) {
260 * ApplicationInstance.allocatedTo(App, Host);
261 * neg find resourceRequirement(Host, App, _);
262 * }
263 * </pre></code>
264 *
265 * @see Match
266 * @see AllocationWithoutResourceRequirement
267 *
268 */
269 public static class Matcher extends BaseMatcher<AllocationWithoutResourceRequirement.Match> {
270 /**
271 * Initializes the pattern matcher within an existing VIATRA Query engine.
272 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
273 *
274 * @param engine the existing VIATRA Query engine in which this matcher will be created.
275 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
276 *
277 */
278 public static AllocationWithoutResourceRequirement.Matcher on(final ViatraQueryEngine engine) {
279 // check if matcher already exists
280 Matcher matcher = engine.getExistingMatcher(querySpecification());
281 if (matcher == null) {
282 matcher = (Matcher)engine.getMatcher(querySpecification());
283 }
284 return matcher;
285 }
286
287 /**
288 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
289 * @return an initialized matcher
290 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
291 *
292 */
293 public static AllocationWithoutResourceRequirement.Matcher create() {
294 return new Matcher();
295 }
296
297 private static final int POSITION_HOST = 0;
298
299 private static final int POSITION_APP = 1;
300
301 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AllocationWithoutResourceRequirement.Matcher.class);
302
303 /**
304 * Initializes the pattern matcher within an existing VIATRA Query engine.
305 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
306 *
307 * @param engine the existing VIATRA Query engine in which this matcher will be created.
308 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
309 *
310 */
311 private Matcher() {
312 super(querySpecification());
313 }
314
315 /**
316 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
317 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
318 * @param pApp the fixed value of pattern parameter App, or null if not bound.
319 * @return matches represented as a Match object.
320 *
321 */
322 public Collection<AllocationWithoutResourceRequirement.Match> getAllMatches(final HostInstance pHost, final ApplicationInstance pApp) {
323 return rawStreamAllMatches(new Object[]{pHost, pApp}).collect(Collectors.toSet());
324 }
325
326 /**
327 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
328 * </p>
329 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
330 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
331 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
332 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
333 * @param pApp the fixed value of pattern parameter App, or null if not bound.
334 * @return a stream of matches represented as a Match object.
335 *
336 */
337 public Stream<AllocationWithoutResourceRequirement.Match> streamAllMatches(final HostInstance pHost, final ApplicationInstance pApp) {
338 return rawStreamAllMatches(new Object[]{pHost, pApp});
339 }
340
341 /**
342 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
343 * Neither determinism nor randomness of selection is guaranteed.
344 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
345 * @param pApp the fixed value of pattern parameter App, or null if not bound.
346 * @return a match represented as a Match object, or null if no match is found.
347 *
348 */
349 public Optional<AllocationWithoutResourceRequirement.Match> getOneArbitraryMatch(final HostInstance pHost, final ApplicationInstance pApp) {
350 return rawGetOneArbitraryMatch(new Object[]{pHost, pApp});
351 }
352
353 /**
354 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
355 * under any possible substitution of the unspecified parameters (if any).
356 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
357 * @param pApp the fixed value of pattern parameter App, or null if not bound.
358 * @return true if the input is a valid (partial) match of the pattern.
359 *
360 */
361 public boolean hasMatch(final HostInstance pHost, final ApplicationInstance pApp) {
362 return rawHasMatch(new Object[]{pHost, pApp});
363 }
364
365 /**
366 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
367 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
368 * @param pApp the fixed value of pattern parameter App, or null if not bound.
369 * @return the number of pattern matches found.
370 *
371 */
372 public int countMatches(final HostInstance pHost, final ApplicationInstance pApp) {
373 return rawCountMatches(new Object[]{pHost, pApp});
374 }
375
376 /**
377 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
378 * Neither determinism nor randomness of selection is guaranteed.
379 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
380 * @param pApp the fixed value of pattern parameter App, or null if not bound.
381 * @param processor the action that will process the selected match.
382 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
383 *
384 */
385 public boolean forOneArbitraryMatch(final HostInstance pHost, final ApplicationInstance pApp, final Consumer<? super AllocationWithoutResourceRequirement.Match> processor) {
386 return rawForOneArbitraryMatch(new Object[]{pHost, pApp}, processor);
387 }
388
389 /**
390 * Returns a new (partial) match.
391 * This can be used e.g. to call the matcher with a partial match.
392 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
393 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
394 * @param pApp the fixed value of pattern parameter App, or null if not bound.
395 * @return the (partial) match object.
396 *
397 */
398 public AllocationWithoutResourceRequirement.Match newMatch(final HostInstance pHost, final ApplicationInstance pApp) {
399 return AllocationWithoutResourceRequirement.Match.newMatch(pHost, pApp);
400 }
401
402 /**
403 * Retrieve the set of values that occur in matches for Host.
404 * @return the Set of all values or empty set if there are no matches
405 *
406 */
407 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
408 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
409 }
410
411 /**
412 * Retrieve the set of values that occur in matches for Host.
413 * @return the Set of all values or empty set if there are no matches
414 *
415 */
416 public Set<HostInstance> getAllValuesOfHost() {
417 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
418 }
419
420 /**
421 * Retrieve the set of values that occur in matches for Host.
422 * @return the Set of all values or empty set if there are no matches
423 *
424 */
425 public Stream<HostInstance> streamAllValuesOfHost() {
426 return rawStreamAllValuesOfHost(emptyArray());
427 }
428
429 /**
430 * Retrieve the set of values that occur in matches for Host.
431 * </p>
432 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
433 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
434 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
435 *
436 * @return the Stream of all values or empty set if there are no matches
437 *
438 */
439 public Stream<HostInstance> streamAllValuesOfHost(final AllocationWithoutResourceRequirement.Match partialMatch) {
440 return rawStreamAllValuesOfHost(partialMatch.toArray());
441 }
442
443 /**
444 * Retrieve the set of values that occur in matches for Host.
445 * </p>
446 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
447 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
448 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
449 *
450 * @return the Stream of all values or empty set if there are no matches
451 *
452 */
453 public Stream<HostInstance> streamAllValuesOfHost(final ApplicationInstance pApp) {
454 return rawStreamAllValuesOfHost(new Object[]{null, pApp});
455 }
456
457 /**
458 * Retrieve the set of values that occur in matches for Host.
459 * @return the Set of all values or empty set if there are no matches
460 *
461 */
462 public Set<HostInstance> getAllValuesOfHost(final AllocationWithoutResourceRequirement.Match partialMatch) {
463 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
464 }
465
466 /**
467 * Retrieve the set of values that occur in matches for Host.
468 * @return the Set of all values or empty set if there are no matches
469 *
470 */
471 public Set<HostInstance> getAllValuesOfHost(final ApplicationInstance pApp) {
472 return rawStreamAllValuesOfHost(new Object[]{null, pApp}).collect(Collectors.toSet());
473 }
474
475 /**
476 * Retrieve the set of values that occur in matches for App.
477 * @return the Set of all values or empty set if there are no matches
478 *
479 */
480 protected Stream<ApplicationInstance> rawStreamAllValuesOfApp(final Object[] parameters) {
481 return rawStreamAllValues(POSITION_APP, parameters).map(ApplicationInstance.class::cast);
482 }
483
484 /**
485 * Retrieve the set of values that occur in matches for App.
486 * @return the Set of all values or empty set if there are no matches
487 *
488 */
489 public Set<ApplicationInstance> getAllValuesOfApp() {
490 return rawStreamAllValuesOfApp(emptyArray()).collect(Collectors.toSet());
491 }
492
493 /**
494 * Retrieve the set of values that occur in matches for App.
495 * @return the Set of all values or empty set if there are no matches
496 *
497 */
498 public Stream<ApplicationInstance> streamAllValuesOfApp() {
499 return rawStreamAllValuesOfApp(emptyArray());
500 }
501
502 /**
503 * Retrieve the set of values that occur in matches for App.
504 * </p>
505 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
506 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
507 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
508 *
509 * @return the Stream of all values or empty set if there are no matches
510 *
511 */
512 public Stream<ApplicationInstance> streamAllValuesOfApp(final AllocationWithoutResourceRequirement.Match partialMatch) {
513 return rawStreamAllValuesOfApp(partialMatch.toArray());
514 }
515
516 /**
517 * Retrieve the set of values that occur in matches for App.
518 * </p>
519 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
520 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
521 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
522 *
523 * @return the Stream of all values or empty set if there are no matches
524 *
525 */
526 public Stream<ApplicationInstance> streamAllValuesOfApp(final HostInstance pHost) {
527 return rawStreamAllValuesOfApp(new Object[]{pHost, null});
528 }
529
530 /**
531 * Retrieve the set of values that occur in matches for App.
532 * @return the Set of all values or empty set if there are no matches
533 *
534 */
535 public Set<ApplicationInstance> getAllValuesOfApp(final AllocationWithoutResourceRequirement.Match partialMatch) {
536 return rawStreamAllValuesOfApp(partialMatch.toArray()).collect(Collectors.toSet());
537 }
538
539 /**
540 * Retrieve the set of values that occur in matches for App.
541 * @return the Set of all values or empty set if there are no matches
542 *
543 */
544 public Set<ApplicationInstance> getAllValuesOfApp(final HostInstance pHost) {
545 return rawStreamAllValuesOfApp(new Object[]{pHost, null}).collect(Collectors.toSet());
546 }
547
548 @Override
549 protected AllocationWithoutResourceRequirement.Match tupleToMatch(final Tuple t) {
550 try {
551 return AllocationWithoutResourceRequirement.Match.newMatch((HostInstance) t.get(POSITION_HOST), (ApplicationInstance) t.get(POSITION_APP));
552 } catch(ClassCastException e) {
553 LOGGER.error("Element(s) in tuple not properly typed!",e);
554 return null;
555 }
556 }
557
558 @Override
559 protected AllocationWithoutResourceRequirement.Match arrayToMatch(final Object[] match) {
560 try {
561 return AllocationWithoutResourceRequirement.Match.newMatch((HostInstance) match[POSITION_HOST], (ApplicationInstance) match[POSITION_APP]);
562 } catch(ClassCastException e) {
563 LOGGER.error("Element(s) in array not properly typed!",e);
564 return null;
565 }
566 }
567
568 @Override
569 protected AllocationWithoutResourceRequirement.Match arrayToMatchMutable(final Object[] match) {
570 try {
571 return AllocationWithoutResourceRequirement.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (ApplicationInstance) match[POSITION_APP]);
572 } catch(ClassCastException e) {
573 LOGGER.error("Element(s) in array not properly typed!",e);
574 return null;
575 }
576 }
577
578 /**
579 * @return the singleton instance of the query specification of this pattern
580 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
581 *
582 */
583 public static IQuerySpecification<AllocationWithoutResourceRequirement.Matcher> querySpecification() {
584 return AllocationWithoutResourceRequirement.instance();
585 }
586 }
587
588 private AllocationWithoutResourceRequirement() {
589 super(GeneratedPQuery.INSTANCE);
590 }
591
592 /**
593 * @return the singleton instance of the query specification
594 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
595 *
596 */
597 public static AllocationWithoutResourceRequirement instance() {
598 try{
599 return LazyHolder.INSTANCE;
600 } catch (ExceptionInInitializerError err) {
601 throw processInitializerError(err);
602 }
603 }
604
605 @Override
606 protected AllocationWithoutResourceRequirement.Matcher instantiate(final ViatraQueryEngine engine) {
607 return AllocationWithoutResourceRequirement.Matcher.on(engine);
608 }
609
610 @Override
611 public AllocationWithoutResourceRequirement.Matcher instantiate() {
612 return AllocationWithoutResourceRequirement.Matcher.create();
613 }
614
615 @Override
616 public AllocationWithoutResourceRequirement.Match newEmptyMatch() {
617 return AllocationWithoutResourceRequirement.Match.newEmptyMatch();
618 }
619
620 @Override
621 public AllocationWithoutResourceRequirement.Match newMatch(final Object... parameters) {
622 return AllocationWithoutResourceRequirement.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance) parameters[1]);
623 }
624
625 /**
626 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement (visibility: PUBLIC, simpleName: AllocationWithoutResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
627 * <b>not</b> at the class load time of the outer class,
628 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement (visibility: PUBLIC, simpleName: AllocationWithoutResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
629 *
630 * <p> This workaround is required e.g. to support recursion.
631 *
632 */
633 private static class LazyHolder {
634 private static final AllocationWithoutResourceRequirement INSTANCE = new AllocationWithoutResourceRequirement();
635
636 /**
637 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
638 * This initialization order is required to support indirect recursion.
639 *
640 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
641 *
642 */
643 private static final Object STATIC_INITIALIZER = ensureInitialized();
644
645 public static Object ensureInitialized() {
646 INSTANCE.ensureInitializedInternal();
647 return null;
648 }
649 }
650
651 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
652 private static final AllocationWithoutResourceRequirement.GeneratedPQuery INSTANCE = new GeneratedPQuery();
653
654 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
655
656 private final PParameter parameter_App = new PParameter("App", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
657
658 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_App);
659
660 private GeneratedPQuery() {
661 super(PVisibility.PUBLIC);
662 }
663
664 @Override
665 public String getFullyQualifiedName() {
666 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement";
667 }
668
669 @Override
670 public List<String> getParameterNames() {
671 return Arrays.asList("Host","App");
672 }
673
674 @Override
675 public List<PParameter> getParameters() {
676 return parameters;
677 }
678
679 @Override
680 public Set<PBody> doGetContainedBodies() {
681 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
682 Set<PBody> bodies = new LinkedHashSet<>();
683 {
684 PBody body = new PBody(this);
685 PVariable var_Host = body.getOrCreateVariableByName("Host");
686 PVariable var_App = body.getOrCreateVariableByName("App");
687 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
688 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
689 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
690 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
691 new ExportedParameter(body, var_Host, parameter_Host),
692 new ExportedParameter(body, var_App, parameter_App)
693 ));
694 // ApplicationInstance.allocatedTo(App, Host)
695 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
696 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
697 new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo")));
698 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
699 new Equality(body, var__virtual_0_, var_Host);
700 // neg find resourceRequirement(Host, App, _)
701 new NegativePatternCall(body, Tuples.flatTupleOf(var_Host, var_App, var___0_), ResourceRequirement.instance().getInternalQueryRepresentation());
702 bodies.add(body);
703 }
704 {
705 PAnnotation annotation = new PAnnotation("Constraint");
706 annotation.addAttribute("severity", "error");
707 annotation.addAttribute("key", Arrays.asList(new Object[] {
708 new ParameterReference("Host"),
709 new ParameterReference("App")
710 }));
711 annotation.addAttribute("message", "Application instance must be allocated to a supported host type.");
712 addAnnotation(annotation);
713 }
714 return bodies;
715 }
716 }
717}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java
new file mode 100644
index 00000000..22821c4a
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java
@@ -0,0 +1,743 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.emf.ecore.EClass;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
32import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
33import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
34import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
35import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
36import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
43import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
44import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
45import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
46import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
47import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
48import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
49import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
50
51/**
52 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
53 *
54 * <p>Original source:
55 * <code><pre>
56 * {@literal @}QueryBasedFeature(feature = "availableHdd")
57 * pattern availableHdd(Host : HostInstance, Hdd : java Integer) {
58 * find totalHdd(Host, TotalHdd);
59 * RequiredHdd == sum find hddRequirement(Host, _, #_);
60 * Hdd == eval(TotalHdd - RequiredHdd);
61 * }
62 * </pre></code>
63 *
64 * @see Matcher
65 * @see Match
66 *
67 */
68@SuppressWarnings("all")
69public final class AvailableHdd extends BaseGeneratedEMFQuerySpecification<AvailableHdd.Matcher> {
70 /**
71 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd pattern,
72 * to be used in conjunction with {@link Matcher}.
73 *
74 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
75 * Each instance is a (possibly partial) substitution of pattern parameters,
76 * usable to represent a match of the pattern in the result of a query,
77 * or to specify the bound (fixed) input parameters when issuing a query.
78 *
79 * @see Matcher
80 *
81 */
82 public static abstract class Match extends BasePatternMatch {
83 private HostInstance fHost;
84
85 private Integer fHdd;
86
87 private static List<String> parameterNames = makeImmutableList("Host", "Hdd");
88
89 private Match(final HostInstance pHost, final Integer pHdd) {
90 this.fHost = pHost;
91 this.fHdd = pHdd;
92 }
93
94 @Override
95 public Object get(final String parameterName) {
96 if ("Host".equals(parameterName)) return this.fHost;
97 if ("Hdd".equals(parameterName)) return this.fHdd;
98 return null;
99 }
100
101 public HostInstance getHost() {
102 return this.fHost;
103 }
104
105 public Integer getHdd() {
106 return this.fHdd;
107 }
108
109 @Override
110 public boolean set(final String parameterName, final Object newValue) {
111 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
112 if ("Host".equals(parameterName) ) {
113 this.fHost = (HostInstance) newValue;
114 return true;
115 }
116 if ("Hdd".equals(parameterName) ) {
117 this.fHdd = (Integer) newValue;
118 return true;
119 }
120 return false;
121 }
122
123 public void setHost(final HostInstance pHost) {
124 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
125 this.fHost = pHost;
126 }
127
128 public void setHdd(final Integer pHdd) {
129 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
130 this.fHdd = pHdd;
131 }
132
133 @Override
134 public String patternName() {
135 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd";
136 }
137
138 @Override
139 public List<String> parameterNames() {
140 return AvailableHdd.Match.parameterNames;
141 }
142
143 @Override
144 public Object[] toArray() {
145 return new Object[]{fHost, fHdd};
146 }
147
148 @Override
149 public AvailableHdd.Match toImmutable() {
150 return isMutable() ? newMatch(fHost, fHdd) : this;
151 }
152
153 @Override
154 public String prettyPrint() {
155 StringBuilder result = new StringBuilder();
156 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
157 result.append("\"Hdd\"=" + prettyPrintValue(fHdd));
158 return result.toString();
159 }
160
161 @Override
162 public int hashCode() {
163 return Objects.hash(fHost, fHdd);
164 }
165
166 @Override
167 public boolean equals(final Object obj) {
168 if (this == obj)
169 return true;
170 if (obj == null) {
171 return false;
172 }
173 if ((obj instanceof AvailableHdd.Match)) {
174 AvailableHdd.Match other = (AvailableHdd.Match) obj;
175 return Objects.equals(fHost, other.fHost) && Objects.equals(fHdd, other.fHdd);
176 } else {
177 // this should be infrequent
178 if (!(obj instanceof IPatternMatch)) {
179 return false;
180 }
181 IPatternMatch otherSig = (IPatternMatch) obj;
182 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
183 }
184 }
185
186 @Override
187 public AvailableHdd specification() {
188 return AvailableHdd.instance();
189 }
190
191 /**
192 * Returns an empty, mutable match.
193 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
194 *
195 * @return the empty match.
196 *
197 */
198 public static AvailableHdd.Match newEmptyMatch() {
199 return new Mutable(null, null);
200 }
201
202 /**
203 * Returns a mutable (partial) match.
204 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
205 *
206 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
207 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
208 * @return the new, mutable (partial) match object.
209 *
210 */
211 public static AvailableHdd.Match newMutableMatch(final HostInstance pHost, final Integer pHdd) {
212 return new Mutable(pHost, pHdd);
213 }
214
215 /**
216 * Returns a new (partial) match.
217 * This can be used e.g. to call the matcher with a partial match.
218 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
219 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
220 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
221 * @return the (partial) match object.
222 *
223 */
224 public static AvailableHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
225 return new Immutable(pHost, pHdd);
226 }
227
228 private static final class Mutable extends AvailableHdd.Match {
229 Mutable(final HostInstance pHost, final Integer pHdd) {
230 super(pHost, pHdd);
231 }
232
233 @Override
234 public boolean isMutable() {
235 return true;
236 }
237 }
238
239 private static final class Immutable extends AvailableHdd.Match {
240 Immutable(final HostInstance pHost, final Integer pHdd) {
241 super(pHost, pHdd);
242 }
243
244 @Override
245 public boolean isMutable() {
246 return false;
247 }
248 }
249 }
250
251 /**
252 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd pattern,
253 * providing pattern-specific query methods.
254 *
255 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
256 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
257 *
258 * <p>Matches of the pattern will be represented as {@link Match}.
259 *
260 * <p>Original source:
261 * <code><pre>
262 * {@literal @}QueryBasedFeature(feature = "availableHdd")
263 * pattern availableHdd(Host : HostInstance, Hdd : java Integer) {
264 * find totalHdd(Host, TotalHdd);
265 * RequiredHdd == sum find hddRequirement(Host, _, #_);
266 * Hdd == eval(TotalHdd - RequiredHdd);
267 * }
268 * </pre></code>
269 *
270 * @see Match
271 * @see AvailableHdd
272 *
273 */
274 public static class Matcher extends BaseMatcher<AvailableHdd.Match> {
275 /**
276 * Initializes the pattern matcher within an existing VIATRA Query engine.
277 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
278 *
279 * @param engine the existing VIATRA Query engine in which this matcher will be created.
280 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
281 *
282 */
283 public static AvailableHdd.Matcher on(final ViatraQueryEngine engine) {
284 // check if matcher already exists
285 Matcher matcher = engine.getExistingMatcher(querySpecification());
286 if (matcher == null) {
287 matcher = (Matcher)engine.getMatcher(querySpecification());
288 }
289 return matcher;
290 }
291
292 /**
293 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
294 * @return an initialized matcher
295 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
296 *
297 */
298 public static AvailableHdd.Matcher create() {
299 return new Matcher();
300 }
301
302 private static final int POSITION_HOST = 0;
303
304 private static final int POSITION_HDD = 1;
305
306 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AvailableHdd.Matcher.class);
307
308 /**
309 * Initializes the pattern matcher within an existing VIATRA Query engine.
310 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
311 *
312 * @param engine the existing VIATRA Query engine in which this matcher will be created.
313 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
314 *
315 */
316 private Matcher() {
317 super(querySpecification());
318 }
319
320 /**
321 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
322 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
323 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
324 * @return matches represented as a Match object.
325 *
326 */
327 public Collection<AvailableHdd.Match> getAllMatches(final HostInstance pHost, final Integer pHdd) {
328 return rawStreamAllMatches(new Object[]{pHost, pHdd}).collect(Collectors.toSet());
329 }
330
331 /**
332 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
333 * </p>
334 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
335 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
336 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
337 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
338 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
339 * @return a stream of matches represented as a Match object.
340 *
341 */
342 public Stream<AvailableHdd.Match> streamAllMatches(final HostInstance pHost, final Integer pHdd) {
343 return rawStreamAllMatches(new Object[]{pHost, pHdd});
344 }
345
346 /**
347 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
348 * Neither determinism nor randomness of selection is guaranteed.
349 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
350 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
351 * @return a match represented as a Match object, or null if no match is found.
352 *
353 */
354 public Optional<AvailableHdd.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pHdd) {
355 return rawGetOneArbitraryMatch(new Object[]{pHost, pHdd});
356 }
357
358 /**
359 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
360 * under any possible substitution of the unspecified parameters (if any).
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
363 * @return true if the input is a valid (partial) match of the pattern.
364 *
365 */
366 public boolean hasMatch(final HostInstance pHost, final Integer pHdd) {
367 return rawHasMatch(new Object[]{pHost, pHdd});
368 }
369
370 /**
371 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
372 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
373 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
374 * @return the number of pattern matches found.
375 *
376 */
377 public int countMatches(final HostInstance pHost, final Integer pHdd) {
378 return rawCountMatches(new Object[]{pHost, pHdd});
379 }
380
381 /**
382 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
383 * Neither determinism nor randomness of selection is guaranteed.
384 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
385 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
386 * @param processor the action that will process the selected match.
387 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
388 *
389 */
390 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pHdd, final Consumer<? super AvailableHdd.Match> processor) {
391 return rawForOneArbitraryMatch(new Object[]{pHost, pHdd}, processor);
392 }
393
394 /**
395 * Returns a new (partial) match.
396 * This can be used e.g. to call the matcher with a partial match.
397 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
398 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
399 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
400 * @return the (partial) match object.
401 *
402 */
403 public AvailableHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
404 return AvailableHdd.Match.newMatch(pHost, pHdd);
405 }
406
407 /**
408 * Retrieve the set of values that occur in matches for Host.
409 * @return the Set of all values or empty set if there are no matches
410 *
411 */
412 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
413 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
414 }
415
416 /**
417 * Retrieve the set of values that occur in matches for Host.
418 * @return the Set of all values or empty set if there are no matches
419 *
420 */
421 public Set<HostInstance> getAllValuesOfHost() {
422 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
423 }
424
425 /**
426 * Retrieve the set of values that occur in matches for Host.
427 * @return the Set of all values or empty set if there are no matches
428 *
429 */
430 public Stream<HostInstance> streamAllValuesOfHost() {
431 return rawStreamAllValuesOfHost(emptyArray());
432 }
433
434 /**
435 * Retrieve the set of values that occur in matches for Host.
436 * </p>
437 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
438 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
439 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
440 *
441 * @return the Stream of all values or empty set if there are no matches
442 *
443 */
444 public Stream<HostInstance> streamAllValuesOfHost(final AvailableHdd.Match partialMatch) {
445 return rawStreamAllValuesOfHost(partialMatch.toArray());
446 }
447
448 /**
449 * Retrieve the set of values that occur in matches for Host.
450 * </p>
451 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
452 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
453 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
454 *
455 * @return the Stream of all values or empty set if there are no matches
456 *
457 */
458 public Stream<HostInstance> streamAllValuesOfHost(final Integer pHdd) {
459 return rawStreamAllValuesOfHost(new Object[]{null, pHdd});
460 }
461
462 /**
463 * Retrieve the set of values that occur in matches for Host.
464 * @return the Set of all values or empty set if there are no matches
465 *
466 */
467 public Set<HostInstance> getAllValuesOfHost(final AvailableHdd.Match partialMatch) {
468 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
469 }
470
471 /**
472 * Retrieve the set of values that occur in matches for Host.
473 * @return the Set of all values or empty set if there are no matches
474 *
475 */
476 public Set<HostInstance> getAllValuesOfHost(final Integer pHdd) {
477 return rawStreamAllValuesOfHost(new Object[]{null, pHdd}).collect(Collectors.toSet());
478 }
479
480 /**
481 * Retrieve the set of values that occur in matches for Hdd.
482 * @return the Set of all values or empty set if there are no matches
483 *
484 */
485 protected Stream<Integer> rawStreamAllValuesOfHdd(final Object[] parameters) {
486 return rawStreamAllValues(POSITION_HDD, parameters).map(Integer.class::cast);
487 }
488
489 /**
490 * Retrieve the set of values that occur in matches for Hdd.
491 * @return the Set of all values or empty set if there are no matches
492 *
493 */
494 public Set<Integer> getAllValuesOfHdd() {
495 return rawStreamAllValuesOfHdd(emptyArray()).collect(Collectors.toSet());
496 }
497
498 /**
499 * Retrieve the set of values that occur in matches for Hdd.
500 * @return the Set of all values or empty set if there are no matches
501 *
502 */
503 public Stream<Integer> streamAllValuesOfHdd() {
504 return rawStreamAllValuesOfHdd(emptyArray());
505 }
506
507 /**
508 * Retrieve the set of values that occur in matches for Hdd.
509 * </p>
510 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
511 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
512 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
513 *
514 * @return the Stream of all values or empty set if there are no matches
515 *
516 */
517 public Stream<Integer> streamAllValuesOfHdd(final AvailableHdd.Match partialMatch) {
518 return rawStreamAllValuesOfHdd(partialMatch.toArray());
519 }
520
521 /**
522 * Retrieve the set of values that occur in matches for Hdd.
523 * </p>
524 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
525 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
526 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
527 *
528 * @return the Stream of all values or empty set if there are no matches
529 *
530 */
531 public Stream<Integer> streamAllValuesOfHdd(final HostInstance pHost) {
532 return rawStreamAllValuesOfHdd(new Object[]{pHost, null});
533 }
534
535 /**
536 * Retrieve the set of values that occur in matches for Hdd.
537 * @return the Set of all values or empty set if there are no matches
538 *
539 */
540 public Set<Integer> getAllValuesOfHdd(final AvailableHdd.Match partialMatch) {
541 return rawStreamAllValuesOfHdd(partialMatch.toArray()).collect(Collectors.toSet());
542 }
543
544 /**
545 * Retrieve the set of values that occur in matches for Hdd.
546 * @return the Set of all values or empty set if there are no matches
547 *
548 */
549 public Set<Integer> getAllValuesOfHdd(final HostInstance pHost) {
550 return rawStreamAllValuesOfHdd(new Object[]{pHost, null}).collect(Collectors.toSet());
551 }
552
553 @Override
554 protected AvailableHdd.Match tupleToMatch(final Tuple t) {
555 try {
556 return AvailableHdd.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_HDD));
557 } catch(ClassCastException e) {
558 LOGGER.error("Element(s) in tuple not properly typed!",e);
559 return null;
560 }
561 }
562
563 @Override
564 protected AvailableHdd.Match arrayToMatch(final Object[] match) {
565 try {
566 return AvailableHdd.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
567 } catch(ClassCastException e) {
568 LOGGER.error("Element(s) in array not properly typed!",e);
569 return null;
570 }
571 }
572
573 @Override
574 protected AvailableHdd.Match arrayToMatchMutable(final Object[] match) {
575 try {
576 return AvailableHdd.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
577 } catch(ClassCastException e) {
578 LOGGER.error("Element(s) in array not properly typed!",e);
579 return null;
580 }
581 }
582
583 /**
584 * @return the singleton instance of the query specification of this pattern
585 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
586 *
587 */
588 public static IQuerySpecification<AvailableHdd.Matcher> querySpecification() {
589 return AvailableHdd.instance();
590 }
591 }
592
593 private AvailableHdd() {
594 super(GeneratedPQuery.INSTANCE);
595 }
596
597 /**
598 * @return the singleton instance of the query specification
599 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
600 *
601 */
602 public static AvailableHdd instance() {
603 try{
604 return LazyHolder.INSTANCE;
605 } catch (ExceptionInInitializerError err) {
606 throw processInitializerError(err);
607 }
608 }
609
610 @Override
611 protected AvailableHdd.Matcher instantiate(final ViatraQueryEngine engine) {
612 return AvailableHdd.Matcher.on(engine);
613 }
614
615 @Override
616 public AvailableHdd.Matcher instantiate() {
617 return AvailableHdd.Matcher.create();
618 }
619
620 @Override
621 public AvailableHdd.Match newEmptyMatch() {
622 return AvailableHdd.Match.newEmptyMatch();
623 }
624
625 @Override
626 public AvailableHdd.Match newMatch(final Object... parameters) {
627 return AvailableHdd.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
628 }
629
630 /**
631 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd (visibility: PUBLIC, simpleName: AvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
632 * <b>not</b> at the class load time of the outer class,
633 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd (visibility: PUBLIC, simpleName: AvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
634 *
635 * <p> This workaround is required e.g. to support recursion.
636 *
637 */
638 private static class LazyHolder {
639 private static final AvailableHdd INSTANCE = new AvailableHdd();
640
641 /**
642 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
643 * This initialization order is required to support indirect recursion.
644 *
645 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
646 *
647 */
648 private static final Object STATIC_INITIALIZER = ensureInitialized();
649
650 public static Object ensureInitialized() {
651 INSTANCE.ensureInitializedInternal();
652 return null;
653 }
654 }
655
656 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
657 private static final AvailableHdd.GeneratedPQuery INSTANCE = new GeneratedPQuery();
658
659 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
660
661 private final PParameter parameter_Hdd = new PParameter("Hdd", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT);
662
663 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Hdd);
664
665 private GeneratedPQuery() {
666 super(PVisibility.PUBLIC);
667 }
668
669 @Override
670 public String getFullyQualifiedName() {
671 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd";
672 }
673
674 @Override
675 public List<String> getParameterNames() {
676 return Arrays.asList("Host","Hdd");
677 }
678
679 @Override
680 public List<PParameter> getParameters() {
681 return parameters;
682 }
683
684 @Override
685 public Set<PBody> doGetContainedBodies() {
686 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
687 Set<PBody> bodies = new LinkedHashSet<>();
688 {
689 PBody body = new PBody(this);
690 PVariable var_Host = body.getOrCreateVariableByName("Host");
691 PVariable var_Hdd = body.getOrCreateVariableByName("Hdd");
692 PVariable var_TotalHdd = body.getOrCreateVariableByName("TotalHdd");
693 PVariable var_RequiredHdd = body.getOrCreateVariableByName("RequiredHdd");
694 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
695 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
696 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
697 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Hdd), new JavaTransitiveInstancesKey(java.lang.Integer.class));
698 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
699 new ExportedParameter(body, var_Host, parameter_Host),
700 new ExportedParameter(body, var_Hdd, parameter_Hdd)
701 ));
702 // find totalHdd(Host, TotalHdd)
703 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_TotalHdd), TotalHdd.instance().getInternalQueryRepresentation());
704 // RequiredHdd == sum find hddRequirement(Host, _, #_)
705 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
706 new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var_Host, var___0_, var___1_), HddRequirement.instance().getInternalQueryRepresentation(), var__virtual_0_, 2);
707 new Equality(body, var_RequiredHdd, var__virtual_0_);
708 // Hdd == eval(TotalHdd - RequiredHdd)
709 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
710 new ExpressionEvaluation(body, new IExpressionEvaluator() {
711
712 @Override
713 public String getShortDescription() {
714 return "Expression evaluation from pattern availableHdd";
715 }
716
717 @Override
718 public Iterable<String> getInputParameterNames() {
719 return Arrays.asList("RequiredHdd", "TotalHdd");}
720
721 @Override
722 public Object evaluateExpression(IValueProvider provider) throws Exception {
723 Integer RequiredHdd = (Integer) provider.getValue("RequiredHdd");
724 Integer TotalHdd = (Integer) provider.getValue("TotalHdd");
725 return evaluateExpression_1_1(RequiredHdd, TotalHdd);
726 }
727 }, var__virtual_1_ );
728 new Equality(body, var_Hdd, var__virtual_1_);
729 bodies.add(body);
730 }
731 {
732 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
733 annotation.addAttribute("feature", "availableHdd");
734 addAnnotation(annotation);
735 }
736 return bodies;
737 }
738 }
739
740 private static int evaluateExpression_1_1(final Integer RequiredHdd, final Integer TotalHdd) {
741 return ((TotalHdd).intValue() - (RequiredHdd).intValue());
742 }
743}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java
new file mode 100644
index 00000000..930a24ba
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java
@@ -0,0 +1,743 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.emf.ecore.EClass;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
32import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
33import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
34import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
35import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
36import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
43import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
44import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
45import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
46import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
47import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
48import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
49import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
50
51/**
52 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
53 *
54 * <p>Original source:
55 * <code><pre>
56 * {@literal @}QueryBasedFeature(feature = "availableMemory")
57 * pattern availableMemory(Host : HostInstance, Memory : java Integer) {
58 * find totalMemory(Host, TotalMemory);
59 * RequiredMemory == sum find memoryRequirement(Host, _, #_);
60 * Memory == eval(TotalMemory - RequiredMemory);
61 * }
62 * </pre></code>
63 *
64 * @see Matcher
65 * @see Match
66 *
67 */
68@SuppressWarnings("all")
69public final class AvailableMemory extends BaseGeneratedEMFQuerySpecification<AvailableMemory.Matcher> {
70 /**
71 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory pattern,
72 * to be used in conjunction with {@link Matcher}.
73 *
74 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
75 * Each instance is a (possibly partial) substitution of pattern parameters,
76 * usable to represent a match of the pattern in the result of a query,
77 * or to specify the bound (fixed) input parameters when issuing a query.
78 *
79 * @see Matcher
80 *
81 */
82 public static abstract class Match extends BasePatternMatch {
83 private HostInstance fHost;
84
85 private Integer fMemory;
86
87 private static List<String> parameterNames = makeImmutableList("Host", "Memory");
88
89 private Match(final HostInstance pHost, final Integer pMemory) {
90 this.fHost = pHost;
91 this.fMemory = pMemory;
92 }
93
94 @Override
95 public Object get(final String parameterName) {
96 if ("Host".equals(parameterName)) return this.fHost;
97 if ("Memory".equals(parameterName)) return this.fMemory;
98 return null;
99 }
100
101 public HostInstance getHost() {
102 return this.fHost;
103 }
104
105 public Integer getMemory() {
106 return this.fMemory;
107 }
108
109 @Override
110 public boolean set(final String parameterName, final Object newValue) {
111 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
112 if ("Host".equals(parameterName) ) {
113 this.fHost = (HostInstance) newValue;
114 return true;
115 }
116 if ("Memory".equals(parameterName) ) {
117 this.fMemory = (Integer) newValue;
118 return true;
119 }
120 return false;
121 }
122
123 public void setHost(final HostInstance pHost) {
124 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
125 this.fHost = pHost;
126 }
127
128 public void setMemory(final Integer pMemory) {
129 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
130 this.fMemory = pMemory;
131 }
132
133 @Override
134 public String patternName() {
135 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory";
136 }
137
138 @Override
139 public List<String> parameterNames() {
140 return AvailableMemory.Match.parameterNames;
141 }
142
143 @Override
144 public Object[] toArray() {
145 return new Object[]{fHost, fMemory};
146 }
147
148 @Override
149 public AvailableMemory.Match toImmutable() {
150 return isMutable() ? newMatch(fHost, fMemory) : this;
151 }
152
153 @Override
154 public String prettyPrint() {
155 StringBuilder result = new StringBuilder();
156 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
157 result.append("\"Memory\"=" + prettyPrintValue(fMemory));
158 return result.toString();
159 }
160
161 @Override
162 public int hashCode() {
163 return Objects.hash(fHost, fMemory);
164 }
165
166 @Override
167 public boolean equals(final Object obj) {
168 if (this == obj)
169 return true;
170 if (obj == null) {
171 return false;
172 }
173 if ((obj instanceof AvailableMemory.Match)) {
174 AvailableMemory.Match other = (AvailableMemory.Match) obj;
175 return Objects.equals(fHost, other.fHost) && Objects.equals(fMemory, other.fMemory);
176 } else {
177 // this should be infrequent
178 if (!(obj instanceof IPatternMatch)) {
179 return false;
180 }
181 IPatternMatch otherSig = (IPatternMatch) obj;
182 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
183 }
184 }
185
186 @Override
187 public AvailableMemory specification() {
188 return AvailableMemory.instance();
189 }
190
191 /**
192 * Returns an empty, mutable match.
193 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
194 *
195 * @return the empty match.
196 *
197 */
198 public static AvailableMemory.Match newEmptyMatch() {
199 return new Mutable(null, null);
200 }
201
202 /**
203 * Returns a mutable (partial) match.
204 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
205 *
206 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
207 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
208 * @return the new, mutable (partial) match object.
209 *
210 */
211 public static AvailableMemory.Match newMutableMatch(final HostInstance pHost, final Integer pMemory) {
212 return new Mutable(pHost, pMemory);
213 }
214
215 /**
216 * Returns a new (partial) match.
217 * This can be used e.g. to call the matcher with a partial match.
218 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
219 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
220 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
221 * @return the (partial) match object.
222 *
223 */
224 public static AvailableMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
225 return new Immutable(pHost, pMemory);
226 }
227
228 private static final class Mutable extends AvailableMemory.Match {
229 Mutable(final HostInstance pHost, final Integer pMemory) {
230 super(pHost, pMemory);
231 }
232
233 @Override
234 public boolean isMutable() {
235 return true;
236 }
237 }
238
239 private static final class Immutable extends AvailableMemory.Match {
240 Immutable(final HostInstance pHost, final Integer pMemory) {
241 super(pHost, pMemory);
242 }
243
244 @Override
245 public boolean isMutable() {
246 return false;
247 }
248 }
249 }
250
251 /**
252 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory pattern,
253 * providing pattern-specific query methods.
254 *
255 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
256 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
257 *
258 * <p>Matches of the pattern will be represented as {@link Match}.
259 *
260 * <p>Original source:
261 * <code><pre>
262 * {@literal @}QueryBasedFeature(feature = "availableMemory")
263 * pattern availableMemory(Host : HostInstance, Memory : java Integer) {
264 * find totalMemory(Host, TotalMemory);
265 * RequiredMemory == sum find memoryRequirement(Host, _, #_);
266 * Memory == eval(TotalMemory - RequiredMemory);
267 * }
268 * </pre></code>
269 *
270 * @see Match
271 * @see AvailableMemory
272 *
273 */
274 public static class Matcher extends BaseMatcher<AvailableMemory.Match> {
275 /**
276 * Initializes the pattern matcher within an existing VIATRA Query engine.
277 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
278 *
279 * @param engine the existing VIATRA Query engine in which this matcher will be created.
280 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
281 *
282 */
283 public static AvailableMemory.Matcher on(final ViatraQueryEngine engine) {
284 // check if matcher already exists
285 Matcher matcher = engine.getExistingMatcher(querySpecification());
286 if (matcher == null) {
287 matcher = (Matcher)engine.getMatcher(querySpecification());
288 }
289 return matcher;
290 }
291
292 /**
293 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
294 * @return an initialized matcher
295 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
296 *
297 */
298 public static AvailableMemory.Matcher create() {
299 return new Matcher();
300 }
301
302 private static final int POSITION_HOST = 0;
303
304 private static final int POSITION_MEMORY = 1;
305
306 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AvailableMemory.Matcher.class);
307
308 /**
309 * Initializes the pattern matcher within an existing VIATRA Query engine.
310 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
311 *
312 * @param engine the existing VIATRA Query engine in which this matcher will be created.
313 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
314 *
315 */
316 private Matcher() {
317 super(querySpecification());
318 }
319
320 /**
321 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
322 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
323 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
324 * @return matches represented as a Match object.
325 *
326 */
327 public Collection<AvailableMemory.Match> getAllMatches(final HostInstance pHost, final Integer pMemory) {
328 return rawStreamAllMatches(new Object[]{pHost, pMemory}).collect(Collectors.toSet());
329 }
330
331 /**
332 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
333 * </p>
334 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
335 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
336 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
337 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
338 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
339 * @return a stream of matches represented as a Match object.
340 *
341 */
342 public Stream<AvailableMemory.Match> streamAllMatches(final HostInstance pHost, final Integer pMemory) {
343 return rawStreamAllMatches(new Object[]{pHost, pMemory});
344 }
345
346 /**
347 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
348 * Neither determinism nor randomness of selection is guaranteed.
349 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
350 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
351 * @return a match represented as a Match object, or null if no match is found.
352 *
353 */
354 public Optional<AvailableMemory.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pMemory) {
355 return rawGetOneArbitraryMatch(new Object[]{pHost, pMemory});
356 }
357
358 /**
359 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
360 * under any possible substitution of the unspecified parameters (if any).
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
363 * @return true if the input is a valid (partial) match of the pattern.
364 *
365 */
366 public boolean hasMatch(final HostInstance pHost, final Integer pMemory) {
367 return rawHasMatch(new Object[]{pHost, pMemory});
368 }
369
370 /**
371 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
372 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
373 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
374 * @return the number of pattern matches found.
375 *
376 */
377 public int countMatches(final HostInstance pHost, final Integer pMemory) {
378 return rawCountMatches(new Object[]{pHost, pMemory});
379 }
380
381 /**
382 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
383 * Neither determinism nor randomness of selection is guaranteed.
384 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
385 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
386 * @param processor the action that will process the selected match.
387 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
388 *
389 */
390 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pMemory, final Consumer<? super AvailableMemory.Match> processor) {
391 return rawForOneArbitraryMatch(new Object[]{pHost, pMemory}, processor);
392 }
393
394 /**
395 * Returns a new (partial) match.
396 * This can be used e.g. to call the matcher with a partial match.
397 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
398 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
399 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
400 * @return the (partial) match object.
401 *
402 */
403 public AvailableMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
404 return AvailableMemory.Match.newMatch(pHost, pMemory);
405 }
406
407 /**
408 * Retrieve the set of values that occur in matches for Host.
409 * @return the Set of all values or empty set if there are no matches
410 *
411 */
412 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
413 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
414 }
415
416 /**
417 * Retrieve the set of values that occur in matches for Host.
418 * @return the Set of all values or empty set if there are no matches
419 *
420 */
421 public Set<HostInstance> getAllValuesOfHost() {
422 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
423 }
424
425 /**
426 * Retrieve the set of values that occur in matches for Host.
427 * @return the Set of all values or empty set if there are no matches
428 *
429 */
430 public Stream<HostInstance> streamAllValuesOfHost() {
431 return rawStreamAllValuesOfHost(emptyArray());
432 }
433
434 /**
435 * Retrieve the set of values that occur in matches for Host.
436 * </p>
437 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
438 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
439 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
440 *
441 * @return the Stream of all values or empty set if there are no matches
442 *
443 */
444 public Stream<HostInstance> streamAllValuesOfHost(final AvailableMemory.Match partialMatch) {
445 return rawStreamAllValuesOfHost(partialMatch.toArray());
446 }
447
448 /**
449 * Retrieve the set of values that occur in matches for Host.
450 * </p>
451 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
452 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
453 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
454 *
455 * @return the Stream of all values or empty set if there are no matches
456 *
457 */
458 public Stream<HostInstance> streamAllValuesOfHost(final Integer pMemory) {
459 return rawStreamAllValuesOfHost(new Object[]{null, pMemory});
460 }
461
462 /**
463 * Retrieve the set of values that occur in matches for Host.
464 * @return the Set of all values or empty set if there are no matches
465 *
466 */
467 public Set<HostInstance> getAllValuesOfHost(final AvailableMemory.Match partialMatch) {
468 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
469 }
470
471 /**
472 * Retrieve the set of values that occur in matches for Host.
473 * @return the Set of all values or empty set if there are no matches
474 *
475 */
476 public Set<HostInstance> getAllValuesOfHost(final Integer pMemory) {
477 return rawStreamAllValuesOfHost(new Object[]{null, pMemory}).collect(Collectors.toSet());
478 }
479
480 /**
481 * Retrieve the set of values that occur in matches for Memory.
482 * @return the Set of all values or empty set if there are no matches
483 *
484 */
485 protected Stream<Integer> rawStreamAllValuesOfMemory(final Object[] parameters) {
486 return rawStreamAllValues(POSITION_MEMORY, parameters).map(Integer.class::cast);
487 }
488
489 /**
490 * Retrieve the set of values that occur in matches for Memory.
491 * @return the Set of all values or empty set if there are no matches
492 *
493 */
494 public Set<Integer> getAllValuesOfMemory() {
495 return rawStreamAllValuesOfMemory(emptyArray()).collect(Collectors.toSet());
496 }
497
498 /**
499 * Retrieve the set of values that occur in matches for Memory.
500 * @return the Set of all values or empty set if there are no matches
501 *
502 */
503 public Stream<Integer> streamAllValuesOfMemory() {
504 return rawStreamAllValuesOfMemory(emptyArray());
505 }
506
507 /**
508 * Retrieve the set of values that occur in matches for Memory.
509 * </p>
510 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
511 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
512 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
513 *
514 * @return the Stream of all values or empty set if there are no matches
515 *
516 */
517 public Stream<Integer> streamAllValuesOfMemory(final AvailableMemory.Match partialMatch) {
518 return rawStreamAllValuesOfMemory(partialMatch.toArray());
519 }
520
521 /**
522 * Retrieve the set of values that occur in matches for Memory.
523 * </p>
524 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
525 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
526 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
527 *
528 * @return the Stream of all values or empty set if there are no matches
529 *
530 */
531 public Stream<Integer> streamAllValuesOfMemory(final HostInstance pHost) {
532 return rawStreamAllValuesOfMemory(new Object[]{pHost, null});
533 }
534
535 /**
536 * Retrieve the set of values that occur in matches for Memory.
537 * @return the Set of all values or empty set if there are no matches
538 *
539 */
540 public Set<Integer> getAllValuesOfMemory(final AvailableMemory.Match partialMatch) {
541 return rawStreamAllValuesOfMemory(partialMatch.toArray()).collect(Collectors.toSet());
542 }
543
544 /**
545 * Retrieve the set of values that occur in matches for Memory.
546 * @return the Set of all values or empty set if there are no matches
547 *
548 */
549 public Set<Integer> getAllValuesOfMemory(final HostInstance pHost) {
550 return rawStreamAllValuesOfMemory(new Object[]{pHost, null}).collect(Collectors.toSet());
551 }
552
553 @Override
554 protected AvailableMemory.Match tupleToMatch(final Tuple t) {
555 try {
556 return AvailableMemory.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_MEMORY));
557 } catch(ClassCastException e) {
558 LOGGER.error("Element(s) in tuple not properly typed!",e);
559 return null;
560 }
561 }
562
563 @Override
564 protected AvailableMemory.Match arrayToMatch(final Object[] match) {
565 try {
566 return AvailableMemory.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
567 } catch(ClassCastException e) {
568 LOGGER.error("Element(s) in array not properly typed!",e);
569 return null;
570 }
571 }
572
573 @Override
574 protected AvailableMemory.Match arrayToMatchMutable(final Object[] match) {
575 try {
576 return AvailableMemory.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
577 } catch(ClassCastException e) {
578 LOGGER.error("Element(s) in array not properly typed!",e);
579 return null;
580 }
581 }
582
583 /**
584 * @return the singleton instance of the query specification of this pattern
585 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
586 *
587 */
588 public static IQuerySpecification<AvailableMemory.Matcher> querySpecification() {
589 return AvailableMemory.instance();
590 }
591 }
592
593 private AvailableMemory() {
594 super(GeneratedPQuery.INSTANCE);
595 }
596
597 /**
598 * @return the singleton instance of the query specification
599 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
600 *
601 */
602 public static AvailableMemory instance() {
603 try{
604 return LazyHolder.INSTANCE;
605 } catch (ExceptionInInitializerError err) {
606 throw processInitializerError(err);
607 }
608 }
609
610 @Override
611 protected AvailableMemory.Matcher instantiate(final ViatraQueryEngine engine) {
612 return AvailableMemory.Matcher.on(engine);
613 }
614
615 @Override
616 public AvailableMemory.Matcher instantiate() {
617 return AvailableMemory.Matcher.create();
618 }
619
620 @Override
621 public AvailableMemory.Match newEmptyMatch() {
622 return AvailableMemory.Match.newEmptyMatch();
623 }
624
625 @Override
626 public AvailableMemory.Match newMatch(final Object... parameters) {
627 return AvailableMemory.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
628 }
629
630 /**
631 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory (visibility: PUBLIC, simpleName: AvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
632 * <b>not</b> at the class load time of the outer class,
633 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory (visibility: PUBLIC, simpleName: AvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
634 *
635 * <p> This workaround is required e.g. to support recursion.
636 *
637 */
638 private static class LazyHolder {
639 private static final AvailableMemory INSTANCE = new AvailableMemory();
640
641 /**
642 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
643 * This initialization order is required to support indirect recursion.
644 *
645 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
646 *
647 */
648 private static final Object STATIC_INITIALIZER = ensureInitialized();
649
650 public static Object ensureInitialized() {
651 INSTANCE.ensureInitializedInternal();
652 return null;
653 }
654 }
655
656 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
657 private static final AvailableMemory.GeneratedPQuery INSTANCE = new GeneratedPQuery();
658
659 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
660
661 private final PParameter parameter_Memory = new PParameter("Memory", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT);
662
663 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Memory);
664
665 private GeneratedPQuery() {
666 super(PVisibility.PUBLIC);
667 }
668
669 @Override
670 public String getFullyQualifiedName() {
671 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory";
672 }
673
674 @Override
675 public List<String> getParameterNames() {
676 return Arrays.asList("Host","Memory");
677 }
678
679 @Override
680 public List<PParameter> getParameters() {
681 return parameters;
682 }
683
684 @Override
685 public Set<PBody> doGetContainedBodies() {
686 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
687 Set<PBody> bodies = new LinkedHashSet<>();
688 {
689 PBody body = new PBody(this);
690 PVariable var_Host = body.getOrCreateVariableByName("Host");
691 PVariable var_Memory = body.getOrCreateVariableByName("Memory");
692 PVariable var_TotalMemory = body.getOrCreateVariableByName("TotalMemory");
693 PVariable var_RequiredMemory = body.getOrCreateVariableByName("RequiredMemory");
694 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
695 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
696 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
697 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Memory), new JavaTransitiveInstancesKey(java.lang.Integer.class));
698 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
699 new ExportedParameter(body, var_Host, parameter_Host),
700 new ExportedParameter(body, var_Memory, parameter_Memory)
701 ));
702 // find totalMemory(Host, TotalMemory)
703 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_TotalMemory), TotalMemory.instance().getInternalQueryRepresentation());
704 // RequiredMemory == sum find memoryRequirement(Host, _, #_)
705 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
706 new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var_Host, var___0_, var___1_), MemoryRequirement.instance().getInternalQueryRepresentation(), var__virtual_0_, 2);
707 new Equality(body, var_RequiredMemory, var__virtual_0_);
708 // Memory == eval(TotalMemory - RequiredMemory)
709 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
710 new ExpressionEvaluation(body, new IExpressionEvaluator() {
711
712 @Override
713 public String getShortDescription() {
714 return "Expression evaluation from pattern availableMemory";
715 }
716
717 @Override
718 public Iterable<String> getInputParameterNames() {
719 return Arrays.asList("RequiredMemory", "TotalMemory");}
720
721 @Override
722 public Object evaluateExpression(IValueProvider provider) throws Exception {
723 Integer RequiredMemory = (Integer) provider.getValue("RequiredMemory");
724 Integer TotalMemory = (Integer) provider.getValue("TotalMemory");
725 return evaluateExpression_1_1(RequiredMemory, TotalMemory);
726 }
727 }, var__virtual_1_ );
728 new Equality(body, var_Memory, var__virtual_1_);
729 bodies.add(body);
730 }
731 {
732 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
733 annotation.addAttribute("feature", "availableMemory");
734 addAnnotation(annotation);
735 }
736 return bodies;
737 }
738 }
739
740 private static int evaluateExpression_1_1(final Integer RequiredMemory, final Integer TotalMemory) {
741 return ((TotalMemory).intValue() - (RequiredMemory).intValue());
742 }
743}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeHddMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeHddMetric.java
new file mode 100644
index 00000000..59d4ad27
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeHddMetric.java
@@ -0,0 +1,540 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.matchers.aggregators.avg;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
29import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
37import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
39import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
40
41/**
42 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
43 *
44 * <p>Original source:
45 * <code><pre>
46 * pattern averageFreeHddMetric(Average : java Double) {
47 * Average == avg find freeHddPercentage(_, #_);
48 * }
49 * </pre></code>
50 *
51 * @see Matcher
52 * @see Match
53 *
54 */
55@SuppressWarnings("all")
56public final class AverageFreeHddMetric extends BaseGeneratedEMFQuerySpecification<AverageFreeHddMetric.Matcher> {
57 /**
58 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric pattern,
59 * to be used in conjunction with {@link Matcher}.
60 *
61 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
62 * Each instance is a (possibly partial) substitution of pattern parameters,
63 * usable to represent a match of the pattern in the result of a query,
64 * or to specify the bound (fixed) input parameters when issuing a query.
65 *
66 * @see Matcher
67 *
68 */
69 public static abstract class Match extends BasePatternMatch {
70 private Double fAverage;
71
72 private static List<String> parameterNames = makeImmutableList("Average");
73
74 private Match(final Double pAverage) {
75 this.fAverage = pAverage;
76 }
77
78 @Override
79 public Object get(final String parameterName) {
80 if ("Average".equals(parameterName)) return this.fAverage;
81 return null;
82 }
83
84 public Double getAverage() {
85 return this.fAverage;
86 }
87
88 @Override
89 public boolean set(final String parameterName, final Object newValue) {
90 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
91 if ("Average".equals(parameterName) ) {
92 this.fAverage = (Double) newValue;
93 return true;
94 }
95 return false;
96 }
97
98 public void setAverage(final Double pAverage) {
99 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
100 this.fAverage = pAverage;
101 }
102
103 @Override
104 public String patternName() {
105 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric";
106 }
107
108 @Override
109 public List<String> parameterNames() {
110 return AverageFreeHddMetric.Match.parameterNames;
111 }
112
113 @Override
114 public Object[] toArray() {
115 return new Object[]{fAverage};
116 }
117
118 @Override
119 public AverageFreeHddMetric.Match toImmutable() {
120 return isMutable() ? newMatch(fAverage) : this;
121 }
122
123 @Override
124 public String prettyPrint() {
125 StringBuilder result = new StringBuilder();
126 result.append("\"Average\"=" + prettyPrintValue(fAverage));
127 return result.toString();
128 }
129
130 @Override
131 public int hashCode() {
132 return Objects.hash(fAverage);
133 }
134
135 @Override
136 public boolean equals(final Object obj) {
137 if (this == obj)
138 return true;
139 if (obj == null) {
140 return false;
141 }
142 if ((obj instanceof AverageFreeHddMetric.Match)) {
143 AverageFreeHddMetric.Match other = (AverageFreeHddMetric.Match) obj;
144 return Objects.equals(fAverage, other.fAverage);
145 } else {
146 // this should be infrequent
147 if (!(obj instanceof IPatternMatch)) {
148 return false;
149 }
150 IPatternMatch otherSig = (IPatternMatch) obj;
151 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
152 }
153 }
154
155 @Override
156 public AverageFreeHddMetric specification() {
157 return AverageFreeHddMetric.instance();
158 }
159
160 /**
161 * Returns an empty, mutable match.
162 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
163 *
164 * @return the empty match.
165 *
166 */
167 public static AverageFreeHddMetric.Match newEmptyMatch() {
168 return new Mutable(null);
169 }
170
171 /**
172 * Returns a mutable (partial) match.
173 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
174 *
175 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
176 * @return the new, mutable (partial) match object.
177 *
178 */
179 public static AverageFreeHddMetric.Match newMutableMatch(final Double pAverage) {
180 return new Mutable(pAverage);
181 }
182
183 /**
184 * Returns a new (partial) match.
185 * This can be used e.g. to call the matcher with a partial match.
186 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
187 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
188 * @return the (partial) match object.
189 *
190 */
191 public static AverageFreeHddMetric.Match newMatch(final Double pAverage) {
192 return new Immutable(pAverage);
193 }
194
195 private static final class Mutable extends AverageFreeHddMetric.Match {
196 Mutable(final Double pAverage) {
197 super(pAverage);
198 }
199
200 @Override
201 public boolean isMutable() {
202 return true;
203 }
204 }
205
206 private static final class Immutable extends AverageFreeHddMetric.Match {
207 Immutable(final Double pAverage) {
208 super(pAverage);
209 }
210
211 @Override
212 public boolean isMutable() {
213 return false;
214 }
215 }
216 }
217
218 /**
219 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric pattern,
220 * providing pattern-specific query methods.
221 *
222 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
223 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
224 *
225 * <p>Matches of the pattern will be represented as {@link Match}.
226 *
227 * <p>Original source:
228 * <code><pre>
229 * pattern averageFreeHddMetric(Average : java Double) {
230 * Average == avg find freeHddPercentage(_, #_);
231 * }
232 * </pre></code>
233 *
234 * @see Match
235 * @see AverageFreeHddMetric
236 *
237 */
238 public static class Matcher extends BaseMatcher<AverageFreeHddMetric.Match> {
239 /**
240 * Initializes the pattern matcher within an existing VIATRA Query engine.
241 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
242 *
243 * @param engine the existing VIATRA Query engine in which this matcher will be created.
244 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
245 *
246 */
247 public static AverageFreeHddMetric.Matcher on(final ViatraQueryEngine engine) {
248 // check if matcher already exists
249 Matcher matcher = engine.getExistingMatcher(querySpecification());
250 if (matcher == null) {
251 matcher = (Matcher)engine.getMatcher(querySpecification());
252 }
253 return matcher;
254 }
255
256 /**
257 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
258 * @return an initialized matcher
259 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
260 *
261 */
262 public static AverageFreeHddMetric.Matcher create() {
263 return new Matcher();
264 }
265
266 private static final int POSITION_AVERAGE = 0;
267
268 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AverageFreeHddMetric.Matcher.class);
269
270 /**
271 * Initializes the pattern matcher within an existing VIATRA Query engine.
272 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
273 *
274 * @param engine the existing VIATRA Query engine in which this matcher will be created.
275 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
276 *
277 */
278 private Matcher() {
279 super(querySpecification());
280 }
281
282 /**
283 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
284 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
285 * @return matches represented as a Match object.
286 *
287 */
288 public Collection<AverageFreeHddMetric.Match> getAllMatches(final Double pAverage) {
289 return rawStreamAllMatches(new Object[]{pAverage}).collect(Collectors.toSet());
290 }
291
292 /**
293 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
294 * </p>
295 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
296 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
297 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
298 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
299 * @return a stream of matches represented as a Match object.
300 *
301 */
302 public Stream<AverageFreeHddMetric.Match> streamAllMatches(final Double pAverage) {
303 return rawStreamAllMatches(new Object[]{pAverage});
304 }
305
306 /**
307 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
308 * Neither determinism nor randomness of selection is guaranteed.
309 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
310 * @return a match represented as a Match object, or null if no match is found.
311 *
312 */
313 public Optional<AverageFreeHddMetric.Match> getOneArbitraryMatch(final Double pAverage) {
314 return rawGetOneArbitraryMatch(new Object[]{pAverage});
315 }
316
317 /**
318 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
319 * under any possible substitution of the unspecified parameters (if any).
320 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
321 * @return true if the input is a valid (partial) match of the pattern.
322 *
323 */
324 public boolean hasMatch(final Double pAverage) {
325 return rawHasMatch(new Object[]{pAverage});
326 }
327
328 /**
329 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
330 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
331 * @return the number of pattern matches found.
332 *
333 */
334 public int countMatches(final Double pAverage) {
335 return rawCountMatches(new Object[]{pAverage});
336 }
337
338 /**
339 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
340 * Neither determinism nor randomness of selection is guaranteed.
341 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
342 * @param processor the action that will process the selected match.
343 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
344 *
345 */
346 public boolean forOneArbitraryMatch(final Double pAverage, final Consumer<? super AverageFreeHddMetric.Match> processor) {
347 return rawForOneArbitraryMatch(new Object[]{pAverage}, processor);
348 }
349
350 /**
351 * Returns a new (partial) match.
352 * This can be used e.g. to call the matcher with a partial match.
353 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
354 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
355 * @return the (partial) match object.
356 *
357 */
358 public AverageFreeHddMetric.Match newMatch(final Double pAverage) {
359 return AverageFreeHddMetric.Match.newMatch(pAverage);
360 }
361
362 /**
363 * Retrieve the set of values that occur in matches for Average.
364 * @return the Set of all values or empty set if there are no matches
365 *
366 */
367 protected Stream<Double> rawStreamAllValuesOfAverage(final Object[] parameters) {
368 return rawStreamAllValues(POSITION_AVERAGE, parameters).map(Double.class::cast);
369 }
370
371 /**
372 * Retrieve the set of values that occur in matches for Average.
373 * @return the Set of all values or empty set if there are no matches
374 *
375 */
376 public Set<Double> getAllValuesOfAverage() {
377 return rawStreamAllValuesOfAverage(emptyArray()).collect(Collectors.toSet());
378 }
379
380 /**
381 * Retrieve the set of values that occur in matches for Average.
382 * @return the Set of all values or empty set if there are no matches
383 *
384 */
385 public Stream<Double> streamAllValuesOfAverage() {
386 return rawStreamAllValuesOfAverage(emptyArray());
387 }
388
389 @Override
390 protected AverageFreeHddMetric.Match tupleToMatch(final Tuple t) {
391 try {
392 return AverageFreeHddMetric.Match.newMatch((Double) t.get(POSITION_AVERAGE));
393 } catch(ClassCastException e) {
394 LOGGER.error("Element(s) in tuple not properly typed!",e);
395 return null;
396 }
397 }
398
399 @Override
400 protected AverageFreeHddMetric.Match arrayToMatch(final Object[] match) {
401 try {
402 return AverageFreeHddMetric.Match.newMatch((Double) match[POSITION_AVERAGE]);
403 } catch(ClassCastException e) {
404 LOGGER.error("Element(s) in array not properly typed!",e);
405 return null;
406 }
407 }
408
409 @Override
410 protected AverageFreeHddMetric.Match arrayToMatchMutable(final Object[] match) {
411 try {
412 return AverageFreeHddMetric.Match.newMutableMatch((Double) match[POSITION_AVERAGE]);
413 } catch(ClassCastException e) {
414 LOGGER.error("Element(s) in array not properly typed!",e);
415 return null;
416 }
417 }
418
419 /**
420 * @return the singleton instance of the query specification of this pattern
421 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
422 *
423 */
424 public static IQuerySpecification<AverageFreeHddMetric.Matcher> querySpecification() {
425 return AverageFreeHddMetric.instance();
426 }
427 }
428
429 private AverageFreeHddMetric() {
430 super(GeneratedPQuery.INSTANCE);
431 }
432
433 /**
434 * @return the singleton instance of the query specification
435 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
436 *
437 */
438 public static AverageFreeHddMetric instance() {
439 try{
440 return LazyHolder.INSTANCE;
441 } catch (ExceptionInInitializerError err) {
442 throw processInitializerError(err);
443 }
444 }
445
446 @Override
447 protected AverageFreeHddMetric.Matcher instantiate(final ViatraQueryEngine engine) {
448 return AverageFreeHddMetric.Matcher.on(engine);
449 }
450
451 @Override
452 public AverageFreeHddMetric.Matcher instantiate() {
453 return AverageFreeHddMetric.Matcher.create();
454 }
455
456 @Override
457 public AverageFreeHddMetric.Match newEmptyMatch() {
458 return AverageFreeHddMetric.Match.newEmptyMatch();
459 }
460
461 @Override
462 public AverageFreeHddMetric.Match newMatch(final Object... parameters) {
463 return AverageFreeHddMetric.Match.newMatch((java.lang.Double) parameters[0]);
464 }
465
466 /**
467 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric (visibility: PUBLIC, simpleName: AverageFreeHddMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
468 * <b>not</b> at the class load time of the outer class,
469 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric (visibility: PUBLIC, simpleName: AverageFreeHddMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
470 *
471 * <p> This workaround is required e.g. to support recursion.
472 *
473 */
474 private static class LazyHolder {
475 private static final AverageFreeHddMetric INSTANCE = new AverageFreeHddMetric();
476
477 /**
478 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
479 * This initialization order is required to support indirect recursion.
480 *
481 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
482 *
483 */
484 private static final Object STATIC_INITIALIZER = ensureInitialized();
485
486 public static Object ensureInitialized() {
487 INSTANCE.ensureInitializedInternal();
488 return null;
489 }
490 }
491
492 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
493 private static final AverageFreeHddMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
494
495 private final PParameter parameter_Average = new PParameter("Average", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
496
497 private final List<PParameter> parameters = Arrays.asList(parameter_Average);
498
499 private GeneratedPQuery() {
500 super(PVisibility.PUBLIC);
501 }
502
503 @Override
504 public String getFullyQualifiedName() {
505 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric";
506 }
507
508 @Override
509 public List<String> getParameterNames() {
510 return Arrays.asList("Average");
511 }
512
513 @Override
514 public List<PParameter> getParameters() {
515 return parameters;
516 }
517
518 @Override
519 public Set<PBody> doGetContainedBodies() {
520 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
521 Set<PBody> bodies = new LinkedHashSet<>();
522 {
523 PBody body = new PBody(this);
524 PVariable var_Average = body.getOrCreateVariableByName("Average");
525 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
526 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
527 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Average), new JavaTransitiveInstancesKey(java.lang.Double.class));
528 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
529 new ExportedParameter(body, var_Average, parameter_Average)
530 ));
531 // Average == avg find freeHddPercentage(_, #_)
532 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
533 new AggregatorConstraint(new avg().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), FreeHddPercentage.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
534 new Equality(body, var_Average, var__virtual_0_);
535 bodies.add(body);
536 }
537 return bodies;
538 }
539 }
540}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeMemoryMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeMemoryMetric.java
new file mode 100644
index 00000000..a0d087f4
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeMemoryMetric.java
@@ -0,0 +1,540 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.matchers.aggregators.avg;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
29import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
37import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
39import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
40
41/**
42 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
43 *
44 * <p>Original source:
45 * <code><pre>
46 * pattern averageFreeMemoryMetric(Average : java Double) {
47 * Average == avg find freeMemoryPercentage(_, #_);
48 * }
49 * </pre></code>
50 *
51 * @see Matcher
52 * @see Match
53 *
54 */
55@SuppressWarnings("all")
56public final class AverageFreeMemoryMetric extends BaseGeneratedEMFQuerySpecification<AverageFreeMemoryMetric.Matcher> {
57 /**
58 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric pattern,
59 * to be used in conjunction with {@link Matcher}.
60 *
61 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
62 * Each instance is a (possibly partial) substitution of pattern parameters,
63 * usable to represent a match of the pattern in the result of a query,
64 * or to specify the bound (fixed) input parameters when issuing a query.
65 *
66 * @see Matcher
67 *
68 */
69 public static abstract class Match extends BasePatternMatch {
70 private Double fAverage;
71
72 private static List<String> parameterNames = makeImmutableList("Average");
73
74 private Match(final Double pAverage) {
75 this.fAverage = pAverage;
76 }
77
78 @Override
79 public Object get(final String parameterName) {
80 if ("Average".equals(parameterName)) return this.fAverage;
81 return null;
82 }
83
84 public Double getAverage() {
85 return this.fAverage;
86 }
87
88 @Override
89 public boolean set(final String parameterName, final Object newValue) {
90 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
91 if ("Average".equals(parameterName) ) {
92 this.fAverage = (Double) newValue;
93 return true;
94 }
95 return false;
96 }
97
98 public void setAverage(final Double pAverage) {
99 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
100 this.fAverage = pAverage;
101 }
102
103 @Override
104 public String patternName() {
105 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric";
106 }
107
108 @Override
109 public List<String> parameterNames() {
110 return AverageFreeMemoryMetric.Match.parameterNames;
111 }
112
113 @Override
114 public Object[] toArray() {
115 return new Object[]{fAverage};
116 }
117
118 @Override
119 public AverageFreeMemoryMetric.Match toImmutable() {
120 return isMutable() ? newMatch(fAverage) : this;
121 }
122
123 @Override
124 public String prettyPrint() {
125 StringBuilder result = new StringBuilder();
126 result.append("\"Average\"=" + prettyPrintValue(fAverage));
127 return result.toString();
128 }
129
130 @Override
131 public int hashCode() {
132 return Objects.hash(fAverage);
133 }
134
135 @Override
136 public boolean equals(final Object obj) {
137 if (this == obj)
138 return true;
139 if (obj == null) {
140 return false;
141 }
142 if ((obj instanceof AverageFreeMemoryMetric.Match)) {
143 AverageFreeMemoryMetric.Match other = (AverageFreeMemoryMetric.Match) obj;
144 return Objects.equals(fAverage, other.fAverage);
145 } else {
146 // this should be infrequent
147 if (!(obj instanceof IPatternMatch)) {
148 return false;
149 }
150 IPatternMatch otherSig = (IPatternMatch) obj;
151 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
152 }
153 }
154
155 @Override
156 public AverageFreeMemoryMetric specification() {
157 return AverageFreeMemoryMetric.instance();
158 }
159
160 /**
161 * Returns an empty, mutable match.
162 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
163 *
164 * @return the empty match.
165 *
166 */
167 public static AverageFreeMemoryMetric.Match newEmptyMatch() {
168 return new Mutable(null);
169 }
170
171 /**
172 * Returns a mutable (partial) match.
173 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
174 *
175 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
176 * @return the new, mutable (partial) match object.
177 *
178 */
179 public static AverageFreeMemoryMetric.Match newMutableMatch(final Double pAverage) {
180 return new Mutable(pAverage);
181 }
182
183 /**
184 * Returns a new (partial) match.
185 * This can be used e.g. to call the matcher with a partial match.
186 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
187 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
188 * @return the (partial) match object.
189 *
190 */
191 public static AverageFreeMemoryMetric.Match newMatch(final Double pAverage) {
192 return new Immutable(pAverage);
193 }
194
195 private static final class Mutable extends AverageFreeMemoryMetric.Match {
196 Mutable(final Double pAverage) {
197 super(pAverage);
198 }
199
200 @Override
201 public boolean isMutable() {
202 return true;
203 }
204 }
205
206 private static final class Immutable extends AverageFreeMemoryMetric.Match {
207 Immutable(final Double pAverage) {
208 super(pAverage);
209 }
210
211 @Override
212 public boolean isMutable() {
213 return false;
214 }
215 }
216 }
217
218 /**
219 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric pattern,
220 * providing pattern-specific query methods.
221 *
222 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
223 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
224 *
225 * <p>Matches of the pattern will be represented as {@link Match}.
226 *
227 * <p>Original source:
228 * <code><pre>
229 * pattern averageFreeMemoryMetric(Average : java Double) {
230 * Average == avg find freeMemoryPercentage(_, #_);
231 * }
232 * </pre></code>
233 *
234 * @see Match
235 * @see AverageFreeMemoryMetric
236 *
237 */
238 public static class Matcher extends BaseMatcher<AverageFreeMemoryMetric.Match> {
239 /**
240 * Initializes the pattern matcher within an existing VIATRA Query engine.
241 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
242 *
243 * @param engine the existing VIATRA Query engine in which this matcher will be created.
244 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
245 *
246 */
247 public static AverageFreeMemoryMetric.Matcher on(final ViatraQueryEngine engine) {
248 // check if matcher already exists
249 Matcher matcher = engine.getExistingMatcher(querySpecification());
250 if (matcher == null) {
251 matcher = (Matcher)engine.getMatcher(querySpecification());
252 }
253 return matcher;
254 }
255
256 /**
257 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
258 * @return an initialized matcher
259 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
260 *
261 */
262 public static AverageFreeMemoryMetric.Matcher create() {
263 return new Matcher();
264 }
265
266 private static final int POSITION_AVERAGE = 0;
267
268 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AverageFreeMemoryMetric.Matcher.class);
269
270 /**
271 * Initializes the pattern matcher within an existing VIATRA Query engine.
272 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
273 *
274 * @param engine the existing VIATRA Query engine in which this matcher will be created.
275 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
276 *
277 */
278 private Matcher() {
279 super(querySpecification());
280 }
281
282 /**
283 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
284 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
285 * @return matches represented as a Match object.
286 *
287 */
288 public Collection<AverageFreeMemoryMetric.Match> getAllMatches(final Double pAverage) {
289 return rawStreamAllMatches(new Object[]{pAverage}).collect(Collectors.toSet());
290 }
291
292 /**
293 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
294 * </p>
295 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
296 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
297 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
298 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
299 * @return a stream of matches represented as a Match object.
300 *
301 */
302 public Stream<AverageFreeMemoryMetric.Match> streamAllMatches(final Double pAverage) {
303 return rawStreamAllMatches(new Object[]{pAverage});
304 }
305
306 /**
307 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
308 * Neither determinism nor randomness of selection is guaranteed.
309 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
310 * @return a match represented as a Match object, or null if no match is found.
311 *
312 */
313 public Optional<AverageFreeMemoryMetric.Match> getOneArbitraryMatch(final Double pAverage) {
314 return rawGetOneArbitraryMatch(new Object[]{pAverage});
315 }
316
317 /**
318 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
319 * under any possible substitution of the unspecified parameters (if any).
320 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
321 * @return true if the input is a valid (partial) match of the pattern.
322 *
323 */
324 public boolean hasMatch(final Double pAverage) {
325 return rawHasMatch(new Object[]{pAverage});
326 }
327
328 /**
329 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
330 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
331 * @return the number of pattern matches found.
332 *
333 */
334 public int countMatches(final Double pAverage) {
335 return rawCountMatches(new Object[]{pAverage});
336 }
337
338 /**
339 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
340 * Neither determinism nor randomness of selection is guaranteed.
341 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
342 * @param processor the action that will process the selected match.
343 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
344 *
345 */
346 public boolean forOneArbitraryMatch(final Double pAverage, final Consumer<? super AverageFreeMemoryMetric.Match> processor) {
347 return rawForOneArbitraryMatch(new Object[]{pAverage}, processor);
348 }
349
350 /**
351 * Returns a new (partial) match.
352 * This can be used e.g. to call the matcher with a partial match.
353 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
354 * @param pAverage the fixed value of pattern parameter Average, or null if not bound.
355 * @return the (partial) match object.
356 *
357 */
358 public AverageFreeMemoryMetric.Match newMatch(final Double pAverage) {
359 return AverageFreeMemoryMetric.Match.newMatch(pAverage);
360 }
361
362 /**
363 * Retrieve the set of values that occur in matches for Average.
364 * @return the Set of all values or empty set if there are no matches
365 *
366 */
367 protected Stream<Double> rawStreamAllValuesOfAverage(final Object[] parameters) {
368 return rawStreamAllValues(POSITION_AVERAGE, parameters).map(Double.class::cast);
369 }
370
371 /**
372 * Retrieve the set of values that occur in matches for Average.
373 * @return the Set of all values or empty set if there are no matches
374 *
375 */
376 public Set<Double> getAllValuesOfAverage() {
377 return rawStreamAllValuesOfAverage(emptyArray()).collect(Collectors.toSet());
378 }
379
380 /**
381 * Retrieve the set of values that occur in matches for Average.
382 * @return the Set of all values or empty set if there are no matches
383 *
384 */
385 public Stream<Double> streamAllValuesOfAverage() {
386 return rawStreamAllValuesOfAverage(emptyArray());
387 }
388
389 @Override
390 protected AverageFreeMemoryMetric.Match tupleToMatch(final Tuple t) {
391 try {
392 return AverageFreeMemoryMetric.Match.newMatch((Double) t.get(POSITION_AVERAGE));
393 } catch(ClassCastException e) {
394 LOGGER.error("Element(s) in tuple not properly typed!",e);
395 return null;
396 }
397 }
398
399 @Override
400 protected AverageFreeMemoryMetric.Match arrayToMatch(final Object[] match) {
401 try {
402 return AverageFreeMemoryMetric.Match.newMatch((Double) match[POSITION_AVERAGE]);
403 } catch(ClassCastException e) {
404 LOGGER.error("Element(s) in array not properly typed!",e);
405 return null;
406 }
407 }
408
409 @Override
410 protected AverageFreeMemoryMetric.Match arrayToMatchMutable(final Object[] match) {
411 try {
412 return AverageFreeMemoryMetric.Match.newMutableMatch((Double) match[POSITION_AVERAGE]);
413 } catch(ClassCastException e) {
414 LOGGER.error("Element(s) in array not properly typed!",e);
415 return null;
416 }
417 }
418
419 /**
420 * @return the singleton instance of the query specification of this pattern
421 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
422 *
423 */
424 public static IQuerySpecification<AverageFreeMemoryMetric.Matcher> querySpecification() {
425 return AverageFreeMemoryMetric.instance();
426 }
427 }
428
429 private AverageFreeMemoryMetric() {
430 super(GeneratedPQuery.INSTANCE);
431 }
432
433 /**
434 * @return the singleton instance of the query specification
435 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
436 *
437 */
438 public static AverageFreeMemoryMetric instance() {
439 try{
440 return LazyHolder.INSTANCE;
441 } catch (ExceptionInInitializerError err) {
442 throw processInitializerError(err);
443 }
444 }
445
446 @Override
447 protected AverageFreeMemoryMetric.Matcher instantiate(final ViatraQueryEngine engine) {
448 return AverageFreeMemoryMetric.Matcher.on(engine);
449 }
450
451 @Override
452 public AverageFreeMemoryMetric.Matcher instantiate() {
453 return AverageFreeMemoryMetric.Matcher.create();
454 }
455
456 @Override
457 public AverageFreeMemoryMetric.Match newEmptyMatch() {
458 return AverageFreeMemoryMetric.Match.newEmptyMatch();
459 }
460
461 @Override
462 public AverageFreeMemoryMetric.Match newMatch(final Object... parameters) {
463 return AverageFreeMemoryMetric.Match.newMatch((java.lang.Double) parameters[0]);
464 }
465
466 /**
467 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric (visibility: PUBLIC, simpleName: AverageFreeMemoryMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
468 * <b>not</b> at the class load time of the outer class,
469 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric (visibility: PUBLIC, simpleName: AverageFreeMemoryMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
470 *
471 * <p> This workaround is required e.g. to support recursion.
472 *
473 */
474 private static class LazyHolder {
475 private static final AverageFreeMemoryMetric INSTANCE = new AverageFreeMemoryMetric();
476
477 /**
478 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
479 * This initialization order is required to support indirect recursion.
480 *
481 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
482 *
483 */
484 private static final Object STATIC_INITIALIZER = ensureInitialized();
485
486 public static Object ensureInitialized() {
487 INSTANCE.ensureInitializedInternal();
488 return null;
489 }
490 }
491
492 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
493 private static final AverageFreeMemoryMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
494
495 private final PParameter parameter_Average = new PParameter("Average", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
496
497 private final List<PParameter> parameters = Arrays.asList(parameter_Average);
498
499 private GeneratedPQuery() {
500 super(PVisibility.PUBLIC);
501 }
502
503 @Override
504 public String getFullyQualifiedName() {
505 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric";
506 }
507
508 @Override
509 public List<String> getParameterNames() {
510 return Arrays.asList("Average");
511 }
512
513 @Override
514 public List<PParameter> getParameters() {
515 return parameters;
516 }
517
518 @Override
519 public Set<PBody> doGetContainedBodies() {
520 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
521 Set<PBody> bodies = new LinkedHashSet<>();
522 {
523 PBody body = new PBody(this);
524 PVariable var_Average = body.getOrCreateVariableByName("Average");
525 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
526 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
527 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Average), new JavaTransitiveInstancesKey(java.lang.Double.class));
528 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
529 new ExportedParameter(body, var_Average, parameter_Average)
530 ));
531 // Average == avg find freeMemoryPercentage(_, #_)
532 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
533 new AggregatorConstraint(new avg().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), FreeMemoryPercentage.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
534 new Equality(body, var_Average, var__virtual_0_);
535 bodies.add(body);
536 }
537 return bodies;
538 }
539 }
540}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CostMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CostMetric.java
new file mode 100644
index 00000000..4d8ca4cc
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CostMetric.java
@@ -0,0 +1,540 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
29import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
37import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
39import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
40
41/**
42 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
43 *
44 * <p>Original source:
45 * <code><pre>
46 * pattern costMetric(Cost : java Integer) {
47 * Cost == sum find cpsCost(_, #_);
48 * }
49 * </pre></code>
50 *
51 * @see Matcher
52 * @see Match
53 *
54 */
55@SuppressWarnings("all")
56public final class CostMetric extends BaseGeneratedEMFQuerySpecification<CostMetric.Matcher> {
57 /**
58 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric pattern,
59 * to be used in conjunction with {@link Matcher}.
60 *
61 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
62 * Each instance is a (possibly partial) substitution of pattern parameters,
63 * usable to represent a match of the pattern in the result of a query,
64 * or to specify the bound (fixed) input parameters when issuing a query.
65 *
66 * @see Matcher
67 *
68 */
69 public static abstract class Match extends BasePatternMatch {
70 private Integer fCost;
71
72 private static List<String> parameterNames = makeImmutableList("Cost");
73
74 private Match(final Integer pCost) {
75 this.fCost = pCost;
76 }
77
78 @Override
79 public Object get(final String parameterName) {
80 if ("Cost".equals(parameterName)) return this.fCost;
81 return null;
82 }
83
84 public Integer getCost() {
85 return this.fCost;
86 }
87
88 @Override
89 public boolean set(final String parameterName, final Object newValue) {
90 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
91 if ("Cost".equals(parameterName) ) {
92 this.fCost = (Integer) newValue;
93 return true;
94 }
95 return false;
96 }
97
98 public void setCost(final Integer pCost) {
99 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
100 this.fCost = pCost;
101 }
102
103 @Override
104 public String patternName() {
105 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric";
106 }
107
108 @Override
109 public List<String> parameterNames() {
110 return CostMetric.Match.parameterNames;
111 }
112
113 @Override
114 public Object[] toArray() {
115 return new Object[]{fCost};
116 }
117
118 @Override
119 public CostMetric.Match toImmutable() {
120 return isMutable() ? newMatch(fCost) : this;
121 }
122
123 @Override
124 public String prettyPrint() {
125 StringBuilder result = new StringBuilder();
126 result.append("\"Cost\"=" + prettyPrintValue(fCost));
127 return result.toString();
128 }
129
130 @Override
131 public int hashCode() {
132 return Objects.hash(fCost);
133 }
134
135 @Override
136 public boolean equals(final Object obj) {
137 if (this == obj)
138 return true;
139 if (obj == null) {
140 return false;
141 }
142 if ((obj instanceof CostMetric.Match)) {
143 CostMetric.Match other = (CostMetric.Match) obj;
144 return Objects.equals(fCost, other.fCost);
145 } else {
146 // this should be infrequent
147 if (!(obj instanceof IPatternMatch)) {
148 return false;
149 }
150 IPatternMatch otherSig = (IPatternMatch) obj;
151 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
152 }
153 }
154
155 @Override
156 public CostMetric specification() {
157 return CostMetric.instance();
158 }
159
160 /**
161 * Returns an empty, mutable match.
162 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
163 *
164 * @return the empty match.
165 *
166 */
167 public static CostMetric.Match newEmptyMatch() {
168 return new Mutable(null);
169 }
170
171 /**
172 * Returns a mutable (partial) match.
173 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
174 *
175 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
176 * @return the new, mutable (partial) match object.
177 *
178 */
179 public static CostMetric.Match newMutableMatch(final Integer pCost) {
180 return new Mutable(pCost);
181 }
182
183 /**
184 * Returns a new (partial) match.
185 * This can be used e.g. to call the matcher with a partial match.
186 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
187 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
188 * @return the (partial) match object.
189 *
190 */
191 public static CostMetric.Match newMatch(final Integer pCost) {
192 return new Immutable(pCost);
193 }
194
195 private static final class Mutable extends CostMetric.Match {
196 Mutable(final Integer pCost) {
197 super(pCost);
198 }
199
200 @Override
201 public boolean isMutable() {
202 return true;
203 }
204 }
205
206 private static final class Immutable extends CostMetric.Match {
207 Immutable(final Integer pCost) {
208 super(pCost);
209 }
210
211 @Override
212 public boolean isMutable() {
213 return false;
214 }
215 }
216 }
217
218 /**
219 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric pattern,
220 * providing pattern-specific query methods.
221 *
222 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
223 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
224 *
225 * <p>Matches of the pattern will be represented as {@link Match}.
226 *
227 * <p>Original source:
228 * <code><pre>
229 * pattern costMetric(Cost : java Integer) {
230 * Cost == sum find cpsCost(_, #_);
231 * }
232 * </pre></code>
233 *
234 * @see Match
235 * @see CostMetric
236 *
237 */
238 public static class Matcher extends BaseMatcher<CostMetric.Match> {
239 /**
240 * Initializes the pattern matcher within an existing VIATRA Query engine.
241 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
242 *
243 * @param engine the existing VIATRA Query engine in which this matcher will be created.
244 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
245 *
246 */
247 public static CostMetric.Matcher on(final ViatraQueryEngine engine) {
248 // check if matcher already exists
249 Matcher matcher = engine.getExistingMatcher(querySpecification());
250 if (matcher == null) {
251 matcher = (Matcher)engine.getMatcher(querySpecification());
252 }
253 return matcher;
254 }
255
256 /**
257 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
258 * @return an initialized matcher
259 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
260 *
261 */
262 public static CostMetric.Matcher create() {
263 return new Matcher();
264 }
265
266 private static final int POSITION_COST = 0;
267
268 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CostMetric.Matcher.class);
269
270 /**
271 * Initializes the pattern matcher within an existing VIATRA Query engine.
272 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
273 *
274 * @param engine the existing VIATRA Query engine in which this matcher will be created.
275 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
276 *
277 */
278 private Matcher() {
279 super(querySpecification());
280 }
281
282 /**
283 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
284 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
285 * @return matches represented as a Match object.
286 *
287 */
288 public Collection<CostMetric.Match> getAllMatches(final Integer pCost) {
289 return rawStreamAllMatches(new Object[]{pCost}).collect(Collectors.toSet());
290 }
291
292 /**
293 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
294 * </p>
295 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
296 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
297 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
298 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
299 * @return a stream of matches represented as a Match object.
300 *
301 */
302 public Stream<CostMetric.Match> streamAllMatches(final Integer pCost) {
303 return rawStreamAllMatches(new Object[]{pCost});
304 }
305
306 /**
307 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
308 * Neither determinism nor randomness of selection is guaranteed.
309 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
310 * @return a match represented as a Match object, or null if no match is found.
311 *
312 */
313 public Optional<CostMetric.Match> getOneArbitraryMatch(final Integer pCost) {
314 return rawGetOneArbitraryMatch(new Object[]{pCost});
315 }
316
317 /**
318 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
319 * under any possible substitution of the unspecified parameters (if any).
320 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
321 * @return true if the input is a valid (partial) match of the pattern.
322 *
323 */
324 public boolean hasMatch(final Integer pCost) {
325 return rawHasMatch(new Object[]{pCost});
326 }
327
328 /**
329 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
330 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
331 * @return the number of pattern matches found.
332 *
333 */
334 public int countMatches(final Integer pCost) {
335 return rawCountMatches(new Object[]{pCost});
336 }
337
338 /**
339 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
340 * Neither determinism nor randomness of selection is guaranteed.
341 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
342 * @param processor the action that will process the selected match.
343 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
344 *
345 */
346 public boolean forOneArbitraryMatch(final Integer pCost, final Consumer<? super CostMetric.Match> processor) {
347 return rawForOneArbitraryMatch(new Object[]{pCost}, processor);
348 }
349
350 /**
351 * Returns a new (partial) match.
352 * This can be used e.g. to call the matcher with a partial match.
353 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
354 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
355 * @return the (partial) match object.
356 *
357 */
358 public CostMetric.Match newMatch(final Integer pCost) {
359 return CostMetric.Match.newMatch(pCost);
360 }
361
362 /**
363 * Retrieve the set of values that occur in matches for Cost.
364 * @return the Set of all values or empty set if there are no matches
365 *
366 */
367 protected Stream<Integer> rawStreamAllValuesOfCost(final Object[] parameters) {
368 return rawStreamAllValues(POSITION_COST, parameters).map(Integer.class::cast);
369 }
370
371 /**
372 * Retrieve the set of values that occur in matches for Cost.
373 * @return the Set of all values or empty set if there are no matches
374 *
375 */
376 public Set<Integer> getAllValuesOfCost() {
377 return rawStreamAllValuesOfCost(emptyArray()).collect(Collectors.toSet());
378 }
379
380 /**
381 * Retrieve the set of values that occur in matches for Cost.
382 * @return the Set of all values or empty set if there are no matches
383 *
384 */
385 public Stream<Integer> streamAllValuesOfCost() {
386 return rawStreamAllValuesOfCost(emptyArray());
387 }
388
389 @Override
390 protected CostMetric.Match tupleToMatch(final Tuple t) {
391 try {
392 return CostMetric.Match.newMatch((Integer) t.get(POSITION_COST));
393 } catch(ClassCastException e) {
394 LOGGER.error("Element(s) in tuple not properly typed!",e);
395 return null;
396 }
397 }
398
399 @Override
400 protected CostMetric.Match arrayToMatch(final Object[] match) {
401 try {
402 return CostMetric.Match.newMatch((Integer) match[POSITION_COST]);
403 } catch(ClassCastException e) {
404 LOGGER.error("Element(s) in array not properly typed!",e);
405 return null;
406 }
407 }
408
409 @Override
410 protected CostMetric.Match arrayToMatchMutable(final Object[] match) {
411 try {
412 return CostMetric.Match.newMutableMatch((Integer) match[POSITION_COST]);
413 } catch(ClassCastException e) {
414 LOGGER.error("Element(s) in array not properly typed!",e);
415 return null;
416 }
417 }
418
419 /**
420 * @return the singleton instance of the query specification of this pattern
421 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
422 *
423 */
424 public static IQuerySpecification<CostMetric.Matcher> querySpecification() {
425 return CostMetric.instance();
426 }
427 }
428
429 private CostMetric() {
430 super(GeneratedPQuery.INSTANCE);
431 }
432
433 /**
434 * @return the singleton instance of the query specification
435 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
436 *
437 */
438 public static CostMetric instance() {
439 try{
440 return LazyHolder.INSTANCE;
441 } catch (ExceptionInInitializerError err) {
442 throw processInitializerError(err);
443 }
444 }
445
446 @Override
447 protected CostMetric.Matcher instantiate(final ViatraQueryEngine engine) {
448 return CostMetric.Matcher.on(engine);
449 }
450
451 @Override
452 public CostMetric.Matcher instantiate() {
453 return CostMetric.Matcher.create();
454 }
455
456 @Override
457 public CostMetric.Match newEmptyMatch() {
458 return CostMetric.Match.newEmptyMatch();
459 }
460
461 @Override
462 public CostMetric.Match newMatch(final Object... parameters) {
463 return CostMetric.Match.newMatch((java.lang.Integer) parameters[0]);
464 }
465
466 /**
467 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric (visibility: PUBLIC, simpleName: CostMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
468 * <b>not</b> at the class load time of the outer class,
469 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric (visibility: PUBLIC, simpleName: CostMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
470 *
471 * <p> This workaround is required e.g. to support recursion.
472 *
473 */
474 private static class LazyHolder {
475 private static final CostMetric INSTANCE = new CostMetric();
476
477 /**
478 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
479 * This initialization order is required to support indirect recursion.
480 *
481 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
482 *
483 */
484 private static final Object STATIC_INITIALIZER = ensureInitialized();
485
486 public static Object ensureInitialized() {
487 INSTANCE.ensureInitializedInternal();
488 return null;
489 }
490 }
491
492 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
493 private static final CostMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
494
495 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT);
496
497 private final List<PParameter> parameters = Arrays.asList(parameter_Cost);
498
499 private GeneratedPQuery() {
500 super(PVisibility.PUBLIC);
501 }
502
503 @Override
504 public String getFullyQualifiedName() {
505 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric";
506 }
507
508 @Override
509 public List<String> getParameterNames() {
510 return Arrays.asList("Cost");
511 }
512
513 @Override
514 public List<PParameter> getParameters() {
515 return parameters;
516 }
517
518 @Override
519 public Set<PBody> doGetContainedBodies() {
520 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
521 Set<PBody> bodies = new LinkedHashSet<>();
522 {
523 PBody body = new PBody(this);
524 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
525 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
526 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
527 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Integer.class));
528 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
529 new ExportedParameter(body, var_Cost, parameter_Cost)
530 ));
531 // Cost == sum find cpsCost(_, #_)
532 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
533 new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var___0_, var___1_), CpsCost.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
534 new Equality(body, var_Cost, var__virtual_0_);
535 bodies.add(body);
536 }
537 return bodies;
538 }
539 }
540}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java
new file mode 100644
index 00000000..2c20b38e
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java
@@ -0,0 +1,705 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
39import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
41import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
42
43/**
44 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
45 *
46 * <p>Original source:
47 * <code><pre>
48 * {@literal @}QueryBasedFeature(feature = "applications")
49 * pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) {
50 * CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance);
51 * }
52 * </pre></code>
53 *
54 * @see Matcher
55 * @see Match
56 *
57 */
58@SuppressWarnings("all")
59public final class CpsApplications extends BaseGeneratedEMFQuerySpecification<CpsApplications.Matcher> {
60 /**
61 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications pattern,
62 * to be used in conjunction with {@link Matcher}.
63 *
64 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
65 * Each instance is a (possibly partial) substitution of pattern parameters,
66 * usable to represent a match of the pattern in the result of a query,
67 * or to specify the bound (fixed) input parameters when issuing a query.
68 *
69 * @see Matcher
70 *
71 */
72 public static abstract class Match extends BasePatternMatch {
73 private CyberPhysicalSystem fCps;
74
75 private ApplicationInstance fAppInstance;
76
77 private static List<String> parameterNames = makeImmutableList("Cps", "AppInstance");
78
79 private Match(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
80 this.fCps = pCps;
81 this.fAppInstance = pAppInstance;
82 }
83
84 @Override
85 public Object get(final String parameterName) {
86 if ("Cps".equals(parameterName)) return this.fCps;
87 if ("AppInstance".equals(parameterName)) return this.fAppInstance;
88 return null;
89 }
90
91 public CyberPhysicalSystem getCps() {
92 return this.fCps;
93 }
94
95 public ApplicationInstance getAppInstance() {
96 return this.fAppInstance;
97 }
98
99 @Override
100 public boolean set(final String parameterName, final Object newValue) {
101 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
102 if ("Cps".equals(parameterName) ) {
103 this.fCps = (CyberPhysicalSystem) newValue;
104 return true;
105 }
106 if ("AppInstance".equals(parameterName) ) {
107 this.fAppInstance = (ApplicationInstance) newValue;
108 return true;
109 }
110 return false;
111 }
112
113 public void setCps(final CyberPhysicalSystem pCps) {
114 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
115 this.fCps = pCps;
116 }
117
118 public void setAppInstance(final ApplicationInstance pAppInstance) {
119 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
120 this.fAppInstance = pAppInstance;
121 }
122
123 @Override
124 public String patternName() {
125 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications";
126 }
127
128 @Override
129 public List<String> parameterNames() {
130 return CpsApplications.Match.parameterNames;
131 }
132
133 @Override
134 public Object[] toArray() {
135 return new Object[]{fCps, fAppInstance};
136 }
137
138 @Override
139 public CpsApplications.Match toImmutable() {
140 return isMutable() ? newMatch(fCps, fAppInstance) : this;
141 }
142
143 @Override
144 public String prettyPrint() {
145 StringBuilder result = new StringBuilder();
146 result.append("\"Cps\"=" + prettyPrintValue(fCps) + ", ");
147 result.append("\"AppInstance\"=" + prettyPrintValue(fAppInstance));
148 return result.toString();
149 }
150
151 @Override
152 public int hashCode() {
153 return Objects.hash(fCps, fAppInstance);
154 }
155
156 @Override
157 public boolean equals(final Object obj) {
158 if (this == obj)
159 return true;
160 if (obj == null) {
161 return false;
162 }
163 if ((obj instanceof CpsApplications.Match)) {
164 CpsApplications.Match other = (CpsApplications.Match) obj;
165 return Objects.equals(fCps, other.fCps) && Objects.equals(fAppInstance, other.fAppInstance);
166 } else {
167 // this should be infrequent
168 if (!(obj instanceof IPatternMatch)) {
169 return false;
170 }
171 IPatternMatch otherSig = (IPatternMatch) obj;
172 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
173 }
174 }
175
176 @Override
177 public CpsApplications specification() {
178 return CpsApplications.instance();
179 }
180
181 /**
182 * Returns an empty, mutable match.
183 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
184 *
185 * @return the empty match.
186 *
187 */
188 public static CpsApplications.Match newEmptyMatch() {
189 return new Mutable(null, null);
190 }
191
192 /**
193 * Returns a mutable (partial) match.
194 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
195 *
196 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
197 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
198 * @return the new, mutable (partial) match object.
199 *
200 */
201 public static CpsApplications.Match newMutableMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
202 return new Mutable(pCps, pAppInstance);
203 }
204
205 /**
206 * Returns a new (partial) match.
207 * This can be used e.g. to call the matcher with a partial match.
208 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
209 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
210 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
211 * @return the (partial) match object.
212 *
213 */
214 public static CpsApplications.Match newMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
215 return new Immutable(pCps, pAppInstance);
216 }
217
218 private static final class Mutable extends CpsApplications.Match {
219 Mutable(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
220 super(pCps, pAppInstance);
221 }
222
223 @Override
224 public boolean isMutable() {
225 return true;
226 }
227 }
228
229 private static final class Immutable extends CpsApplications.Match {
230 Immutable(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
231 super(pCps, pAppInstance);
232 }
233
234 @Override
235 public boolean isMutable() {
236 return false;
237 }
238 }
239 }
240
241 /**
242 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications pattern,
243 * providing pattern-specific query methods.
244 *
245 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
246 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
247 *
248 * <p>Matches of the pattern will be represented as {@link Match}.
249 *
250 * <p>Original source:
251 * <code><pre>
252 * {@literal @}QueryBasedFeature(feature = "applications")
253 * pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) {
254 * CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance);
255 * }
256 * </pre></code>
257 *
258 * @see Match
259 * @see CpsApplications
260 *
261 */
262 public static class Matcher extends BaseMatcher<CpsApplications.Match> {
263 /**
264 * Initializes the pattern matcher within an existing VIATRA Query engine.
265 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
266 *
267 * @param engine the existing VIATRA Query engine in which this matcher will be created.
268 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
269 *
270 */
271 public static CpsApplications.Matcher on(final ViatraQueryEngine engine) {
272 // check if matcher already exists
273 Matcher matcher = engine.getExistingMatcher(querySpecification());
274 if (matcher == null) {
275 matcher = (Matcher)engine.getMatcher(querySpecification());
276 }
277 return matcher;
278 }
279
280 /**
281 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
282 * @return an initialized matcher
283 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
284 *
285 */
286 public static CpsApplications.Matcher create() {
287 return new Matcher();
288 }
289
290 private static final int POSITION_CPS = 0;
291
292 private static final int POSITION_APPINSTANCE = 1;
293
294 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CpsApplications.Matcher.class);
295
296 /**
297 * Initializes the pattern matcher within an existing VIATRA Query engine.
298 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
299 *
300 * @param engine the existing VIATRA Query engine in which this matcher will be created.
301 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
302 *
303 */
304 private Matcher() {
305 super(querySpecification());
306 }
307
308 /**
309 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
310 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
311 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
312 * @return matches represented as a Match object.
313 *
314 */
315 public Collection<CpsApplications.Match> getAllMatches(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
316 return rawStreamAllMatches(new Object[]{pCps, pAppInstance}).collect(Collectors.toSet());
317 }
318
319 /**
320 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
321 * </p>
322 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
323 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
324 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
325 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
326 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
327 * @return a stream of matches represented as a Match object.
328 *
329 */
330 public Stream<CpsApplications.Match> streamAllMatches(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
331 return rawStreamAllMatches(new Object[]{pCps, pAppInstance});
332 }
333
334 /**
335 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
336 * Neither determinism nor randomness of selection is guaranteed.
337 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
338 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
339 * @return a match represented as a Match object, or null if no match is found.
340 *
341 */
342 public Optional<CpsApplications.Match> getOneArbitraryMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
343 return rawGetOneArbitraryMatch(new Object[]{pCps, pAppInstance});
344 }
345
346 /**
347 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
348 * under any possible substitution of the unspecified parameters (if any).
349 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
350 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
351 * @return true if the input is a valid (partial) match of the pattern.
352 *
353 */
354 public boolean hasMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
355 return rawHasMatch(new Object[]{pCps, pAppInstance});
356 }
357
358 /**
359 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
360 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
361 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
362 * @return the number of pattern matches found.
363 *
364 */
365 public int countMatches(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
366 return rawCountMatches(new Object[]{pCps, pAppInstance});
367 }
368
369 /**
370 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
371 * Neither determinism nor randomness of selection is guaranteed.
372 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
373 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
374 * @param processor the action that will process the selected match.
375 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
376 *
377 */
378 public boolean forOneArbitraryMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance, final Consumer<? super CpsApplications.Match> processor) {
379 return rawForOneArbitraryMatch(new Object[]{pCps, pAppInstance}, processor);
380 }
381
382 /**
383 * Returns a new (partial) match.
384 * This can be used e.g. to call the matcher with a partial match.
385 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
386 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
387 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
388 * @return the (partial) match object.
389 *
390 */
391 public CpsApplications.Match newMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
392 return CpsApplications.Match.newMatch(pCps, pAppInstance);
393 }
394
395 /**
396 * Retrieve the set of values that occur in matches for Cps.
397 * @return the Set of all values or empty set if there are no matches
398 *
399 */
400 protected Stream<CyberPhysicalSystem> rawStreamAllValuesOfCps(final Object[] parameters) {
401 return rawStreamAllValues(POSITION_CPS, parameters).map(CyberPhysicalSystem.class::cast);
402 }
403
404 /**
405 * Retrieve the set of values that occur in matches for Cps.
406 * @return the Set of all values or empty set if there are no matches
407 *
408 */
409 public Set<CyberPhysicalSystem> getAllValuesOfCps() {
410 return rawStreamAllValuesOfCps(emptyArray()).collect(Collectors.toSet());
411 }
412
413 /**
414 * Retrieve the set of values that occur in matches for Cps.
415 * @return the Set of all values or empty set if there are no matches
416 *
417 */
418 public Stream<CyberPhysicalSystem> streamAllValuesOfCps() {
419 return rawStreamAllValuesOfCps(emptyArray());
420 }
421
422 /**
423 * Retrieve the set of values that occur in matches for Cps.
424 * </p>
425 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
426 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
427 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
428 *
429 * @return the Stream of all values or empty set if there are no matches
430 *
431 */
432 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final CpsApplications.Match partialMatch) {
433 return rawStreamAllValuesOfCps(partialMatch.toArray());
434 }
435
436 /**
437 * Retrieve the set of values that occur in matches for Cps.
438 * </p>
439 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
440 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
441 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
442 *
443 * @return the Stream of all values or empty set if there are no matches
444 *
445 */
446 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final ApplicationInstance pAppInstance) {
447 return rawStreamAllValuesOfCps(new Object[]{null, pAppInstance});
448 }
449
450 /**
451 * Retrieve the set of values that occur in matches for Cps.
452 * @return the Set of all values or empty set if there are no matches
453 *
454 */
455 public Set<CyberPhysicalSystem> getAllValuesOfCps(final CpsApplications.Match partialMatch) {
456 return rawStreamAllValuesOfCps(partialMatch.toArray()).collect(Collectors.toSet());
457 }
458
459 /**
460 * Retrieve the set of values that occur in matches for Cps.
461 * @return the Set of all values or empty set if there are no matches
462 *
463 */
464 public Set<CyberPhysicalSystem> getAllValuesOfCps(final ApplicationInstance pAppInstance) {
465 return rawStreamAllValuesOfCps(new Object[]{null, pAppInstance}).collect(Collectors.toSet());
466 }
467
468 /**
469 * Retrieve the set of values that occur in matches for AppInstance.
470 * @return the Set of all values or empty set if there are no matches
471 *
472 */
473 protected Stream<ApplicationInstance> rawStreamAllValuesOfAppInstance(final Object[] parameters) {
474 return rawStreamAllValues(POSITION_APPINSTANCE, parameters).map(ApplicationInstance.class::cast);
475 }
476
477 /**
478 * Retrieve the set of values that occur in matches for AppInstance.
479 * @return the Set of all values or empty set if there are no matches
480 *
481 */
482 public Set<ApplicationInstance> getAllValuesOfAppInstance() {
483 return rawStreamAllValuesOfAppInstance(emptyArray()).collect(Collectors.toSet());
484 }
485
486 /**
487 * Retrieve the set of values that occur in matches for AppInstance.
488 * @return the Set of all values or empty set if there are no matches
489 *
490 */
491 public Stream<ApplicationInstance> streamAllValuesOfAppInstance() {
492 return rawStreamAllValuesOfAppInstance(emptyArray());
493 }
494
495 /**
496 * Retrieve the set of values that occur in matches for AppInstance.
497 * </p>
498 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
499 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
500 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
501 *
502 * @return the Stream of all values or empty set if there are no matches
503 *
504 */
505 public Stream<ApplicationInstance> streamAllValuesOfAppInstance(final CpsApplications.Match partialMatch) {
506 return rawStreamAllValuesOfAppInstance(partialMatch.toArray());
507 }
508
509 /**
510 * Retrieve the set of values that occur in matches for AppInstance.
511 * </p>
512 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
513 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
514 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
515 *
516 * @return the Stream of all values or empty set if there are no matches
517 *
518 */
519 public Stream<ApplicationInstance> streamAllValuesOfAppInstance(final CyberPhysicalSystem pCps) {
520 return rawStreamAllValuesOfAppInstance(new Object[]{pCps, null});
521 }
522
523 /**
524 * Retrieve the set of values that occur in matches for AppInstance.
525 * @return the Set of all values or empty set if there are no matches
526 *
527 */
528 public Set<ApplicationInstance> getAllValuesOfAppInstance(final CpsApplications.Match partialMatch) {
529 return rawStreamAllValuesOfAppInstance(partialMatch.toArray()).collect(Collectors.toSet());
530 }
531
532 /**
533 * Retrieve the set of values that occur in matches for AppInstance.
534 * @return the Set of all values or empty set if there are no matches
535 *
536 */
537 public Set<ApplicationInstance> getAllValuesOfAppInstance(final CyberPhysicalSystem pCps) {
538 return rawStreamAllValuesOfAppInstance(new Object[]{pCps, null}).collect(Collectors.toSet());
539 }
540
541 @Override
542 protected CpsApplications.Match tupleToMatch(final Tuple t) {
543 try {
544 return CpsApplications.Match.newMatch((CyberPhysicalSystem) t.get(POSITION_CPS), (ApplicationInstance) t.get(POSITION_APPINSTANCE));
545 } catch(ClassCastException e) {
546 LOGGER.error("Element(s) in tuple not properly typed!",e);
547 return null;
548 }
549 }
550
551 @Override
552 protected CpsApplications.Match arrayToMatch(final Object[] match) {
553 try {
554 return CpsApplications.Match.newMatch((CyberPhysicalSystem) match[POSITION_CPS], (ApplicationInstance) match[POSITION_APPINSTANCE]);
555 } catch(ClassCastException e) {
556 LOGGER.error("Element(s) in array not properly typed!",e);
557 return null;
558 }
559 }
560
561 @Override
562 protected CpsApplications.Match arrayToMatchMutable(final Object[] match) {
563 try {
564 return CpsApplications.Match.newMutableMatch((CyberPhysicalSystem) match[POSITION_CPS], (ApplicationInstance) match[POSITION_APPINSTANCE]);
565 } catch(ClassCastException e) {
566 LOGGER.error("Element(s) in array not properly typed!",e);
567 return null;
568 }
569 }
570
571 /**
572 * @return the singleton instance of the query specification of this pattern
573 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
574 *
575 */
576 public static IQuerySpecification<CpsApplications.Matcher> querySpecification() {
577 return CpsApplications.instance();
578 }
579 }
580
581 private CpsApplications() {
582 super(GeneratedPQuery.INSTANCE);
583 }
584
585 /**
586 * @return the singleton instance of the query specification
587 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
588 *
589 */
590 public static CpsApplications instance() {
591 try{
592 return LazyHolder.INSTANCE;
593 } catch (ExceptionInInitializerError err) {
594 throw processInitializerError(err);
595 }
596 }
597
598 @Override
599 protected CpsApplications.Matcher instantiate(final ViatraQueryEngine engine) {
600 return CpsApplications.Matcher.on(engine);
601 }
602
603 @Override
604 public CpsApplications.Matcher instantiate() {
605 return CpsApplications.Matcher.create();
606 }
607
608 @Override
609 public CpsApplications.Match newEmptyMatch() {
610 return CpsApplications.Match.newEmptyMatch();
611 }
612
613 @Override
614 public CpsApplications.Match newMatch(final Object... parameters) {
615 return CpsApplications.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance) parameters[1]);
616 }
617
618 /**
619 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications (visibility: PUBLIC, simpleName: CpsApplications, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
620 * <b>not</b> at the class load time of the outer class,
621 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications (visibility: PUBLIC, simpleName: CpsApplications, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
622 *
623 * <p> This workaround is required e.g. to support recursion.
624 *
625 */
626 private static class LazyHolder {
627 private static final CpsApplications INSTANCE = new CpsApplications();
628
629 /**
630 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
631 * This initialization order is required to support indirect recursion.
632 *
633 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
634 *
635 */
636 private static final Object STATIC_INITIALIZER = ensureInitialized();
637
638 public static Object ensureInitialized() {
639 INSTANCE.ensureInitializedInternal();
640 return null;
641 }
642 }
643
644 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
645 private static final CpsApplications.GeneratedPQuery INSTANCE = new GeneratedPQuery();
646
647 private final PParameter parameter_Cps = new PParameter("Cps", "hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "CyberPhysicalSystem")), PParameterDirection.INOUT);
648
649 private final PParameter parameter_AppInstance = new PParameter("AppInstance", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
650
651 private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_AppInstance);
652
653 private GeneratedPQuery() {
654 super(PVisibility.PUBLIC);
655 }
656
657 @Override
658 public String getFullyQualifiedName() {
659 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications";
660 }
661
662 @Override
663 public List<String> getParameterNames() {
664 return Arrays.asList("Cps","AppInstance");
665 }
666
667 @Override
668 public List<PParameter> getParameters() {
669 return parameters;
670 }
671
672 @Override
673 public Set<PBody> doGetContainedBodies() {
674 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
675 Set<PBody> bodies = new LinkedHashSet<>();
676 {
677 PBody body = new PBody(this);
678 PVariable var_Cps = body.getOrCreateVariableByName("Cps");
679 PVariable var_AppInstance = body.getOrCreateVariableByName("AppInstance");
680 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
681 new TypeConstraint(body, Tuples.flatTupleOf(var_AppInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
682 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
683 new ExportedParameter(body, var_Cps, parameter_Cps),
684 new ExportedParameter(body, var_AppInstance, parameter_AppInstance)
685 ));
686 // CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance)
687 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
688 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
689 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "CyberPhysicalSystem", "applicationTypes")));
690 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType")));
691 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
692 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "instances")));
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
694 new Equality(body, var__virtual_1_, var_AppInstance);
695 bodies.add(body);
696 }
697 {
698 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
699 annotation.addAttribute("feature", "applications");
700 addAnnotation(annotation);
701 }
702 return bodies;
703 }
704 }
705}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsCost.java
new file mode 100644
index 00000000..169a30e5
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsCost.java
@@ -0,0 +1,738 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.emf.ecore.EClass;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
32import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
33import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
34import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
35import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
43import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
44import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
45import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
46import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
47import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
48import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
49
50/**
51 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
52 *
53 * <p>Original source:
54 * <code><pre>
55 * pattern cpsCost(Cps : CyberPhysicalSystem, Cost : java Integer) {
56 * AppCount == count find cpsApplications(Cps, _);
57 * HostCost == sum find hostInstanceCost(Cps, _, #_);
58 * Cost == eval(5 AppCount + HostCost);
59 * }
60 * </pre></code>
61 *
62 * @see Matcher
63 * @see Match
64 *
65 */
66@SuppressWarnings("all")
67public final class CpsCost extends BaseGeneratedEMFQuerySpecification<CpsCost.Matcher> {
68 /**
69 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsCost pattern,
70 * to be used in conjunction with {@link Matcher}.
71 *
72 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
73 * Each instance is a (possibly partial) substitution of pattern parameters,
74 * usable to represent a match of the pattern in the result of a query,
75 * or to specify the bound (fixed) input parameters when issuing a query.
76 *
77 * @see Matcher
78 *
79 */
80 public static abstract class Match extends BasePatternMatch {
81 private CyberPhysicalSystem fCps;
82
83 private Integer fCost;
84
85 private static List<String> parameterNames = makeImmutableList("Cps", "Cost");
86
87 private Match(final CyberPhysicalSystem pCps, final Integer pCost) {
88 this.fCps = pCps;
89 this.fCost = pCost;
90 }
91
92 @Override
93 public Object get(final String parameterName) {
94 if ("Cps".equals(parameterName)) return this.fCps;
95 if ("Cost".equals(parameterName)) return this.fCost;
96 return null;
97 }
98
99 public CyberPhysicalSystem getCps() {
100 return this.fCps;
101 }
102
103 public Integer getCost() {
104 return this.fCost;
105 }
106
107 @Override
108 public boolean set(final String parameterName, final Object newValue) {
109 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
110 if ("Cps".equals(parameterName) ) {
111 this.fCps = (CyberPhysicalSystem) newValue;
112 return true;
113 }
114 if ("Cost".equals(parameterName) ) {
115 this.fCost = (Integer) newValue;
116 return true;
117 }
118 return false;
119 }
120
121 public void setCps(final CyberPhysicalSystem pCps) {
122 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
123 this.fCps = pCps;
124 }
125
126 public void setCost(final Integer pCost) {
127 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
128 this.fCost = pCost;
129 }
130
131 @Override
132 public String patternName() {
133 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsCost";
134 }
135
136 @Override
137 public List<String> parameterNames() {
138 return CpsCost.Match.parameterNames;
139 }
140
141 @Override
142 public Object[] toArray() {
143 return new Object[]{fCps, fCost};
144 }
145
146 @Override
147 public CpsCost.Match toImmutable() {
148 return isMutable() ? newMatch(fCps, fCost) : this;
149 }
150
151 @Override
152 public String prettyPrint() {
153 StringBuilder result = new StringBuilder();
154 result.append("\"Cps\"=" + prettyPrintValue(fCps) + ", ");
155 result.append("\"Cost\"=" + prettyPrintValue(fCost));
156 return result.toString();
157 }
158
159 @Override
160 public int hashCode() {
161 return Objects.hash(fCps, fCost);
162 }
163
164 @Override
165 public boolean equals(final Object obj) {
166 if (this == obj)
167 return true;
168 if (obj == null) {
169 return false;
170 }
171 if ((obj instanceof CpsCost.Match)) {
172 CpsCost.Match other = (CpsCost.Match) obj;
173 return Objects.equals(fCps, other.fCps) && Objects.equals(fCost, other.fCost);
174 } else {
175 // this should be infrequent
176 if (!(obj instanceof IPatternMatch)) {
177 return false;
178 }
179 IPatternMatch otherSig = (IPatternMatch) obj;
180 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
181 }
182 }
183
184 @Override
185 public CpsCost specification() {
186 return CpsCost.instance();
187 }
188
189 /**
190 * Returns an empty, mutable match.
191 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
192 *
193 * @return the empty match.
194 *
195 */
196 public static CpsCost.Match newEmptyMatch() {
197 return new Mutable(null, null);
198 }
199
200 /**
201 * Returns a mutable (partial) match.
202 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
203 *
204 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
205 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
206 * @return the new, mutable (partial) match object.
207 *
208 */
209 public static CpsCost.Match newMutableMatch(final CyberPhysicalSystem pCps, final Integer pCost) {
210 return new Mutable(pCps, pCost);
211 }
212
213 /**
214 * Returns a new (partial) match.
215 * This can be used e.g. to call the matcher with a partial match.
216 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
217 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
218 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
219 * @return the (partial) match object.
220 *
221 */
222 public static CpsCost.Match newMatch(final CyberPhysicalSystem pCps, final Integer pCost) {
223 return new Immutable(pCps, pCost);
224 }
225
226 private static final class Mutable extends CpsCost.Match {
227 Mutable(final CyberPhysicalSystem pCps, final Integer pCost) {
228 super(pCps, pCost);
229 }
230
231 @Override
232 public boolean isMutable() {
233 return true;
234 }
235 }
236
237 private static final class Immutable extends CpsCost.Match {
238 Immutable(final CyberPhysicalSystem pCps, final Integer pCost) {
239 super(pCps, pCost);
240 }
241
242 @Override
243 public boolean isMutable() {
244 return false;
245 }
246 }
247 }
248
249 /**
250 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsCost pattern,
251 * providing pattern-specific query methods.
252 *
253 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
254 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
255 *
256 * <p>Matches of the pattern will be represented as {@link Match}.
257 *
258 * <p>Original source:
259 * <code><pre>
260 * pattern cpsCost(Cps : CyberPhysicalSystem, Cost : java Integer) {
261 * AppCount == count find cpsApplications(Cps, _);
262 * HostCost == sum find hostInstanceCost(Cps, _, #_);
263 * Cost == eval(5 AppCount + HostCost);
264 * }
265 * </pre></code>
266 *
267 * @see Match
268 * @see CpsCost
269 *
270 */
271 public static class Matcher extends BaseMatcher<CpsCost.Match> {
272 /**
273 * Initializes the pattern matcher within an existing VIATRA Query engine.
274 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
275 *
276 * @param engine the existing VIATRA Query engine in which this matcher will be created.
277 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
278 *
279 */
280 public static CpsCost.Matcher on(final ViatraQueryEngine engine) {
281 // check if matcher already exists
282 Matcher matcher = engine.getExistingMatcher(querySpecification());
283 if (matcher == null) {
284 matcher = (Matcher)engine.getMatcher(querySpecification());
285 }
286 return matcher;
287 }
288
289 /**
290 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
291 * @return an initialized matcher
292 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
293 *
294 */
295 public static CpsCost.Matcher create() {
296 return new Matcher();
297 }
298
299 private static final int POSITION_CPS = 0;
300
301 private static final int POSITION_COST = 1;
302
303 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CpsCost.Matcher.class);
304
305 /**
306 * Initializes the pattern matcher within an existing VIATRA Query engine.
307 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
308 *
309 * @param engine the existing VIATRA Query engine in which this matcher will be created.
310 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
311 *
312 */
313 private Matcher() {
314 super(querySpecification());
315 }
316
317 /**
318 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
319 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
320 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
321 * @return matches represented as a Match object.
322 *
323 */
324 public Collection<CpsCost.Match> getAllMatches(final CyberPhysicalSystem pCps, final Integer pCost) {
325 return rawStreamAllMatches(new Object[]{pCps, pCost}).collect(Collectors.toSet());
326 }
327
328 /**
329 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
330 * </p>
331 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
332 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
333 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
334 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
335 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
336 * @return a stream of matches represented as a Match object.
337 *
338 */
339 public Stream<CpsCost.Match> streamAllMatches(final CyberPhysicalSystem pCps, final Integer pCost) {
340 return rawStreamAllMatches(new Object[]{pCps, pCost});
341 }
342
343 /**
344 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
345 * Neither determinism nor randomness of selection is guaranteed.
346 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
347 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
348 * @return a match represented as a Match object, or null if no match is found.
349 *
350 */
351 public Optional<CpsCost.Match> getOneArbitraryMatch(final CyberPhysicalSystem pCps, final Integer pCost) {
352 return rawGetOneArbitraryMatch(new Object[]{pCps, pCost});
353 }
354
355 /**
356 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
357 * under any possible substitution of the unspecified parameters (if any).
358 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
359 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
360 * @return true if the input is a valid (partial) match of the pattern.
361 *
362 */
363 public boolean hasMatch(final CyberPhysicalSystem pCps, final Integer pCost) {
364 return rawHasMatch(new Object[]{pCps, pCost});
365 }
366
367 /**
368 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
369 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
370 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
371 * @return the number of pattern matches found.
372 *
373 */
374 public int countMatches(final CyberPhysicalSystem pCps, final Integer pCost) {
375 return rawCountMatches(new Object[]{pCps, pCost});
376 }
377
378 /**
379 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
380 * Neither determinism nor randomness of selection is guaranteed.
381 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
382 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
383 * @param processor the action that will process the selected match.
384 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
385 *
386 */
387 public boolean forOneArbitraryMatch(final CyberPhysicalSystem pCps, final Integer pCost, final Consumer<? super CpsCost.Match> processor) {
388 return rawForOneArbitraryMatch(new Object[]{pCps, pCost}, processor);
389 }
390
391 /**
392 * Returns a new (partial) match.
393 * This can be used e.g. to call the matcher with a partial match.
394 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
395 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
396 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
397 * @return the (partial) match object.
398 *
399 */
400 public CpsCost.Match newMatch(final CyberPhysicalSystem pCps, final Integer pCost) {
401 return CpsCost.Match.newMatch(pCps, pCost);
402 }
403
404 /**
405 * Retrieve the set of values that occur in matches for Cps.
406 * @return the Set of all values or empty set if there are no matches
407 *
408 */
409 protected Stream<CyberPhysicalSystem> rawStreamAllValuesOfCps(final Object[] parameters) {
410 return rawStreamAllValues(POSITION_CPS, parameters).map(CyberPhysicalSystem.class::cast);
411 }
412
413 /**
414 * Retrieve the set of values that occur in matches for Cps.
415 * @return the Set of all values or empty set if there are no matches
416 *
417 */
418 public Set<CyberPhysicalSystem> getAllValuesOfCps() {
419 return rawStreamAllValuesOfCps(emptyArray()).collect(Collectors.toSet());
420 }
421
422 /**
423 * Retrieve the set of values that occur in matches for Cps.
424 * @return the Set of all values or empty set if there are no matches
425 *
426 */
427 public Stream<CyberPhysicalSystem> streamAllValuesOfCps() {
428 return rawStreamAllValuesOfCps(emptyArray());
429 }
430
431 /**
432 * Retrieve the set of values that occur in matches for Cps.
433 * </p>
434 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
435 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
436 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
437 *
438 * @return the Stream of all values or empty set if there are no matches
439 *
440 */
441 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final CpsCost.Match partialMatch) {
442 return rawStreamAllValuesOfCps(partialMatch.toArray());
443 }
444
445 /**
446 * Retrieve the set of values that occur in matches for Cps.
447 * </p>
448 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
449 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
450 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
451 *
452 * @return the Stream of all values or empty set if there are no matches
453 *
454 */
455 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final Integer pCost) {
456 return rawStreamAllValuesOfCps(new Object[]{null, pCost});
457 }
458
459 /**
460 * Retrieve the set of values that occur in matches for Cps.
461 * @return the Set of all values or empty set if there are no matches
462 *
463 */
464 public Set<CyberPhysicalSystem> getAllValuesOfCps(final CpsCost.Match partialMatch) {
465 return rawStreamAllValuesOfCps(partialMatch.toArray()).collect(Collectors.toSet());
466 }
467
468 /**
469 * Retrieve the set of values that occur in matches for Cps.
470 * @return the Set of all values or empty set if there are no matches
471 *
472 */
473 public Set<CyberPhysicalSystem> getAllValuesOfCps(final Integer pCost) {
474 return rawStreamAllValuesOfCps(new Object[]{null, pCost}).collect(Collectors.toSet());
475 }
476
477 /**
478 * Retrieve the set of values that occur in matches for Cost.
479 * @return the Set of all values or empty set if there are no matches
480 *
481 */
482 protected Stream<Integer> rawStreamAllValuesOfCost(final Object[] parameters) {
483 return rawStreamAllValues(POSITION_COST, parameters).map(Integer.class::cast);
484 }
485
486 /**
487 * Retrieve the set of values that occur in matches for Cost.
488 * @return the Set of all values or empty set if there are no matches
489 *
490 */
491 public Set<Integer> getAllValuesOfCost() {
492 return rawStreamAllValuesOfCost(emptyArray()).collect(Collectors.toSet());
493 }
494
495 /**
496 * Retrieve the set of values that occur in matches for Cost.
497 * @return the Set of all values or empty set if there are no matches
498 *
499 */
500 public Stream<Integer> streamAllValuesOfCost() {
501 return rawStreamAllValuesOfCost(emptyArray());
502 }
503
504 /**
505 * Retrieve the set of values that occur in matches for Cost.
506 * </p>
507 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
508 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
509 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
510 *
511 * @return the Stream of all values or empty set if there are no matches
512 *
513 */
514 public Stream<Integer> streamAllValuesOfCost(final CpsCost.Match partialMatch) {
515 return rawStreamAllValuesOfCost(partialMatch.toArray());
516 }
517
518 /**
519 * Retrieve the set of values that occur in matches for Cost.
520 * </p>
521 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
522 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
523 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
524 *
525 * @return the Stream of all values or empty set if there are no matches
526 *
527 */
528 public Stream<Integer> streamAllValuesOfCost(final CyberPhysicalSystem pCps) {
529 return rawStreamAllValuesOfCost(new Object[]{pCps, null});
530 }
531
532 /**
533 * Retrieve the set of values that occur in matches for Cost.
534 * @return the Set of all values or empty set if there are no matches
535 *
536 */
537 public Set<Integer> getAllValuesOfCost(final CpsCost.Match partialMatch) {
538 return rawStreamAllValuesOfCost(partialMatch.toArray()).collect(Collectors.toSet());
539 }
540
541 /**
542 * Retrieve the set of values that occur in matches for Cost.
543 * @return the Set of all values or empty set if there are no matches
544 *
545 */
546 public Set<Integer> getAllValuesOfCost(final CyberPhysicalSystem pCps) {
547 return rawStreamAllValuesOfCost(new Object[]{pCps, null}).collect(Collectors.toSet());
548 }
549
550 @Override
551 protected CpsCost.Match tupleToMatch(final Tuple t) {
552 try {
553 return CpsCost.Match.newMatch((CyberPhysicalSystem) t.get(POSITION_CPS), (Integer) t.get(POSITION_COST));
554 } catch(ClassCastException e) {
555 LOGGER.error("Element(s) in tuple not properly typed!",e);
556 return null;
557 }
558 }
559
560 @Override
561 protected CpsCost.Match arrayToMatch(final Object[] match) {
562 try {
563 return CpsCost.Match.newMatch((CyberPhysicalSystem) match[POSITION_CPS], (Integer) match[POSITION_COST]);
564 } catch(ClassCastException e) {
565 LOGGER.error("Element(s) in array not properly typed!",e);
566 return null;
567 }
568 }
569
570 @Override
571 protected CpsCost.Match arrayToMatchMutable(final Object[] match) {
572 try {
573 return CpsCost.Match.newMutableMatch((CyberPhysicalSystem) match[POSITION_CPS], (Integer) match[POSITION_COST]);
574 } catch(ClassCastException e) {
575 LOGGER.error("Element(s) in array not properly typed!",e);
576 return null;
577 }
578 }
579
580 /**
581 * @return the singleton instance of the query specification of this pattern
582 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
583 *
584 */
585 public static IQuerySpecification<CpsCost.Matcher> querySpecification() {
586 return CpsCost.instance();
587 }
588 }
589
590 private CpsCost() {
591 super(GeneratedPQuery.INSTANCE);
592 }
593
594 /**
595 * @return the singleton instance of the query specification
596 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
597 *
598 */
599 public static CpsCost instance() {
600 try{
601 return LazyHolder.INSTANCE;
602 } catch (ExceptionInInitializerError err) {
603 throw processInitializerError(err);
604 }
605 }
606
607 @Override
608 protected CpsCost.Matcher instantiate(final ViatraQueryEngine engine) {
609 return CpsCost.Matcher.on(engine);
610 }
611
612 @Override
613 public CpsCost.Matcher instantiate() {
614 return CpsCost.Matcher.create();
615 }
616
617 @Override
618 public CpsCost.Match newEmptyMatch() {
619 return CpsCost.Match.newEmptyMatch();
620 }
621
622 @Override
623 public CpsCost.Match newMatch(final Object... parameters) {
624 return CpsCost.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem) parameters[0], (java.lang.Integer) parameters[1]);
625 }
626
627 /**
628 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost (visibility: PUBLIC, simpleName: CpsCost, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
629 * <b>not</b> at the class load time of the outer class,
630 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost (visibility: PUBLIC, simpleName: CpsCost, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
631 *
632 * <p> This workaround is required e.g. to support recursion.
633 *
634 */
635 private static class LazyHolder {
636 private static final CpsCost INSTANCE = new CpsCost();
637
638 /**
639 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
640 * This initialization order is required to support indirect recursion.
641 *
642 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
643 *
644 */
645 private static final Object STATIC_INITIALIZER = ensureInitialized();
646
647 public static Object ensureInitialized() {
648 INSTANCE.ensureInitializedInternal();
649 return null;
650 }
651 }
652
653 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
654 private static final CpsCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
655
656 private final PParameter parameter_Cps = new PParameter("Cps", "hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "CyberPhysicalSystem")), PParameterDirection.INOUT);
657
658 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT);
659
660 private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_Cost);
661
662 private GeneratedPQuery() {
663 super(PVisibility.PUBLIC);
664 }
665
666 @Override
667 public String getFullyQualifiedName() {
668 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsCost";
669 }
670
671 @Override
672 public List<String> getParameterNames() {
673 return Arrays.asList("Cps","Cost");
674 }
675
676 @Override
677 public List<PParameter> getParameters() {
678 return parameters;
679 }
680
681 @Override
682 public Set<PBody> doGetContainedBodies() {
683 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
684 Set<PBody> bodies = new LinkedHashSet<>();
685 {
686 PBody body = new PBody(this);
687 PVariable var_Cps = body.getOrCreateVariableByName("Cps");
688 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
689 PVariable var_AppCount = body.getOrCreateVariableByName("AppCount");
690 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
691 PVariable var_HostCost = body.getOrCreateVariableByName("HostCost");
692 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
693 PVariable var___2_ = body.getOrCreateVariableByName("_<2>");
694 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
695 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Integer.class));
696 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
697 new ExportedParameter(body, var_Cps, parameter_Cps),
698 new ExportedParameter(body, var_Cost, parameter_Cost)
699 ));
700 // AppCount == count find cpsApplications(Cps, _)
701 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
702 new PatternMatchCounter(body, Tuples.flatTupleOf(var_Cps, var___0_), CpsApplications.instance().getInternalQueryRepresentation(), var__virtual_0_);
703 new Equality(body, var_AppCount, var__virtual_0_);
704 // HostCost == sum find hostInstanceCost(Cps, _, #_)
705 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
706 new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var_Cps, var___1_, var___2_), HostInstanceCost.instance().getInternalQueryRepresentation(), var__virtual_1_, 2);
707 new Equality(body, var_HostCost, var__virtual_1_);
708 // Cost == eval(5 * AppCount + HostCost)
709 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
710 new ExpressionEvaluation(body, new IExpressionEvaluator() {
711
712 @Override
713 public String getShortDescription() {
714 return "Expression evaluation from pattern cpsCost";
715 }
716
717 @Override
718 public Iterable<String> getInputParameterNames() {
719 return Arrays.asList("AppCount", "HostCost");}
720
721 @Override
722 public Object evaluateExpression(IValueProvider provider) throws Exception {
723 Integer AppCount = (Integer) provider.getValue("AppCount");
724 Integer HostCost = (Integer) provider.getValue("HostCost");
725 return evaluateExpression_1_1(AppCount, HostCost);
726 }
727 }, var__virtual_2_ );
728 new Equality(body, var_Cost, var__virtual_2_);
729 bodies.add(body);
730 }
731 return bodies;
732 }
733 }
734
735 private static int evaluateExpression_1_1(final Integer AppCount, final Integer HostCost) {
736 return ((5 * (AppCount).intValue()) + (HostCost).intValue());
737 }
738}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsHosts.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsHosts.java
new file mode 100644
index 00000000..e1abf758
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsHosts.java
@@ -0,0 +1,705 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
39import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
41import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
42
43/**
44 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
45 *
46 * <p>Original source:
47 * <code><pre>
48 * {@literal @}QueryBasedFeature(feature = "hosts")
49 * pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) {
50 * CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance);
51 * }
52 * </pre></code>
53 *
54 * @see Matcher
55 * @see Match
56 *
57 */
58@SuppressWarnings("all")
59public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.Matcher> {
60 /**
61 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts pattern,
62 * to be used in conjunction with {@link Matcher}.
63 *
64 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
65 * Each instance is a (possibly partial) substitution of pattern parameters,
66 * usable to represent a match of the pattern in the result of a query,
67 * or to specify the bound (fixed) input parameters when issuing a query.
68 *
69 * @see Matcher
70 *
71 */
72 public static abstract class Match extends BasePatternMatch {
73 private CyberPhysicalSystem fCps;
74
75 private HostInstance fHostInstance;
76
77 private static List<String> parameterNames = makeImmutableList("Cps", "HostInstance");
78
79 private Match(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
80 this.fCps = pCps;
81 this.fHostInstance = pHostInstance;
82 }
83
84 @Override
85 public Object get(final String parameterName) {
86 if ("Cps".equals(parameterName)) return this.fCps;
87 if ("HostInstance".equals(parameterName)) return this.fHostInstance;
88 return null;
89 }
90
91 public CyberPhysicalSystem getCps() {
92 return this.fCps;
93 }
94
95 public HostInstance getHostInstance() {
96 return this.fHostInstance;
97 }
98
99 @Override
100 public boolean set(final String parameterName, final Object newValue) {
101 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
102 if ("Cps".equals(parameterName) ) {
103 this.fCps = (CyberPhysicalSystem) newValue;
104 return true;
105 }
106 if ("HostInstance".equals(parameterName) ) {
107 this.fHostInstance = (HostInstance) newValue;
108 return true;
109 }
110 return false;
111 }
112
113 public void setCps(final CyberPhysicalSystem pCps) {
114 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
115 this.fCps = pCps;
116 }
117
118 public void setHostInstance(final HostInstance pHostInstance) {
119 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
120 this.fHostInstance = pHostInstance;
121 }
122
123 @Override
124 public String patternName() {
125 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts";
126 }
127
128 @Override
129 public List<String> parameterNames() {
130 return CpsHosts.Match.parameterNames;
131 }
132
133 @Override
134 public Object[] toArray() {
135 return new Object[]{fCps, fHostInstance};
136 }
137
138 @Override
139 public CpsHosts.Match toImmutable() {
140 return isMutable() ? newMatch(fCps, fHostInstance) : this;
141 }
142
143 @Override
144 public String prettyPrint() {
145 StringBuilder result = new StringBuilder();
146 result.append("\"Cps\"=" + prettyPrintValue(fCps) + ", ");
147 result.append("\"HostInstance\"=" + prettyPrintValue(fHostInstance));
148 return result.toString();
149 }
150
151 @Override
152 public int hashCode() {
153 return Objects.hash(fCps, fHostInstance);
154 }
155
156 @Override
157 public boolean equals(final Object obj) {
158 if (this == obj)
159 return true;
160 if (obj == null) {
161 return false;
162 }
163 if ((obj instanceof CpsHosts.Match)) {
164 CpsHosts.Match other = (CpsHosts.Match) obj;
165 return Objects.equals(fCps, other.fCps) && Objects.equals(fHostInstance, other.fHostInstance);
166 } else {
167 // this should be infrequent
168 if (!(obj instanceof IPatternMatch)) {
169 return false;
170 }
171 IPatternMatch otherSig = (IPatternMatch) obj;
172 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
173 }
174 }
175
176 @Override
177 public CpsHosts specification() {
178 return CpsHosts.instance();
179 }
180
181 /**
182 * Returns an empty, mutable match.
183 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
184 *
185 * @return the empty match.
186 *
187 */
188 public static CpsHosts.Match newEmptyMatch() {
189 return new Mutable(null, null);
190 }
191
192 /**
193 * Returns a mutable (partial) match.
194 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
195 *
196 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
197 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
198 * @return the new, mutable (partial) match object.
199 *
200 */
201 public static CpsHosts.Match newMutableMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
202 return new Mutable(pCps, pHostInstance);
203 }
204
205 /**
206 * Returns a new (partial) match.
207 * This can be used e.g. to call the matcher with a partial match.
208 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
209 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
210 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
211 * @return the (partial) match object.
212 *
213 */
214 public static CpsHosts.Match newMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
215 return new Immutable(pCps, pHostInstance);
216 }
217
218 private static final class Mutable extends CpsHosts.Match {
219 Mutable(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
220 super(pCps, pHostInstance);
221 }
222
223 @Override
224 public boolean isMutable() {
225 return true;
226 }
227 }
228
229 private static final class Immutable extends CpsHosts.Match {
230 Immutable(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
231 super(pCps, pHostInstance);
232 }
233
234 @Override
235 public boolean isMutable() {
236 return false;
237 }
238 }
239 }
240
241 /**
242 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts pattern,
243 * providing pattern-specific query methods.
244 *
245 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
246 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
247 *
248 * <p>Matches of the pattern will be represented as {@link Match}.
249 *
250 * <p>Original source:
251 * <code><pre>
252 * {@literal @}QueryBasedFeature(feature = "hosts")
253 * pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) {
254 * CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance);
255 * }
256 * </pre></code>
257 *
258 * @see Match
259 * @see CpsHosts
260 *
261 */
262 public static class Matcher extends BaseMatcher<CpsHosts.Match> {
263 /**
264 * Initializes the pattern matcher within an existing VIATRA Query engine.
265 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
266 *
267 * @param engine the existing VIATRA Query engine in which this matcher will be created.
268 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
269 *
270 */
271 public static CpsHosts.Matcher on(final ViatraQueryEngine engine) {
272 // check if matcher already exists
273 Matcher matcher = engine.getExistingMatcher(querySpecification());
274 if (matcher == null) {
275 matcher = (Matcher)engine.getMatcher(querySpecification());
276 }
277 return matcher;
278 }
279
280 /**
281 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
282 * @return an initialized matcher
283 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
284 *
285 */
286 public static CpsHosts.Matcher create() {
287 return new Matcher();
288 }
289
290 private static final int POSITION_CPS = 0;
291
292 private static final int POSITION_HOSTINSTANCE = 1;
293
294 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CpsHosts.Matcher.class);
295
296 /**
297 * Initializes the pattern matcher within an existing VIATRA Query engine.
298 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
299 *
300 * @param engine the existing VIATRA Query engine in which this matcher will be created.
301 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
302 *
303 */
304 private Matcher() {
305 super(querySpecification());
306 }
307
308 /**
309 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
310 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
311 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
312 * @return matches represented as a Match object.
313 *
314 */
315 public Collection<CpsHosts.Match> getAllMatches(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
316 return rawStreamAllMatches(new Object[]{pCps, pHostInstance}).collect(Collectors.toSet());
317 }
318
319 /**
320 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
321 * </p>
322 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
323 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
324 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
325 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
326 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
327 * @return a stream of matches represented as a Match object.
328 *
329 */
330 public Stream<CpsHosts.Match> streamAllMatches(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
331 return rawStreamAllMatches(new Object[]{pCps, pHostInstance});
332 }
333
334 /**
335 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
336 * Neither determinism nor randomness of selection is guaranteed.
337 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
338 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
339 * @return a match represented as a Match object, or null if no match is found.
340 *
341 */
342 public Optional<CpsHosts.Match> getOneArbitraryMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
343 return rawGetOneArbitraryMatch(new Object[]{pCps, pHostInstance});
344 }
345
346 /**
347 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
348 * under any possible substitution of the unspecified parameters (if any).
349 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
350 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
351 * @return true if the input is a valid (partial) match of the pattern.
352 *
353 */
354 public boolean hasMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
355 return rawHasMatch(new Object[]{pCps, pHostInstance});
356 }
357
358 /**
359 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
360 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
361 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
362 * @return the number of pattern matches found.
363 *
364 */
365 public int countMatches(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
366 return rawCountMatches(new Object[]{pCps, pHostInstance});
367 }
368
369 /**
370 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
371 * Neither determinism nor randomness of selection is guaranteed.
372 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
373 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
374 * @param processor the action that will process the selected match.
375 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
376 *
377 */
378 public boolean forOneArbitraryMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance, final Consumer<? super CpsHosts.Match> processor) {
379 return rawForOneArbitraryMatch(new Object[]{pCps, pHostInstance}, processor);
380 }
381
382 /**
383 * Returns a new (partial) match.
384 * This can be used e.g. to call the matcher with a partial match.
385 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
386 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
387 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
388 * @return the (partial) match object.
389 *
390 */
391 public CpsHosts.Match newMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) {
392 return CpsHosts.Match.newMatch(pCps, pHostInstance);
393 }
394
395 /**
396 * Retrieve the set of values that occur in matches for Cps.
397 * @return the Set of all values or empty set if there are no matches
398 *
399 */
400 protected Stream<CyberPhysicalSystem> rawStreamAllValuesOfCps(final Object[] parameters) {
401 return rawStreamAllValues(POSITION_CPS, parameters).map(CyberPhysicalSystem.class::cast);
402 }
403
404 /**
405 * Retrieve the set of values that occur in matches for Cps.
406 * @return the Set of all values or empty set if there are no matches
407 *
408 */
409 public Set<CyberPhysicalSystem> getAllValuesOfCps() {
410 return rawStreamAllValuesOfCps(emptyArray()).collect(Collectors.toSet());
411 }
412
413 /**
414 * Retrieve the set of values that occur in matches for Cps.
415 * @return the Set of all values or empty set if there are no matches
416 *
417 */
418 public Stream<CyberPhysicalSystem> streamAllValuesOfCps() {
419 return rawStreamAllValuesOfCps(emptyArray());
420 }
421
422 /**
423 * Retrieve the set of values that occur in matches for Cps.
424 * </p>
425 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
426 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
427 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
428 *
429 * @return the Stream of all values or empty set if there are no matches
430 *
431 */
432 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final CpsHosts.Match partialMatch) {
433 return rawStreamAllValuesOfCps(partialMatch.toArray());
434 }
435
436 /**
437 * Retrieve the set of values that occur in matches for Cps.
438 * </p>
439 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
440 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
441 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
442 *
443 * @return the Stream of all values or empty set if there are no matches
444 *
445 */
446 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final HostInstance pHostInstance) {
447 return rawStreamAllValuesOfCps(new Object[]{null, pHostInstance});
448 }
449
450 /**
451 * Retrieve the set of values that occur in matches for Cps.
452 * @return the Set of all values or empty set if there are no matches
453 *
454 */
455 public Set<CyberPhysicalSystem> getAllValuesOfCps(final CpsHosts.Match partialMatch) {
456 return rawStreamAllValuesOfCps(partialMatch.toArray()).collect(Collectors.toSet());
457 }
458
459 /**
460 * Retrieve the set of values that occur in matches for Cps.
461 * @return the Set of all values or empty set if there are no matches
462 *
463 */
464 public Set<CyberPhysicalSystem> getAllValuesOfCps(final HostInstance pHostInstance) {
465 return rawStreamAllValuesOfCps(new Object[]{null, pHostInstance}).collect(Collectors.toSet());
466 }
467
468 /**
469 * Retrieve the set of values that occur in matches for HostInstance.
470 * @return the Set of all values or empty set if there are no matches
471 *
472 */
473 protected Stream<HostInstance> rawStreamAllValuesOfHostInstance(final Object[] parameters) {
474 return rawStreamAllValues(POSITION_HOSTINSTANCE, parameters).map(HostInstance.class::cast);
475 }
476
477 /**
478 * Retrieve the set of values that occur in matches for HostInstance.
479 * @return the Set of all values or empty set if there are no matches
480 *
481 */
482 public Set<HostInstance> getAllValuesOfHostInstance() {
483 return rawStreamAllValuesOfHostInstance(emptyArray()).collect(Collectors.toSet());
484 }
485
486 /**
487 * Retrieve the set of values that occur in matches for HostInstance.
488 * @return the Set of all values or empty set if there are no matches
489 *
490 */
491 public Stream<HostInstance> streamAllValuesOfHostInstance() {
492 return rawStreamAllValuesOfHostInstance(emptyArray());
493 }
494
495 /**
496 * Retrieve the set of values that occur in matches for HostInstance.
497 * </p>
498 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
499 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
500 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
501 *
502 * @return the Stream of all values or empty set if there are no matches
503 *
504 */
505 public Stream<HostInstance> streamAllValuesOfHostInstance(final CpsHosts.Match partialMatch) {
506 return rawStreamAllValuesOfHostInstance(partialMatch.toArray());
507 }
508
509 /**
510 * Retrieve the set of values that occur in matches for HostInstance.
511 * </p>
512 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
513 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
514 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
515 *
516 * @return the Stream of all values or empty set if there are no matches
517 *
518 */
519 public Stream<HostInstance> streamAllValuesOfHostInstance(final CyberPhysicalSystem pCps) {
520 return rawStreamAllValuesOfHostInstance(new Object[]{pCps, null});
521 }
522
523 /**
524 * Retrieve the set of values that occur in matches for HostInstance.
525 * @return the Set of all values or empty set if there are no matches
526 *
527 */
528 public Set<HostInstance> getAllValuesOfHostInstance(final CpsHosts.Match partialMatch) {
529 return rawStreamAllValuesOfHostInstance(partialMatch.toArray()).collect(Collectors.toSet());
530 }
531
532 /**
533 * Retrieve the set of values that occur in matches for HostInstance.
534 * @return the Set of all values or empty set if there are no matches
535 *
536 */
537 public Set<HostInstance> getAllValuesOfHostInstance(final CyberPhysicalSystem pCps) {
538 return rawStreamAllValuesOfHostInstance(new Object[]{pCps, null}).collect(Collectors.toSet());
539 }
540
541 @Override
542 protected CpsHosts.Match tupleToMatch(final Tuple t) {
543 try {
544 return CpsHosts.Match.newMatch((CyberPhysicalSystem) t.get(POSITION_CPS), (HostInstance) t.get(POSITION_HOSTINSTANCE));
545 } catch(ClassCastException e) {
546 LOGGER.error("Element(s) in tuple not properly typed!",e);
547 return null;
548 }
549 }
550
551 @Override
552 protected CpsHosts.Match arrayToMatch(final Object[] match) {
553 try {
554 return CpsHosts.Match.newMatch((CyberPhysicalSystem) match[POSITION_CPS], (HostInstance) match[POSITION_HOSTINSTANCE]);
555 } catch(ClassCastException e) {
556 LOGGER.error("Element(s) in array not properly typed!",e);
557 return null;
558 }
559 }
560
561 @Override
562 protected CpsHosts.Match arrayToMatchMutable(final Object[] match) {
563 try {
564 return CpsHosts.Match.newMutableMatch((CyberPhysicalSystem) match[POSITION_CPS], (HostInstance) match[POSITION_HOSTINSTANCE]);
565 } catch(ClassCastException e) {
566 LOGGER.error("Element(s) in array not properly typed!",e);
567 return null;
568 }
569 }
570
571 /**
572 * @return the singleton instance of the query specification of this pattern
573 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
574 *
575 */
576 public static IQuerySpecification<CpsHosts.Matcher> querySpecification() {
577 return CpsHosts.instance();
578 }
579 }
580
581 private CpsHosts() {
582 super(GeneratedPQuery.INSTANCE);
583 }
584
585 /**
586 * @return the singleton instance of the query specification
587 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
588 *
589 */
590 public static CpsHosts instance() {
591 try{
592 return LazyHolder.INSTANCE;
593 } catch (ExceptionInInitializerError err) {
594 throw processInitializerError(err);
595 }
596 }
597
598 @Override
599 protected CpsHosts.Matcher instantiate(final ViatraQueryEngine engine) {
600 return CpsHosts.Matcher.on(engine);
601 }
602
603 @Override
604 public CpsHosts.Matcher instantiate() {
605 return CpsHosts.Matcher.create();
606 }
607
608 @Override
609 public CpsHosts.Match newEmptyMatch() {
610 return CpsHosts.Match.newEmptyMatch();
611 }
612
613 @Override
614 public CpsHosts.Match newMatch(final Object... parameters) {
615 return CpsHosts.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[1]);
616 }
617
618 /**
619 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts (visibility: PUBLIC, simpleName: CpsHosts, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
620 * <b>not</b> at the class load time of the outer class,
621 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts (visibility: PUBLIC, simpleName: CpsHosts, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
622 *
623 * <p> This workaround is required e.g. to support recursion.
624 *
625 */
626 private static class LazyHolder {
627 private static final CpsHosts INSTANCE = new CpsHosts();
628
629 /**
630 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
631 * This initialization order is required to support indirect recursion.
632 *
633 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
634 *
635 */
636 private static final Object STATIC_INITIALIZER = ensureInitialized();
637
638 public static Object ensureInitialized() {
639 INSTANCE.ensureInitializedInternal();
640 return null;
641 }
642 }
643
644 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
645 private static final CpsHosts.GeneratedPQuery INSTANCE = new GeneratedPQuery();
646
647 private final PParameter parameter_Cps = new PParameter("Cps", "hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "CyberPhysicalSystem")), PParameterDirection.INOUT);
648
649 private final PParameter parameter_HostInstance = new PParameter("HostInstance", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
650
651 private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_HostInstance);
652
653 private GeneratedPQuery() {
654 super(PVisibility.PUBLIC);
655 }
656
657 @Override
658 public String getFullyQualifiedName() {
659 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts";
660 }
661
662 @Override
663 public List<String> getParameterNames() {
664 return Arrays.asList("Cps","HostInstance");
665 }
666
667 @Override
668 public List<PParameter> getParameters() {
669 return parameters;
670 }
671
672 @Override
673 public Set<PBody> doGetContainedBodies() {
674 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
675 Set<PBody> bodies = new LinkedHashSet<>();
676 {
677 PBody body = new PBody(this);
678 PVariable var_Cps = body.getOrCreateVariableByName("Cps");
679 PVariable var_HostInstance = body.getOrCreateVariableByName("HostInstance");
680 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
681 new TypeConstraint(body, Tuples.flatTupleOf(var_HostInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
682 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
683 new ExportedParameter(body, var_Cps, parameter_Cps),
684 new ExportedParameter(body, var_HostInstance, parameter_HostInstance)
685 ));
686 // CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance)
687 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
688 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
689 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "CyberPhysicalSystem", "hostTypes")));
690 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
691 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
692 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "instances")));
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
694 new Equality(body, var__virtual_1_, var_HostInstance);
695 bodies.add(body);
696 }
697 {
698 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
699 annotation.addAttribute("feature", "hosts");
700 addAnnotation(annotation);
701 }
702 return bodies;
703 }
704 }
705}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.java
new file mode 100644
index 00000000..4442718b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.java
@@ -0,0 +1,207 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory;
9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric;
10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric;
11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric;
12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications;
13import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost;
14import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts;
15import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement;
16import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd;
17import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory;
18import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied;
19import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd;
20import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory;
21import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
23
24/**
25 * A pattern group formed of all public patterns defined in CpsQueries.vql.
26 *
27 * <p>Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare
28 * a VIATRA Query engine for matching all patterns originally defined in file CpsQueries.vql,
29 * in order to achieve better performance than one-by-one on-demand matcher initialization.
30 *
31 * <p> From package hu.bme.mit.inf.dslreasoner.domains.cps.queries, the group contains the definition of the following patterns: <ul>
32 * <li>cpsApplications</li>
33 * <li>cpsHosts</li>
34 * <li>totalMemory</li>
35 * <li>totalHdd</li>
36 * <li>availableMemory</li>
37 * <li>availableHdd</li>
38 * <li>allocationWithoutResourceRequirement</li>
39 * <li>notEnoughAvailableMemory</li>
40 * <li>notEnoughAvailableHdd</li>
41 * <li>instanceDoesNotSatisfyRequirement</li>
42 * <li>requirementNotSatisfied</li>
43 * <li>averageFreeMemoryMetric</li>
44 * <li>averageFreeHddMetric</li>
45 * <li>costMetric</li>
46 * <li>cpsCost</li>
47 * </ul>
48 *
49 * @see IQueryGroup
50 *
51 */
52@SuppressWarnings("all")
53public final class CpsQueries extends BaseGeneratedPatternGroup {
54 /**
55 * Access the pattern group.
56 *
57 * @return the singleton instance of the group
58 * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications
59 *
60 */
61 public static CpsQueries instance() {
62 if (INSTANCE == null) {
63 INSTANCE = new CpsQueries();
64 }
65 return INSTANCE;
66 }
67
68 private static CpsQueries INSTANCE;
69
70 private CpsQueries() {
71 querySpecifications.add(CpsApplications.instance());
72 querySpecifications.add(CpsHosts.instance());
73 querySpecifications.add(TotalMemory.instance());
74 querySpecifications.add(TotalHdd.instance());
75 querySpecifications.add(AvailableMemory.instance());
76 querySpecifications.add(AvailableHdd.instance());
77 querySpecifications.add(AllocationWithoutResourceRequirement.instance());
78 querySpecifications.add(NotEnoughAvailableMemory.instance());
79 querySpecifications.add(NotEnoughAvailableHdd.instance());
80 querySpecifications.add(InstanceDoesNotSatisfyRequirement.instance());
81 querySpecifications.add(RequirementNotSatisfied.instance());
82 querySpecifications.add(AverageFreeMemoryMetric.instance());
83 querySpecifications.add(AverageFreeHddMetric.instance());
84 querySpecifications.add(CostMetric.instance());
85 querySpecifications.add(CpsCost.instance());
86 }
87
88 public CpsApplications getCpsApplications() {
89 return CpsApplications.instance();
90 }
91
92 public CpsApplications.Matcher getCpsApplications(final ViatraQueryEngine engine) {
93 return CpsApplications.Matcher.on(engine);
94 }
95
96 public CpsHosts getCpsHosts() {
97 return CpsHosts.instance();
98 }
99
100 public CpsHosts.Matcher getCpsHosts(final ViatraQueryEngine engine) {
101 return CpsHosts.Matcher.on(engine);
102 }
103
104 public TotalMemory getTotalMemory() {
105 return TotalMemory.instance();
106 }
107
108 public TotalMemory.Matcher getTotalMemory(final ViatraQueryEngine engine) {
109 return TotalMemory.Matcher.on(engine);
110 }
111
112 public TotalHdd getTotalHdd() {
113 return TotalHdd.instance();
114 }
115
116 public TotalHdd.Matcher getTotalHdd(final ViatraQueryEngine engine) {
117 return TotalHdd.Matcher.on(engine);
118 }
119
120 public AvailableMemory getAvailableMemory() {
121 return AvailableMemory.instance();
122 }
123
124 public AvailableMemory.Matcher getAvailableMemory(final ViatraQueryEngine engine) {
125 return AvailableMemory.Matcher.on(engine);
126 }
127
128 public AvailableHdd getAvailableHdd() {
129 return AvailableHdd.instance();
130 }
131
132 public AvailableHdd.Matcher getAvailableHdd(final ViatraQueryEngine engine) {
133 return AvailableHdd.Matcher.on(engine);
134 }
135
136 public AllocationWithoutResourceRequirement getAllocationWithoutResourceRequirement() {
137 return AllocationWithoutResourceRequirement.instance();
138 }
139
140 public AllocationWithoutResourceRequirement.Matcher getAllocationWithoutResourceRequirement(final ViatraQueryEngine engine) {
141 return AllocationWithoutResourceRequirement.Matcher.on(engine);
142 }
143
144 public NotEnoughAvailableMemory getNotEnoughAvailableMemory() {
145 return NotEnoughAvailableMemory.instance();
146 }
147
148 public NotEnoughAvailableMemory.Matcher getNotEnoughAvailableMemory(final ViatraQueryEngine engine) {
149 return NotEnoughAvailableMemory.Matcher.on(engine);
150 }
151
152 public NotEnoughAvailableHdd getNotEnoughAvailableHdd() {
153 return NotEnoughAvailableHdd.instance();
154 }
155
156 public NotEnoughAvailableHdd.Matcher getNotEnoughAvailableHdd(final ViatraQueryEngine engine) {
157 return NotEnoughAvailableHdd.Matcher.on(engine);
158 }
159
160 public InstanceDoesNotSatisfyRequirement getInstanceDoesNotSatisfyRequirement() {
161 return InstanceDoesNotSatisfyRequirement.instance();
162 }
163
164 public InstanceDoesNotSatisfyRequirement.Matcher getInstanceDoesNotSatisfyRequirement(final ViatraQueryEngine engine) {
165 return InstanceDoesNotSatisfyRequirement.Matcher.on(engine);
166 }
167
168 public RequirementNotSatisfied getRequirementNotSatisfied() {
169 return RequirementNotSatisfied.instance();
170 }
171
172 public RequirementNotSatisfied.Matcher getRequirementNotSatisfied(final ViatraQueryEngine engine) {
173 return RequirementNotSatisfied.Matcher.on(engine);
174 }
175
176 public AverageFreeMemoryMetric getAverageFreeMemoryMetric() {
177 return AverageFreeMemoryMetric.instance();
178 }
179
180 public AverageFreeMemoryMetric.Matcher getAverageFreeMemoryMetric(final ViatraQueryEngine engine) {
181 return AverageFreeMemoryMetric.Matcher.on(engine);
182 }
183
184 public AverageFreeHddMetric getAverageFreeHddMetric() {
185 return AverageFreeHddMetric.instance();
186 }
187
188 public AverageFreeHddMetric.Matcher getAverageFreeHddMetric(final ViatraQueryEngine engine) {
189 return AverageFreeHddMetric.Matcher.on(engine);
190 }
191
192 public CostMetric getCostMetric() {
193 return CostMetric.instance();
194 }
195
196 public CostMetric.Matcher getCostMetric(final ViatraQueryEngine engine) {
197 return CostMetric.Matcher.on(engine);
198 }
199
200 public CpsCost getCpsCost() {
201 return CpsCost.instance();
202 }
203
204 public CpsCost.Matcher getCpsCost(final ViatraQueryEngine engine) {
205 return CpsCost.Matcher.on(engine);
206 }
207}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/InstanceDoesNotSatisfyRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/InstanceDoesNotSatisfyRequirement.java
new file mode 100644
index 00000000..14deb337
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/InstanceDoesNotSatisfyRequirement.java
@@ -0,0 +1,716 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.emf.ecore.EClass;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
41import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
42import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
43import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
44import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
45
46/**
47 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
48 *
49 * <p>Original source:
50 * <code><pre>
51 * {@literal @}Constraint(severity = "error", key = {Req, App},
52 * message = "Requirement must be satisfied by the required application type.")
53 * pattern instanceDoesNotSatisfyRequirement(Req : Requirement, App : ApplicationInstance) {
54 * Requirement.instances(Req, App);
55 * neg find satisfyingInstance(Req, App);
56 * }
57 * </pre></code>
58 *
59 * @see Matcher
60 * @see Match
61 *
62 */
63@SuppressWarnings("all")
64public final class InstanceDoesNotSatisfyRequirement extends BaseGeneratedEMFQuerySpecification<InstanceDoesNotSatisfyRequirement.Matcher> {
65 /**
66 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.instanceDoesNotSatisfyRequirement pattern,
67 * to be used in conjunction with {@link Matcher}.
68 *
69 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
70 * Each instance is a (possibly partial) substitution of pattern parameters,
71 * usable to represent a match of the pattern in the result of a query,
72 * or to specify the bound (fixed) input parameters when issuing a query.
73 *
74 * @see Matcher
75 *
76 */
77 public static abstract class Match extends BasePatternMatch {
78 private Requirement fReq;
79
80 private ApplicationInstance fApp;
81
82 private static List<String> parameterNames = makeImmutableList("Req", "App");
83
84 private Match(final Requirement pReq, final ApplicationInstance pApp) {
85 this.fReq = pReq;
86 this.fApp = pApp;
87 }
88
89 @Override
90 public Object get(final String parameterName) {
91 if ("Req".equals(parameterName)) return this.fReq;
92 if ("App".equals(parameterName)) return this.fApp;
93 return null;
94 }
95
96 public Requirement getReq() {
97 return this.fReq;
98 }
99
100 public ApplicationInstance getApp() {
101 return this.fApp;
102 }
103
104 @Override
105 public boolean set(final String parameterName, final Object newValue) {
106 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
107 if ("Req".equals(parameterName) ) {
108 this.fReq = (Requirement) newValue;
109 return true;
110 }
111 if ("App".equals(parameterName) ) {
112 this.fApp = (ApplicationInstance) newValue;
113 return true;
114 }
115 return false;
116 }
117
118 public void setReq(final Requirement pReq) {
119 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
120 this.fReq = pReq;
121 }
122
123 public void setApp(final ApplicationInstance pApp) {
124 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
125 this.fApp = pApp;
126 }
127
128 @Override
129 public String patternName() {
130 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.instanceDoesNotSatisfyRequirement";
131 }
132
133 @Override
134 public List<String> parameterNames() {
135 return InstanceDoesNotSatisfyRequirement.Match.parameterNames;
136 }
137
138 @Override
139 public Object[] toArray() {
140 return new Object[]{fReq, fApp};
141 }
142
143 @Override
144 public InstanceDoesNotSatisfyRequirement.Match toImmutable() {
145 return isMutable() ? newMatch(fReq, fApp) : this;
146 }
147
148 @Override
149 public String prettyPrint() {
150 StringBuilder result = new StringBuilder();
151 result.append("\"Req\"=" + prettyPrintValue(fReq) + ", ");
152 result.append("\"App\"=" + prettyPrintValue(fApp));
153 return result.toString();
154 }
155
156 @Override
157 public int hashCode() {
158 return Objects.hash(fReq, fApp);
159 }
160
161 @Override
162 public boolean equals(final Object obj) {
163 if (this == obj)
164 return true;
165 if (obj == null) {
166 return false;
167 }
168 if ((obj instanceof InstanceDoesNotSatisfyRequirement.Match)) {
169 InstanceDoesNotSatisfyRequirement.Match other = (InstanceDoesNotSatisfyRequirement.Match) obj;
170 return Objects.equals(fReq, other.fReq) && Objects.equals(fApp, other.fApp);
171 } else {
172 // this should be infrequent
173 if (!(obj instanceof IPatternMatch)) {
174 return false;
175 }
176 IPatternMatch otherSig = (IPatternMatch) obj;
177 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
178 }
179 }
180
181 @Override
182 public InstanceDoesNotSatisfyRequirement specification() {
183 return InstanceDoesNotSatisfyRequirement.instance();
184 }
185
186 /**
187 * Returns an empty, mutable match.
188 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
189 *
190 * @return the empty match.
191 *
192 */
193 public static InstanceDoesNotSatisfyRequirement.Match newEmptyMatch() {
194 return new Mutable(null, null);
195 }
196
197 /**
198 * Returns a mutable (partial) match.
199 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
200 *
201 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
202 * @param pApp the fixed value of pattern parameter App, or null if not bound.
203 * @return the new, mutable (partial) match object.
204 *
205 */
206 public static InstanceDoesNotSatisfyRequirement.Match newMutableMatch(final Requirement pReq, final ApplicationInstance pApp) {
207 return new Mutable(pReq, pApp);
208 }
209
210 /**
211 * Returns a new (partial) match.
212 * This can be used e.g. to call the matcher with a partial match.
213 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
214 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
215 * @param pApp the fixed value of pattern parameter App, or null if not bound.
216 * @return the (partial) match object.
217 *
218 */
219 public static InstanceDoesNotSatisfyRequirement.Match newMatch(final Requirement pReq, final ApplicationInstance pApp) {
220 return new Immutable(pReq, pApp);
221 }
222
223 private static final class Mutable extends InstanceDoesNotSatisfyRequirement.Match {
224 Mutable(final Requirement pReq, final ApplicationInstance pApp) {
225 super(pReq, pApp);
226 }
227
228 @Override
229 public boolean isMutable() {
230 return true;
231 }
232 }
233
234 private static final class Immutable extends InstanceDoesNotSatisfyRequirement.Match {
235 Immutable(final Requirement pReq, final ApplicationInstance pApp) {
236 super(pReq, pApp);
237 }
238
239 @Override
240 public boolean isMutable() {
241 return false;
242 }
243 }
244 }
245
246 /**
247 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.instanceDoesNotSatisfyRequirement pattern,
248 * providing pattern-specific query methods.
249 *
250 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
251 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
252 *
253 * <p>Matches of the pattern will be represented as {@link Match}.
254 *
255 * <p>Original source:
256 * <code><pre>
257 * {@literal @}Constraint(severity = "error", key = {Req, App},
258 * message = "Requirement must be satisfied by the required application type.")
259 * pattern instanceDoesNotSatisfyRequirement(Req : Requirement, App : ApplicationInstance) {
260 * Requirement.instances(Req, App);
261 * neg find satisfyingInstance(Req, App);
262 * }
263 * </pre></code>
264 *
265 * @see Match
266 * @see InstanceDoesNotSatisfyRequirement
267 *
268 */
269 public static class Matcher extends BaseMatcher<InstanceDoesNotSatisfyRequirement.Match> {
270 /**
271 * Initializes the pattern matcher within an existing VIATRA Query engine.
272 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
273 *
274 * @param engine the existing VIATRA Query engine in which this matcher will be created.
275 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
276 *
277 */
278 public static InstanceDoesNotSatisfyRequirement.Matcher on(final ViatraQueryEngine engine) {
279 // check if matcher already exists
280 Matcher matcher = engine.getExistingMatcher(querySpecification());
281 if (matcher == null) {
282 matcher = (Matcher)engine.getMatcher(querySpecification());
283 }
284 return matcher;
285 }
286
287 /**
288 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
289 * @return an initialized matcher
290 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
291 *
292 */
293 public static InstanceDoesNotSatisfyRequirement.Matcher create() {
294 return new Matcher();
295 }
296
297 private static final int POSITION_REQ = 0;
298
299 private static final int POSITION_APP = 1;
300
301 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(InstanceDoesNotSatisfyRequirement.Matcher.class);
302
303 /**
304 * Initializes the pattern matcher within an existing VIATRA Query engine.
305 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
306 *
307 * @param engine the existing VIATRA Query engine in which this matcher will be created.
308 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
309 *
310 */
311 private Matcher() {
312 super(querySpecification());
313 }
314
315 /**
316 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
317 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
318 * @param pApp the fixed value of pattern parameter App, or null if not bound.
319 * @return matches represented as a Match object.
320 *
321 */
322 public Collection<InstanceDoesNotSatisfyRequirement.Match> getAllMatches(final Requirement pReq, final ApplicationInstance pApp) {
323 return rawStreamAllMatches(new Object[]{pReq, pApp}).collect(Collectors.toSet());
324 }
325
326 /**
327 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
328 * </p>
329 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
330 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
331 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
332 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
333 * @param pApp the fixed value of pattern parameter App, or null if not bound.
334 * @return a stream of matches represented as a Match object.
335 *
336 */
337 public Stream<InstanceDoesNotSatisfyRequirement.Match> streamAllMatches(final Requirement pReq, final ApplicationInstance pApp) {
338 return rawStreamAllMatches(new Object[]{pReq, pApp});
339 }
340
341 /**
342 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
343 * Neither determinism nor randomness of selection is guaranteed.
344 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
345 * @param pApp the fixed value of pattern parameter App, or null if not bound.
346 * @return a match represented as a Match object, or null if no match is found.
347 *
348 */
349 public Optional<InstanceDoesNotSatisfyRequirement.Match> getOneArbitraryMatch(final Requirement pReq, final ApplicationInstance pApp) {
350 return rawGetOneArbitraryMatch(new Object[]{pReq, pApp});
351 }
352
353 /**
354 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
355 * under any possible substitution of the unspecified parameters (if any).
356 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
357 * @param pApp the fixed value of pattern parameter App, or null if not bound.
358 * @return true if the input is a valid (partial) match of the pattern.
359 *
360 */
361 public boolean hasMatch(final Requirement pReq, final ApplicationInstance pApp) {
362 return rawHasMatch(new Object[]{pReq, pApp});
363 }
364
365 /**
366 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
367 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
368 * @param pApp the fixed value of pattern parameter App, or null if not bound.
369 * @return the number of pattern matches found.
370 *
371 */
372 public int countMatches(final Requirement pReq, final ApplicationInstance pApp) {
373 return rawCountMatches(new Object[]{pReq, pApp});
374 }
375
376 /**
377 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
378 * Neither determinism nor randomness of selection is guaranteed.
379 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
380 * @param pApp the fixed value of pattern parameter App, or null if not bound.
381 * @param processor the action that will process the selected match.
382 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
383 *
384 */
385 public boolean forOneArbitraryMatch(final Requirement pReq, final ApplicationInstance pApp, final Consumer<? super InstanceDoesNotSatisfyRequirement.Match> processor) {
386 return rawForOneArbitraryMatch(new Object[]{pReq, pApp}, processor);
387 }
388
389 /**
390 * Returns a new (partial) match.
391 * This can be used e.g. to call the matcher with a partial match.
392 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
393 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
394 * @param pApp the fixed value of pattern parameter App, or null if not bound.
395 * @return the (partial) match object.
396 *
397 */
398 public InstanceDoesNotSatisfyRequirement.Match newMatch(final Requirement pReq, final ApplicationInstance pApp) {
399 return InstanceDoesNotSatisfyRequirement.Match.newMatch(pReq, pApp);
400 }
401
402 /**
403 * Retrieve the set of values that occur in matches for Req.
404 * @return the Set of all values or empty set if there are no matches
405 *
406 */
407 protected Stream<Requirement> rawStreamAllValuesOfReq(final Object[] parameters) {
408 return rawStreamAllValues(POSITION_REQ, parameters).map(Requirement.class::cast);
409 }
410
411 /**
412 * Retrieve the set of values that occur in matches for Req.
413 * @return the Set of all values or empty set if there are no matches
414 *
415 */
416 public Set<Requirement> getAllValuesOfReq() {
417 return rawStreamAllValuesOfReq(emptyArray()).collect(Collectors.toSet());
418 }
419
420 /**
421 * Retrieve the set of values that occur in matches for Req.
422 * @return the Set of all values or empty set if there are no matches
423 *
424 */
425 public Stream<Requirement> streamAllValuesOfReq() {
426 return rawStreamAllValuesOfReq(emptyArray());
427 }
428
429 /**
430 * Retrieve the set of values that occur in matches for Req.
431 * </p>
432 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
433 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
434 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
435 *
436 * @return the Stream of all values or empty set if there are no matches
437 *
438 */
439 public Stream<Requirement> streamAllValuesOfReq(final InstanceDoesNotSatisfyRequirement.Match partialMatch) {
440 return rawStreamAllValuesOfReq(partialMatch.toArray());
441 }
442
443 /**
444 * Retrieve the set of values that occur in matches for Req.
445 * </p>
446 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
447 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
448 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
449 *
450 * @return the Stream of all values or empty set if there are no matches
451 *
452 */
453 public Stream<Requirement> streamAllValuesOfReq(final ApplicationInstance pApp) {
454 return rawStreamAllValuesOfReq(new Object[]{null, pApp});
455 }
456
457 /**
458 * Retrieve the set of values that occur in matches for Req.
459 * @return the Set of all values or empty set if there are no matches
460 *
461 */
462 public Set<Requirement> getAllValuesOfReq(final InstanceDoesNotSatisfyRequirement.Match partialMatch) {
463 return rawStreamAllValuesOfReq(partialMatch.toArray()).collect(Collectors.toSet());
464 }
465
466 /**
467 * Retrieve the set of values that occur in matches for Req.
468 * @return the Set of all values or empty set if there are no matches
469 *
470 */
471 public Set<Requirement> getAllValuesOfReq(final ApplicationInstance pApp) {
472 return rawStreamAllValuesOfReq(new Object[]{null, pApp}).collect(Collectors.toSet());
473 }
474
475 /**
476 * Retrieve the set of values that occur in matches for App.
477 * @return the Set of all values or empty set if there are no matches
478 *
479 */
480 protected Stream<ApplicationInstance> rawStreamAllValuesOfApp(final Object[] parameters) {
481 return rawStreamAllValues(POSITION_APP, parameters).map(ApplicationInstance.class::cast);
482 }
483
484 /**
485 * Retrieve the set of values that occur in matches for App.
486 * @return the Set of all values or empty set if there are no matches
487 *
488 */
489 public Set<ApplicationInstance> getAllValuesOfApp() {
490 return rawStreamAllValuesOfApp(emptyArray()).collect(Collectors.toSet());
491 }
492
493 /**
494 * Retrieve the set of values that occur in matches for App.
495 * @return the Set of all values or empty set if there are no matches
496 *
497 */
498 public Stream<ApplicationInstance> streamAllValuesOfApp() {
499 return rawStreamAllValuesOfApp(emptyArray());
500 }
501
502 /**
503 * Retrieve the set of values that occur in matches for App.
504 * </p>
505 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
506 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
507 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
508 *
509 * @return the Stream of all values or empty set if there are no matches
510 *
511 */
512 public Stream<ApplicationInstance> streamAllValuesOfApp(final InstanceDoesNotSatisfyRequirement.Match partialMatch) {
513 return rawStreamAllValuesOfApp(partialMatch.toArray());
514 }
515
516 /**
517 * Retrieve the set of values that occur in matches for App.
518 * </p>
519 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
520 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
521 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
522 *
523 * @return the Stream of all values or empty set if there are no matches
524 *
525 */
526 public Stream<ApplicationInstance> streamAllValuesOfApp(final Requirement pReq) {
527 return rawStreamAllValuesOfApp(new Object[]{pReq, null});
528 }
529
530 /**
531 * Retrieve the set of values that occur in matches for App.
532 * @return the Set of all values or empty set if there are no matches
533 *
534 */
535 public Set<ApplicationInstance> getAllValuesOfApp(final InstanceDoesNotSatisfyRequirement.Match partialMatch) {
536 return rawStreamAllValuesOfApp(partialMatch.toArray()).collect(Collectors.toSet());
537 }
538
539 /**
540 * Retrieve the set of values that occur in matches for App.
541 * @return the Set of all values or empty set if there are no matches
542 *
543 */
544 public Set<ApplicationInstance> getAllValuesOfApp(final Requirement pReq) {
545 return rawStreamAllValuesOfApp(new Object[]{pReq, null}).collect(Collectors.toSet());
546 }
547
548 @Override
549 protected InstanceDoesNotSatisfyRequirement.Match tupleToMatch(final Tuple t) {
550 try {
551 return InstanceDoesNotSatisfyRequirement.Match.newMatch((Requirement) t.get(POSITION_REQ), (ApplicationInstance) t.get(POSITION_APP));
552 } catch(ClassCastException e) {
553 LOGGER.error("Element(s) in tuple not properly typed!",e);
554 return null;
555 }
556 }
557
558 @Override
559 protected InstanceDoesNotSatisfyRequirement.Match arrayToMatch(final Object[] match) {
560 try {
561 return InstanceDoesNotSatisfyRequirement.Match.newMatch((Requirement) match[POSITION_REQ], (ApplicationInstance) match[POSITION_APP]);
562 } catch(ClassCastException e) {
563 LOGGER.error("Element(s) in array not properly typed!",e);
564 return null;
565 }
566 }
567
568 @Override
569 protected InstanceDoesNotSatisfyRequirement.Match arrayToMatchMutable(final Object[] match) {
570 try {
571 return InstanceDoesNotSatisfyRequirement.Match.newMutableMatch((Requirement) match[POSITION_REQ], (ApplicationInstance) match[POSITION_APP]);
572 } catch(ClassCastException e) {
573 LOGGER.error("Element(s) in array not properly typed!",e);
574 return null;
575 }
576 }
577
578 /**
579 * @return the singleton instance of the query specification of this pattern
580 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
581 *
582 */
583 public static IQuerySpecification<InstanceDoesNotSatisfyRequirement.Matcher> querySpecification() {
584 return InstanceDoesNotSatisfyRequirement.instance();
585 }
586 }
587
588 private InstanceDoesNotSatisfyRequirement() {
589 super(GeneratedPQuery.INSTANCE);
590 }
591
592 /**
593 * @return the singleton instance of the query specification
594 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
595 *
596 */
597 public static InstanceDoesNotSatisfyRequirement instance() {
598 try{
599 return LazyHolder.INSTANCE;
600 } catch (ExceptionInInitializerError err) {
601 throw processInitializerError(err);
602 }
603 }
604
605 @Override
606 protected InstanceDoesNotSatisfyRequirement.Matcher instantiate(final ViatraQueryEngine engine) {
607 return InstanceDoesNotSatisfyRequirement.Matcher.on(engine);
608 }
609
610 @Override
611 public InstanceDoesNotSatisfyRequirement.Matcher instantiate() {
612 return InstanceDoesNotSatisfyRequirement.Matcher.create();
613 }
614
615 @Override
616 public InstanceDoesNotSatisfyRequirement.Match newEmptyMatch() {
617 return InstanceDoesNotSatisfyRequirement.Match.newEmptyMatch();
618 }
619
620 @Override
621 public InstanceDoesNotSatisfyRequirement.Match newMatch(final Object... parameters) {
622 return InstanceDoesNotSatisfyRequirement.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.Requirement) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance) parameters[1]);
623 }
624
625 /**
626 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement (visibility: PUBLIC, simpleName: InstanceDoesNotSatisfyRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
627 * <b>not</b> at the class load time of the outer class,
628 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement (visibility: PUBLIC, simpleName: InstanceDoesNotSatisfyRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
629 *
630 * <p> This workaround is required e.g. to support recursion.
631 *
632 */
633 private static class LazyHolder {
634 private static final InstanceDoesNotSatisfyRequirement INSTANCE = new InstanceDoesNotSatisfyRequirement();
635
636 /**
637 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
638 * This initialization order is required to support indirect recursion.
639 *
640 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
641 *
642 */
643 private static final Object STATIC_INITIALIZER = ensureInitialized();
644
645 public static Object ensureInitialized() {
646 INSTANCE.ensureInitializedInternal();
647 return null;
648 }
649 }
650
651 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
652 private static final InstanceDoesNotSatisfyRequirement.GeneratedPQuery INSTANCE = new GeneratedPQuery();
653
654 private final PParameter parameter_Req = new PParameter("Req", "hu.bme.mit.inf.dslreasoner.domains.cps.Requirement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "Requirement")), PParameterDirection.INOUT);
655
656 private final PParameter parameter_App = new PParameter("App", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
657
658 private final List<PParameter> parameters = Arrays.asList(parameter_Req, parameter_App);
659
660 private GeneratedPQuery() {
661 super(PVisibility.PUBLIC);
662 }
663
664 @Override
665 public String getFullyQualifiedName() {
666 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.instanceDoesNotSatisfyRequirement";
667 }
668
669 @Override
670 public List<String> getParameterNames() {
671 return Arrays.asList("Req","App");
672 }
673
674 @Override
675 public List<PParameter> getParameters() {
676 return parameters;
677 }
678
679 @Override
680 public Set<PBody> doGetContainedBodies() {
681 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
682 Set<PBody> bodies = new LinkedHashSet<>();
683 {
684 PBody body = new PBody(this);
685 PVariable var_Req = body.getOrCreateVariableByName("Req");
686 PVariable var_App = body.getOrCreateVariableByName("App");
687 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
688 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
689 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
690 new ExportedParameter(body, var_Req, parameter_Req),
691 new ExportedParameter(body, var_App, parameter_App)
692 ));
693 // Requirement.instances(Req, App)
694 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
695 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
696 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "instances")));
697 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
698 new Equality(body, var__virtual_0_, var_App);
699 // neg find satisfyingInstance(Req, App)
700 new NegativePatternCall(body, Tuples.flatTupleOf(var_Req, var_App), SatisfyingInstance.instance().getInternalQueryRepresentation());
701 bodies.add(body);
702 }
703 {
704 PAnnotation annotation = new PAnnotation("Constraint");
705 annotation.addAttribute("severity", "error");
706 annotation.addAttribute("key", Arrays.asList(new Object[] {
707 new ParameterReference("Req"),
708 new ParameterReference("App")
709 }));
710 annotation.addAttribute("message", "Requirement must be satisfied by the required application type.");
711 addAnnotation(annotation);
712 }
713 return bodies;
714 }
715 }
716}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableHdd.java
new file mode 100644
index 00000000..41615598
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableHdd.java
@@ -0,0 +1,579 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
29import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
30import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
41import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
42import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
43import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
44import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
45
46/**
47 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
48 *
49 * <p>Original source:
50 * <code><pre>
51 * {@literal @}Constraint(severity = "error", key = {Host},
52 * message = "Insufficient HDD available on host.")
53 * pattern notEnoughAvailableHdd(Host : HostInstance) {
54 * find availableHdd(Host, Hdd);
55 * check(Hdd {@literal <} 0);
56 * }
57 * </pre></code>
58 *
59 * @see Matcher
60 * @see Match
61 *
62 */
63@SuppressWarnings("all")
64public final class NotEnoughAvailableHdd extends BaseGeneratedEMFQuerySpecification<NotEnoughAvailableHdd.Matcher> {
65 /**
66 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd pattern,
67 * to be used in conjunction with {@link Matcher}.
68 *
69 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
70 * Each instance is a (possibly partial) substitution of pattern parameters,
71 * usable to represent a match of the pattern in the result of a query,
72 * or to specify the bound (fixed) input parameters when issuing a query.
73 *
74 * @see Matcher
75 *
76 */
77 public static abstract class Match extends BasePatternMatch {
78 private HostInstance fHost;
79
80 private static List<String> parameterNames = makeImmutableList("Host");
81
82 private Match(final HostInstance pHost) {
83 this.fHost = pHost;
84 }
85
86 @Override
87 public Object get(final String parameterName) {
88 if ("Host".equals(parameterName)) return this.fHost;
89 return null;
90 }
91
92 public HostInstance getHost() {
93 return this.fHost;
94 }
95
96 @Override
97 public boolean set(final String parameterName, final Object newValue) {
98 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
99 if ("Host".equals(parameterName) ) {
100 this.fHost = (HostInstance) newValue;
101 return true;
102 }
103 return false;
104 }
105
106 public void setHost(final HostInstance pHost) {
107 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
108 this.fHost = pHost;
109 }
110
111 @Override
112 public String patternName() {
113 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd";
114 }
115
116 @Override
117 public List<String> parameterNames() {
118 return NotEnoughAvailableHdd.Match.parameterNames;
119 }
120
121 @Override
122 public Object[] toArray() {
123 return new Object[]{fHost};
124 }
125
126 @Override
127 public NotEnoughAvailableHdd.Match toImmutable() {
128 return isMutable() ? newMatch(fHost) : this;
129 }
130
131 @Override
132 public String prettyPrint() {
133 StringBuilder result = new StringBuilder();
134 result.append("\"Host\"=" + prettyPrintValue(fHost));
135 return result.toString();
136 }
137
138 @Override
139 public int hashCode() {
140 return Objects.hash(fHost);
141 }
142
143 @Override
144 public boolean equals(final Object obj) {
145 if (this == obj)
146 return true;
147 if (obj == null) {
148 return false;
149 }
150 if ((obj instanceof NotEnoughAvailableHdd.Match)) {
151 NotEnoughAvailableHdd.Match other = (NotEnoughAvailableHdd.Match) obj;
152 return Objects.equals(fHost, other.fHost);
153 } else {
154 // this should be infrequent
155 if (!(obj instanceof IPatternMatch)) {
156 return false;
157 }
158 IPatternMatch otherSig = (IPatternMatch) obj;
159 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
160 }
161 }
162
163 @Override
164 public NotEnoughAvailableHdd specification() {
165 return NotEnoughAvailableHdd.instance();
166 }
167
168 /**
169 * Returns an empty, mutable match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @return the empty match.
173 *
174 */
175 public static NotEnoughAvailableHdd.Match newEmptyMatch() {
176 return new Mutable(null);
177 }
178
179 /**
180 * Returns a mutable (partial) match.
181 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
182 *
183 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
184 * @return the new, mutable (partial) match object.
185 *
186 */
187 public static NotEnoughAvailableHdd.Match newMutableMatch(final HostInstance pHost) {
188 return new Mutable(pHost);
189 }
190
191 /**
192 * Returns a new (partial) match.
193 * This can be used e.g. to call the matcher with a partial match.
194 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
195 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
196 * @return the (partial) match object.
197 *
198 */
199 public static NotEnoughAvailableHdd.Match newMatch(final HostInstance pHost) {
200 return new Immutable(pHost);
201 }
202
203 private static final class Mutable extends NotEnoughAvailableHdd.Match {
204 Mutable(final HostInstance pHost) {
205 super(pHost);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return true;
211 }
212 }
213
214 private static final class Immutable extends NotEnoughAvailableHdd.Match {
215 Immutable(final HostInstance pHost) {
216 super(pHost);
217 }
218
219 @Override
220 public boolean isMutable() {
221 return false;
222 }
223 }
224 }
225
226 /**
227 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd pattern,
228 * providing pattern-specific query methods.
229 *
230 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
231 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
232 *
233 * <p>Matches of the pattern will be represented as {@link Match}.
234 *
235 * <p>Original source:
236 * <code><pre>
237 * {@literal @}Constraint(severity = "error", key = {Host},
238 * message = "Insufficient HDD available on host.")
239 * pattern notEnoughAvailableHdd(Host : HostInstance) {
240 * find availableHdd(Host, Hdd);
241 * check(Hdd {@literal <} 0);
242 * }
243 * </pre></code>
244 *
245 * @see Match
246 * @see NotEnoughAvailableHdd
247 *
248 */
249 public static class Matcher extends BaseMatcher<NotEnoughAvailableHdd.Match> {
250 /**
251 * Initializes the pattern matcher within an existing VIATRA Query engine.
252 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
253 *
254 * @param engine the existing VIATRA Query engine in which this matcher will be created.
255 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
256 *
257 */
258 public static NotEnoughAvailableHdd.Matcher on(final ViatraQueryEngine engine) {
259 // check if matcher already exists
260 Matcher matcher = engine.getExistingMatcher(querySpecification());
261 if (matcher == null) {
262 matcher = (Matcher)engine.getMatcher(querySpecification());
263 }
264 return matcher;
265 }
266
267 /**
268 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
269 * @return an initialized matcher
270 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
271 *
272 */
273 public static NotEnoughAvailableHdd.Matcher create() {
274 return new Matcher();
275 }
276
277 private static final int POSITION_HOST = 0;
278
279 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NotEnoughAvailableHdd.Matcher.class);
280
281 /**
282 * Initializes the pattern matcher within an existing VIATRA Query engine.
283 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
284 *
285 * @param engine the existing VIATRA Query engine in which this matcher will be created.
286 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
287 *
288 */
289 private Matcher() {
290 super(querySpecification());
291 }
292
293 /**
294 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
295 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
296 * @return matches represented as a Match object.
297 *
298 */
299 public Collection<NotEnoughAvailableHdd.Match> getAllMatches(final HostInstance pHost) {
300 return rawStreamAllMatches(new Object[]{pHost}).collect(Collectors.toSet());
301 }
302
303 /**
304 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
305 * </p>
306 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
307 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
308 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
309 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
310 * @return a stream of matches represented as a Match object.
311 *
312 */
313 public Stream<NotEnoughAvailableHdd.Match> streamAllMatches(final HostInstance pHost) {
314 return rawStreamAllMatches(new Object[]{pHost});
315 }
316
317 /**
318 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
319 * Neither determinism nor randomness of selection is guaranteed.
320 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
321 * @return a match represented as a Match object, or null if no match is found.
322 *
323 */
324 public Optional<NotEnoughAvailableHdd.Match> getOneArbitraryMatch(final HostInstance pHost) {
325 return rawGetOneArbitraryMatch(new Object[]{pHost});
326 }
327
328 /**
329 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
330 * under any possible substitution of the unspecified parameters (if any).
331 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
332 * @return true if the input is a valid (partial) match of the pattern.
333 *
334 */
335 public boolean hasMatch(final HostInstance pHost) {
336 return rawHasMatch(new Object[]{pHost});
337 }
338
339 /**
340 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
341 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
342 * @return the number of pattern matches found.
343 *
344 */
345 public int countMatches(final HostInstance pHost) {
346 return rawCountMatches(new Object[]{pHost});
347 }
348
349 /**
350 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
351 * Neither determinism nor randomness of selection is guaranteed.
352 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
353 * @param processor the action that will process the selected match.
354 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
355 *
356 */
357 public boolean forOneArbitraryMatch(final HostInstance pHost, final Consumer<? super NotEnoughAvailableHdd.Match> processor) {
358 return rawForOneArbitraryMatch(new Object[]{pHost}, processor);
359 }
360
361 /**
362 * Returns a new (partial) match.
363 * This can be used e.g. to call the matcher with a partial match.
364 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
365 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
366 * @return the (partial) match object.
367 *
368 */
369 public NotEnoughAvailableHdd.Match newMatch(final HostInstance pHost) {
370 return NotEnoughAvailableHdd.Match.newMatch(pHost);
371 }
372
373 /**
374 * Retrieve the set of values that occur in matches for Host.
375 * @return the Set of all values or empty set if there are no matches
376 *
377 */
378 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
379 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
380 }
381
382 /**
383 * Retrieve the set of values that occur in matches for Host.
384 * @return the Set of all values or empty set if there are no matches
385 *
386 */
387 public Set<HostInstance> getAllValuesOfHost() {
388 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
389 }
390
391 /**
392 * Retrieve the set of values that occur in matches for Host.
393 * @return the Set of all values or empty set if there are no matches
394 *
395 */
396 public Stream<HostInstance> streamAllValuesOfHost() {
397 return rawStreamAllValuesOfHost(emptyArray());
398 }
399
400 @Override
401 protected NotEnoughAvailableHdd.Match tupleToMatch(final Tuple t) {
402 try {
403 return NotEnoughAvailableHdd.Match.newMatch((HostInstance) t.get(POSITION_HOST));
404 } catch(ClassCastException e) {
405 LOGGER.error("Element(s) in tuple not properly typed!",e);
406 return null;
407 }
408 }
409
410 @Override
411 protected NotEnoughAvailableHdd.Match arrayToMatch(final Object[] match) {
412 try {
413 return NotEnoughAvailableHdd.Match.newMatch((HostInstance) match[POSITION_HOST]);
414 } catch(ClassCastException e) {
415 LOGGER.error("Element(s) in array not properly typed!",e);
416 return null;
417 }
418 }
419
420 @Override
421 protected NotEnoughAvailableHdd.Match arrayToMatchMutable(final Object[] match) {
422 try {
423 return NotEnoughAvailableHdd.Match.newMutableMatch((HostInstance) match[POSITION_HOST]);
424 } catch(ClassCastException e) {
425 LOGGER.error("Element(s) in array not properly typed!",e);
426 return null;
427 }
428 }
429
430 /**
431 * @return the singleton instance of the query specification of this pattern
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static IQuerySpecification<NotEnoughAvailableHdd.Matcher> querySpecification() {
436 return NotEnoughAvailableHdd.instance();
437 }
438 }
439
440 private NotEnoughAvailableHdd() {
441 super(GeneratedPQuery.INSTANCE);
442 }
443
444 /**
445 * @return the singleton instance of the query specification
446 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
447 *
448 */
449 public static NotEnoughAvailableHdd instance() {
450 try{
451 return LazyHolder.INSTANCE;
452 } catch (ExceptionInInitializerError err) {
453 throw processInitializerError(err);
454 }
455 }
456
457 @Override
458 protected NotEnoughAvailableHdd.Matcher instantiate(final ViatraQueryEngine engine) {
459 return NotEnoughAvailableHdd.Matcher.on(engine);
460 }
461
462 @Override
463 public NotEnoughAvailableHdd.Matcher instantiate() {
464 return NotEnoughAvailableHdd.Matcher.create();
465 }
466
467 @Override
468 public NotEnoughAvailableHdd.Match newEmptyMatch() {
469 return NotEnoughAvailableHdd.Match.newEmptyMatch();
470 }
471
472 @Override
473 public NotEnoughAvailableHdd.Match newMatch(final Object... parameters) {
474 return NotEnoughAvailableHdd.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0]);
475 }
476
477 /**
478 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd (visibility: PUBLIC, simpleName: NotEnoughAvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
479 * <b>not</b> at the class load time of the outer class,
480 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd (visibility: PUBLIC, simpleName: NotEnoughAvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
481 *
482 * <p> This workaround is required e.g. to support recursion.
483 *
484 */
485 private static class LazyHolder {
486 private static final NotEnoughAvailableHdd INSTANCE = new NotEnoughAvailableHdd();
487
488 /**
489 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
490 * This initialization order is required to support indirect recursion.
491 *
492 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
493 *
494 */
495 private static final Object STATIC_INITIALIZER = ensureInitialized();
496
497 public static Object ensureInitialized() {
498 INSTANCE.ensureInitializedInternal();
499 return null;
500 }
501 }
502
503 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
504 private static final NotEnoughAvailableHdd.GeneratedPQuery INSTANCE = new GeneratedPQuery();
505
506 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
507
508 private final List<PParameter> parameters = Arrays.asList(parameter_Host);
509
510 private GeneratedPQuery() {
511 super(PVisibility.PUBLIC);
512 }
513
514 @Override
515 public String getFullyQualifiedName() {
516 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd";
517 }
518
519 @Override
520 public List<String> getParameterNames() {
521 return Arrays.asList("Host");
522 }
523
524 @Override
525 public List<PParameter> getParameters() {
526 return parameters;
527 }
528
529 @Override
530 public Set<PBody> doGetContainedBodies() {
531 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
532 Set<PBody> bodies = new LinkedHashSet<>();
533 {
534 PBody body = new PBody(this);
535 PVariable var_Host = body.getOrCreateVariableByName("Host");
536 PVariable var_Hdd = body.getOrCreateVariableByName("Hdd");
537 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
538 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
539 new ExportedParameter(body, var_Host, parameter_Host)
540 ));
541 // find availableHdd(Host, Hdd)
542 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_Hdd), AvailableHdd.instance().getInternalQueryRepresentation());
543 // check(Hdd < 0)
544 new ExpressionEvaluation(body, new IExpressionEvaluator() {
545
546 @Override
547 public String getShortDescription() {
548 return "Expression evaluation from pattern notEnoughAvailableHdd";
549 }
550
551 @Override
552 public Iterable<String> getInputParameterNames() {
553 return Arrays.asList("Hdd");}
554
555 @Override
556 public Object evaluateExpression(IValueProvider provider) throws Exception {
557 Integer Hdd = (Integer) provider.getValue("Hdd");
558 return evaluateExpression_1_1(Hdd);
559 }
560 }, null);
561 bodies.add(body);
562 }
563 {
564 PAnnotation annotation = new PAnnotation("Constraint");
565 annotation.addAttribute("severity", "error");
566 annotation.addAttribute("key", Arrays.asList(new Object[] {
567 new ParameterReference("Host")
568 }));
569 annotation.addAttribute("message", "Insufficient HDD available on host.");
570 addAnnotation(annotation);
571 }
572 return bodies;
573 }
574 }
575
576 private static boolean evaluateExpression_1_1(final Integer Hdd) {
577 return ((Hdd).intValue() < 0);
578 }
579}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableMemory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableMemory.java
new file mode 100644
index 00000000..4803ec3a
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableMemory.java
@@ -0,0 +1,579 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
29import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
30import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
41import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
42import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
43import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
44import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
45
46/**
47 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
48 *
49 * <p>Original source:
50 * <code><pre>
51 * {@literal @}Constraint(severity = "error", key = {Host},
52 * message = "Insufficient memory available on host.")
53 * pattern notEnoughAvailableMemory(Host : HostInstance) {
54 * find availableMemory(Host, Memory);
55 * check(Memory {@literal <} 0);
56 * }
57 * </pre></code>
58 *
59 * @see Matcher
60 * @see Match
61 *
62 */
63@SuppressWarnings("all")
64public final class NotEnoughAvailableMemory extends BaseGeneratedEMFQuerySpecification<NotEnoughAvailableMemory.Matcher> {
65 /**
66 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory pattern,
67 * to be used in conjunction with {@link Matcher}.
68 *
69 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
70 * Each instance is a (possibly partial) substitution of pattern parameters,
71 * usable to represent a match of the pattern in the result of a query,
72 * or to specify the bound (fixed) input parameters when issuing a query.
73 *
74 * @see Matcher
75 *
76 */
77 public static abstract class Match extends BasePatternMatch {
78 private HostInstance fHost;
79
80 private static List<String> parameterNames = makeImmutableList("Host");
81
82 private Match(final HostInstance pHost) {
83 this.fHost = pHost;
84 }
85
86 @Override
87 public Object get(final String parameterName) {
88 if ("Host".equals(parameterName)) return this.fHost;
89 return null;
90 }
91
92 public HostInstance getHost() {
93 return this.fHost;
94 }
95
96 @Override
97 public boolean set(final String parameterName, final Object newValue) {
98 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
99 if ("Host".equals(parameterName) ) {
100 this.fHost = (HostInstance) newValue;
101 return true;
102 }
103 return false;
104 }
105
106 public void setHost(final HostInstance pHost) {
107 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
108 this.fHost = pHost;
109 }
110
111 @Override
112 public String patternName() {
113 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory";
114 }
115
116 @Override
117 public List<String> parameterNames() {
118 return NotEnoughAvailableMemory.Match.parameterNames;
119 }
120
121 @Override
122 public Object[] toArray() {
123 return new Object[]{fHost};
124 }
125
126 @Override
127 public NotEnoughAvailableMemory.Match toImmutable() {
128 return isMutable() ? newMatch(fHost) : this;
129 }
130
131 @Override
132 public String prettyPrint() {
133 StringBuilder result = new StringBuilder();
134 result.append("\"Host\"=" + prettyPrintValue(fHost));
135 return result.toString();
136 }
137
138 @Override
139 public int hashCode() {
140 return Objects.hash(fHost);
141 }
142
143 @Override
144 public boolean equals(final Object obj) {
145 if (this == obj)
146 return true;
147 if (obj == null) {
148 return false;
149 }
150 if ((obj instanceof NotEnoughAvailableMemory.Match)) {
151 NotEnoughAvailableMemory.Match other = (NotEnoughAvailableMemory.Match) obj;
152 return Objects.equals(fHost, other.fHost);
153 } else {
154 // this should be infrequent
155 if (!(obj instanceof IPatternMatch)) {
156 return false;
157 }
158 IPatternMatch otherSig = (IPatternMatch) obj;
159 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
160 }
161 }
162
163 @Override
164 public NotEnoughAvailableMemory specification() {
165 return NotEnoughAvailableMemory.instance();
166 }
167
168 /**
169 * Returns an empty, mutable match.
170 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
171 *
172 * @return the empty match.
173 *
174 */
175 public static NotEnoughAvailableMemory.Match newEmptyMatch() {
176 return new Mutable(null);
177 }
178
179 /**
180 * Returns a mutable (partial) match.
181 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
182 *
183 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
184 * @return the new, mutable (partial) match object.
185 *
186 */
187 public static NotEnoughAvailableMemory.Match newMutableMatch(final HostInstance pHost) {
188 return new Mutable(pHost);
189 }
190
191 /**
192 * Returns a new (partial) match.
193 * This can be used e.g. to call the matcher with a partial match.
194 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
195 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
196 * @return the (partial) match object.
197 *
198 */
199 public static NotEnoughAvailableMemory.Match newMatch(final HostInstance pHost) {
200 return new Immutable(pHost);
201 }
202
203 private static final class Mutable extends NotEnoughAvailableMemory.Match {
204 Mutable(final HostInstance pHost) {
205 super(pHost);
206 }
207
208 @Override
209 public boolean isMutable() {
210 return true;
211 }
212 }
213
214 private static final class Immutable extends NotEnoughAvailableMemory.Match {
215 Immutable(final HostInstance pHost) {
216 super(pHost);
217 }
218
219 @Override
220 public boolean isMutable() {
221 return false;
222 }
223 }
224 }
225
226 /**
227 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory pattern,
228 * providing pattern-specific query methods.
229 *
230 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
231 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
232 *
233 * <p>Matches of the pattern will be represented as {@link Match}.
234 *
235 * <p>Original source:
236 * <code><pre>
237 * {@literal @}Constraint(severity = "error", key = {Host},
238 * message = "Insufficient memory available on host.")
239 * pattern notEnoughAvailableMemory(Host : HostInstance) {
240 * find availableMemory(Host, Memory);
241 * check(Memory {@literal <} 0);
242 * }
243 * </pre></code>
244 *
245 * @see Match
246 * @see NotEnoughAvailableMemory
247 *
248 */
249 public static class Matcher extends BaseMatcher<NotEnoughAvailableMemory.Match> {
250 /**
251 * Initializes the pattern matcher within an existing VIATRA Query engine.
252 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
253 *
254 * @param engine the existing VIATRA Query engine in which this matcher will be created.
255 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
256 *
257 */
258 public static NotEnoughAvailableMemory.Matcher on(final ViatraQueryEngine engine) {
259 // check if matcher already exists
260 Matcher matcher = engine.getExistingMatcher(querySpecification());
261 if (matcher == null) {
262 matcher = (Matcher)engine.getMatcher(querySpecification());
263 }
264 return matcher;
265 }
266
267 /**
268 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
269 * @return an initialized matcher
270 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
271 *
272 */
273 public static NotEnoughAvailableMemory.Matcher create() {
274 return new Matcher();
275 }
276
277 private static final int POSITION_HOST = 0;
278
279 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NotEnoughAvailableMemory.Matcher.class);
280
281 /**
282 * Initializes the pattern matcher within an existing VIATRA Query engine.
283 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
284 *
285 * @param engine the existing VIATRA Query engine in which this matcher will be created.
286 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
287 *
288 */
289 private Matcher() {
290 super(querySpecification());
291 }
292
293 /**
294 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
295 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
296 * @return matches represented as a Match object.
297 *
298 */
299 public Collection<NotEnoughAvailableMemory.Match> getAllMatches(final HostInstance pHost) {
300 return rawStreamAllMatches(new Object[]{pHost}).collect(Collectors.toSet());
301 }
302
303 /**
304 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
305 * </p>
306 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
307 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
308 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
309 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
310 * @return a stream of matches represented as a Match object.
311 *
312 */
313 public Stream<NotEnoughAvailableMemory.Match> streamAllMatches(final HostInstance pHost) {
314 return rawStreamAllMatches(new Object[]{pHost});
315 }
316
317 /**
318 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
319 * Neither determinism nor randomness of selection is guaranteed.
320 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
321 * @return a match represented as a Match object, or null if no match is found.
322 *
323 */
324 public Optional<NotEnoughAvailableMemory.Match> getOneArbitraryMatch(final HostInstance pHost) {
325 return rawGetOneArbitraryMatch(new Object[]{pHost});
326 }
327
328 /**
329 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
330 * under any possible substitution of the unspecified parameters (if any).
331 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
332 * @return true if the input is a valid (partial) match of the pattern.
333 *
334 */
335 public boolean hasMatch(final HostInstance pHost) {
336 return rawHasMatch(new Object[]{pHost});
337 }
338
339 /**
340 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
341 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
342 * @return the number of pattern matches found.
343 *
344 */
345 public int countMatches(final HostInstance pHost) {
346 return rawCountMatches(new Object[]{pHost});
347 }
348
349 /**
350 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
351 * Neither determinism nor randomness of selection is guaranteed.
352 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
353 * @param processor the action that will process the selected match.
354 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
355 *
356 */
357 public boolean forOneArbitraryMatch(final HostInstance pHost, final Consumer<? super NotEnoughAvailableMemory.Match> processor) {
358 return rawForOneArbitraryMatch(new Object[]{pHost}, processor);
359 }
360
361 /**
362 * Returns a new (partial) match.
363 * This can be used e.g. to call the matcher with a partial match.
364 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
365 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
366 * @return the (partial) match object.
367 *
368 */
369 public NotEnoughAvailableMemory.Match newMatch(final HostInstance pHost) {
370 return NotEnoughAvailableMemory.Match.newMatch(pHost);
371 }
372
373 /**
374 * Retrieve the set of values that occur in matches for Host.
375 * @return the Set of all values or empty set if there are no matches
376 *
377 */
378 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
379 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
380 }
381
382 /**
383 * Retrieve the set of values that occur in matches for Host.
384 * @return the Set of all values or empty set if there are no matches
385 *
386 */
387 public Set<HostInstance> getAllValuesOfHost() {
388 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
389 }
390
391 /**
392 * Retrieve the set of values that occur in matches for Host.
393 * @return the Set of all values or empty set if there are no matches
394 *
395 */
396 public Stream<HostInstance> streamAllValuesOfHost() {
397 return rawStreamAllValuesOfHost(emptyArray());
398 }
399
400 @Override
401 protected NotEnoughAvailableMemory.Match tupleToMatch(final Tuple t) {
402 try {
403 return NotEnoughAvailableMemory.Match.newMatch((HostInstance) t.get(POSITION_HOST));
404 } catch(ClassCastException e) {
405 LOGGER.error("Element(s) in tuple not properly typed!",e);
406 return null;
407 }
408 }
409
410 @Override
411 protected NotEnoughAvailableMemory.Match arrayToMatch(final Object[] match) {
412 try {
413 return NotEnoughAvailableMemory.Match.newMatch((HostInstance) match[POSITION_HOST]);
414 } catch(ClassCastException e) {
415 LOGGER.error("Element(s) in array not properly typed!",e);
416 return null;
417 }
418 }
419
420 @Override
421 protected NotEnoughAvailableMemory.Match arrayToMatchMutable(final Object[] match) {
422 try {
423 return NotEnoughAvailableMemory.Match.newMutableMatch((HostInstance) match[POSITION_HOST]);
424 } catch(ClassCastException e) {
425 LOGGER.error("Element(s) in array not properly typed!",e);
426 return null;
427 }
428 }
429
430 /**
431 * @return the singleton instance of the query specification of this pattern
432 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
433 *
434 */
435 public static IQuerySpecification<NotEnoughAvailableMemory.Matcher> querySpecification() {
436 return NotEnoughAvailableMemory.instance();
437 }
438 }
439
440 private NotEnoughAvailableMemory() {
441 super(GeneratedPQuery.INSTANCE);
442 }
443
444 /**
445 * @return the singleton instance of the query specification
446 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
447 *
448 */
449 public static NotEnoughAvailableMemory instance() {
450 try{
451 return LazyHolder.INSTANCE;
452 } catch (ExceptionInInitializerError err) {
453 throw processInitializerError(err);
454 }
455 }
456
457 @Override
458 protected NotEnoughAvailableMemory.Matcher instantiate(final ViatraQueryEngine engine) {
459 return NotEnoughAvailableMemory.Matcher.on(engine);
460 }
461
462 @Override
463 public NotEnoughAvailableMemory.Matcher instantiate() {
464 return NotEnoughAvailableMemory.Matcher.create();
465 }
466
467 @Override
468 public NotEnoughAvailableMemory.Match newEmptyMatch() {
469 return NotEnoughAvailableMemory.Match.newEmptyMatch();
470 }
471
472 @Override
473 public NotEnoughAvailableMemory.Match newMatch(final Object... parameters) {
474 return NotEnoughAvailableMemory.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0]);
475 }
476
477 /**
478 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory (visibility: PUBLIC, simpleName: NotEnoughAvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
479 * <b>not</b> at the class load time of the outer class,
480 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory (visibility: PUBLIC, simpleName: NotEnoughAvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
481 *
482 * <p> This workaround is required e.g. to support recursion.
483 *
484 */
485 private static class LazyHolder {
486 private static final NotEnoughAvailableMemory INSTANCE = new NotEnoughAvailableMemory();
487
488 /**
489 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
490 * This initialization order is required to support indirect recursion.
491 *
492 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
493 *
494 */
495 private static final Object STATIC_INITIALIZER = ensureInitialized();
496
497 public static Object ensureInitialized() {
498 INSTANCE.ensureInitializedInternal();
499 return null;
500 }
501 }
502
503 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
504 private static final NotEnoughAvailableMemory.GeneratedPQuery INSTANCE = new GeneratedPQuery();
505
506 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
507
508 private final List<PParameter> parameters = Arrays.asList(parameter_Host);
509
510 private GeneratedPQuery() {
511 super(PVisibility.PUBLIC);
512 }
513
514 @Override
515 public String getFullyQualifiedName() {
516 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory";
517 }
518
519 @Override
520 public List<String> getParameterNames() {
521 return Arrays.asList("Host");
522 }
523
524 @Override
525 public List<PParameter> getParameters() {
526 return parameters;
527 }
528
529 @Override
530 public Set<PBody> doGetContainedBodies() {
531 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
532 Set<PBody> bodies = new LinkedHashSet<>();
533 {
534 PBody body = new PBody(this);
535 PVariable var_Host = body.getOrCreateVariableByName("Host");
536 PVariable var_Memory = body.getOrCreateVariableByName("Memory");
537 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
538 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
539 new ExportedParameter(body, var_Host, parameter_Host)
540 ));
541 // find availableMemory(Host, Memory)
542 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_Memory), AvailableMemory.instance().getInternalQueryRepresentation());
543 // check(Memory < 0)
544 new ExpressionEvaluation(body, new IExpressionEvaluator() {
545
546 @Override
547 public String getShortDescription() {
548 return "Expression evaluation from pattern notEnoughAvailableMemory";
549 }
550
551 @Override
552 public Iterable<String> getInputParameterNames() {
553 return Arrays.asList("Memory");}
554
555 @Override
556 public Object evaluateExpression(IValueProvider provider) throws Exception {
557 Integer Memory = (Integer) provider.getValue("Memory");
558 return evaluateExpression_1_1(Memory);
559 }
560 }, null);
561 bodies.add(body);
562 }
563 {
564 PAnnotation annotation = new PAnnotation("Constraint");
565 annotation.addAttribute("severity", "error");
566 annotation.addAttribute("key", Arrays.asList(new Object[] {
567 new ParameterReference("Host")
568 }));
569 annotation.addAttribute("message", "Insufficient memory available on host.");
570 addAnnotation(annotation);
571 }
572 return bodies;
573 }
574 }
575
576 private static boolean evaluateExpression_1_1(final Integer Memory) {
577 return ((Memory).intValue() < 0);
578 }
579}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java
new file mode 100644
index 00000000..04066c50
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RequirementNotSatisfied.java
@@ -0,0 +1,597 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.emf.ecore.EDataType;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
30import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
31import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
32import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
33import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
34import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
35import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
36import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
43import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
44import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
45import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
46import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
47import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
48import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
49
50/**
51 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
52 *
53 * <p>Original source:
54 * <code><pre>
55 * {@literal @}Constraint(severity = "error", key = {Req},
56 * message = "Requirement is not satisfied by enough application instances.")
57 * pattern requirementNotSatisfied(Req : Requirement) {
58 * Instances == count find satisfyingInstance(Req, _);
59 * Requirement.count(Req, RequiredCount);
60 * check(Instances {@literal <} RequiredCount);
61 * }
62 * </pre></code>
63 *
64 * @see Matcher
65 * @see Match
66 *
67 */
68@SuppressWarnings("all")
69public final class RequirementNotSatisfied extends BaseGeneratedEMFQuerySpecification<RequirementNotSatisfied.Matcher> {
70 /**
71 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied pattern,
72 * to be used in conjunction with {@link Matcher}.
73 *
74 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
75 * Each instance is a (possibly partial) substitution of pattern parameters,
76 * usable to represent a match of the pattern in the result of a query,
77 * or to specify the bound (fixed) input parameters when issuing a query.
78 *
79 * @see Matcher
80 *
81 */
82 public static abstract class Match extends BasePatternMatch {
83 private Requirement fReq;
84
85 private static List<String> parameterNames = makeImmutableList("Req");
86
87 private Match(final Requirement pReq) {
88 this.fReq = pReq;
89 }
90
91 @Override
92 public Object get(final String parameterName) {
93 if ("Req".equals(parameterName)) return this.fReq;
94 return null;
95 }
96
97 public Requirement getReq() {
98 return this.fReq;
99 }
100
101 @Override
102 public boolean set(final String parameterName, final Object newValue) {
103 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
104 if ("Req".equals(parameterName) ) {
105 this.fReq = (Requirement) newValue;
106 return true;
107 }
108 return false;
109 }
110
111 public void setReq(final Requirement pReq) {
112 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
113 this.fReq = pReq;
114 }
115
116 @Override
117 public String patternName() {
118 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied";
119 }
120
121 @Override
122 public List<String> parameterNames() {
123 return RequirementNotSatisfied.Match.parameterNames;
124 }
125
126 @Override
127 public Object[] toArray() {
128 return new Object[]{fReq};
129 }
130
131 @Override
132 public RequirementNotSatisfied.Match toImmutable() {
133 return isMutable() ? newMatch(fReq) : this;
134 }
135
136 @Override
137 public String prettyPrint() {
138 StringBuilder result = new StringBuilder();
139 result.append("\"Req\"=" + prettyPrintValue(fReq));
140 return result.toString();
141 }
142
143 @Override
144 public int hashCode() {
145 return Objects.hash(fReq);
146 }
147
148 @Override
149 public boolean equals(final Object obj) {
150 if (this == obj)
151 return true;
152 if (obj == null) {
153 return false;
154 }
155 if ((obj instanceof RequirementNotSatisfied.Match)) {
156 RequirementNotSatisfied.Match other = (RequirementNotSatisfied.Match) obj;
157 return Objects.equals(fReq, other.fReq);
158 } else {
159 // this should be infrequent
160 if (!(obj instanceof IPatternMatch)) {
161 return false;
162 }
163 IPatternMatch otherSig = (IPatternMatch) obj;
164 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
165 }
166 }
167
168 @Override
169 public RequirementNotSatisfied specification() {
170 return RequirementNotSatisfied.instance();
171 }
172
173 /**
174 * Returns an empty, mutable match.
175 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
176 *
177 * @return the empty match.
178 *
179 */
180 public static RequirementNotSatisfied.Match newEmptyMatch() {
181 return new Mutable(null);
182 }
183
184 /**
185 * Returns a mutable (partial) match.
186 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
187 *
188 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
189 * @return the new, mutable (partial) match object.
190 *
191 */
192 public static RequirementNotSatisfied.Match newMutableMatch(final Requirement pReq) {
193 return new Mutable(pReq);
194 }
195
196 /**
197 * Returns a new (partial) match.
198 * This can be used e.g. to call the matcher with a partial match.
199 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
200 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
201 * @return the (partial) match object.
202 *
203 */
204 public static RequirementNotSatisfied.Match newMatch(final Requirement pReq) {
205 return new Immutable(pReq);
206 }
207
208 private static final class Mutable extends RequirementNotSatisfied.Match {
209 Mutable(final Requirement pReq) {
210 super(pReq);
211 }
212
213 @Override
214 public boolean isMutable() {
215 return true;
216 }
217 }
218
219 private static final class Immutable extends RequirementNotSatisfied.Match {
220 Immutable(final Requirement pReq) {
221 super(pReq);
222 }
223
224 @Override
225 public boolean isMutable() {
226 return false;
227 }
228 }
229 }
230
231 /**
232 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied pattern,
233 * providing pattern-specific query methods.
234 *
235 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
236 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
237 *
238 * <p>Matches of the pattern will be represented as {@link Match}.
239 *
240 * <p>Original source:
241 * <code><pre>
242 * {@literal @}Constraint(severity = "error", key = {Req},
243 * message = "Requirement is not satisfied by enough application instances.")
244 * pattern requirementNotSatisfied(Req : Requirement) {
245 * Instances == count find satisfyingInstance(Req, _);
246 * Requirement.count(Req, RequiredCount);
247 * check(Instances {@literal <} RequiredCount);
248 * }
249 * </pre></code>
250 *
251 * @see Match
252 * @see RequirementNotSatisfied
253 *
254 */
255 public static class Matcher extends BaseMatcher<RequirementNotSatisfied.Match> {
256 /**
257 * Initializes the pattern matcher within an existing VIATRA Query engine.
258 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
259 *
260 * @param engine the existing VIATRA Query engine in which this matcher will be created.
261 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
262 *
263 */
264 public static RequirementNotSatisfied.Matcher on(final ViatraQueryEngine engine) {
265 // check if matcher already exists
266 Matcher matcher = engine.getExistingMatcher(querySpecification());
267 if (matcher == null) {
268 matcher = (Matcher)engine.getMatcher(querySpecification());
269 }
270 return matcher;
271 }
272
273 /**
274 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
275 * @return an initialized matcher
276 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
277 *
278 */
279 public static RequirementNotSatisfied.Matcher create() {
280 return new Matcher();
281 }
282
283 private static final int POSITION_REQ = 0;
284
285 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(RequirementNotSatisfied.Matcher.class);
286
287 /**
288 * Initializes the pattern matcher within an existing VIATRA Query engine.
289 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
290 *
291 * @param engine the existing VIATRA Query engine in which this matcher will be created.
292 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
293 *
294 */
295 private Matcher() {
296 super(querySpecification());
297 }
298
299 /**
300 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
301 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
302 * @return matches represented as a Match object.
303 *
304 */
305 public Collection<RequirementNotSatisfied.Match> getAllMatches(final Requirement pReq) {
306 return rawStreamAllMatches(new Object[]{pReq}).collect(Collectors.toSet());
307 }
308
309 /**
310 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
311 * </p>
312 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
313 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
314 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
315 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
316 * @return a stream of matches represented as a Match object.
317 *
318 */
319 public Stream<RequirementNotSatisfied.Match> streamAllMatches(final Requirement pReq) {
320 return rawStreamAllMatches(new Object[]{pReq});
321 }
322
323 /**
324 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
325 * Neither determinism nor randomness of selection is guaranteed.
326 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
327 * @return a match represented as a Match object, or null if no match is found.
328 *
329 */
330 public Optional<RequirementNotSatisfied.Match> getOneArbitraryMatch(final Requirement pReq) {
331 return rawGetOneArbitraryMatch(new Object[]{pReq});
332 }
333
334 /**
335 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
336 * under any possible substitution of the unspecified parameters (if any).
337 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
338 * @return true if the input is a valid (partial) match of the pattern.
339 *
340 */
341 public boolean hasMatch(final Requirement pReq) {
342 return rawHasMatch(new Object[]{pReq});
343 }
344
345 /**
346 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
347 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
348 * @return the number of pattern matches found.
349 *
350 */
351 public int countMatches(final Requirement pReq) {
352 return rawCountMatches(new Object[]{pReq});
353 }
354
355 /**
356 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
357 * Neither determinism nor randomness of selection is guaranteed.
358 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
359 * @param processor the action that will process the selected match.
360 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
361 *
362 */
363 public boolean forOneArbitraryMatch(final Requirement pReq, final Consumer<? super RequirementNotSatisfied.Match> processor) {
364 return rawForOneArbitraryMatch(new Object[]{pReq}, processor);
365 }
366
367 /**
368 * Returns a new (partial) match.
369 * This can be used e.g. to call the matcher with a partial match.
370 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
371 * @param pReq the fixed value of pattern parameter Req, or null if not bound.
372 * @return the (partial) match object.
373 *
374 */
375 public RequirementNotSatisfied.Match newMatch(final Requirement pReq) {
376 return RequirementNotSatisfied.Match.newMatch(pReq);
377 }
378
379 /**
380 * Retrieve the set of values that occur in matches for Req.
381 * @return the Set of all values or empty set if there are no matches
382 *
383 */
384 protected Stream<Requirement> rawStreamAllValuesOfReq(final Object[] parameters) {
385 return rawStreamAllValues(POSITION_REQ, parameters).map(Requirement.class::cast);
386 }
387
388 /**
389 * Retrieve the set of values that occur in matches for Req.
390 * @return the Set of all values or empty set if there are no matches
391 *
392 */
393 public Set<Requirement> getAllValuesOfReq() {
394 return rawStreamAllValuesOfReq(emptyArray()).collect(Collectors.toSet());
395 }
396
397 /**
398 * Retrieve the set of values that occur in matches for Req.
399 * @return the Set of all values or empty set if there are no matches
400 *
401 */
402 public Stream<Requirement> streamAllValuesOfReq() {
403 return rawStreamAllValuesOfReq(emptyArray());
404 }
405
406 @Override
407 protected RequirementNotSatisfied.Match tupleToMatch(final Tuple t) {
408 try {
409 return RequirementNotSatisfied.Match.newMatch((Requirement) t.get(POSITION_REQ));
410 } catch(ClassCastException e) {
411 LOGGER.error("Element(s) in tuple not properly typed!",e);
412 return null;
413 }
414 }
415
416 @Override
417 protected RequirementNotSatisfied.Match arrayToMatch(final Object[] match) {
418 try {
419 return RequirementNotSatisfied.Match.newMatch((Requirement) match[POSITION_REQ]);
420 } catch(ClassCastException e) {
421 LOGGER.error("Element(s) in array not properly typed!",e);
422 return null;
423 }
424 }
425
426 @Override
427 protected RequirementNotSatisfied.Match arrayToMatchMutable(final Object[] match) {
428 try {
429 return RequirementNotSatisfied.Match.newMutableMatch((Requirement) match[POSITION_REQ]);
430 } catch(ClassCastException e) {
431 LOGGER.error("Element(s) in array not properly typed!",e);
432 return null;
433 }
434 }
435
436 /**
437 * @return the singleton instance of the query specification of this pattern
438 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
439 *
440 */
441 public static IQuerySpecification<RequirementNotSatisfied.Matcher> querySpecification() {
442 return RequirementNotSatisfied.instance();
443 }
444 }
445
446 private RequirementNotSatisfied() {
447 super(GeneratedPQuery.INSTANCE);
448 }
449
450 /**
451 * @return the singleton instance of the query specification
452 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
453 *
454 */
455 public static RequirementNotSatisfied instance() {
456 try{
457 return LazyHolder.INSTANCE;
458 } catch (ExceptionInInitializerError err) {
459 throw processInitializerError(err);
460 }
461 }
462
463 @Override
464 protected RequirementNotSatisfied.Matcher instantiate(final ViatraQueryEngine engine) {
465 return RequirementNotSatisfied.Matcher.on(engine);
466 }
467
468 @Override
469 public RequirementNotSatisfied.Matcher instantiate() {
470 return RequirementNotSatisfied.Matcher.create();
471 }
472
473 @Override
474 public RequirementNotSatisfied.Match newEmptyMatch() {
475 return RequirementNotSatisfied.Match.newEmptyMatch();
476 }
477
478 @Override
479 public RequirementNotSatisfied.Match newMatch(final Object... parameters) {
480 return RequirementNotSatisfied.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.Requirement) parameters[0]);
481 }
482
483 /**
484 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied (visibility: PUBLIC, simpleName: RequirementNotSatisfied, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
485 * <b>not</b> at the class load time of the outer class,
486 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied (visibility: PUBLIC, simpleName: RequirementNotSatisfied, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
487 *
488 * <p> This workaround is required e.g. to support recursion.
489 *
490 */
491 private static class LazyHolder {
492 private static final RequirementNotSatisfied INSTANCE = new RequirementNotSatisfied();
493
494 /**
495 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
496 * This initialization order is required to support indirect recursion.
497 *
498 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
499 *
500 */
501 private static final Object STATIC_INITIALIZER = ensureInitialized();
502
503 public static Object ensureInitialized() {
504 INSTANCE.ensureInitializedInternal();
505 return null;
506 }
507 }
508
509 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
510 private static final RequirementNotSatisfied.GeneratedPQuery INSTANCE = new GeneratedPQuery();
511
512 private final PParameter parameter_Req = new PParameter("Req", "hu.bme.mit.inf.dslreasoner.domains.cps.Requirement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "Requirement")), PParameterDirection.INOUT);
513
514 private final List<PParameter> parameters = Arrays.asList(parameter_Req);
515
516 private GeneratedPQuery() {
517 super(PVisibility.PUBLIC);
518 }
519
520 @Override
521 public String getFullyQualifiedName() {
522 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied";
523 }
524
525 @Override
526 public List<String> getParameterNames() {
527 return Arrays.asList("Req");
528 }
529
530 @Override
531 public List<PParameter> getParameters() {
532 return parameters;
533 }
534
535 @Override
536 public Set<PBody> doGetContainedBodies() {
537 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
538 Set<PBody> bodies = new LinkedHashSet<>();
539 {
540 PBody body = new PBody(this);
541 PVariable var_Req = body.getOrCreateVariableByName("Req");
542 PVariable var_Instances = body.getOrCreateVariableByName("Instances");
543 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
544 PVariable var_RequiredCount = body.getOrCreateVariableByName("RequiredCount");
545 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
546 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
547 new ExportedParameter(body, var_Req, parameter_Req)
548 ));
549 // Instances == count find satisfyingInstance(Req, _)
550 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
551 new PatternMatchCounter(body, Tuples.flatTupleOf(var_Req, var___0_), SatisfyingInstance.instance().getInternalQueryRepresentation(), var__virtual_0_);
552 new Equality(body, var_Instances, var__virtual_0_);
553 // Requirement.count(Req, RequiredCount)
554 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
555 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
556 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "count")));
557 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
558 new Equality(body, var__virtual_1_, var_RequiredCount);
559 // check(Instances < RequiredCount)
560 new ExpressionEvaluation(body, new IExpressionEvaluator() {
561
562 @Override
563 public String getShortDescription() {
564 return "Expression evaluation from pattern requirementNotSatisfied";
565 }
566
567 @Override
568 public Iterable<String> getInputParameterNames() {
569 return Arrays.asList("Instances", "RequiredCount");}
570
571 @Override
572 public Object evaluateExpression(IValueProvider provider) throws Exception {
573 Integer Instances = (Integer) provider.getValue("Instances");
574 Integer RequiredCount = (Integer) provider.getValue("RequiredCount");
575 return evaluateExpression_1_1(Instances, RequiredCount);
576 }
577 }, null);
578 bodies.add(body);
579 }
580 {
581 PAnnotation annotation = new PAnnotation("Constraint");
582 annotation.addAttribute("severity", "error");
583 annotation.addAttribute("key", Arrays.asList(new Object[] {
584 new ParameterReference("Req")
585 }));
586 annotation.addAttribute("message", "Requirement is not satisfied by enough application instances.");
587 addAnnotation(annotation);
588 }
589 return bodies;
590 }
591 }
592
593 private static boolean evaluateExpression_1_1(final Integer Instances, final Integer RequiredCount) {
594 boolean _lessThan = (Instances.compareTo(RequiredCount) < 0);
595 return _lessThan;
596 }
597}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalHdd.java
new file mode 100644
index 00000000..f91853de
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalHdd.java
@@ -0,0 +1,706 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.emf.ecore.EDataType;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
29import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
41import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
42import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43
44/**
45 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
46 *
47 * <p>Original source:
48 * <code><pre>
49 * {@literal @}QueryBasedFeature(feature = "totalHdd")
50 * pattern totalHdd(Host : HostInstance, Hdd : EInt) {
51 * HostInstance.type.defaultHdd(Host, Hdd);
52 * }
53 * </pre></code>
54 *
55 * @see Matcher
56 * @see Match
57 *
58 */
59@SuppressWarnings("all")
60public final class TotalHdd extends BaseGeneratedEMFQuerySpecification<TotalHdd.Matcher> {
61 /**
62 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd pattern,
63 * to be used in conjunction with {@link Matcher}.
64 *
65 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
66 * Each instance is a (possibly partial) substitution of pattern parameters,
67 * usable to represent a match of the pattern in the result of a query,
68 * or to specify the bound (fixed) input parameters when issuing a query.
69 *
70 * @see Matcher
71 *
72 */
73 public static abstract class Match extends BasePatternMatch {
74 private HostInstance fHost;
75
76 private Integer fHdd;
77
78 private static List<String> parameterNames = makeImmutableList("Host", "Hdd");
79
80 private Match(final HostInstance pHost, final Integer pHdd) {
81 this.fHost = pHost;
82 this.fHdd = pHdd;
83 }
84
85 @Override
86 public Object get(final String parameterName) {
87 if ("Host".equals(parameterName)) return this.fHost;
88 if ("Hdd".equals(parameterName)) return this.fHdd;
89 return null;
90 }
91
92 public HostInstance getHost() {
93 return this.fHost;
94 }
95
96 public Integer getHdd() {
97 return this.fHdd;
98 }
99
100 @Override
101 public boolean set(final String parameterName, final Object newValue) {
102 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
103 if ("Host".equals(parameterName) ) {
104 this.fHost = (HostInstance) newValue;
105 return true;
106 }
107 if ("Hdd".equals(parameterName) ) {
108 this.fHdd = (Integer) newValue;
109 return true;
110 }
111 return false;
112 }
113
114 public void setHost(final HostInstance pHost) {
115 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
116 this.fHost = pHost;
117 }
118
119 public void setHdd(final Integer pHdd) {
120 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
121 this.fHdd = pHdd;
122 }
123
124 @Override
125 public String patternName() {
126 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd";
127 }
128
129 @Override
130 public List<String> parameterNames() {
131 return TotalHdd.Match.parameterNames;
132 }
133
134 @Override
135 public Object[] toArray() {
136 return new Object[]{fHost, fHdd};
137 }
138
139 @Override
140 public TotalHdd.Match toImmutable() {
141 return isMutable() ? newMatch(fHost, fHdd) : this;
142 }
143
144 @Override
145 public String prettyPrint() {
146 StringBuilder result = new StringBuilder();
147 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
148 result.append("\"Hdd\"=" + prettyPrintValue(fHdd));
149 return result.toString();
150 }
151
152 @Override
153 public int hashCode() {
154 return Objects.hash(fHost, fHdd);
155 }
156
157 @Override
158 public boolean equals(final Object obj) {
159 if (this == obj)
160 return true;
161 if (obj == null) {
162 return false;
163 }
164 if ((obj instanceof TotalHdd.Match)) {
165 TotalHdd.Match other = (TotalHdd.Match) obj;
166 return Objects.equals(fHost, other.fHost) && Objects.equals(fHdd, other.fHdd);
167 } else {
168 // this should be infrequent
169 if (!(obj instanceof IPatternMatch)) {
170 return false;
171 }
172 IPatternMatch otherSig = (IPatternMatch) obj;
173 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
174 }
175 }
176
177 @Override
178 public TotalHdd specification() {
179 return TotalHdd.instance();
180 }
181
182 /**
183 * Returns an empty, mutable match.
184 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
185 *
186 * @return the empty match.
187 *
188 */
189 public static TotalHdd.Match newEmptyMatch() {
190 return new Mutable(null, null);
191 }
192
193 /**
194 * Returns a mutable (partial) match.
195 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
196 *
197 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
198 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
199 * @return the new, mutable (partial) match object.
200 *
201 */
202 public static TotalHdd.Match newMutableMatch(final HostInstance pHost, final Integer pHdd) {
203 return new Mutable(pHost, pHdd);
204 }
205
206 /**
207 * Returns a new (partial) match.
208 * This can be used e.g. to call the matcher with a partial match.
209 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
210 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
211 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
212 * @return the (partial) match object.
213 *
214 */
215 public static TotalHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
216 return new Immutable(pHost, pHdd);
217 }
218
219 private static final class Mutable extends TotalHdd.Match {
220 Mutable(final HostInstance pHost, final Integer pHdd) {
221 super(pHost, pHdd);
222 }
223
224 @Override
225 public boolean isMutable() {
226 return true;
227 }
228 }
229
230 private static final class Immutable extends TotalHdd.Match {
231 Immutable(final HostInstance pHost, final Integer pHdd) {
232 super(pHost, pHdd);
233 }
234
235 @Override
236 public boolean isMutable() {
237 return false;
238 }
239 }
240 }
241
242 /**
243 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd pattern,
244 * providing pattern-specific query methods.
245 *
246 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
247 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
248 *
249 * <p>Matches of the pattern will be represented as {@link Match}.
250 *
251 * <p>Original source:
252 * <code><pre>
253 * {@literal @}QueryBasedFeature(feature = "totalHdd")
254 * pattern totalHdd(Host : HostInstance, Hdd : EInt) {
255 * HostInstance.type.defaultHdd(Host, Hdd);
256 * }
257 * </pre></code>
258 *
259 * @see Match
260 * @see TotalHdd
261 *
262 */
263 public static class Matcher extends BaseMatcher<TotalHdd.Match> {
264 /**
265 * Initializes the pattern matcher within an existing VIATRA Query engine.
266 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
267 *
268 * @param engine the existing VIATRA Query engine in which this matcher will be created.
269 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
270 *
271 */
272 public static TotalHdd.Matcher on(final ViatraQueryEngine engine) {
273 // check if matcher already exists
274 Matcher matcher = engine.getExistingMatcher(querySpecification());
275 if (matcher == null) {
276 matcher = (Matcher)engine.getMatcher(querySpecification());
277 }
278 return matcher;
279 }
280
281 /**
282 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
283 * @return an initialized matcher
284 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
285 *
286 */
287 public static TotalHdd.Matcher create() {
288 return new Matcher();
289 }
290
291 private static final int POSITION_HOST = 0;
292
293 private static final int POSITION_HDD = 1;
294
295 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TotalHdd.Matcher.class);
296
297 /**
298 * Initializes the pattern matcher within an existing VIATRA Query engine.
299 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
300 *
301 * @param engine the existing VIATRA Query engine in which this matcher will be created.
302 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
303 *
304 */
305 private Matcher() {
306 super(querySpecification());
307 }
308
309 /**
310 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
311 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
312 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
313 * @return matches represented as a Match object.
314 *
315 */
316 public Collection<TotalHdd.Match> getAllMatches(final HostInstance pHost, final Integer pHdd) {
317 return rawStreamAllMatches(new Object[]{pHost, pHdd}).collect(Collectors.toSet());
318 }
319
320 /**
321 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
322 * </p>
323 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
324 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
325 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
326 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
327 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
328 * @return a stream of matches represented as a Match object.
329 *
330 */
331 public Stream<TotalHdd.Match> streamAllMatches(final HostInstance pHost, final Integer pHdd) {
332 return rawStreamAllMatches(new Object[]{pHost, pHdd});
333 }
334
335 /**
336 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
339 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
340 * @return a match represented as a Match object, or null if no match is found.
341 *
342 */
343 public Optional<TotalHdd.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pHdd) {
344 return rawGetOneArbitraryMatch(new Object[]{pHost, pHdd});
345 }
346
347 /**
348 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
349 * under any possible substitution of the unspecified parameters (if any).
350 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
351 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
352 * @return true if the input is a valid (partial) match of the pattern.
353 *
354 */
355 public boolean hasMatch(final HostInstance pHost, final Integer pHdd) {
356 return rawHasMatch(new Object[]{pHost, pHdd});
357 }
358
359 /**
360 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
363 * @return the number of pattern matches found.
364 *
365 */
366 public int countMatches(final HostInstance pHost, final Integer pHdd) {
367 return rawCountMatches(new Object[]{pHost, pHdd});
368 }
369
370 /**
371 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
372 * Neither determinism nor randomness of selection is guaranteed.
373 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
374 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
375 * @param processor the action that will process the selected match.
376 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
377 *
378 */
379 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pHdd, final Consumer<? super TotalHdd.Match> processor) {
380 return rawForOneArbitraryMatch(new Object[]{pHost, pHdd}, processor);
381 }
382
383 /**
384 * Returns a new (partial) match.
385 * This can be used e.g. to call the matcher with a partial match.
386 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
387 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
388 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
389 * @return the (partial) match object.
390 *
391 */
392 public TotalHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
393 return TotalHdd.Match.newMatch(pHost, pHdd);
394 }
395
396 /**
397 * Retrieve the set of values that occur in matches for Host.
398 * @return the Set of all values or empty set if there are no matches
399 *
400 */
401 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
402 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
403 }
404
405 /**
406 * Retrieve the set of values that occur in matches for Host.
407 * @return the Set of all values or empty set if there are no matches
408 *
409 */
410 public Set<HostInstance> getAllValuesOfHost() {
411 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
412 }
413
414 /**
415 * Retrieve the set of values that occur in matches for Host.
416 * @return the Set of all values or empty set if there are no matches
417 *
418 */
419 public Stream<HostInstance> streamAllValuesOfHost() {
420 return rawStreamAllValuesOfHost(emptyArray());
421 }
422
423 /**
424 * Retrieve the set of values that occur in matches for Host.
425 * </p>
426 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
427 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
428 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
429 *
430 * @return the Stream of all values or empty set if there are no matches
431 *
432 */
433 public Stream<HostInstance> streamAllValuesOfHost(final TotalHdd.Match partialMatch) {
434 return rawStreamAllValuesOfHost(partialMatch.toArray());
435 }
436
437 /**
438 * Retrieve the set of values that occur in matches for Host.
439 * </p>
440 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
441 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
442 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
443 *
444 * @return the Stream of all values or empty set if there are no matches
445 *
446 */
447 public Stream<HostInstance> streamAllValuesOfHost(final Integer pHdd) {
448 return rawStreamAllValuesOfHost(new Object[]{null, pHdd});
449 }
450
451 /**
452 * Retrieve the set of values that occur in matches for Host.
453 * @return the Set of all values or empty set if there are no matches
454 *
455 */
456 public Set<HostInstance> getAllValuesOfHost(final TotalHdd.Match partialMatch) {
457 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
458 }
459
460 /**
461 * Retrieve the set of values that occur in matches for Host.
462 * @return the Set of all values or empty set if there are no matches
463 *
464 */
465 public Set<HostInstance> getAllValuesOfHost(final Integer pHdd) {
466 return rawStreamAllValuesOfHost(new Object[]{null, pHdd}).collect(Collectors.toSet());
467 }
468
469 /**
470 * Retrieve the set of values that occur in matches for Hdd.
471 * @return the Set of all values or empty set if there are no matches
472 *
473 */
474 protected Stream<Integer> rawStreamAllValuesOfHdd(final Object[] parameters) {
475 return rawStreamAllValues(POSITION_HDD, parameters).map(Integer.class::cast);
476 }
477
478 /**
479 * Retrieve the set of values that occur in matches for Hdd.
480 * @return the Set of all values or empty set if there are no matches
481 *
482 */
483 public Set<Integer> getAllValuesOfHdd() {
484 return rawStreamAllValuesOfHdd(emptyArray()).collect(Collectors.toSet());
485 }
486
487 /**
488 * Retrieve the set of values that occur in matches for Hdd.
489 * @return the Set of all values or empty set if there are no matches
490 *
491 */
492 public Stream<Integer> streamAllValuesOfHdd() {
493 return rawStreamAllValuesOfHdd(emptyArray());
494 }
495
496 /**
497 * Retrieve the set of values that occur in matches for Hdd.
498 * </p>
499 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
500 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
501 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
502 *
503 * @return the Stream of all values or empty set if there are no matches
504 *
505 */
506 public Stream<Integer> streamAllValuesOfHdd(final TotalHdd.Match partialMatch) {
507 return rawStreamAllValuesOfHdd(partialMatch.toArray());
508 }
509
510 /**
511 * Retrieve the set of values that occur in matches for Hdd.
512 * </p>
513 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
514 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
515 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
516 *
517 * @return the Stream of all values or empty set if there are no matches
518 *
519 */
520 public Stream<Integer> streamAllValuesOfHdd(final HostInstance pHost) {
521 return rawStreamAllValuesOfHdd(new Object[]{pHost, null});
522 }
523
524 /**
525 * Retrieve the set of values that occur in matches for Hdd.
526 * @return the Set of all values or empty set if there are no matches
527 *
528 */
529 public Set<Integer> getAllValuesOfHdd(final TotalHdd.Match partialMatch) {
530 return rawStreamAllValuesOfHdd(partialMatch.toArray()).collect(Collectors.toSet());
531 }
532
533 /**
534 * Retrieve the set of values that occur in matches for Hdd.
535 * @return the Set of all values or empty set if there are no matches
536 *
537 */
538 public Set<Integer> getAllValuesOfHdd(final HostInstance pHost) {
539 return rawStreamAllValuesOfHdd(new Object[]{pHost, null}).collect(Collectors.toSet());
540 }
541
542 @Override
543 protected TotalHdd.Match tupleToMatch(final Tuple t) {
544 try {
545 return TotalHdd.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_HDD));
546 } catch(ClassCastException e) {
547 LOGGER.error("Element(s) in tuple not properly typed!",e);
548 return null;
549 }
550 }
551
552 @Override
553 protected TotalHdd.Match arrayToMatch(final Object[] match) {
554 try {
555 return TotalHdd.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
556 } catch(ClassCastException e) {
557 LOGGER.error("Element(s) in array not properly typed!",e);
558 return null;
559 }
560 }
561
562 @Override
563 protected TotalHdd.Match arrayToMatchMutable(final Object[] match) {
564 try {
565 return TotalHdd.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
566 } catch(ClassCastException e) {
567 LOGGER.error("Element(s) in array not properly typed!",e);
568 return null;
569 }
570 }
571
572 /**
573 * @return the singleton instance of the query specification of this pattern
574 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
575 *
576 */
577 public static IQuerySpecification<TotalHdd.Matcher> querySpecification() {
578 return TotalHdd.instance();
579 }
580 }
581
582 private TotalHdd() {
583 super(GeneratedPQuery.INSTANCE);
584 }
585
586 /**
587 * @return the singleton instance of the query specification
588 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
589 *
590 */
591 public static TotalHdd instance() {
592 try{
593 return LazyHolder.INSTANCE;
594 } catch (ExceptionInInitializerError err) {
595 throw processInitializerError(err);
596 }
597 }
598
599 @Override
600 protected TotalHdd.Matcher instantiate(final ViatraQueryEngine engine) {
601 return TotalHdd.Matcher.on(engine);
602 }
603
604 @Override
605 public TotalHdd.Matcher instantiate() {
606 return TotalHdd.Matcher.create();
607 }
608
609 @Override
610 public TotalHdd.Match newEmptyMatch() {
611 return TotalHdd.Match.newEmptyMatch();
612 }
613
614 @Override
615 public TotalHdd.Match newMatch(final Object... parameters) {
616 return TotalHdd.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
617 }
618
619 /**
620 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd (visibility: PUBLIC, simpleName: TotalHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
621 * <b>not</b> at the class load time of the outer class,
622 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd (visibility: PUBLIC, simpleName: TotalHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
623 *
624 * <p> This workaround is required e.g. to support recursion.
625 *
626 */
627 private static class LazyHolder {
628 private static final TotalHdd INSTANCE = new TotalHdd();
629
630 /**
631 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
632 * This initialization order is required to support indirect recursion.
633 *
634 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
635 *
636 */
637 private static final Object STATIC_INITIALIZER = ensureInitialized();
638
639 public static Object ensureInitialized() {
640 INSTANCE.ensureInitializedInternal();
641 return null;
642 }
643 }
644
645 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
646 private static final TotalHdd.GeneratedPQuery INSTANCE = new GeneratedPQuery();
647
648 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
649
650 private final PParameter parameter_Hdd = new PParameter("Hdd", "java.lang.Integer", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EInt")), PParameterDirection.INOUT);
651
652 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Hdd);
653
654 private GeneratedPQuery() {
655 super(PVisibility.PUBLIC);
656 }
657
658 @Override
659 public String getFullyQualifiedName() {
660 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd";
661 }
662
663 @Override
664 public List<String> getParameterNames() {
665 return Arrays.asList("Host","Hdd");
666 }
667
668 @Override
669 public List<PParameter> getParameters() {
670 return parameters;
671 }
672
673 @Override
674 public Set<PBody> doGetContainedBodies() {
675 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
676 Set<PBody> bodies = new LinkedHashSet<>();
677 {
678 PBody body = new PBody(this);
679 PVariable var_Host = body.getOrCreateVariableByName("Host");
680 PVariable var_Hdd = body.getOrCreateVariableByName("Hdd");
681 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
682 new TypeConstraint(body, Tuples.flatTupleOf(var_Hdd), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
683 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
684 new ExportedParameter(body, var_Host, parameter_Host),
685 new ExportedParameter(body, var_Hdd, parameter_Hdd)
686 ));
687 // HostInstance.type.defaultHdd(Host, Hdd)
688 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
689 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
690 new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type")));
691 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
692 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "defaultHdd")));
694 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
695 new Equality(body, var__virtual_1_, var_Hdd);
696 bodies.add(body);
697 }
698 {
699 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
700 annotation.addAttribute("feature", "totalHdd");
701 addAnnotation(annotation);
702 }
703 return bodies;
704 }
705 }
706}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java
new file mode 100644
index 00000000..e8a11e36
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java
@@ -0,0 +1,706 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.emf.ecore.EDataType;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
29import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
41import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
42import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43
44/**
45 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
46 *
47 * <p>Original source:
48 * <code><pre>
49 * {@literal @}QueryBasedFeature(feature = "totalMemory")
50 * pattern totalMemory(Host : HostInstance, Memory : EInt) {
51 * HostInstance.type.defaultMemory(Host, Memory);
52 * }
53 * </pre></code>
54 *
55 * @see Matcher
56 * @see Match
57 *
58 */
59@SuppressWarnings("all")
60public final class TotalMemory extends BaseGeneratedEMFQuerySpecification<TotalMemory.Matcher> {
61 /**
62 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory pattern,
63 * to be used in conjunction with {@link Matcher}.
64 *
65 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
66 * Each instance is a (possibly partial) substitution of pattern parameters,
67 * usable to represent a match of the pattern in the result of a query,
68 * or to specify the bound (fixed) input parameters when issuing a query.
69 *
70 * @see Matcher
71 *
72 */
73 public static abstract class Match extends BasePatternMatch {
74 private HostInstance fHost;
75
76 private Integer fMemory;
77
78 private static List<String> parameterNames = makeImmutableList("Host", "Memory");
79
80 private Match(final HostInstance pHost, final Integer pMemory) {
81 this.fHost = pHost;
82 this.fMemory = pMemory;
83 }
84
85 @Override
86 public Object get(final String parameterName) {
87 if ("Host".equals(parameterName)) return this.fHost;
88 if ("Memory".equals(parameterName)) return this.fMemory;
89 return null;
90 }
91
92 public HostInstance getHost() {
93 return this.fHost;
94 }
95
96 public Integer getMemory() {
97 return this.fMemory;
98 }
99
100 @Override
101 public boolean set(final String parameterName, final Object newValue) {
102 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
103 if ("Host".equals(parameterName) ) {
104 this.fHost = (HostInstance) newValue;
105 return true;
106 }
107 if ("Memory".equals(parameterName) ) {
108 this.fMemory = (Integer) newValue;
109 return true;
110 }
111 return false;
112 }
113
114 public void setHost(final HostInstance pHost) {
115 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
116 this.fHost = pHost;
117 }
118
119 public void setMemory(final Integer pMemory) {
120 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
121 this.fMemory = pMemory;
122 }
123
124 @Override
125 public String patternName() {
126 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory";
127 }
128
129 @Override
130 public List<String> parameterNames() {
131 return TotalMemory.Match.parameterNames;
132 }
133
134 @Override
135 public Object[] toArray() {
136 return new Object[]{fHost, fMemory};
137 }
138
139 @Override
140 public TotalMemory.Match toImmutable() {
141 return isMutable() ? newMatch(fHost, fMemory) : this;
142 }
143
144 @Override
145 public String prettyPrint() {
146 StringBuilder result = new StringBuilder();
147 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
148 result.append("\"Memory\"=" + prettyPrintValue(fMemory));
149 return result.toString();
150 }
151
152 @Override
153 public int hashCode() {
154 return Objects.hash(fHost, fMemory);
155 }
156
157 @Override
158 public boolean equals(final Object obj) {
159 if (this == obj)
160 return true;
161 if (obj == null) {
162 return false;
163 }
164 if ((obj instanceof TotalMemory.Match)) {
165 TotalMemory.Match other = (TotalMemory.Match) obj;
166 return Objects.equals(fHost, other.fHost) && Objects.equals(fMemory, other.fMemory);
167 } else {
168 // this should be infrequent
169 if (!(obj instanceof IPatternMatch)) {
170 return false;
171 }
172 IPatternMatch otherSig = (IPatternMatch) obj;
173 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
174 }
175 }
176
177 @Override
178 public TotalMemory specification() {
179 return TotalMemory.instance();
180 }
181
182 /**
183 * Returns an empty, mutable match.
184 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
185 *
186 * @return the empty match.
187 *
188 */
189 public static TotalMemory.Match newEmptyMatch() {
190 return new Mutable(null, null);
191 }
192
193 /**
194 * Returns a mutable (partial) match.
195 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
196 *
197 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
198 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
199 * @return the new, mutable (partial) match object.
200 *
201 */
202 public static TotalMemory.Match newMutableMatch(final HostInstance pHost, final Integer pMemory) {
203 return new Mutable(pHost, pMemory);
204 }
205
206 /**
207 * Returns a new (partial) match.
208 * This can be used e.g. to call the matcher with a partial match.
209 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
210 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
211 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
212 * @return the (partial) match object.
213 *
214 */
215 public static TotalMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
216 return new Immutable(pHost, pMemory);
217 }
218
219 private static final class Mutable extends TotalMemory.Match {
220 Mutable(final HostInstance pHost, final Integer pMemory) {
221 super(pHost, pMemory);
222 }
223
224 @Override
225 public boolean isMutable() {
226 return true;
227 }
228 }
229
230 private static final class Immutable extends TotalMemory.Match {
231 Immutable(final HostInstance pHost, final Integer pMemory) {
232 super(pHost, pMemory);
233 }
234
235 @Override
236 public boolean isMutable() {
237 return false;
238 }
239 }
240 }
241
242 /**
243 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory pattern,
244 * providing pattern-specific query methods.
245 *
246 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
247 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
248 *
249 * <p>Matches of the pattern will be represented as {@link Match}.
250 *
251 * <p>Original source:
252 * <code><pre>
253 * {@literal @}QueryBasedFeature(feature = "totalMemory")
254 * pattern totalMemory(Host : HostInstance, Memory : EInt) {
255 * HostInstance.type.defaultMemory(Host, Memory);
256 * }
257 * </pre></code>
258 *
259 * @see Match
260 * @see TotalMemory
261 *
262 */
263 public static class Matcher extends BaseMatcher<TotalMemory.Match> {
264 /**
265 * Initializes the pattern matcher within an existing VIATRA Query engine.
266 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
267 *
268 * @param engine the existing VIATRA Query engine in which this matcher will be created.
269 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
270 *
271 */
272 public static TotalMemory.Matcher on(final ViatraQueryEngine engine) {
273 // check if matcher already exists
274 Matcher matcher = engine.getExistingMatcher(querySpecification());
275 if (matcher == null) {
276 matcher = (Matcher)engine.getMatcher(querySpecification());
277 }
278 return matcher;
279 }
280
281 /**
282 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
283 * @return an initialized matcher
284 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
285 *
286 */
287 public static TotalMemory.Matcher create() {
288 return new Matcher();
289 }
290
291 private static final int POSITION_HOST = 0;
292
293 private static final int POSITION_MEMORY = 1;
294
295 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TotalMemory.Matcher.class);
296
297 /**
298 * Initializes the pattern matcher within an existing VIATRA Query engine.
299 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
300 *
301 * @param engine the existing VIATRA Query engine in which this matcher will be created.
302 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
303 *
304 */
305 private Matcher() {
306 super(querySpecification());
307 }
308
309 /**
310 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
311 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
312 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
313 * @return matches represented as a Match object.
314 *
315 */
316 public Collection<TotalMemory.Match> getAllMatches(final HostInstance pHost, final Integer pMemory) {
317 return rawStreamAllMatches(new Object[]{pHost, pMemory}).collect(Collectors.toSet());
318 }
319
320 /**
321 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
322 * </p>
323 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
324 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
325 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
326 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
327 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
328 * @return a stream of matches represented as a Match object.
329 *
330 */
331 public Stream<TotalMemory.Match> streamAllMatches(final HostInstance pHost, final Integer pMemory) {
332 return rawStreamAllMatches(new Object[]{pHost, pMemory});
333 }
334
335 /**
336 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
339 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
340 * @return a match represented as a Match object, or null if no match is found.
341 *
342 */
343 public Optional<TotalMemory.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pMemory) {
344 return rawGetOneArbitraryMatch(new Object[]{pHost, pMemory});
345 }
346
347 /**
348 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
349 * under any possible substitution of the unspecified parameters (if any).
350 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
351 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
352 * @return true if the input is a valid (partial) match of the pattern.
353 *
354 */
355 public boolean hasMatch(final HostInstance pHost, final Integer pMemory) {
356 return rawHasMatch(new Object[]{pHost, pMemory});
357 }
358
359 /**
360 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
363 * @return the number of pattern matches found.
364 *
365 */
366 public int countMatches(final HostInstance pHost, final Integer pMemory) {
367 return rawCountMatches(new Object[]{pHost, pMemory});
368 }
369
370 /**
371 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
372 * Neither determinism nor randomness of selection is guaranteed.
373 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
374 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
375 * @param processor the action that will process the selected match.
376 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
377 *
378 */
379 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pMemory, final Consumer<? super TotalMemory.Match> processor) {
380 return rawForOneArbitraryMatch(new Object[]{pHost, pMemory}, processor);
381 }
382
383 /**
384 * Returns a new (partial) match.
385 * This can be used e.g. to call the matcher with a partial match.
386 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
387 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
388 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
389 * @return the (partial) match object.
390 *
391 */
392 public TotalMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
393 return TotalMemory.Match.newMatch(pHost, pMemory);
394 }
395
396 /**
397 * Retrieve the set of values that occur in matches for Host.
398 * @return the Set of all values or empty set if there are no matches
399 *
400 */
401 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
402 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
403 }
404
405 /**
406 * Retrieve the set of values that occur in matches for Host.
407 * @return the Set of all values or empty set if there are no matches
408 *
409 */
410 public Set<HostInstance> getAllValuesOfHost() {
411 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
412 }
413
414 /**
415 * Retrieve the set of values that occur in matches for Host.
416 * @return the Set of all values or empty set if there are no matches
417 *
418 */
419 public Stream<HostInstance> streamAllValuesOfHost() {
420 return rawStreamAllValuesOfHost(emptyArray());
421 }
422
423 /**
424 * Retrieve the set of values that occur in matches for Host.
425 * </p>
426 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
427 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
428 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
429 *
430 * @return the Stream of all values or empty set if there are no matches
431 *
432 */
433 public Stream<HostInstance> streamAllValuesOfHost(final TotalMemory.Match partialMatch) {
434 return rawStreamAllValuesOfHost(partialMatch.toArray());
435 }
436
437 /**
438 * Retrieve the set of values that occur in matches for Host.
439 * </p>
440 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
441 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
442 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
443 *
444 * @return the Stream of all values or empty set if there are no matches
445 *
446 */
447 public Stream<HostInstance> streamAllValuesOfHost(final Integer pMemory) {
448 return rawStreamAllValuesOfHost(new Object[]{null, pMemory});
449 }
450
451 /**
452 * Retrieve the set of values that occur in matches for Host.
453 * @return the Set of all values or empty set if there are no matches
454 *
455 */
456 public Set<HostInstance> getAllValuesOfHost(final TotalMemory.Match partialMatch) {
457 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
458 }
459
460 /**
461 * Retrieve the set of values that occur in matches for Host.
462 * @return the Set of all values or empty set if there are no matches
463 *
464 */
465 public Set<HostInstance> getAllValuesOfHost(final Integer pMemory) {
466 return rawStreamAllValuesOfHost(new Object[]{null, pMemory}).collect(Collectors.toSet());
467 }
468
469 /**
470 * Retrieve the set of values that occur in matches for Memory.
471 * @return the Set of all values or empty set if there are no matches
472 *
473 */
474 protected Stream<Integer> rawStreamAllValuesOfMemory(final Object[] parameters) {
475 return rawStreamAllValues(POSITION_MEMORY, parameters).map(Integer.class::cast);
476 }
477
478 /**
479 * Retrieve the set of values that occur in matches for Memory.
480 * @return the Set of all values or empty set if there are no matches
481 *
482 */
483 public Set<Integer> getAllValuesOfMemory() {
484 return rawStreamAllValuesOfMemory(emptyArray()).collect(Collectors.toSet());
485 }
486
487 /**
488 * Retrieve the set of values that occur in matches for Memory.
489 * @return the Set of all values or empty set if there are no matches
490 *
491 */
492 public Stream<Integer> streamAllValuesOfMemory() {
493 return rawStreamAllValuesOfMemory(emptyArray());
494 }
495
496 /**
497 * Retrieve the set of values that occur in matches for Memory.
498 * </p>
499 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
500 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
501 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
502 *
503 * @return the Stream of all values or empty set if there are no matches
504 *
505 */
506 public Stream<Integer> streamAllValuesOfMemory(final TotalMemory.Match partialMatch) {
507 return rawStreamAllValuesOfMemory(partialMatch.toArray());
508 }
509
510 /**
511 * Retrieve the set of values that occur in matches for Memory.
512 * </p>
513 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
514 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
515 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
516 *
517 * @return the Stream of all values or empty set if there are no matches
518 *
519 */
520 public Stream<Integer> streamAllValuesOfMemory(final HostInstance pHost) {
521 return rawStreamAllValuesOfMemory(new Object[]{pHost, null});
522 }
523
524 /**
525 * Retrieve the set of values that occur in matches for Memory.
526 * @return the Set of all values or empty set if there are no matches
527 *
528 */
529 public Set<Integer> getAllValuesOfMemory(final TotalMemory.Match partialMatch) {
530 return rawStreamAllValuesOfMemory(partialMatch.toArray()).collect(Collectors.toSet());
531 }
532
533 /**
534 * Retrieve the set of values that occur in matches for Memory.
535 * @return the Set of all values or empty set if there are no matches
536 *
537 */
538 public Set<Integer> getAllValuesOfMemory(final HostInstance pHost) {
539 return rawStreamAllValuesOfMemory(new Object[]{pHost, null}).collect(Collectors.toSet());
540 }
541
542 @Override
543 protected TotalMemory.Match tupleToMatch(final Tuple t) {
544 try {
545 return TotalMemory.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_MEMORY));
546 } catch(ClassCastException e) {
547 LOGGER.error("Element(s) in tuple not properly typed!",e);
548 return null;
549 }
550 }
551
552 @Override
553 protected TotalMemory.Match arrayToMatch(final Object[] match) {
554 try {
555 return TotalMemory.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
556 } catch(ClassCastException e) {
557 LOGGER.error("Element(s) in array not properly typed!",e);
558 return null;
559 }
560 }
561
562 @Override
563 protected TotalMemory.Match arrayToMatchMutable(final Object[] match) {
564 try {
565 return TotalMemory.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
566 } catch(ClassCastException e) {
567 LOGGER.error("Element(s) in array not properly typed!",e);
568 return null;
569 }
570 }
571
572 /**
573 * @return the singleton instance of the query specification of this pattern
574 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
575 *
576 */
577 public static IQuerySpecification<TotalMemory.Matcher> querySpecification() {
578 return TotalMemory.instance();
579 }
580 }
581
582 private TotalMemory() {
583 super(GeneratedPQuery.INSTANCE);
584 }
585
586 /**
587 * @return the singleton instance of the query specification
588 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
589 *
590 */
591 public static TotalMemory instance() {
592 try{
593 return LazyHolder.INSTANCE;
594 } catch (ExceptionInInitializerError err) {
595 throw processInitializerError(err);
596 }
597 }
598
599 @Override
600 protected TotalMemory.Matcher instantiate(final ViatraQueryEngine engine) {
601 return TotalMemory.Matcher.on(engine);
602 }
603
604 @Override
605 public TotalMemory.Matcher instantiate() {
606 return TotalMemory.Matcher.create();
607 }
608
609 @Override
610 public TotalMemory.Match newEmptyMatch() {
611 return TotalMemory.Match.newEmptyMatch();
612 }
613
614 @Override
615 public TotalMemory.Match newMatch(final Object... parameters) {
616 return TotalMemory.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
617 }
618
619 /**
620 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory (visibility: PUBLIC, simpleName: TotalMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
621 * <b>not</b> at the class load time of the outer class,
622 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory (visibility: PUBLIC, simpleName: TotalMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
623 *
624 * <p> This workaround is required e.g. to support recursion.
625 *
626 */
627 private static class LazyHolder {
628 private static final TotalMemory INSTANCE = new TotalMemory();
629
630 /**
631 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
632 * This initialization order is required to support indirect recursion.
633 *
634 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
635 *
636 */
637 private static final Object STATIC_INITIALIZER = ensureInitialized();
638
639 public static Object ensureInitialized() {
640 INSTANCE.ensureInitializedInternal();
641 return null;
642 }
643 }
644
645 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
646 private static final TotalMemory.GeneratedPQuery INSTANCE = new GeneratedPQuery();
647
648 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
649
650 private final PParameter parameter_Memory = new PParameter("Memory", "java.lang.Integer", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EInt")), PParameterDirection.INOUT);
651
652 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Memory);
653
654 private GeneratedPQuery() {
655 super(PVisibility.PUBLIC);
656 }
657
658 @Override
659 public String getFullyQualifiedName() {
660 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory";
661 }
662
663 @Override
664 public List<String> getParameterNames() {
665 return Arrays.asList("Host","Memory");
666 }
667
668 @Override
669 public List<PParameter> getParameters() {
670 return parameters;
671 }
672
673 @Override
674 public Set<PBody> doGetContainedBodies() {
675 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
676 Set<PBody> bodies = new LinkedHashSet<>();
677 {
678 PBody body = new PBody(this);
679 PVariable var_Host = body.getOrCreateVariableByName("Host");
680 PVariable var_Memory = body.getOrCreateVariableByName("Memory");
681 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
682 new TypeConstraint(body, Tuples.flatTupleOf(var_Memory), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
683 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
684 new ExportedParameter(body, var_Host, parameter_Host),
685 new ExportedParameter(body, var_Memory, parameter_Memory)
686 ));
687 // HostInstance.type.defaultMemory(Host, Memory)
688 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
689 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
690 new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type")));
691 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
692 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "defaultMemory")));
694 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
695 new Equality(body, var__virtual_1_, var_Memory);
696 bodies.add(body);
697 }
698 {
699 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
700 annotation.addAttribute("feature", "totalMemory");
701 addAnnotation(annotation);
702 }
703 return bodies;
704 }
705 }
706}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/.gitignore
new file mode 100644
index 00000000..2f593811
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/.gitignore
@@ -0,0 +1,11 @@
1/.CpsQueriesAll.java._trace
2/.ResourceRequirement.java._trace
3/.MemoryRequirement.java._trace
4/.HddRequirement.java._trace
5/.AllocationWithoutResourceRequirement.java._trace
6/.RequiredType.java._trace
7/.SatisfyingInstance.java._trace
8/.FreeMemoryPercentage.java._trace
9/.FreeHddPercentage.java._trace
10/.ApplicationInstance.java._trace
11/.HostInstanceCost.java._trace
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsQueriesAll.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsQueriesAll.java
new file mode 100644
index 00000000..5f6d161d
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsQueriesAll.java
@@ -0,0 +1,105 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory;
9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric;
10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric;
11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric;
12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications;
13import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost;
14import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts;
15import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement;
16import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd;
17import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory;
18import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied;
19import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd;
20import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory;
21import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage;
22import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage;
23import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement;
24import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost;
25import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement;
26import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement;
27import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance;
28import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
29
30/**
31 * A pattern group formed of all patterns defined in CpsQueries.vql.
32 *
33 * <p>A private group that includes private patterns as well. Only intended use case is for pattern testing.
34 *
35 * <p> From package hu.bme.mit.inf.dslreasoner.domains.cps.queries, the group contains the definition of the following patterns: <ul>
36 * <li>cpsApplications</li>
37 * <li>cpsHosts</li>
38 * <li>totalMemory</li>
39 * <li>totalHdd</li>
40 * <li>availableMemory</li>
41 * <li>memoryRequirement</li>
42 * <li>availableHdd</li>
43 * <li>hddRequirement</li>
44 * <li>resourceRequirement</li>
45 * <li>allocationWithoutResourceRequirement</li>
46 * <li>notEnoughAvailableMemory</li>
47 * <li>notEnoughAvailableHdd</li>
48 * <li>instanceDoesNotSatisfyRequirement</li>
49 * <li>satisfyingInstance</li>
50 * <li>requirementNotSatisfied</li>
51 * <li>averageFreeMemoryMetric</li>
52 * <li>freeMemoryPercentage</li>
53 * <li>averageFreeHddMetric</li>
54 * <li>freeHddPercentage</li>
55 * <li>costMetric</li>
56 * <li>cpsCost</li>
57 * <li>hostInstanceCost</li>
58 * </ul>
59 *
60 * @see IQueryGroup
61 *
62 */
63@SuppressWarnings("all")
64public final class CpsQueriesAll extends BaseGeneratedPatternGroup {
65 /**
66 * Access the pattern group.
67 *
68 * @return the singleton instance of the group
69 * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications
70 *
71 */
72 public static CpsQueriesAll instance() {
73 if (INSTANCE == null) {
74 INSTANCE = new CpsQueriesAll();
75 }
76 return INSTANCE;
77 }
78
79 private static CpsQueriesAll INSTANCE;
80
81 private CpsQueriesAll() {
82 querySpecifications.add(CpsApplications.instance());
83 querySpecifications.add(CpsHosts.instance());
84 querySpecifications.add(TotalMemory.instance());
85 querySpecifications.add(TotalHdd.instance());
86 querySpecifications.add(AvailableMemory.instance());
87 querySpecifications.add(MemoryRequirement.instance());
88 querySpecifications.add(AvailableHdd.instance());
89 querySpecifications.add(HddRequirement.instance());
90 querySpecifications.add(ResourceRequirement.instance());
91 querySpecifications.add(AllocationWithoutResourceRequirement.instance());
92 querySpecifications.add(NotEnoughAvailableMemory.instance());
93 querySpecifications.add(NotEnoughAvailableHdd.instance());
94 querySpecifications.add(InstanceDoesNotSatisfyRequirement.instance());
95 querySpecifications.add(SatisfyingInstance.instance());
96 querySpecifications.add(RequirementNotSatisfied.instance());
97 querySpecifications.add(AverageFreeMemoryMetric.instance());
98 querySpecifications.add(FreeMemoryPercentage.instance());
99 querySpecifications.add(AverageFreeHddMetric.instance());
100 querySpecifications.add(FreeHddPercentage.instance());
101 querySpecifications.add(CostMetric.instance());
102 querySpecifications.add(CpsCost.instance());
103 querySpecifications.add(HostInstanceCost.instance());
104 }
105}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeHddPercentage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeHddPercentage.java
new file mode 100644
index 00000000..366677b5
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeHddPercentage.java
@@ -0,0 +1,172 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd;
8import java.util.Arrays;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Set;
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
17import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
19import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
20import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
21import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
28import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
29import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
30import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
31import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
32
33/**
34 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
35 *
36 * <p>Original source:
37 * <code><pre>
38 * private pattern freeHddPercentage(Host : HostInstance, Free : java Double) {
39 * find totalHdd(Host, Total);
40 * find availableHdd(Host, Available);
41 * Free == eval((Available as double) / Total);
42 * }
43 * </pre></code>
44 *
45 * @see GenericPatternMatcher
46 * @see GenericPatternMatch
47 *
48 */
49@SuppressWarnings("all")
50public final class FreeHddPercentage extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
51 private FreeHddPercentage() {
52 super(GeneratedPQuery.INSTANCE);
53 }
54
55 /**
56 * @return the singleton instance of the query specification
57 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
58 *
59 */
60 public static FreeHddPercentage instance() {
61 try{
62 return LazyHolder.INSTANCE;
63 } catch (ExceptionInInitializerError err) {
64 throw processInitializerError(err);
65 }
66 }
67
68 /**
69 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage (visibility: PUBLIC, simpleName: FreeHddPercentage, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
70 * <b>not</b> at the class load time of the outer class,
71 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage (visibility: PUBLIC, simpleName: FreeHddPercentage, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
72 *
73 * <p> This workaround is required e.g. to support recursion.
74 *
75 */
76 private static class LazyHolder {
77 private static final FreeHddPercentage INSTANCE = new FreeHddPercentage();
78
79 /**
80 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
81 * This initialization order is required to support indirect recursion.
82 *
83 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
84 *
85 */
86 private static final Object STATIC_INITIALIZER = ensureInitialized();
87
88 public static Object ensureInitialized() {
89 INSTANCE.ensureInitializedInternal();
90 return null;
91 }
92 }
93
94 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
95 private static final FreeHddPercentage.GeneratedPQuery INSTANCE = new GeneratedPQuery();
96
97 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
98
99 private final PParameter parameter_Free = new PParameter("Free", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
100
101 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Free);
102
103 private GeneratedPQuery() {
104 super(PVisibility.PRIVATE);
105 }
106
107 @Override
108 public String getFullyQualifiedName() {
109 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.freeHddPercentage";
110 }
111
112 @Override
113 public List<String> getParameterNames() {
114 return Arrays.asList("Host","Free");
115 }
116
117 @Override
118 public List<PParameter> getParameters() {
119 return parameters;
120 }
121
122 @Override
123 public Set<PBody> doGetContainedBodies() {
124 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
125 Set<PBody> bodies = new LinkedHashSet<>();
126 {
127 PBody body = new PBody(this);
128 PVariable var_Host = body.getOrCreateVariableByName("Host");
129 PVariable var_Free = body.getOrCreateVariableByName("Free");
130 PVariable var_Total = body.getOrCreateVariableByName("Total");
131 PVariable var_Available = body.getOrCreateVariableByName("Available");
132 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
133 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Free), new JavaTransitiveInstancesKey(java.lang.Double.class));
134 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
135 new ExportedParameter(body, var_Host, parameter_Host),
136 new ExportedParameter(body, var_Free, parameter_Free)
137 ));
138 // find totalHdd(Host, Total)
139 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_Total), TotalHdd.instance().getInternalQueryRepresentation());
140 // find availableHdd(Host, Available)
141 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_Available), AvailableHdd.instance().getInternalQueryRepresentation());
142 // Free == eval((Available as double) / Total)
143 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
144 new ExpressionEvaluation(body, new IExpressionEvaluator() {
145
146 @Override
147 public String getShortDescription() {
148 return "Expression evaluation from pattern freeHddPercentage";
149 }
150
151 @Override
152 public Iterable<String> getInputParameterNames() {
153 return Arrays.asList("Available", "Total");}
154
155 @Override
156 public Object evaluateExpression(IValueProvider provider) throws Exception {
157 Integer Available = (Integer) provider.getValue("Available");
158 Integer Total = (Integer) provider.getValue("Total");
159 return evaluateExpression_1_1(Available, Total);
160 }
161 }, var__virtual_0_ );
162 new Equality(body, var_Free, var__virtual_0_);
163 bodies.add(body);
164 }
165 return bodies;
166 }
167 }
168
169 private static double evaluateExpression_1_1(final Integer Available, final Integer Total) {
170 return (((double) (Available).intValue()) / (Total).intValue());
171 }
172}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeMemoryPercentage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeMemoryPercentage.java
new file mode 100644
index 00000000..bd151ea6
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeMemoryPercentage.java
@@ -0,0 +1,172 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory;
8import java.util.Arrays;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Set;
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
17import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
19import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
20import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
21import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
28import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
29import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
30import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
31import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
32
33/**
34 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
35 *
36 * <p>Original source:
37 * <code><pre>
38 * private pattern freeMemoryPercentage(Host : HostInstance, Free : java Double) {
39 * find totalMemory(Host, Total);
40 * find availableMemory(Host, Available);
41 * Free == eval((Available as double) / Total);
42 * }
43 * </pre></code>
44 *
45 * @see GenericPatternMatcher
46 * @see GenericPatternMatch
47 *
48 */
49@SuppressWarnings("all")
50public final class FreeMemoryPercentage extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
51 private FreeMemoryPercentage() {
52 super(GeneratedPQuery.INSTANCE);
53 }
54
55 /**
56 * @return the singleton instance of the query specification
57 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
58 *
59 */
60 public static FreeMemoryPercentage instance() {
61 try{
62 return LazyHolder.INSTANCE;
63 } catch (ExceptionInInitializerError err) {
64 throw processInitializerError(err);
65 }
66 }
67
68 /**
69 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage (visibility: PUBLIC, simpleName: FreeMemoryPercentage, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
70 * <b>not</b> at the class load time of the outer class,
71 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage (visibility: PUBLIC, simpleName: FreeMemoryPercentage, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
72 *
73 * <p> This workaround is required e.g. to support recursion.
74 *
75 */
76 private static class LazyHolder {
77 private static final FreeMemoryPercentage INSTANCE = new FreeMemoryPercentage();
78
79 /**
80 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
81 * This initialization order is required to support indirect recursion.
82 *
83 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
84 *
85 */
86 private static final Object STATIC_INITIALIZER = ensureInitialized();
87
88 public static Object ensureInitialized() {
89 INSTANCE.ensureInitializedInternal();
90 return null;
91 }
92 }
93
94 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
95 private static final FreeMemoryPercentage.GeneratedPQuery INSTANCE = new GeneratedPQuery();
96
97 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
98
99 private final PParameter parameter_Free = new PParameter("Free", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
100
101 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Free);
102
103 private GeneratedPQuery() {
104 super(PVisibility.PRIVATE);
105 }
106
107 @Override
108 public String getFullyQualifiedName() {
109 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.freeMemoryPercentage";
110 }
111
112 @Override
113 public List<String> getParameterNames() {
114 return Arrays.asList("Host","Free");
115 }
116
117 @Override
118 public List<PParameter> getParameters() {
119 return parameters;
120 }
121
122 @Override
123 public Set<PBody> doGetContainedBodies() {
124 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
125 Set<PBody> bodies = new LinkedHashSet<>();
126 {
127 PBody body = new PBody(this);
128 PVariable var_Host = body.getOrCreateVariableByName("Host");
129 PVariable var_Free = body.getOrCreateVariableByName("Free");
130 PVariable var_Total = body.getOrCreateVariableByName("Total");
131 PVariable var_Available = body.getOrCreateVariableByName("Available");
132 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
133 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Free), new JavaTransitiveInstancesKey(java.lang.Double.class));
134 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
135 new ExportedParameter(body, var_Host, parameter_Host),
136 new ExportedParameter(body, var_Free, parameter_Free)
137 ));
138 // find totalMemory(Host, Total)
139 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_Total), TotalMemory.instance().getInternalQueryRepresentation());
140 // find availableMemory(Host, Available)
141 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_Available), AvailableMemory.instance().getInternalQueryRepresentation());
142 // Free == eval((Available as double) / Total)
143 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
144 new ExpressionEvaluation(body, new IExpressionEvaluator() {
145
146 @Override
147 public String getShortDescription() {
148 return "Expression evaluation from pattern freeMemoryPercentage";
149 }
150
151 @Override
152 public Iterable<String> getInputParameterNames() {
153 return Arrays.asList("Available", "Total");}
154
155 @Override
156 public Object evaluateExpression(IValueProvider provider) throws Exception {
157 Integer Available = (Integer) provider.getValue("Available");
158 Integer Total = (Integer) provider.getValue("Total");
159 return evaluateExpression_1_1(Available, Total);
160 }
161 }, var__virtual_0_ );
162 new Equality(body, var_Free, var__virtual_0_);
163 bodies.add(body);
164 }
165 return bodies;
166 }
167 }
168
169 private static double evaluateExpression_1_1(final Integer Available, final Integer Total) {
170 return (((double) (Available).intValue()) / (Total).intValue());
171 }
172}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HddRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HddRequirement.java
new file mode 100644
index 00000000..fbe7a46b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HddRequirement.java
@@ -0,0 +1,151 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.EDataType;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
19import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
20import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
27import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
28import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
29
30/**
31 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
32 *
33 * <p>Original source:
34 * <code><pre>
35 * private pattern hddRequirement(Host : HostInstance, App : ApplicationInstance, Hdd : EInt) {
36 * find resourceRequirement(Host, App, Req);
37 * ResourceRequirement.requiredHdd(Req, Hdd);
38 * }
39 * </pre></code>
40 *
41 * @see GenericPatternMatcher
42 * @see GenericPatternMatch
43 *
44 */
45@SuppressWarnings("all")
46public final class HddRequirement extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
47 private HddRequirement() {
48 super(GeneratedPQuery.INSTANCE);
49 }
50
51 /**
52 * @return the singleton instance of the query specification
53 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
54 *
55 */
56 public static HddRequirement instance() {
57 try{
58 return LazyHolder.INSTANCE;
59 } catch (ExceptionInInitializerError err) {
60 throw processInitializerError(err);
61 }
62 }
63
64 /**
65 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement (visibility: PUBLIC, simpleName: HddRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
66 * <b>not</b> at the class load time of the outer class,
67 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement (visibility: PUBLIC, simpleName: HddRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
68 *
69 * <p> This workaround is required e.g. to support recursion.
70 *
71 */
72 private static class LazyHolder {
73 private static final HddRequirement INSTANCE = new HddRequirement();
74
75 /**
76 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
77 * This initialization order is required to support indirect recursion.
78 *
79 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
80 *
81 */
82 private static final Object STATIC_INITIALIZER = ensureInitialized();
83
84 public static Object ensureInitialized() {
85 INSTANCE.ensureInitializedInternal();
86 return null;
87 }
88 }
89
90 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
91 private static final HddRequirement.GeneratedPQuery INSTANCE = new GeneratedPQuery();
92
93 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
94
95 private final PParameter parameter_App = new PParameter("App", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
96
97 private final PParameter parameter_Hdd = new PParameter("Hdd", "java.lang.Integer", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EInt")), PParameterDirection.INOUT);
98
99 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_App, parameter_Hdd);
100
101 private GeneratedPQuery() {
102 super(PVisibility.PRIVATE);
103 }
104
105 @Override
106 public String getFullyQualifiedName() {
107 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.hddRequirement";
108 }
109
110 @Override
111 public List<String> getParameterNames() {
112 return Arrays.asList("Host","App","Hdd");
113 }
114
115 @Override
116 public List<PParameter> getParameters() {
117 return parameters;
118 }
119
120 @Override
121 public Set<PBody> doGetContainedBodies() {
122 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
123 Set<PBody> bodies = new LinkedHashSet<>();
124 {
125 PBody body = new PBody(this);
126 PVariable var_Host = body.getOrCreateVariableByName("Host");
127 PVariable var_App = body.getOrCreateVariableByName("App");
128 PVariable var_Hdd = body.getOrCreateVariableByName("Hdd");
129 PVariable var_Req = body.getOrCreateVariableByName("Req");
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
131 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
132 new TypeConstraint(body, Tuples.flatTupleOf(var_Hdd), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
133 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
134 new ExportedParameter(body, var_Host, parameter_Host),
135 new ExportedParameter(body, var_App, parameter_App),
136 new ExportedParameter(body, var_Hdd, parameter_Hdd)
137 ));
138 // find resourceRequirement(Host, App, Req)
139 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_App, var_Req), ResourceRequirement.instance().getInternalQueryRepresentation());
140 // ResourceRequirement.requiredHdd(Req, Hdd)
141 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
142 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
143 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "requiredHdd")));
144 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
145 new Equality(body, var__virtual_0_, var_Hdd);
146 bodies.add(body);
147 }
148 return bodies;
149 }
150 }
151}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HostInstanceCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HostInstanceCost.java
new file mode 100644
index 00000000..767ca342
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HostInstanceCost.java
@@ -0,0 +1,153 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.EDataType;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
19import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
20import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
27import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
28import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
29
30/**
31 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
32 *
33 * <p>Original source:
34 * <code><pre>
35 * private pattern hostInstanceCost(Cps : CyberPhysicalSystem, Host : HostInstance, Cost : EInt) {
36 * find cpsHosts(Cps, Host);
37 * HostInstance.type.cost(Host, Cost);
38 * }
39 * </pre></code>
40 *
41 * @see GenericPatternMatcher
42 * @see GenericPatternMatch
43 *
44 */
45@SuppressWarnings("all")
46public final class HostInstanceCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
47 private HostInstanceCost() {
48 super(GeneratedPQuery.INSTANCE);
49 }
50
51 /**
52 * @return the singleton instance of the query specification
53 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
54 *
55 */
56 public static HostInstanceCost instance() {
57 try{
58 return LazyHolder.INSTANCE;
59 } catch (ExceptionInInitializerError err) {
60 throw processInitializerError(err);
61 }
62 }
63
64 /**
65 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost (visibility: PUBLIC, simpleName: HostInstanceCost, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
66 * <b>not</b> at the class load time of the outer class,
67 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost (visibility: PUBLIC, simpleName: HostInstanceCost, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
68 *
69 * <p> This workaround is required e.g. to support recursion.
70 *
71 */
72 private static class LazyHolder {
73 private static final HostInstanceCost INSTANCE = new HostInstanceCost();
74
75 /**
76 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
77 * This initialization order is required to support indirect recursion.
78 *
79 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
80 *
81 */
82 private static final Object STATIC_INITIALIZER = ensureInitialized();
83
84 public static Object ensureInitialized() {
85 INSTANCE.ensureInitializedInternal();
86 return null;
87 }
88 }
89
90 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
91 private static final HostInstanceCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
92
93 private final PParameter parameter_Cps = new PParameter("Cps", "hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "CyberPhysicalSystem")), PParameterDirection.INOUT);
94
95 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
96
97 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Integer", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EInt")), PParameterDirection.INOUT);
98
99 private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_Host, parameter_Cost);
100
101 private GeneratedPQuery() {
102 super(PVisibility.PRIVATE);
103 }
104
105 @Override
106 public String getFullyQualifiedName() {
107 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.hostInstanceCost";
108 }
109
110 @Override
111 public List<String> getParameterNames() {
112 return Arrays.asList("Cps","Host","Cost");
113 }
114
115 @Override
116 public List<PParameter> getParameters() {
117 return parameters;
118 }
119
120 @Override
121 public Set<PBody> doGetContainedBodies() {
122 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
123 Set<PBody> bodies = new LinkedHashSet<>();
124 {
125 PBody body = new PBody(this);
126 PVariable var_Cps = body.getOrCreateVariableByName("Cps");
127 PVariable var_Host = body.getOrCreateVariableByName("Host");
128 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
129 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
131 new TypeConstraint(body, Tuples.flatTupleOf(var_Cost), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
132 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
133 new ExportedParameter(body, var_Cps, parameter_Cps),
134 new ExportedParameter(body, var_Host, parameter_Host),
135 new ExportedParameter(body, var_Cost, parameter_Cost)
136 ));
137 // find cpsHosts(Cps, Host)
138 new PositivePatternCall(body, Tuples.flatTupleOf(var_Cps, var_Host), CpsHosts.instance().getInternalQueryRepresentation());
139 // HostInstance.type.cost(Host, Cost)
140 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
141 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
142 new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type")));
143 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
144 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
145 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "cost")));
146 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
147 new Equality(body, var__virtual_1_, var_Cost);
148 bodies.add(body);
149 }
150 return bodies;
151 }
152 }
153}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/MemoryRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/MemoryRequirement.java
new file mode 100644
index 00000000..0a24d105
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/MemoryRequirement.java
@@ -0,0 +1,151 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.EDataType;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
19import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
20import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
27import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
28import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
29
30/**
31 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
32 *
33 * <p>Original source:
34 * <code><pre>
35 * private pattern memoryRequirement(Host : HostInstance, App : ApplicationInstance, Memory : EInt) {
36 * find resourceRequirement(Host, App, Req);
37 * ResourceRequirement.requiredMemory(Req, Memory);
38 * }
39 * </pre></code>
40 *
41 * @see GenericPatternMatcher
42 * @see GenericPatternMatch
43 *
44 */
45@SuppressWarnings("all")
46public final class MemoryRequirement extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
47 private MemoryRequirement() {
48 super(GeneratedPQuery.INSTANCE);
49 }
50
51 /**
52 * @return the singleton instance of the query specification
53 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
54 *
55 */
56 public static MemoryRequirement instance() {
57 try{
58 return LazyHolder.INSTANCE;
59 } catch (ExceptionInInitializerError err) {
60 throw processInitializerError(err);
61 }
62 }
63
64 /**
65 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement (visibility: PUBLIC, simpleName: MemoryRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
66 * <b>not</b> at the class load time of the outer class,
67 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement (visibility: PUBLIC, simpleName: MemoryRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
68 *
69 * <p> This workaround is required e.g. to support recursion.
70 *
71 */
72 private static class LazyHolder {
73 private static final MemoryRequirement INSTANCE = new MemoryRequirement();
74
75 /**
76 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
77 * This initialization order is required to support indirect recursion.
78 *
79 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
80 *
81 */
82 private static final Object STATIC_INITIALIZER = ensureInitialized();
83
84 public static Object ensureInitialized() {
85 INSTANCE.ensureInitializedInternal();
86 return null;
87 }
88 }
89
90 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
91 private static final MemoryRequirement.GeneratedPQuery INSTANCE = new GeneratedPQuery();
92
93 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
94
95 private final PParameter parameter_App = new PParameter("App", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
96
97 private final PParameter parameter_Memory = new PParameter("Memory", "java.lang.Integer", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EInt")), PParameterDirection.INOUT);
98
99 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_App, parameter_Memory);
100
101 private GeneratedPQuery() {
102 super(PVisibility.PRIVATE);
103 }
104
105 @Override
106 public String getFullyQualifiedName() {
107 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.memoryRequirement";
108 }
109
110 @Override
111 public List<String> getParameterNames() {
112 return Arrays.asList("Host","App","Memory");
113 }
114
115 @Override
116 public List<PParameter> getParameters() {
117 return parameters;
118 }
119
120 @Override
121 public Set<PBody> doGetContainedBodies() {
122 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
123 Set<PBody> bodies = new LinkedHashSet<>();
124 {
125 PBody body = new PBody(this);
126 PVariable var_Host = body.getOrCreateVariableByName("Host");
127 PVariable var_App = body.getOrCreateVariableByName("App");
128 PVariable var_Memory = body.getOrCreateVariableByName("Memory");
129 PVariable var_Req = body.getOrCreateVariableByName("Req");
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
131 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
132 new TypeConstraint(body, Tuples.flatTupleOf(var_Memory), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
133 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
134 new ExportedParameter(body, var_Host, parameter_Host),
135 new ExportedParameter(body, var_App, parameter_App),
136 new ExportedParameter(body, var_Memory, parameter_Memory)
137 ));
138 // find resourceRequirement(Host, App, Req)
139 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_App, var_Req), ResourceRequirement.instance().getInternalQueryRepresentation());
140 // ResourceRequirement.requiredMemory(Req, Memory)
141 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
142 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
143 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "requiredMemory")));
144 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
145 new Equality(body, var__virtual_0_, var_Memory);
146 bodies.add(body);
147 }
148 return bodies;
149 }
150 }
151}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/ResourceRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/ResourceRequirement.java
new file mode 100644
index 00000000..8c5bdefe
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/ResourceRequirement.java
@@ -0,0 +1,168 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
13import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
14import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
18import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
21import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
24import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
25
26/**
27 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
28 *
29 * <p>Original source:
30 * <code><pre>
31 * private pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) {
32 * ApplicationInstance.allocatedTo(App, Host);
33 * ApplicationInstance.type.requirements(App, Req);
34 * HostInstance.type(Host, HostType);
35 * ResourceRequirement.hostType(Req, HostType);
36 * }
37 * </pre></code>
38 *
39 * @see GenericPatternMatcher
40 * @see GenericPatternMatch
41 *
42 */
43@SuppressWarnings("all")
44public final class ResourceRequirement extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
45 private ResourceRequirement() {
46 super(GeneratedPQuery.INSTANCE);
47 }
48
49 /**
50 * @return the singleton instance of the query specification
51 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
52 *
53 */
54 public static ResourceRequirement instance() {
55 try{
56 return LazyHolder.INSTANCE;
57 } catch (ExceptionInInitializerError err) {
58 throw processInitializerError(err);
59 }
60 }
61
62 /**
63 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement (visibility: PUBLIC, simpleName: ResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
64 * <b>not</b> at the class load time of the outer class,
65 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement (visibility: PUBLIC, simpleName: ResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
66 *
67 * <p> This workaround is required e.g. to support recursion.
68 *
69 */
70 private static class LazyHolder {
71 private static final ResourceRequirement INSTANCE = new ResourceRequirement();
72
73 /**
74 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
75 * This initialization order is required to support indirect recursion.
76 *
77 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
78 *
79 */
80 private static final Object STATIC_INITIALIZER = ensureInitialized();
81
82 public static Object ensureInitialized() {
83 INSTANCE.ensureInitializedInternal();
84 return null;
85 }
86 }
87
88 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
89 private static final ResourceRequirement.GeneratedPQuery INSTANCE = new GeneratedPQuery();
90
91 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
92
93 private final PParameter parameter_App = new PParameter("App", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
94
95 private final PParameter parameter_Req = new PParameter("Req", "hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ResourceRequirement")), PParameterDirection.INOUT);
96
97 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_App, parameter_Req);
98
99 private GeneratedPQuery() {
100 super(PVisibility.PRIVATE);
101 }
102
103 @Override
104 public String getFullyQualifiedName() {
105 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement";
106 }
107
108 @Override
109 public List<String> getParameterNames() {
110 return Arrays.asList("Host","App","Req");
111 }
112
113 @Override
114 public List<PParameter> getParameters() {
115 return parameters;
116 }
117
118 @Override
119 public Set<PBody> doGetContainedBodies() {
120 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
121 Set<PBody> bodies = new LinkedHashSet<>();
122 {
123 PBody body = new PBody(this);
124 PVariable var_Host = body.getOrCreateVariableByName("Host");
125 PVariable var_App = body.getOrCreateVariableByName("App");
126 PVariable var_Req = body.getOrCreateVariableByName("Req");
127 PVariable var_HostType = body.getOrCreateVariableByName("HostType");
128 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
129 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
131 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
132 new ExportedParameter(body, var_Host, parameter_Host),
133 new ExportedParameter(body, var_App, parameter_App),
134 new ExportedParameter(body, var_Req, parameter_Req)
135 ));
136 // ApplicationInstance.allocatedTo(App, Host)
137 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
138 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
139 new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo")));
140 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
141 new Equality(body, var__virtual_0_, var_Host);
142 // ApplicationInstance.type.requirements(App, Req)
143 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
144 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
145 new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "type")));
146 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType")));
147 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
148 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "requirements")));
149 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
150 new Equality(body, var__virtual_2_, var_Req);
151 // HostInstance.type(Host, HostType)
152 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
153 PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
154 new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type")));
155 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
156 new Equality(body, var__virtual_3_, var_HostType);
157 // ResourceRequirement.hostType(Req, HostType)
158 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
159 PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}");
160 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "hostType")));
161 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
162 new Equality(body, var__virtual_4_, var_HostType);
163 bodies.add(body);
164 }
165 return bodies;
166 }
167 }
168}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/SatisfyingInstance.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/SatisfyingInstance.java
new file mode 100644
index 00000000..4285101c
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/SatisfyingInstance.java
@@ -0,0 +1,153 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
13import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
14import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
18import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
21import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
24import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
25
26/**
27 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
28 *
29 * <p>Original source:
30 * <code><pre>
31 * private pattern satisfyingInstance(Req : Requirement, App : ApplicationInstance) {
32 * Requirement.instances(Req, App);
33 * Requirement.type(Req, Type);
34 * ApplicationInstance.type(App, Type);
35 * }
36 * </pre></code>
37 *
38 * @see GenericPatternMatcher
39 * @see GenericPatternMatch
40 *
41 */
42@SuppressWarnings("all")
43public final class SatisfyingInstance extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
44 private SatisfyingInstance() {
45 super(GeneratedPQuery.INSTANCE);
46 }
47
48 /**
49 * @return the singleton instance of the query specification
50 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
51 *
52 */
53 public static SatisfyingInstance instance() {
54 try{
55 return LazyHolder.INSTANCE;
56 } catch (ExceptionInInitializerError err) {
57 throw processInitializerError(err);
58 }
59 }
60
61 /**
62 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance (visibility: PUBLIC, simpleName: SatisfyingInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
63 * <b>not</b> at the class load time of the outer class,
64 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance (visibility: PUBLIC, simpleName: SatisfyingInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
65 *
66 * <p> This workaround is required e.g. to support recursion.
67 *
68 */
69 private static class LazyHolder {
70 private static final SatisfyingInstance INSTANCE = new SatisfyingInstance();
71
72 /**
73 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
74 * This initialization order is required to support indirect recursion.
75 *
76 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
77 *
78 */
79 private static final Object STATIC_INITIALIZER = ensureInitialized();
80
81 public static Object ensureInitialized() {
82 INSTANCE.ensureInitializedInternal();
83 return null;
84 }
85 }
86
87 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
88 private static final SatisfyingInstance.GeneratedPQuery INSTANCE = new GeneratedPQuery();
89
90 private final PParameter parameter_Req = new PParameter("Req", "hu.bme.mit.inf.dslreasoner.domains.cps.Requirement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "Requirement")), PParameterDirection.INOUT);
91
92 private final PParameter parameter_App = new PParameter("App", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
93
94 private final List<PParameter> parameters = Arrays.asList(parameter_Req, parameter_App);
95
96 private GeneratedPQuery() {
97 super(PVisibility.PRIVATE);
98 }
99
100 @Override
101 public String getFullyQualifiedName() {
102 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.satisfyingInstance";
103 }
104
105 @Override
106 public List<String> getParameterNames() {
107 return Arrays.asList("Req","App");
108 }
109
110 @Override
111 public List<PParameter> getParameters() {
112 return parameters;
113 }
114
115 @Override
116 public Set<PBody> doGetContainedBodies() {
117 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
118 Set<PBody> bodies = new LinkedHashSet<>();
119 {
120 PBody body = new PBody(this);
121 PVariable var_Req = body.getOrCreateVariableByName("Req");
122 PVariable var_App = body.getOrCreateVariableByName("App");
123 PVariable var_Type = body.getOrCreateVariableByName("Type");
124 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
125 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
126 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
127 new ExportedParameter(body, var_Req, parameter_Req),
128 new ExportedParameter(body, var_App, parameter_App)
129 ));
130 // Requirement.instances(Req, App)
131 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
132 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
133 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "instances")));
134 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
135 new Equality(body, var__virtual_0_, var_App);
136 // Requirement.type(Req, Type)
137 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement")));
138 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
139 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "type")));
140 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType")));
141 new Equality(body, var__virtual_1_, var_Type);
142 // ApplicationInstance.type(App, Type)
143 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
144 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
145 new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "type")));
146 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType")));
147 new Equality(body, var__virtual_2_, var_Type);
148 bodies.add(body);
149 }
150 return bodies;
151 }
152 }
153}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
new file mode 100644
index 00000000..7f7cc5a4
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
@@ -0,0 +1,132 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.queries
2
3import "http://www.eclipse.org/emf/2002/Ecore"
4import "http://www.example.org/cps"
5
6@QueryBasedFeature(feature = "applications")
7pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) {
8 CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance);
9}
10
11@QueryBasedFeature(feature = "hosts")
12pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) {
13 CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance);
14}
15
16@QueryBasedFeature(feature = "totalMemory")
17pattern totalMemory(Host : HostInstance, Memory : EInt) {
18 HostInstance.type.defaultMemory(Host, Memory);
19}
20
21@QueryBasedFeature(feature = "totalHdd")
22pattern totalHdd(Host : HostInstance, Hdd : EInt) {
23 HostInstance.type.defaultHdd(Host, Hdd);
24}
25
26@QueryBasedFeature(feature = "availableMemory")
27pattern availableMemory(Host : HostInstance, Memory : java Integer) {
28 find totalMemory(Host, TotalMemory);
29 RequiredMemory == sum find memoryRequirement(Host, _, #_);
30 Memory == eval(TotalMemory - RequiredMemory);
31}
32
33private pattern memoryRequirement(Host : HostInstance, App : ApplicationInstance, Memory : EInt) {
34 find resourceRequirement(Host, App, Req);
35 ResourceRequirement.requiredMemory(Req, Memory);
36}
37
38@QueryBasedFeature(feature = "availableHdd")
39pattern availableHdd(Host : HostInstance, Hdd : java Integer) {
40 find totalHdd(Host, TotalHdd);
41 RequiredHdd == sum find hddRequirement(Host, _, #_);
42 Hdd == eval(TotalHdd - RequiredHdd);
43}
44
45private pattern hddRequirement(Host : HostInstance, App : ApplicationInstance, Hdd : EInt) {
46 find resourceRequirement(Host, App, Req);
47 ResourceRequirement.requiredHdd(Req, Hdd);
48}
49
50private pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) {
51 ApplicationInstance.allocatedTo(App, Host);
52 ApplicationInstance.type.requirements(App, Req);
53 HostInstance.type(Host, HostType);
54 ResourceRequirement.hostType(Req, HostType);
55}
56
57@Constraint(severity = "error", key = {Host, App},
58 message = "Application instance must be allocated to a supported host type.")
59pattern allocationWithoutResourceRequirement(Host : HostInstance, App : ApplicationInstance) {
60 ApplicationInstance.allocatedTo(App, Host);
61 neg find resourceRequirement(Host, App, _);
62}
63
64@Constraint(severity = "error", key = {Host},
65 message = "Insufficient memory available on host.")
66pattern notEnoughAvailableMemory(Host : HostInstance) {
67 find availableMemory(Host, Memory);
68 check(Memory < 0);
69}
70
71@Constraint(severity = "error", key = {Host},
72 message = "Insufficient HDD available on host.")
73pattern notEnoughAvailableHdd(Host : HostInstance) {
74 find availableHdd(Host, Hdd);
75 check(Hdd < 0);
76}
77
78@Constraint(severity = "error", key = {Req, App},
79 message = "Requirement must be satisfied by the required application type.")
80pattern instanceDoesNotSatisfyRequirement(Req : Requirement, App : ApplicationInstance) {
81 Requirement.instances(Req, App);
82 neg find satisfyingInstance(Req, App);
83}
84
85private pattern satisfyingInstance(Req : Requirement, App : ApplicationInstance) {
86 Requirement.instances(Req, App);
87 Requirement.type(Req, Type);
88 ApplicationInstance.type(App, Type);
89}
90
91@Constraint(severity = "error", key = {Req},
92 message = "Requirement is not satisfied by enough application instances.")
93pattern requirementNotSatisfied(Req : Requirement) {
94 Instances == count find satisfyingInstance(Req, _);
95 Requirement.count(Req, RequiredCount);
96 check(Instances < RequiredCount);
97}
98
99pattern averageFreeMemoryMetric(Average : java Double) {
100 Average == avg find freeMemoryPercentage(_, #_);
101}
102
103private pattern freeMemoryPercentage(Host : HostInstance, Free : java Double) {
104 find totalMemory(Host, Total);
105 find availableMemory(Host, Available);
106 Free == eval((Available as double) / Total);
107}
108
109pattern averageFreeHddMetric(Average : java Double) {
110 Average == avg find freeHddPercentage(_, #_);
111}
112
113private pattern freeHddPercentage(Host : HostInstance, Free : java Double) {
114 find totalHdd(Host, Total);
115 find availableHdd(Host, Available);
116 Free == eval((Available as double) / Total);
117}
118
119pattern costMetric(Cost : java Integer) {
120 Cost == sum find cpsCost(_, #_);
121}
122
123pattern cpsCost(Cps : CyberPhysicalSystem, Cost : java Integer) {
124 AppCount == count find cpsApplications(Cps, _);
125 HostCost == sum find hostInstanceCost(Cps, _, #_);
126 Cost == eval(5 * AppCount + HostCost);
127}
128
129private pattern hostInstanceCost(Cps : CyberPhysicalSystem, Host : HostInstance, Cost : EInt) {
130 find cpsHosts(Cps, Host);
131 HostInstance.type.cost(Host, Cost);
132}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml
index 5d75b948..f08e6b96 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml
@@ -1,12 +1,12 @@
1<?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.0"?><!-- 1<?xml version="1.0" encoding="UTF-8"?><?eclipse version="3.0"?><!--
2--><plugin> 2--><plugin>
3 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKind" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
4 <wellbehaving-derived-feature classifier-name="Spacecraft" feature-name="kind" package-nsUri="http://www.example.org/satellite"/>
5 </extension>
6 <extension point="org.eclipse.emf.ecore.generated_package"> 3 <extension point="org.eclipse.emf.ecore.generated_package">
7 <!-- @generated satellite --> 4 <!-- @generated satellite -->
8 <package class="satellite.SatellitePackage" genModel="model/satellite.genmodel" uri="http://www.example.org/satellite"/> 5 <package class="satellite.SatellitePackage" genModel="model/satellite.genmodel" uri="http://www.example.org/satellite"/>
9 </extension> 6 </extension>
7 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKind" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
8 <wellbehaving-derived-feature classifier-name="Spacecraft" feature-name="kind" package-nsUri="http://www.example.org/satellite"/>
9 </extension>
10 <extension id="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SatelliteQueries" point="org.eclipse.viatra.query.runtime.queryspecification"> 10 <extension id="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SatelliteQueries" point="org.eclipse.viatra.query.runtime.queryspecification">
11 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SatelliteQueries" id="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SatelliteQueries"> 11 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SatelliteQueries" id="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SatelliteQueries">
12 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement"/> 12 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement"/>
@@ -23,6 +23,9 @@
23 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna"/> 23 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna"/>
24 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat"/> 24 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat"/>
25 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKind"/> 25 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftOfKind"/>
26 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric"/>
27 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric"/>
28 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric"/>
26 </group> 29 </group>
27 </extension> 30 </extension>
28</plugin> 31</plugin>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CostMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CostMetric.java
new file mode 100644
index 00000000..474719b2
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CostMetric.java
@@ -0,0 +1,544 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
29import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
37import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
39import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
40
41/**
42 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
43 *
44 * <p>Original source:
45 * <code><pre>
46 * // Cost
47 *
48 * pattern costMetric(Cost : java Double) {
49 * Cost == sum find missionCost(_, #_);
50 * }
51 * </pre></code>
52 *
53 * @see Matcher
54 * @see Match
55 *
56 */
57@SuppressWarnings("all")
58public final class CostMetric extends BaseGeneratedEMFQuerySpecification<CostMetric.Matcher> {
59 /**
60 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric pattern,
61 * to be used in conjunction with {@link Matcher}.
62 *
63 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
64 * Each instance is a (possibly partial) substitution of pattern parameters,
65 * usable to represent a match of the pattern in the result of a query,
66 * or to specify the bound (fixed) input parameters when issuing a query.
67 *
68 * @see Matcher
69 *
70 */
71 public static abstract class Match extends BasePatternMatch {
72 private Double fCost;
73
74 private static List<String> parameterNames = makeImmutableList("Cost");
75
76 private Match(final Double pCost) {
77 this.fCost = pCost;
78 }
79
80 @Override
81 public Object get(final String parameterName) {
82 if ("Cost".equals(parameterName)) return this.fCost;
83 return null;
84 }
85
86 public Double getCost() {
87 return this.fCost;
88 }
89
90 @Override
91 public boolean set(final String parameterName, final Object newValue) {
92 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
93 if ("Cost".equals(parameterName) ) {
94 this.fCost = (Double) newValue;
95 return true;
96 }
97 return false;
98 }
99
100 public void setCost(final Double pCost) {
101 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
102 this.fCost = pCost;
103 }
104
105 @Override
106 public String patternName() {
107 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric";
108 }
109
110 @Override
111 public List<String> parameterNames() {
112 return CostMetric.Match.parameterNames;
113 }
114
115 @Override
116 public Object[] toArray() {
117 return new Object[]{fCost};
118 }
119
120 @Override
121 public CostMetric.Match toImmutable() {
122 return isMutable() ? newMatch(fCost) : this;
123 }
124
125 @Override
126 public String prettyPrint() {
127 StringBuilder result = new StringBuilder();
128 result.append("\"Cost\"=" + prettyPrintValue(fCost));
129 return result.toString();
130 }
131
132 @Override
133 public int hashCode() {
134 return Objects.hash(fCost);
135 }
136
137 @Override
138 public boolean equals(final Object obj) {
139 if (this == obj)
140 return true;
141 if (obj == null) {
142 return false;
143 }
144 if ((obj instanceof CostMetric.Match)) {
145 CostMetric.Match other = (CostMetric.Match) obj;
146 return Objects.equals(fCost, other.fCost);
147 } else {
148 // this should be infrequent
149 if (!(obj instanceof IPatternMatch)) {
150 return false;
151 }
152 IPatternMatch otherSig = (IPatternMatch) obj;
153 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
154 }
155 }
156
157 @Override
158 public CostMetric specification() {
159 return CostMetric.instance();
160 }
161
162 /**
163 * Returns an empty, mutable match.
164 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
165 *
166 * @return the empty match.
167 *
168 */
169 public static CostMetric.Match newEmptyMatch() {
170 return new Mutable(null);
171 }
172
173 /**
174 * Returns a mutable (partial) match.
175 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
176 *
177 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
178 * @return the new, mutable (partial) match object.
179 *
180 */
181 public static CostMetric.Match newMutableMatch(final Double pCost) {
182 return new Mutable(pCost);
183 }
184
185 /**
186 * Returns a new (partial) match.
187 * This can be used e.g. to call the matcher with a partial match.
188 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
189 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
190 * @return the (partial) match object.
191 *
192 */
193 public static CostMetric.Match newMatch(final Double pCost) {
194 return new Immutable(pCost);
195 }
196
197 private static final class Mutable extends CostMetric.Match {
198 Mutable(final Double pCost) {
199 super(pCost);
200 }
201
202 @Override
203 public boolean isMutable() {
204 return true;
205 }
206 }
207
208 private static final class Immutable extends CostMetric.Match {
209 Immutable(final Double pCost) {
210 super(pCost);
211 }
212
213 @Override
214 public boolean isMutable() {
215 return false;
216 }
217 }
218 }
219
220 /**
221 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric pattern,
222 * providing pattern-specific query methods.
223 *
224 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
225 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
226 *
227 * <p>Matches of the pattern will be represented as {@link Match}.
228 *
229 * <p>Original source:
230 * <code><pre>
231 * // Cost
232 *
233 * pattern costMetric(Cost : java Double) {
234 * Cost == sum find missionCost(_, #_);
235 * }
236 * </pre></code>
237 *
238 * @see Match
239 * @see CostMetric
240 *
241 */
242 public static class Matcher extends BaseMatcher<CostMetric.Match> {
243 /**
244 * Initializes the pattern matcher within an existing VIATRA Query engine.
245 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
246 *
247 * @param engine the existing VIATRA Query engine in which this matcher will be created.
248 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
249 *
250 */
251 public static CostMetric.Matcher on(final ViatraQueryEngine engine) {
252 // check if matcher already exists
253 Matcher matcher = engine.getExistingMatcher(querySpecification());
254 if (matcher == null) {
255 matcher = (Matcher)engine.getMatcher(querySpecification());
256 }
257 return matcher;
258 }
259
260 /**
261 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
262 * @return an initialized matcher
263 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
264 *
265 */
266 public static CostMetric.Matcher create() {
267 return new Matcher();
268 }
269
270 private static final int POSITION_COST = 0;
271
272 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CostMetric.Matcher.class);
273
274 /**
275 * Initializes the pattern matcher within an existing VIATRA Query engine.
276 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
277 *
278 * @param engine the existing VIATRA Query engine in which this matcher will be created.
279 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
280 *
281 */
282 private Matcher() {
283 super(querySpecification());
284 }
285
286 /**
287 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
288 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
289 * @return matches represented as a Match object.
290 *
291 */
292 public Collection<CostMetric.Match> getAllMatches(final Double pCost) {
293 return rawStreamAllMatches(new Object[]{pCost}).collect(Collectors.toSet());
294 }
295
296 /**
297 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
298 * </p>
299 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
300 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
301 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
302 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
303 * @return a stream of matches represented as a Match object.
304 *
305 */
306 public Stream<CostMetric.Match> streamAllMatches(final Double pCost) {
307 return rawStreamAllMatches(new Object[]{pCost});
308 }
309
310 /**
311 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
312 * Neither determinism nor randomness of selection is guaranteed.
313 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
314 * @return a match represented as a Match object, or null if no match is found.
315 *
316 */
317 public Optional<CostMetric.Match> getOneArbitraryMatch(final Double pCost) {
318 return rawGetOneArbitraryMatch(new Object[]{pCost});
319 }
320
321 /**
322 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
323 * under any possible substitution of the unspecified parameters (if any).
324 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
325 * @return true if the input is a valid (partial) match of the pattern.
326 *
327 */
328 public boolean hasMatch(final Double pCost) {
329 return rawHasMatch(new Object[]{pCost});
330 }
331
332 /**
333 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
334 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
335 * @return the number of pattern matches found.
336 *
337 */
338 public int countMatches(final Double pCost) {
339 return rawCountMatches(new Object[]{pCost});
340 }
341
342 /**
343 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
344 * Neither determinism nor randomness of selection is guaranteed.
345 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
346 * @param processor the action that will process the selected match.
347 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
348 *
349 */
350 public boolean forOneArbitraryMatch(final Double pCost, final Consumer<? super CostMetric.Match> processor) {
351 return rawForOneArbitraryMatch(new Object[]{pCost}, processor);
352 }
353
354 /**
355 * Returns a new (partial) match.
356 * This can be used e.g. to call the matcher with a partial match.
357 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
358 * @param pCost the fixed value of pattern parameter Cost, or null if not bound.
359 * @return the (partial) match object.
360 *
361 */
362 public CostMetric.Match newMatch(final Double pCost) {
363 return CostMetric.Match.newMatch(pCost);
364 }
365
366 /**
367 * Retrieve the set of values that occur in matches for Cost.
368 * @return the Set of all values or empty set if there are no matches
369 *
370 */
371 protected Stream<Double> rawStreamAllValuesOfCost(final Object[] parameters) {
372 return rawStreamAllValues(POSITION_COST, parameters).map(Double.class::cast);
373 }
374
375 /**
376 * Retrieve the set of values that occur in matches for Cost.
377 * @return the Set of all values or empty set if there are no matches
378 *
379 */
380 public Set<Double> getAllValuesOfCost() {
381 return rawStreamAllValuesOfCost(emptyArray()).collect(Collectors.toSet());
382 }
383
384 /**
385 * Retrieve the set of values that occur in matches for Cost.
386 * @return the Set of all values or empty set if there are no matches
387 *
388 */
389 public Stream<Double> streamAllValuesOfCost() {
390 return rawStreamAllValuesOfCost(emptyArray());
391 }
392
393 @Override
394 protected CostMetric.Match tupleToMatch(final Tuple t) {
395 try {
396 return CostMetric.Match.newMatch((Double) t.get(POSITION_COST));
397 } catch(ClassCastException e) {
398 LOGGER.error("Element(s) in tuple not properly typed!",e);
399 return null;
400 }
401 }
402
403 @Override
404 protected CostMetric.Match arrayToMatch(final Object[] match) {
405 try {
406 return CostMetric.Match.newMatch((Double) match[POSITION_COST]);
407 } catch(ClassCastException e) {
408 LOGGER.error("Element(s) in array not properly typed!",e);
409 return null;
410 }
411 }
412
413 @Override
414 protected CostMetric.Match arrayToMatchMutable(final Object[] match) {
415 try {
416 return CostMetric.Match.newMutableMatch((Double) match[POSITION_COST]);
417 } catch(ClassCastException e) {
418 LOGGER.error("Element(s) in array not properly typed!",e);
419 return null;
420 }
421 }
422
423 /**
424 * @return the singleton instance of the query specification of this pattern
425 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
426 *
427 */
428 public static IQuerySpecification<CostMetric.Matcher> querySpecification() {
429 return CostMetric.instance();
430 }
431 }
432
433 private CostMetric() {
434 super(GeneratedPQuery.INSTANCE);
435 }
436
437 /**
438 * @return the singleton instance of the query specification
439 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
440 *
441 */
442 public static CostMetric instance() {
443 try{
444 return LazyHolder.INSTANCE;
445 } catch (ExceptionInInitializerError err) {
446 throw processInitializerError(err);
447 }
448 }
449
450 @Override
451 protected CostMetric.Matcher instantiate(final ViatraQueryEngine engine) {
452 return CostMetric.Matcher.on(engine);
453 }
454
455 @Override
456 public CostMetric.Matcher instantiate() {
457 return CostMetric.Matcher.create();
458 }
459
460 @Override
461 public CostMetric.Match newEmptyMatch() {
462 return CostMetric.Match.newEmptyMatch();
463 }
464
465 @Override
466 public CostMetric.Match newMatch(final Object... parameters) {
467 return CostMetric.Match.newMatch((java.lang.Double) parameters[0]);
468 }
469
470 /**
471 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric (visibility: PUBLIC, simpleName: CostMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
472 * <b>not</b> at the class load time of the outer class,
473 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric (visibility: PUBLIC, simpleName: CostMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
474 *
475 * <p> This workaround is required e.g. to support recursion.
476 *
477 */
478 private static class LazyHolder {
479 private static final CostMetric INSTANCE = new CostMetric();
480
481 /**
482 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
483 * This initialization order is required to support indirect recursion.
484 *
485 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
486 *
487 */
488 private static final Object STATIC_INITIALIZER = ensureInitialized();
489
490 public static Object ensureInitialized() {
491 INSTANCE.ensureInitializedInternal();
492 return null;
493 }
494 }
495
496 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
497 private static final CostMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
498
499 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
500
501 private final List<PParameter> parameters = Arrays.asList(parameter_Cost);
502
503 private GeneratedPQuery() {
504 super(PVisibility.PUBLIC);
505 }
506
507 @Override
508 public String getFullyQualifiedName() {
509 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.costMetric";
510 }
511
512 @Override
513 public List<String> getParameterNames() {
514 return Arrays.asList("Cost");
515 }
516
517 @Override
518 public List<PParameter> getParameters() {
519 return parameters;
520 }
521
522 @Override
523 public Set<PBody> doGetContainedBodies() {
524 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
525 Set<PBody> bodies = new LinkedHashSet<>();
526 {
527 PBody body = new PBody(this);
528 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
529 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
530 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
531 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
532 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
533 new ExportedParameter(body, var_Cost, parameter_Cost)
534 ));
535 // Cost == sum find missionCost(_, #_)
536 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
537 new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), MissionCost.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
538 new Equality(body, var_Cost, var__virtual_0_);
539 bodies.add(body);
540 }
541 return bodies;
542 }
543 }
544}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CoverageMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CoverageMetric.java
new file mode 100644
index 00000000..23b02ce4
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/CoverageMetric.java
@@ -0,0 +1,552 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
29import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
37import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
39import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
40
41/**
42 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
43 *
44 * <p>Original source:
45 * <code><pre>
46 * //
47 * // Metrics
48 * //
49 *
50 * // Coverage
51 *
52 * pattern coverageMetric(Coverage : java Double) {
53 * Coverage == sum find missionCoverage(_, #_);
54 * }
55 * </pre></code>
56 *
57 * @see Matcher
58 * @see Match
59 *
60 */
61@SuppressWarnings("all")
62public final class CoverageMetric extends BaseGeneratedEMFQuerySpecification<CoverageMetric.Matcher> {
63 /**
64 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric pattern,
65 * to be used in conjunction with {@link Matcher}.
66 *
67 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
68 * Each instance is a (possibly partial) substitution of pattern parameters,
69 * usable to represent a match of the pattern in the result of a query,
70 * or to specify the bound (fixed) input parameters when issuing a query.
71 *
72 * @see Matcher
73 *
74 */
75 public static abstract class Match extends BasePatternMatch {
76 private Double fCoverage;
77
78 private static List<String> parameterNames = makeImmutableList("Coverage");
79
80 private Match(final Double pCoverage) {
81 this.fCoverage = pCoverage;
82 }
83
84 @Override
85 public Object get(final String parameterName) {
86 if ("Coverage".equals(parameterName)) return this.fCoverage;
87 return null;
88 }
89
90 public Double getCoverage() {
91 return this.fCoverage;
92 }
93
94 @Override
95 public boolean set(final String parameterName, final Object newValue) {
96 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
97 if ("Coverage".equals(parameterName) ) {
98 this.fCoverage = (Double) newValue;
99 return true;
100 }
101 return false;
102 }
103
104 public void setCoverage(final Double pCoverage) {
105 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
106 this.fCoverage = pCoverage;
107 }
108
109 @Override
110 public String patternName() {
111 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric";
112 }
113
114 @Override
115 public List<String> parameterNames() {
116 return CoverageMetric.Match.parameterNames;
117 }
118
119 @Override
120 public Object[] toArray() {
121 return new Object[]{fCoverage};
122 }
123
124 @Override
125 public CoverageMetric.Match toImmutable() {
126 return isMutable() ? newMatch(fCoverage) : this;
127 }
128
129 @Override
130 public String prettyPrint() {
131 StringBuilder result = new StringBuilder();
132 result.append("\"Coverage\"=" + prettyPrintValue(fCoverage));
133 return result.toString();
134 }
135
136 @Override
137 public int hashCode() {
138 return Objects.hash(fCoverage);
139 }
140
141 @Override
142 public boolean equals(final Object obj) {
143 if (this == obj)
144 return true;
145 if (obj == null) {
146 return false;
147 }
148 if ((obj instanceof CoverageMetric.Match)) {
149 CoverageMetric.Match other = (CoverageMetric.Match) obj;
150 return Objects.equals(fCoverage, other.fCoverage);
151 } else {
152 // this should be infrequent
153 if (!(obj instanceof IPatternMatch)) {
154 return false;
155 }
156 IPatternMatch otherSig = (IPatternMatch) obj;
157 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
158 }
159 }
160
161 @Override
162 public CoverageMetric specification() {
163 return CoverageMetric.instance();
164 }
165
166 /**
167 * Returns an empty, mutable match.
168 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
169 *
170 * @return the empty match.
171 *
172 */
173 public static CoverageMetric.Match newEmptyMatch() {
174 return new Mutable(null);
175 }
176
177 /**
178 * Returns a mutable (partial) match.
179 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
180 *
181 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
182 * @return the new, mutable (partial) match object.
183 *
184 */
185 public static CoverageMetric.Match newMutableMatch(final Double pCoverage) {
186 return new Mutable(pCoverage);
187 }
188
189 /**
190 * Returns a new (partial) match.
191 * This can be used e.g. to call the matcher with a partial match.
192 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
193 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
194 * @return the (partial) match object.
195 *
196 */
197 public static CoverageMetric.Match newMatch(final Double pCoverage) {
198 return new Immutable(pCoverage);
199 }
200
201 private static final class Mutable extends CoverageMetric.Match {
202 Mutable(final Double pCoverage) {
203 super(pCoverage);
204 }
205
206 @Override
207 public boolean isMutable() {
208 return true;
209 }
210 }
211
212 private static final class Immutable extends CoverageMetric.Match {
213 Immutable(final Double pCoverage) {
214 super(pCoverage);
215 }
216
217 @Override
218 public boolean isMutable() {
219 return false;
220 }
221 }
222 }
223
224 /**
225 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric pattern,
226 * providing pattern-specific query methods.
227 *
228 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
229 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
230 *
231 * <p>Matches of the pattern will be represented as {@link Match}.
232 *
233 * <p>Original source:
234 * <code><pre>
235 * //
236 * // Metrics
237 * //
238 *
239 * // Coverage
240 *
241 * pattern coverageMetric(Coverage : java Double) {
242 * Coverage == sum find missionCoverage(_, #_);
243 * }
244 * </pre></code>
245 *
246 * @see Match
247 * @see CoverageMetric
248 *
249 */
250 public static class Matcher extends BaseMatcher<CoverageMetric.Match> {
251 /**
252 * Initializes the pattern matcher within an existing VIATRA Query engine.
253 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
254 *
255 * @param engine the existing VIATRA Query engine in which this matcher will be created.
256 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
257 *
258 */
259 public static CoverageMetric.Matcher on(final ViatraQueryEngine engine) {
260 // check if matcher already exists
261 Matcher matcher = engine.getExistingMatcher(querySpecification());
262 if (matcher == null) {
263 matcher = (Matcher)engine.getMatcher(querySpecification());
264 }
265 return matcher;
266 }
267
268 /**
269 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
270 * @return an initialized matcher
271 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
272 *
273 */
274 public static CoverageMetric.Matcher create() {
275 return new Matcher();
276 }
277
278 private static final int POSITION_COVERAGE = 0;
279
280 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CoverageMetric.Matcher.class);
281
282 /**
283 * Initializes the pattern matcher within an existing VIATRA Query engine.
284 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
285 *
286 * @param engine the existing VIATRA Query engine in which this matcher will be created.
287 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
288 *
289 */
290 private Matcher() {
291 super(querySpecification());
292 }
293
294 /**
295 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
296 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
297 * @return matches represented as a Match object.
298 *
299 */
300 public Collection<CoverageMetric.Match> getAllMatches(final Double pCoverage) {
301 return rawStreamAllMatches(new Object[]{pCoverage}).collect(Collectors.toSet());
302 }
303
304 /**
305 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
306 * </p>
307 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
308 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
309 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
310 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
311 * @return a stream of matches represented as a Match object.
312 *
313 */
314 public Stream<CoverageMetric.Match> streamAllMatches(final Double pCoverage) {
315 return rawStreamAllMatches(new Object[]{pCoverage});
316 }
317
318 /**
319 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
320 * Neither determinism nor randomness of selection is guaranteed.
321 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
322 * @return a match represented as a Match object, or null if no match is found.
323 *
324 */
325 public Optional<CoverageMetric.Match> getOneArbitraryMatch(final Double pCoverage) {
326 return rawGetOneArbitraryMatch(new Object[]{pCoverage});
327 }
328
329 /**
330 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
331 * under any possible substitution of the unspecified parameters (if any).
332 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
333 * @return true if the input is a valid (partial) match of the pattern.
334 *
335 */
336 public boolean hasMatch(final Double pCoverage) {
337 return rawHasMatch(new Object[]{pCoverage});
338 }
339
340 /**
341 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
342 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
343 * @return the number of pattern matches found.
344 *
345 */
346 public int countMatches(final Double pCoverage) {
347 return rawCountMatches(new Object[]{pCoverage});
348 }
349
350 /**
351 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
352 * Neither determinism nor randomness of selection is guaranteed.
353 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
354 * @param processor the action that will process the selected match.
355 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
356 *
357 */
358 public boolean forOneArbitraryMatch(final Double pCoverage, final Consumer<? super CoverageMetric.Match> processor) {
359 return rawForOneArbitraryMatch(new Object[]{pCoverage}, processor);
360 }
361
362 /**
363 * Returns a new (partial) match.
364 * This can be used e.g. to call the matcher with a partial match.
365 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
366 * @param pCoverage the fixed value of pattern parameter Coverage, or null if not bound.
367 * @return the (partial) match object.
368 *
369 */
370 public CoverageMetric.Match newMatch(final Double pCoverage) {
371 return CoverageMetric.Match.newMatch(pCoverage);
372 }
373
374 /**
375 * Retrieve the set of values that occur in matches for Coverage.
376 * @return the Set of all values or empty set if there are no matches
377 *
378 */
379 protected Stream<Double> rawStreamAllValuesOfCoverage(final Object[] parameters) {
380 return rawStreamAllValues(POSITION_COVERAGE, parameters).map(Double.class::cast);
381 }
382
383 /**
384 * Retrieve the set of values that occur in matches for Coverage.
385 * @return the Set of all values or empty set if there are no matches
386 *
387 */
388 public Set<Double> getAllValuesOfCoverage() {
389 return rawStreamAllValuesOfCoverage(emptyArray()).collect(Collectors.toSet());
390 }
391
392 /**
393 * Retrieve the set of values that occur in matches for Coverage.
394 * @return the Set of all values or empty set if there are no matches
395 *
396 */
397 public Stream<Double> streamAllValuesOfCoverage() {
398 return rawStreamAllValuesOfCoverage(emptyArray());
399 }
400
401 @Override
402 protected CoverageMetric.Match tupleToMatch(final Tuple t) {
403 try {
404 return CoverageMetric.Match.newMatch((Double) t.get(POSITION_COVERAGE));
405 } catch(ClassCastException e) {
406 LOGGER.error("Element(s) in tuple not properly typed!",e);
407 return null;
408 }
409 }
410
411 @Override
412 protected CoverageMetric.Match arrayToMatch(final Object[] match) {
413 try {
414 return CoverageMetric.Match.newMatch((Double) match[POSITION_COVERAGE]);
415 } catch(ClassCastException e) {
416 LOGGER.error("Element(s) in array not properly typed!",e);
417 return null;
418 }
419 }
420
421 @Override
422 protected CoverageMetric.Match arrayToMatchMutable(final Object[] match) {
423 try {
424 return CoverageMetric.Match.newMutableMatch((Double) match[POSITION_COVERAGE]);
425 } catch(ClassCastException e) {
426 LOGGER.error("Element(s) in array not properly typed!",e);
427 return null;
428 }
429 }
430
431 /**
432 * @return the singleton instance of the query specification of this pattern
433 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
434 *
435 */
436 public static IQuerySpecification<CoverageMetric.Matcher> querySpecification() {
437 return CoverageMetric.instance();
438 }
439 }
440
441 private CoverageMetric() {
442 super(GeneratedPQuery.INSTANCE);
443 }
444
445 /**
446 * @return the singleton instance of the query specification
447 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
448 *
449 */
450 public static CoverageMetric instance() {
451 try{
452 return LazyHolder.INSTANCE;
453 } catch (ExceptionInInitializerError err) {
454 throw processInitializerError(err);
455 }
456 }
457
458 @Override
459 protected CoverageMetric.Matcher instantiate(final ViatraQueryEngine engine) {
460 return CoverageMetric.Matcher.on(engine);
461 }
462
463 @Override
464 public CoverageMetric.Matcher instantiate() {
465 return CoverageMetric.Matcher.create();
466 }
467
468 @Override
469 public CoverageMetric.Match newEmptyMatch() {
470 return CoverageMetric.Match.newEmptyMatch();
471 }
472
473 @Override
474 public CoverageMetric.Match newMatch(final Object... parameters) {
475 return CoverageMetric.Match.newMatch((java.lang.Double) parameters[0]);
476 }
477
478 /**
479 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric (visibility: PUBLIC, simpleName: CoverageMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
480 * <b>not</b> at the class load time of the outer class,
481 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric (visibility: PUBLIC, simpleName: CoverageMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
482 *
483 * <p> This workaround is required e.g. to support recursion.
484 *
485 */
486 private static class LazyHolder {
487 private static final CoverageMetric INSTANCE = new CoverageMetric();
488
489 /**
490 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
491 * This initialization order is required to support indirect recursion.
492 *
493 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
494 *
495 */
496 private static final Object STATIC_INITIALIZER = ensureInitialized();
497
498 public static Object ensureInitialized() {
499 INSTANCE.ensureInitializedInternal();
500 return null;
501 }
502 }
503
504 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
505 private static final CoverageMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
506
507 private final PParameter parameter_Coverage = new PParameter("Coverage", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
508
509 private final List<PParameter> parameters = Arrays.asList(parameter_Coverage);
510
511 private GeneratedPQuery() {
512 super(PVisibility.PUBLIC);
513 }
514
515 @Override
516 public String getFullyQualifiedName() {
517 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.coverageMetric";
518 }
519
520 @Override
521 public List<String> getParameterNames() {
522 return Arrays.asList("Coverage");
523 }
524
525 @Override
526 public List<PParameter> getParameters() {
527 return parameters;
528 }
529
530 @Override
531 public Set<PBody> doGetContainedBodies() {
532 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
533 Set<PBody> bodies = new LinkedHashSet<>();
534 {
535 PBody body = new PBody(this);
536 PVariable var_Coverage = body.getOrCreateVariableByName("Coverage");
537 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
538 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
539 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Coverage), new JavaTransitiveInstancesKey(java.lang.Double.class));
540 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
541 new ExportedParameter(body, var_Coverage, parameter_Coverage)
542 ));
543 // Coverage == sum find missionCoverage(_, #_)
544 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
545 new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), MissionCoverage.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
546 new Equality(body, var_Coverage, var__virtual_0_);
547 bodies.add(body);
548 }
549 return bodies;
550 }
551 }
552}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java
index c86761ce..31c5a70a 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.java
@@ -5,6 +5,8 @@ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement; 6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement;
7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop; 7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop;
8import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric;
9import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric;
8import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna; 10import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna;
9import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand; 11import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand;
10import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetGain; 12import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetGain;
@@ -15,6 +17,7 @@ import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferome
15import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat; 17import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat;
16import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SpacecraftOfKind; 18import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SpacecraftOfKind;
17import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink; 19import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink;
20import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric;
18import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.UhfAntennaGainNotLow; 21import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.UhfAntennaGainNotLow;
19import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.XAntennaGainNotMedium; 22import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.XAntennaGainNotMedium;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; 23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
@@ -42,6 +45,9 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
42 * <li>cubeSatWithKaAntenna</li> 45 * <li>cubeSatWithKaAntenna</li>
43 * <li>smallSat</li> 46 * <li>smallSat</li>
44 * <li>spacecraftOfKind</li> 47 * <li>spacecraftOfKind</li>
48 * <li>coverageMetric</li>
49 * <li>timeMetric</li>
50 * <li>costMetric</li>
45 * </ul> 51 * </ul>
46 * 52 *
47 * @see IQueryGroup 53 * @see IQueryGroup
@@ -80,6 +86,9 @@ public final class SatelliteQueries extends BaseGeneratedPatternGroup {
80 querySpecifications.add(CubeSatWithKaAntenna.instance()); 86 querySpecifications.add(CubeSatWithKaAntenna.instance());
81 querySpecifications.add(SmallSat.instance()); 87 querySpecifications.add(SmallSat.instance());
82 querySpecifications.add(SpacecraftOfKind.instance()); 88 querySpecifications.add(SpacecraftOfKind.instance());
89 querySpecifications.add(CoverageMetric.instance());
90 querySpecifications.add(TimeMetric.instance());
91 querySpecifications.add(CostMetric.instance());
83 } 92 }
84 93
85 public CommunicationLinkDoesNotStartAtContainingElement getCommunicationLinkDoesNotStartAtContainingElement() { 94 public CommunicationLinkDoesNotStartAtContainingElement getCommunicationLinkDoesNotStartAtContainingElement() {
@@ -193,4 +202,28 @@ public final class SatelliteQueries extends BaseGeneratedPatternGroup {
193 public SpacecraftOfKind.Matcher getSpacecraftOfKind(final ViatraQueryEngine engine) { 202 public SpacecraftOfKind.Matcher getSpacecraftOfKind(final ViatraQueryEngine engine) {
194 return SpacecraftOfKind.Matcher.on(engine); 203 return SpacecraftOfKind.Matcher.on(engine);
195 } 204 }
205
206 public CoverageMetric getCoverageMetric() {
207 return CoverageMetric.instance();
208 }
209
210 public CoverageMetric.Matcher getCoverageMetric(final ViatraQueryEngine engine) {
211 return CoverageMetric.Matcher.on(engine);
212 }
213
214 public TimeMetric getTimeMetric() {
215 return TimeMetric.instance();
216 }
217
218 public TimeMetric.Matcher getTimeMetric(final ViatraQueryEngine engine) {
219 return TimeMetric.Matcher.on(engine);
220 }
221
222 public CostMetric getCostMetric() {
223 return CostMetric.instance();
224 }
225
226 public CostMetric.Matcher getCostMetric(final ViatraQueryEngine engine) {
227 return CostMetric.Matcher.on(engine);
228 }
196} 229}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/TimeMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/TimeMetric.java
new file mode 100644
index 00000000..45d4cc35
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/TimeMetric.java
@@ -0,0 +1,544 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
20import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
21import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
24import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
25import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
26import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
27import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
29import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
37import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
39import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
40
41/**
42 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
43 *
44 * <p>Original source:
45 * <code><pre>
46 * // Time
47 *
48 * pattern timeMetric(Time : java Double) {
49 * Time == sum find missionTime(_, #_);
50 * }
51 * </pre></code>
52 *
53 * @see Matcher
54 * @see Match
55 *
56 */
57@SuppressWarnings("all")
58public final class TimeMetric extends BaseGeneratedEMFQuerySpecification<TimeMetric.Matcher> {
59 /**
60 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric pattern,
61 * to be used in conjunction with {@link Matcher}.
62 *
63 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
64 * Each instance is a (possibly partial) substitution of pattern parameters,
65 * usable to represent a match of the pattern in the result of a query,
66 * or to specify the bound (fixed) input parameters when issuing a query.
67 *
68 * @see Matcher
69 *
70 */
71 public static abstract class Match extends BasePatternMatch {
72 private Double fTime;
73
74 private static List<String> parameterNames = makeImmutableList("Time");
75
76 private Match(final Double pTime) {
77 this.fTime = pTime;
78 }
79
80 @Override
81 public Object get(final String parameterName) {
82 if ("Time".equals(parameterName)) return this.fTime;
83 return null;
84 }
85
86 public Double getTime() {
87 return this.fTime;
88 }
89
90 @Override
91 public boolean set(final String parameterName, final Object newValue) {
92 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
93 if ("Time".equals(parameterName) ) {
94 this.fTime = (Double) newValue;
95 return true;
96 }
97 return false;
98 }
99
100 public void setTime(final Double pTime) {
101 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
102 this.fTime = pTime;
103 }
104
105 @Override
106 public String patternName() {
107 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric";
108 }
109
110 @Override
111 public List<String> parameterNames() {
112 return TimeMetric.Match.parameterNames;
113 }
114
115 @Override
116 public Object[] toArray() {
117 return new Object[]{fTime};
118 }
119
120 @Override
121 public TimeMetric.Match toImmutable() {
122 return isMutable() ? newMatch(fTime) : this;
123 }
124
125 @Override
126 public String prettyPrint() {
127 StringBuilder result = new StringBuilder();
128 result.append("\"Time\"=" + prettyPrintValue(fTime));
129 return result.toString();
130 }
131
132 @Override
133 public int hashCode() {
134 return Objects.hash(fTime);
135 }
136
137 @Override
138 public boolean equals(final Object obj) {
139 if (this == obj)
140 return true;
141 if (obj == null) {
142 return false;
143 }
144 if ((obj instanceof TimeMetric.Match)) {
145 TimeMetric.Match other = (TimeMetric.Match) obj;
146 return Objects.equals(fTime, other.fTime);
147 } else {
148 // this should be infrequent
149 if (!(obj instanceof IPatternMatch)) {
150 return false;
151 }
152 IPatternMatch otherSig = (IPatternMatch) obj;
153 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
154 }
155 }
156
157 @Override
158 public TimeMetric specification() {
159 return TimeMetric.instance();
160 }
161
162 /**
163 * Returns an empty, mutable match.
164 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
165 *
166 * @return the empty match.
167 *
168 */
169 public static TimeMetric.Match newEmptyMatch() {
170 return new Mutable(null);
171 }
172
173 /**
174 * Returns a mutable (partial) match.
175 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
176 *
177 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
178 * @return the new, mutable (partial) match object.
179 *
180 */
181 public static TimeMetric.Match newMutableMatch(final Double pTime) {
182 return new Mutable(pTime);
183 }
184
185 /**
186 * Returns a new (partial) match.
187 * This can be used e.g. to call the matcher with a partial match.
188 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
189 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
190 * @return the (partial) match object.
191 *
192 */
193 public static TimeMetric.Match newMatch(final Double pTime) {
194 return new Immutable(pTime);
195 }
196
197 private static final class Mutable extends TimeMetric.Match {
198 Mutable(final Double pTime) {
199 super(pTime);
200 }
201
202 @Override
203 public boolean isMutable() {
204 return true;
205 }
206 }
207
208 private static final class Immutable extends TimeMetric.Match {
209 Immutable(final Double pTime) {
210 super(pTime);
211 }
212
213 @Override
214 public boolean isMutable() {
215 return false;
216 }
217 }
218 }
219
220 /**
221 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric pattern,
222 * providing pattern-specific query methods.
223 *
224 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
225 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
226 *
227 * <p>Matches of the pattern will be represented as {@link Match}.
228 *
229 * <p>Original source:
230 * <code><pre>
231 * // Time
232 *
233 * pattern timeMetric(Time : java Double) {
234 * Time == sum find missionTime(_, #_);
235 * }
236 * </pre></code>
237 *
238 * @see Match
239 * @see TimeMetric
240 *
241 */
242 public static class Matcher extends BaseMatcher<TimeMetric.Match> {
243 /**
244 * Initializes the pattern matcher within an existing VIATRA Query engine.
245 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
246 *
247 * @param engine the existing VIATRA Query engine in which this matcher will be created.
248 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
249 *
250 */
251 public static TimeMetric.Matcher on(final ViatraQueryEngine engine) {
252 // check if matcher already exists
253 Matcher matcher = engine.getExistingMatcher(querySpecification());
254 if (matcher == null) {
255 matcher = (Matcher)engine.getMatcher(querySpecification());
256 }
257 return matcher;
258 }
259
260 /**
261 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
262 * @return an initialized matcher
263 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
264 *
265 */
266 public static TimeMetric.Matcher create() {
267 return new Matcher();
268 }
269
270 private static final int POSITION_TIME = 0;
271
272 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TimeMetric.Matcher.class);
273
274 /**
275 * Initializes the pattern matcher within an existing VIATRA Query engine.
276 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
277 *
278 * @param engine the existing VIATRA Query engine in which this matcher will be created.
279 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
280 *
281 */
282 private Matcher() {
283 super(querySpecification());
284 }
285
286 /**
287 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
288 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
289 * @return matches represented as a Match object.
290 *
291 */
292 public Collection<TimeMetric.Match> getAllMatches(final Double pTime) {
293 return rawStreamAllMatches(new Object[]{pTime}).collect(Collectors.toSet());
294 }
295
296 /**
297 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
298 * </p>
299 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
300 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
301 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
302 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
303 * @return a stream of matches represented as a Match object.
304 *
305 */
306 public Stream<TimeMetric.Match> streamAllMatches(final Double pTime) {
307 return rawStreamAllMatches(new Object[]{pTime});
308 }
309
310 /**
311 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
312 * Neither determinism nor randomness of selection is guaranteed.
313 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
314 * @return a match represented as a Match object, or null if no match is found.
315 *
316 */
317 public Optional<TimeMetric.Match> getOneArbitraryMatch(final Double pTime) {
318 return rawGetOneArbitraryMatch(new Object[]{pTime});
319 }
320
321 /**
322 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
323 * under any possible substitution of the unspecified parameters (if any).
324 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
325 * @return true if the input is a valid (partial) match of the pattern.
326 *
327 */
328 public boolean hasMatch(final Double pTime) {
329 return rawHasMatch(new Object[]{pTime});
330 }
331
332 /**
333 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
334 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
335 * @return the number of pattern matches found.
336 *
337 */
338 public int countMatches(final Double pTime) {
339 return rawCountMatches(new Object[]{pTime});
340 }
341
342 /**
343 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
344 * Neither determinism nor randomness of selection is guaranteed.
345 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
346 * @param processor the action that will process the selected match.
347 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
348 *
349 */
350 public boolean forOneArbitraryMatch(final Double pTime, final Consumer<? super TimeMetric.Match> processor) {
351 return rawForOneArbitraryMatch(new Object[]{pTime}, processor);
352 }
353
354 /**
355 * Returns a new (partial) match.
356 * This can be used e.g. to call the matcher with a partial match.
357 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
358 * @param pTime the fixed value of pattern parameter Time, or null if not bound.
359 * @return the (partial) match object.
360 *
361 */
362 public TimeMetric.Match newMatch(final Double pTime) {
363 return TimeMetric.Match.newMatch(pTime);
364 }
365
366 /**
367 * Retrieve the set of values that occur in matches for Time.
368 * @return the Set of all values or empty set if there are no matches
369 *
370 */
371 protected Stream<Double> rawStreamAllValuesOfTime(final Object[] parameters) {
372 return rawStreamAllValues(POSITION_TIME, parameters).map(Double.class::cast);
373 }
374
375 /**
376 * Retrieve the set of values that occur in matches for Time.
377 * @return the Set of all values or empty set if there are no matches
378 *
379 */
380 public Set<Double> getAllValuesOfTime() {
381 return rawStreamAllValuesOfTime(emptyArray()).collect(Collectors.toSet());
382 }
383
384 /**
385 * Retrieve the set of values that occur in matches for Time.
386 * @return the Set of all values or empty set if there are no matches
387 *
388 */
389 public Stream<Double> streamAllValuesOfTime() {
390 return rawStreamAllValuesOfTime(emptyArray());
391 }
392
393 @Override
394 protected TimeMetric.Match tupleToMatch(final Tuple t) {
395 try {
396 return TimeMetric.Match.newMatch((Double) t.get(POSITION_TIME));
397 } catch(ClassCastException e) {
398 LOGGER.error("Element(s) in tuple not properly typed!",e);
399 return null;
400 }
401 }
402
403 @Override
404 protected TimeMetric.Match arrayToMatch(final Object[] match) {
405 try {
406 return TimeMetric.Match.newMatch((Double) match[POSITION_TIME]);
407 } catch(ClassCastException e) {
408 LOGGER.error("Element(s) in array not properly typed!",e);
409 return null;
410 }
411 }
412
413 @Override
414 protected TimeMetric.Match arrayToMatchMutable(final Object[] match) {
415 try {
416 return TimeMetric.Match.newMutableMatch((Double) match[POSITION_TIME]);
417 } catch(ClassCastException e) {
418 LOGGER.error("Element(s) in array not properly typed!",e);
419 return null;
420 }
421 }
422
423 /**
424 * @return the singleton instance of the query specification of this pattern
425 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
426 *
427 */
428 public static IQuerySpecification<TimeMetric.Matcher> querySpecification() {
429 return TimeMetric.instance();
430 }
431 }
432
433 private TimeMetric() {
434 super(GeneratedPQuery.INSTANCE);
435 }
436
437 /**
438 * @return the singleton instance of the query specification
439 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
440 *
441 */
442 public static TimeMetric instance() {
443 try{
444 return LazyHolder.INSTANCE;
445 } catch (ExceptionInInitializerError err) {
446 throw processInitializerError(err);
447 }
448 }
449
450 @Override
451 protected TimeMetric.Matcher instantiate(final ViatraQueryEngine engine) {
452 return TimeMetric.Matcher.on(engine);
453 }
454
455 @Override
456 public TimeMetric.Matcher instantiate() {
457 return TimeMetric.Matcher.create();
458 }
459
460 @Override
461 public TimeMetric.Match newEmptyMatch() {
462 return TimeMetric.Match.newEmptyMatch();
463 }
464
465 @Override
466 public TimeMetric.Match newMatch(final Object... parameters) {
467 return TimeMetric.Match.newMatch((java.lang.Double) parameters[0]);
468 }
469
470 /**
471 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric (visibility: PUBLIC, simpleName: TimeMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
472 * <b>not</b> at the class load time of the outer class,
473 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric (visibility: PUBLIC, simpleName: TimeMetric, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
474 *
475 * <p> This workaround is required e.g. to support recursion.
476 *
477 */
478 private static class LazyHolder {
479 private static final TimeMetric INSTANCE = new TimeMetric();
480
481 /**
482 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
483 * This initialization order is required to support indirect recursion.
484 *
485 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
486 *
487 */
488 private static final Object STATIC_INITIALIZER = ensureInitialized();
489
490 public static Object ensureInitialized() {
491 INSTANCE.ensureInitializedInternal();
492 return null;
493 }
494 }
495
496 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
497 private static final TimeMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery();
498
499 private final PParameter parameter_Time = new PParameter("Time", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
500
501 private final List<PParameter> parameters = Arrays.asList(parameter_Time);
502
503 private GeneratedPQuery() {
504 super(PVisibility.PUBLIC);
505 }
506
507 @Override
508 public String getFullyQualifiedName() {
509 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.timeMetric";
510 }
511
512 @Override
513 public List<String> getParameterNames() {
514 return Arrays.asList("Time");
515 }
516
517 @Override
518 public List<PParameter> getParameters() {
519 return parameters;
520 }
521
522 @Override
523 public Set<PBody> doGetContainedBodies() {
524 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
525 Set<PBody> bodies = new LinkedHashSet<>();
526 {
527 PBody body = new PBody(this);
528 PVariable var_Time = body.getOrCreateVariableByName("Time");
529 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
530 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
531 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Time), new JavaTransitiveInstancesKey(java.lang.Double.class));
532 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
533 new ExportedParameter(body, var_Time, parameter_Time)
534 ));
535 // Time == sum find missionTime(_, #_)
536 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
537 new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), MissionTime.instance().getInternalQueryRepresentation(), var__virtual_0_, 1);
538 new Equality(body, var_Time, var__virtual_0_);
539 bodies.add(body);
540 }
541 return bodies;
542 }
543 }
544}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AdditionalCommSubsystemCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AdditionalCommSubsystemCost.java
new file mode 100644
index 00000000..293fdbe0
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/AdditionalCommSubsystemCost.java
@@ -0,0 +1,173 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
26import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
27import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
28import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
29import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
30
31/**
32 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
33 *
34 * <p>Original source:
35 * <code><pre>
36 * private pattern additionalCommSubsystemCost(Spacecraft : Spacecraft, Cost : java Double) {
37 * find spacecraftWithTwoCommSubsystems(Spacecraft);
38 * Cost == 100000.0;
39 * } or {
40 * neg find spacecraftWithTwoCommSubsystems(Spacecraft);
41 * Cost == 0.0;
42 * }
43 * </pre></code>
44 *
45 * @see GenericPatternMatcher
46 * @see GenericPatternMatch
47 *
48 */
49@SuppressWarnings("all")
50public final class AdditionalCommSubsystemCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
51 private AdditionalCommSubsystemCost() {
52 super(GeneratedPQuery.INSTANCE);
53 }
54
55 /**
56 * @return the singleton instance of the query specification
57 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
58 *
59 */
60 public static AdditionalCommSubsystemCost instance() {
61 try{
62 return LazyHolder.INSTANCE;
63 } catch (ExceptionInInitializerError err) {
64 throw processInitializerError(err);
65 }
66 }
67
68 /**
69 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost (visibility: PUBLIC, simpleName: AdditionalCommSubsystemCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
70 * <b>not</b> at the class load time of the outer class,
71 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost (visibility: PUBLIC, simpleName: AdditionalCommSubsystemCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
72 *
73 * <p> This workaround is required e.g. to support recursion.
74 *
75 */
76 private static class LazyHolder {
77 private static final AdditionalCommSubsystemCost INSTANCE = new AdditionalCommSubsystemCost();
78
79 /**
80 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
81 * This initialization order is required to support indirect recursion.
82 *
83 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
84 *
85 */
86 private static final Object STATIC_INITIALIZER = ensureInitialized();
87
88 public static Object ensureInitialized() {
89 INSTANCE.ensureInitializedInternal();
90 return null;
91 }
92 }
93
94 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
95 private static final AdditionalCommSubsystemCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
96
97 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
98
99 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
100
101 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_Cost);
102
103 private GeneratedPQuery() {
104 super(PVisibility.PRIVATE);
105 }
106
107 @Override
108 public String getFullyQualifiedName() {
109 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.additionalCommSubsystemCost";
110 }
111
112 @Override
113 public List<String> getParameterNames() {
114 return Arrays.asList("Spacecraft","Cost");
115 }
116
117 @Override
118 public List<PParameter> getParameters() {
119 return parameters;
120 }
121
122 @Override
123 public Set<PBody> doGetContainedBodies() {
124 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
125 Set<PBody> bodies = new LinkedHashSet<>();
126 {
127 PBody body = new PBody(this);
128 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
129 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
131 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
132 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
133 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
134 new ExportedParameter(body, var_Cost, parameter_Cost)
135 ));
136 // find spacecraftWithTwoCommSubsystems(Spacecraft)
137 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft), SpacecraftWithTwoCommSubsystems.instance().getInternalQueryRepresentation());
138 // Cost == 100000.0
139 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
140 new ConstantValue(body, var__virtual_0_, 100000.0);
141 new Equality(body, var_Cost, var__virtual_0_);
142 bodies.add(body);
143 }
144 {
145 PBody body = new PBody(this);
146 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
147 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
148 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
149 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
150 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
151 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
152 new ExportedParameter(body, var_Cost, parameter_Cost)
153 ));
154 // neg find spacecraftWithTwoCommSubsystems(Spacecraft)
155 new NegativePatternCall(body, Tuples.flatTupleOf(var_Spacecraft), SpacecraftWithTwoCommSubsystems.instance().getInternalQueryRepresentation());
156 // Cost == 0.0
157 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
158 new ConstantValue(body, var__virtual_0_, 0.0);
159 new Equality(body, var_Cost, var__virtual_0_);
160 bodies.add(body);
161 }
162 return bodies;
163 }
164 }
165
166 private static double evaluateExpression_1_1() {
167 return 100000.0;
168 }
169
170 private static double evaluateExpression_2_1() {
171 return 0.0;
172 }
173}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java
new file mode 100644
index 00000000..833148f9
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/BasePrice.java
@@ -0,0 +1,195 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
13import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
14import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
15import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
18import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
26import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
27
28/**
29 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
30 *
31 * <p>Original source:
32 * <code><pre>
33 * private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) {
34 * CubeSat3U(Spacecraft);
35 * BasePrice == 250000.0;
36 * } or {
37 * CubeSat6U(Spacecraft);
38 * BasePrice == 750000.0;
39 * } or {
40 * SmallSat(Spacecraft);
41 * BasePrice == 3000000.0;
42 * }
43 * </pre></code>
44 *
45 * @see GenericPatternMatcher
46 * @see GenericPatternMatch
47 *
48 */
49@SuppressWarnings("all")
50public final class BasePrice extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
51 private BasePrice() {
52 super(GeneratedPQuery.INSTANCE);
53 }
54
55 /**
56 * @return the singleton instance of the query specification
57 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
58 *
59 */
60 public static BasePrice instance() {
61 try{
62 return LazyHolder.INSTANCE;
63 } catch (ExceptionInInitializerError err) {
64 throw processInitializerError(err);
65 }
66 }
67
68 /**
69 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice (visibility: PUBLIC, simpleName: BasePrice, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
70 * <b>not</b> at the class load time of the outer class,
71 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice (visibility: PUBLIC, simpleName: BasePrice, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
72 *
73 * <p> This workaround is required e.g. to support recursion.
74 *
75 */
76 private static class LazyHolder {
77 private static final BasePrice INSTANCE = new BasePrice();
78
79 /**
80 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
81 * This initialization order is required to support indirect recursion.
82 *
83 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
84 *
85 */
86 private static final Object STATIC_INITIALIZER = ensureInitialized();
87
88 public static Object ensureInitialized() {
89 INSTANCE.ensureInitializedInternal();
90 return null;
91 }
92 }
93
94 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
95 private static final BasePrice.GeneratedPQuery INSTANCE = new GeneratedPQuery();
96
97 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
98
99 private final PParameter parameter_BasePrice = new PParameter("BasePrice", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
100
101 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_BasePrice);
102
103 private GeneratedPQuery() {
104 super(PVisibility.PRIVATE);
105 }
106
107 @Override
108 public String getFullyQualifiedName() {
109 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.basePrice";
110 }
111
112 @Override
113 public List<String> getParameterNames() {
114 return Arrays.asList("Spacecraft","BasePrice");
115 }
116
117 @Override
118 public List<PParameter> getParameters() {
119 return parameters;
120 }
121
122 @Override
123 public Set<PBody> doGetContainedBodies() {
124 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
125 Set<PBody> bodies = new LinkedHashSet<>();
126 {
127 PBody body = new PBody(this);
128 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
129 PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice");
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
131 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class));
132 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
133 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
134 new ExportedParameter(body, var_BasePrice, parameter_BasePrice)
135 ));
136 // CubeSat3U(Spacecraft)
137 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat3U")));
138 // BasePrice == 250000.0
139 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
140 new ConstantValue(body, var__virtual_0_, 250000.0);
141 new Equality(body, var_BasePrice, var__virtual_0_);
142 bodies.add(body);
143 }
144 {
145 PBody body = new PBody(this);
146 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
147 PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice");
148 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
149 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class));
150 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
151 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
152 new ExportedParameter(body, var_BasePrice, parameter_BasePrice)
153 ));
154 // CubeSat6U(Spacecraft)
155 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CubeSat6U")));
156 // BasePrice == 750000.0
157 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
158 new ConstantValue(body, var__virtual_0_, 750000.0);
159 new Equality(body, var_BasePrice, var__virtual_0_);
160 bodies.add(body);
161 }
162 {
163 PBody body = new PBody(this);
164 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
165 PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice");
166 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
167 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_BasePrice), new JavaTransitiveInstancesKey(java.lang.Double.class));
168 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
169 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
170 new ExportedParameter(body, var_BasePrice, parameter_BasePrice)
171 ));
172 // SmallSat(Spacecraft)
173 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "SmallSat")));
174 // BasePrice == 3000000.0
175 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
176 new ConstantValue(body, var__virtual_0_, 3000000.0);
177 new Equality(body, var_BasePrice, var__virtual_0_);
178 bodies.add(body);
179 }
180 return bodies;
181 }
182 }
183
184 private static double evaluateExpression_1_1() {
185 return 250000.0;
186 }
187
188 private static double evaluateExpression_2_1() {
189 return 750000.0;
190 }
191
192 private static double evaluateExpression_3_1() {
193 return 3000000.0;
194 }
195}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IncomingData.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IncomingData.java
new file mode 100644
index 00000000..4d18f028
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/IncomingData.java
@@ -0,0 +1,145 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink;
7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData;
8import java.util.Arrays;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Set;
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
17import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
19import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
26import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
27import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
28
29/**
30 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
31 *
32 * <p>Original source:
33 * <code><pre>
34 * private pattern incomingData(Spacecraft : Spacecraft, Source : Spacecraft, Data : java Double) {
35 * find indirectCommunicationLink(Source, Spacecraft);
36 * find scienceData(Source, Data);
37 * }
38 * </pre></code>
39 *
40 * @see GenericPatternMatcher
41 * @see GenericPatternMatch
42 *
43 */
44@SuppressWarnings("all")
45public final class IncomingData extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
46 private IncomingData() {
47 super(GeneratedPQuery.INSTANCE);
48 }
49
50 /**
51 * @return the singleton instance of the query specification
52 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
53 *
54 */
55 public static IncomingData instance() {
56 try{
57 return LazyHolder.INSTANCE;
58 } catch (ExceptionInInitializerError err) {
59 throw processInitializerError(err);
60 }
61 }
62
63 /**
64 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData (visibility: PUBLIC, simpleName: IncomingData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
65 * <b>not</b> at the class load time of the outer class,
66 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData (visibility: PUBLIC, simpleName: IncomingData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
67 *
68 * <p> This workaround is required e.g. to support recursion.
69 *
70 */
71 private static class LazyHolder {
72 private static final IncomingData INSTANCE = new IncomingData();
73
74 /**
75 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
76 * This initialization order is required to support indirect recursion.
77 *
78 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
79 *
80 */
81 private static final Object STATIC_INITIALIZER = ensureInitialized();
82
83 public static Object ensureInitialized() {
84 INSTANCE.ensureInitializedInternal();
85 return null;
86 }
87 }
88
89 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
90 private static final IncomingData.GeneratedPQuery INSTANCE = new GeneratedPQuery();
91
92 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
93
94 private final PParameter parameter_Source = new PParameter("Source", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
95
96 private final PParameter parameter_Data = new PParameter("Data", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
97
98 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_Source, parameter_Data);
99
100 private GeneratedPQuery() {
101 super(PVisibility.PRIVATE);
102 }
103
104 @Override
105 public String getFullyQualifiedName() {
106 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incomingData";
107 }
108
109 @Override
110 public List<String> getParameterNames() {
111 return Arrays.asList("Spacecraft","Source","Data");
112 }
113
114 @Override
115 public List<PParameter> getParameters() {
116 return parameters;
117 }
118
119 @Override
120 public Set<PBody> doGetContainedBodies() {
121 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
122 Set<PBody> bodies = new LinkedHashSet<>();
123 {
124 PBody body = new PBody(this);
125 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
126 PVariable var_Source = body.getOrCreateVariableByName("Source");
127 PVariable var_Data = body.getOrCreateVariableByName("Data");
128 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
129 new TypeConstraint(body, Tuples.flatTupleOf(var_Source), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
130 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Data), new JavaTransitiveInstancesKey(java.lang.Double.class));
131 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
132 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
133 new ExportedParameter(body, var_Source, parameter_Source),
134 new ExportedParameter(body, var_Data, parameter_Data)
135 ));
136 // find indirectCommunicationLink(Source, Spacecraft)
137 new PositivePatternCall(body, Tuples.flatTupleOf(var_Source, var_Spacecraft), IndirectCommunicationLink.instance().getInternalQueryRepresentation());
138 // find scienceData(Source, Data)
139 new PositivePatternCall(body, Tuples.flatTupleOf(var_Source, var_Data), ScienceData.instance().getInternalQueryRepresentation());
140 bodies.add(body);
141 }
142 return bodies;
143 }
144 }
145}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/InterferometryPayloadCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/InterferometryPayloadCost.java
new file mode 100644
index 00000000..535f32d9
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/InterferometryPayloadCost.java
@@ -0,0 +1,175 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
26import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
27import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
28import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
29import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
30
31/**
32 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
33 *
34 * <p>Original source:
35 * <code><pre>
36 * private pattern interferometryPayloadCost(Spacecraft : Spacecraft, Cost : java Double) {
37 * find spacecraftWithInterferometryPayload(_, Spacecraft);
38 * Cost == 50000.0;
39 * } or {
40 * neg find spacecraftWithInterferometryPayload(_, Spacecraft);
41 * Cost == 0.0;
42 * }
43 * </pre></code>
44 *
45 * @see GenericPatternMatcher
46 * @see GenericPatternMatch
47 *
48 */
49@SuppressWarnings("all")
50public final class InterferometryPayloadCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
51 private InterferometryPayloadCost() {
52 super(GeneratedPQuery.INSTANCE);
53 }
54
55 /**
56 * @return the singleton instance of the query specification
57 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
58 *
59 */
60 public static InterferometryPayloadCost instance() {
61 try{
62 return LazyHolder.INSTANCE;
63 } catch (ExceptionInInitializerError err) {
64 throw processInitializerError(err);
65 }
66 }
67
68 /**
69 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost (visibility: PUBLIC, simpleName: InterferometryPayloadCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
70 * <b>not</b> at the class load time of the outer class,
71 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost (visibility: PUBLIC, simpleName: InterferometryPayloadCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
72 *
73 * <p> This workaround is required e.g. to support recursion.
74 *
75 */
76 private static class LazyHolder {
77 private static final InterferometryPayloadCost INSTANCE = new InterferometryPayloadCost();
78
79 /**
80 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
81 * This initialization order is required to support indirect recursion.
82 *
83 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
84 *
85 */
86 private static final Object STATIC_INITIALIZER = ensureInitialized();
87
88 public static Object ensureInitialized() {
89 INSTANCE.ensureInitializedInternal();
90 return null;
91 }
92 }
93
94 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
95 private static final InterferometryPayloadCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
96
97 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
98
99 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
100
101 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_Cost);
102
103 private GeneratedPQuery() {
104 super(PVisibility.PRIVATE);
105 }
106
107 @Override
108 public String getFullyQualifiedName() {
109 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.interferometryPayloadCost";
110 }
111
112 @Override
113 public List<String> getParameterNames() {
114 return Arrays.asList("Spacecraft","Cost");
115 }
116
117 @Override
118 public List<PParameter> getParameters() {
119 return parameters;
120 }
121
122 @Override
123 public Set<PBody> doGetContainedBodies() {
124 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
125 Set<PBody> bodies = new LinkedHashSet<>();
126 {
127 PBody body = new PBody(this);
128 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
129 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
130 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
131 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
132 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
133 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
134 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
135 new ExportedParameter(body, var_Cost, parameter_Cost)
136 ));
137 // find spacecraftWithInterferometryPayload(_, Spacecraft)
138 new PositivePatternCall(body, Tuples.flatTupleOf(var___0_, var_Spacecraft), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation());
139 // Cost == 50000.0
140 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
141 new ConstantValue(body, var__virtual_0_, 50000.0);
142 new Equality(body, var_Cost, var__virtual_0_);
143 bodies.add(body);
144 }
145 {
146 PBody body = new PBody(this);
147 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
148 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
149 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
150 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
151 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
152 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
153 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
154 new ExportedParameter(body, var_Cost, parameter_Cost)
155 ));
156 // neg find spacecraftWithInterferometryPayload(_, Spacecraft)
157 new NegativePatternCall(body, Tuples.flatTupleOf(var___0_, var_Spacecraft), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation());
158 // Cost == 0.0
159 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
160 new ConstantValue(body, var__virtual_0_, 0.0);
161 new Equality(body, var_Cost, var__virtual_0_);
162 bodies.add(body);
163 }
164 return bodies;
165 }
166 }
167
168 private static double evaluateExpression_1_1() {
169 return 50000.0;
170 }
171
172 private static double evaluateExpression_2_1() {
173 return 0.0;
174 }
175}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCost.java
new file mode 100644
index 00000000..c3389e11
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCost.java
@@ -0,0 +1,183 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.EDataType;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
19import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
20import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
21import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
22import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
23import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
24import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
35
36/**
37 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
38 *
39 * <p>Original source:
40 * <code><pre>
41 * private pattern missionCost(Mission : InterferometryMission, Cost : java Double) {
42 * InterferometryMission.observationTime(Mission, ObservationTime);
43 * SpacecraftCost == sum find spacecraftCost(Mission, _, #_);
44 * Cost == eval(SpacecraftCost + 100000.0 ObservationTime);
45 * }
46 * </pre></code>
47 *
48 * @see GenericPatternMatcher
49 * @see GenericPatternMatch
50 *
51 */
52@SuppressWarnings("all")
53public final class MissionCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
54 private MissionCost() {
55 super(GeneratedPQuery.INSTANCE);
56 }
57
58 /**
59 * @return the singleton instance of the query specification
60 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
61 *
62 */
63 public static MissionCost instance() {
64 try{
65 return LazyHolder.INSTANCE;
66 } catch (ExceptionInInitializerError err) {
67 throw processInitializerError(err);
68 }
69 }
70
71 /**
72 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost (visibility: PUBLIC, simpleName: MissionCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
73 * <b>not</b> at the class load time of the outer class,
74 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost (visibility: PUBLIC, simpleName: MissionCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
75 *
76 * <p> This workaround is required e.g. to support recursion.
77 *
78 */
79 private static class LazyHolder {
80 private static final MissionCost INSTANCE = new MissionCost();
81
82 /**
83 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
84 * This initialization order is required to support indirect recursion.
85 *
86 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
87 *
88 */
89 private static final Object STATIC_INITIALIZER = ensureInitialized();
90
91 public static Object ensureInitialized() {
92 INSTANCE.ensureInitializedInternal();
93 return null;
94 }
95 }
96
97 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
98 private static final MissionCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
99
100 private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
101
102 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
103
104 private final List<PParameter> parameters = Arrays.asList(parameter_Mission, parameter_Cost);
105
106 private GeneratedPQuery() {
107 super(PVisibility.PRIVATE);
108 }
109
110 @Override
111 public String getFullyQualifiedName() {
112 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.missionCost";
113 }
114
115 @Override
116 public List<String> getParameterNames() {
117 return Arrays.asList("Mission","Cost");
118 }
119
120 @Override
121 public List<PParameter> getParameters() {
122 return parameters;
123 }
124
125 @Override
126 public Set<PBody> doGetContainedBodies() {
127 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
128 Set<PBody> bodies = new LinkedHashSet<>();
129 {
130 PBody body = new PBody(this);
131 PVariable var_Mission = body.getOrCreateVariableByName("Mission");
132 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
133 PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
134 PVariable var_SpacecraftCost = body.getOrCreateVariableByName("SpacecraftCost");
135 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
136 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
137 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
138 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
139 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
140 new ExportedParameter(body, var_Mission, parameter_Mission),
141 new ExportedParameter(body, var_Cost, parameter_Cost)
142 ));
143 // InterferometryMission.observationTime(Mission, ObservationTime)
144 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
145 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
146 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "InterferometryMission", "observationTime")));
147 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
148 new Equality(body, var__virtual_0_, var_ObservationTime);
149 // SpacecraftCost == sum find spacecraftCost(Mission, _, #_)
150 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
151 new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var_Mission, var___0_, var___1_), SpacecraftCost.instance().getInternalQueryRepresentation(), var__virtual_1_, 2);
152 new Equality(body, var_SpacecraftCost, var__virtual_1_);
153 // Cost == eval(SpacecraftCost + 100000.0 * ObservationTime)
154 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
155 new ExpressionEvaluation(body, new IExpressionEvaluator() {
156
157 @Override
158 public String getShortDescription() {
159 return "Expression evaluation from pattern missionCost";
160 }
161
162 @Override
163 public Iterable<String> getInputParameterNames() {
164 return Arrays.asList("ObservationTime", "SpacecraftCost");}
165
166 @Override
167 public Object evaluateExpression(IValueProvider provider) throws Exception {
168 Float ObservationTime = (Float) provider.getValue("ObservationTime");
169 Double SpacecraftCost = (Double) provider.getValue("SpacecraftCost");
170 return evaluateExpression_1_1(ObservationTime, SpacecraftCost);
171 }
172 }, var__virtual_2_ );
173 new Equality(body, var_Cost, var__virtual_2_);
174 bodies.add(body);
175 }
176 return bodies;
177 }
178 }
179
180 private static double evaluateExpression_1_1(final Float ObservationTime, final Double SpacecraftCost) {
181 return ((SpacecraftCost).doubleValue() + (100000.0 * (ObservationTime).floatValue()));
182 }
183}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCoverage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCoverage.java
new file mode 100644
index 00000000..639d82ef
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionCoverage.java
@@ -0,0 +1,183 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.EDataType;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
19import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
20import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
21import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
22import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
23import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
33import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
34
35/**
36 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
37 *
38 * <p>Original source:
39 * <code><pre>
40 * private pattern missionCoverage(Mission : InterferometryMission, Coverage : java Double) {
41 * InterferometryMission.observationTime(Mission, ObservationTime);
42 * ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _);
43 * Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 (1.0 / ObservationTime)) + 0.05 ObservationTime / 3);
44 * }
45 * </pre></code>
46 *
47 * @see GenericPatternMatcher
48 * @see GenericPatternMatch
49 *
50 */
51@SuppressWarnings("all")
52public final class MissionCoverage extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
53 private MissionCoverage() {
54 super(GeneratedPQuery.INSTANCE);
55 }
56
57 /**
58 * @return the singleton instance of the query specification
59 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
60 *
61 */
62 public static MissionCoverage instance() {
63 try{
64 return LazyHolder.INSTANCE;
65 } catch (ExceptionInInitializerError err) {
66 throw processInitializerError(err);
67 }
68 }
69
70 /**
71 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage (visibility: PUBLIC, simpleName: MissionCoverage, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
72 * <b>not</b> at the class load time of the outer class,
73 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage (visibility: PUBLIC, simpleName: MissionCoverage, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
74 *
75 * <p> This workaround is required e.g. to support recursion.
76 *
77 */
78 private static class LazyHolder {
79 private static final MissionCoverage INSTANCE = new MissionCoverage();
80
81 /**
82 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
83 * This initialization order is required to support indirect recursion.
84 *
85 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
86 *
87 */
88 private static final Object STATIC_INITIALIZER = ensureInitialized();
89
90 public static Object ensureInitialized() {
91 INSTANCE.ensureInitializedInternal();
92 return null;
93 }
94 }
95
96 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
97 private static final MissionCoverage.GeneratedPQuery INSTANCE = new GeneratedPQuery();
98
99 private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
100
101 private final PParameter parameter_Coverage = new PParameter("Coverage", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
102
103 private final List<PParameter> parameters = Arrays.asList(parameter_Mission, parameter_Coverage);
104
105 private GeneratedPQuery() {
106 super(PVisibility.PRIVATE);
107 }
108
109 @Override
110 public String getFullyQualifiedName() {
111 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.missionCoverage";
112 }
113
114 @Override
115 public List<String> getParameterNames() {
116 return Arrays.asList("Mission","Coverage");
117 }
118
119 @Override
120 public List<PParameter> getParameters() {
121 return parameters;
122 }
123
124 @Override
125 public Set<PBody> doGetContainedBodies() {
126 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
127 Set<PBody> bodies = new LinkedHashSet<>();
128 {
129 PBody body = new PBody(this);
130 PVariable var_Mission = body.getOrCreateVariableByName("Mission");
131 PVariable var_Coverage = body.getOrCreateVariableByName("Coverage");
132 PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
133 PVariable var_ObserverCount = body.getOrCreateVariableByName("ObserverCount");
134 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
135 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
136 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Coverage), new JavaTransitiveInstancesKey(java.lang.Double.class));
137 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
138 new ExportedParameter(body, var_Mission, parameter_Mission),
139 new ExportedParameter(body, var_Coverage, parameter_Coverage)
140 ));
141 // InterferometryMission.observationTime(Mission, ObservationTime)
142 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
143 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
144 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "InterferometryMission", "observationTime")));
145 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
146 new Equality(body, var__virtual_0_, var_ObservationTime);
147 // ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _)
148 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
149 new PatternMatchCounter(body, Tuples.flatTupleOf(var_Mission, var___0_), SpacecraftWithInterferometryPayload.instance().getInternalQueryRepresentation(), var__virtual_1_);
150 new Equality(body, var_ObserverCount, var__virtual_1_);
151 // Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 * (1.0 / ObservationTime)) + 0.05 * ObservationTime / 3)
152 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
153 new ExpressionEvaluation(body, new IExpressionEvaluator() {
154
155 @Override
156 public String getShortDescription() {
157 return "Expression evaluation from pattern missionCoverage";
158 }
159
160 @Override
161 public Iterable<String> getInputParameterNames() {
162 return Arrays.asList("ObservationTime", "ObserverCount");}
163
164 @Override
165 public Object evaluateExpression(IValueProvider provider) throws Exception {
166 Float ObservationTime = (Float) provider.getValue("ObservationTime");
167 Integer ObserverCount = (Integer) provider.getValue("ObserverCount");
168 return evaluateExpression_1_1(ObservationTime, ObserverCount);
169 }
170 }, var__virtual_2_ );
171 new Equality(body, var_Coverage, var__virtual_2_);
172 bodies.add(body);
173 }
174 return bodies;
175 }
176 }
177
178 private static double evaluateExpression_1_1(final Float ObservationTime, final Integer ObserverCount) {
179 double _pow = Math.pow((1 - (2.0 / (ObserverCount).intValue())), (1 + (9 * (1.0 / (ObservationTime).floatValue()))));
180 double _plus = (_pow + ((0.05 * (ObservationTime).floatValue()) / 3));
181 return _plus;
182 }
183}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionTime.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionTime.java
new file mode 100644
index 00000000..5e610441
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/MissionTime.java
@@ -0,0 +1,183 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.EDataType;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
19import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
20import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
21import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
22import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
23import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
24import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
34import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
35
36/**
37 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
38 *
39 * <p>Original source:
40 * <code><pre>
41 * private pattern missionTime(Mission : InterferometryMission, Time : java Double) {
42 * InterferometryMission.observationTime(Mission, ObservationTime);
43 * TrasmitTime == sum find transmitTime(Mission, _, #_);
44 * Time == eval(TrasmitTime + 60.0 ObservationTime);
45 * }
46 * </pre></code>
47 *
48 * @see GenericPatternMatcher
49 * @see GenericPatternMatch
50 *
51 */
52@SuppressWarnings("all")
53public final class MissionTime extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
54 private MissionTime() {
55 super(GeneratedPQuery.INSTANCE);
56 }
57
58 /**
59 * @return the singleton instance of the query specification
60 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
61 *
62 */
63 public static MissionTime instance() {
64 try{
65 return LazyHolder.INSTANCE;
66 } catch (ExceptionInInitializerError err) {
67 throw processInitializerError(err);
68 }
69 }
70
71 /**
72 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime (visibility: PUBLIC, simpleName: MissionTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
73 * <b>not</b> at the class load time of the outer class,
74 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime (visibility: PUBLIC, simpleName: MissionTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
75 *
76 * <p> This workaround is required e.g. to support recursion.
77 *
78 */
79 private static class LazyHolder {
80 private static final MissionTime INSTANCE = new MissionTime();
81
82 /**
83 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
84 * This initialization order is required to support indirect recursion.
85 *
86 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
87 *
88 */
89 private static final Object STATIC_INITIALIZER = ensureInitialized();
90
91 public static Object ensureInitialized() {
92 INSTANCE.ensureInitializedInternal();
93 return null;
94 }
95 }
96
97 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
98 private static final MissionTime.GeneratedPQuery INSTANCE = new GeneratedPQuery();
99
100 private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
101
102 private final PParameter parameter_Time = new PParameter("Time", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
103
104 private final List<PParameter> parameters = Arrays.asList(parameter_Mission, parameter_Time);
105
106 private GeneratedPQuery() {
107 super(PVisibility.PRIVATE);
108 }
109
110 @Override
111 public String getFullyQualifiedName() {
112 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.missionTime";
113 }
114
115 @Override
116 public List<String> getParameterNames() {
117 return Arrays.asList("Mission","Time");
118 }
119
120 @Override
121 public List<PParameter> getParameters() {
122 return parameters;
123 }
124
125 @Override
126 public Set<PBody> doGetContainedBodies() {
127 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
128 Set<PBody> bodies = new LinkedHashSet<>();
129 {
130 PBody body = new PBody(this);
131 PVariable var_Mission = body.getOrCreateVariableByName("Mission");
132 PVariable var_Time = body.getOrCreateVariableByName("Time");
133 PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
134 PVariable var_TrasmitTime = body.getOrCreateVariableByName("TrasmitTime");
135 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
136 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
137 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
138 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Time), new JavaTransitiveInstancesKey(java.lang.Double.class));
139 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
140 new ExportedParameter(body, var_Mission, parameter_Mission),
141 new ExportedParameter(body, var_Time, parameter_Time)
142 ));
143 // InterferometryMission.observationTime(Mission, ObservationTime)
144 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
145 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
146 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "InterferometryMission", "observationTime")));
147 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
148 new Equality(body, var__virtual_0_, var_ObservationTime);
149 // TrasmitTime == sum find transmitTime(Mission, _, #_)
150 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
151 new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var_Mission, var___0_, var___1_), TransmitTime.instance().getInternalQueryRepresentation(), var__virtual_1_, 2);
152 new Equality(body, var_TrasmitTime, var__virtual_1_);
153 // Time == eval(TrasmitTime + 60.0 * ObservationTime)
154 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
155 new ExpressionEvaluation(body, new IExpressionEvaluator() {
156
157 @Override
158 public String getShortDescription() {
159 return "Expression evaluation from pattern missionTime";
160 }
161
162 @Override
163 public Iterable<String> getInputParameterNames() {
164 return Arrays.asList("ObservationTime", "TrasmitTime");}
165
166 @Override
167 public Object evaluateExpression(IValueProvider provider) throws Exception {
168 Float ObservationTime = (Float) provider.getValue("ObservationTime");
169 Double TrasmitTime = (Double) provider.getValue("TrasmitTime");
170 return evaluateExpression_1_1(ObservationTime, TrasmitTime);
171 }
172 }, var__virtual_2_ );
173 new Equality(body, var_Time, var__virtual_2_);
174 bodies.add(body);
175 }
176 return bodies;
177 }
178 }
179
180 private static double evaluateExpression_1_1(final Float ObservationTime, final Double TrasmitTime) {
181 return ((TrasmitTime).doubleValue() + (60.0 * (ObservationTime).floatValue()));
182 }
183}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java
index 36fa4557..e474ddf1 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SatelliteQueriesAll.java
@@ -5,6 +5,8 @@ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement; 6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLinkDoesNotStartAtContainingElement;
7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop; 7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CommunicationLoop;
8import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric;
9import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CoverageMetric;
8import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna; 10import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CubeSatWithKaAntenna;
9import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand; 11import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetBand;
10import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetGain; 12import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.IncompatibleSourceAndTargetGain;
@@ -15,9 +17,12 @@ import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.NotEnoughInterferome
15import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat; 17import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SmallSat;
16import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SpacecraftOfKind; 18import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SpacecraftOfKind;
17import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink; 19import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.ThreeUCubeSatWithNonUhfCrossLink;
20import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.TimeMetric;
18import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.UhfAntennaGainNotLow; 21import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.UhfAntennaGainNotLow;
19import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.XAntennaGainNotMedium; 22import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.XAntennaGainNotMedium;
23import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost;
20import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads; 24import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AtLeastTwoInterferometryPayloads;
25import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice;
21import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBand; 26import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBand;
22import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf; 27import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemBandUhf;
23import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemGain; 28import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsystemGain;
@@ -26,11 +31,22 @@ import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CommSubsyst
26import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U; 31import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.CubeSat3U;
27import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink; 32import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.DirectCommunicationLink;
28import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork; 33import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.GroundStationNetwork;
34import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData;
29import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink; 35import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectCommunicationLink;
30import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed; 36import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IndirectLinkAllowed;
37import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost;
31import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed; 38import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.LinkAllowed;
32import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna; 39import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MatchingAntenna;
40import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCost;
41import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionCoverage;
42import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.MissionTime;
43import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData;
44import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost;
45import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink;
33import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload; 46import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithInterferometryPayload;
47import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems;
48import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate;
49import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime;
34import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; 50import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
35 51
36/** 52/**
@@ -67,6 +83,22 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
67 * <li>cubeSatWithKaAntenna</li> 83 * <li>cubeSatWithKaAntenna</li>
68 * <li>smallSat</li> 84 * <li>smallSat</li>
69 * <li>spacecraftOfKind</li> 85 * <li>spacecraftOfKind</li>
86 * <li>coverageMetric</li>
87 * <li>missionCoverage</li>
88 * <li>timeMetric</li>
89 * <li>missionTime</li>
90 * <li>transmitTime</li>
91 * <li>incomingData</li>
92 * <li>scienceData</li>
93 * <li>transmitRate</li>
94 * <li>spacecraftUplink</li>
95 * <li>costMetric</li>
96 * <li>missionCost</li>
97 * <li>spacecraftCost</li>
98 * <li>basePrice</li>
99 * <li>interferometryPayloadCost</li>
100 * <li>additionalCommSubsystemCost</li>
101 * <li>spacecraftWithTwoCommSubsystems</li>
70 * </ul> 102 * </ul>
71 * 103 *
72 * @see IQueryGroup 104 * @see IQueryGroup
@@ -119,5 +151,21 @@ public final class SatelliteQueriesAll extends BaseGeneratedPatternGroup {
119 querySpecifications.add(CubeSatWithKaAntenna.instance()); 151 querySpecifications.add(CubeSatWithKaAntenna.instance());
120 querySpecifications.add(SmallSat.instance()); 152 querySpecifications.add(SmallSat.instance());
121 querySpecifications.add(SpacecraftOfKind.instance()); 153 querySpecifications.add(SpacecraftOfKind.instance());
154 querySpecifications.add(CoverageMetric.instance());
155 querySpecifications.add(MissionCoverage.instance());
156 querySpecifications.add(TimeMetric.instance());
157 querySpecifications.add(MissionTime.instance());
158 querySpecifications.add(TransmitTime.instance());
159 querySpecifications.add(IncomingData.instance());
160 querySpecifications.add(ScienceData.instance());
161 querySpecifications.add(TransmitRate.instance());
162 querySpecifications.add(SpacecraftUplink.instance());
163 querySpecifications.add(CostMetric.instance());
164 querySpecifications.add(MissionCost.instance());
165 querySpecifications.add(SpacecraftCost.instance());
166 querySpecifications.add(BasePrice.instance());
167 querySpecifications.add(InterferometryPayloadCost.instance());
168 querySpecifications.add(AdditionalCommSubsystemCost.instance());
169 querySpecifications.add(SpacecraftWithTwoCommSubsystems.instance());
122 } 170 }
123} 171}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/ScienceData.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/ScienceData.java
new file mode 100644
index 00000000..bb262a0b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/ScienceData.java
@@ -0,0 +1,179 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.emf.ecore.EDataType;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
16import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
17import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
18import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
19import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
20import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
21import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
22import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
28import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
29import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
30import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
31import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
32
33/**
34 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
35 *
36 * <p>Original source:
37 * <code><pre>
38 * private pattern scienceData(Spacecraft : Spacecraft, Data : java Double) {
39 * ConstellationMission.spacecraft(Mission, Spacecraft);
40 * InterferometryMission.observationTime(Mission, ObservationTime);
41 * Data == eval(12.0 ObservationTime);
42 * }
43 * </pre></code>
44 *
45 * @see GenericPatternMatcher
46 * @see GenericPatternMatch
47 *
48 */
49@SuppressWarnings("all")
50public final class ScienceData extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
51 private ScienceData() {
52 super(GeneratedPQuery.INSTANCE);
53 }
54
55 /**
56 * @return the singleton instance of the query specification
57 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
58 *
59 */
60 public static ScienceData instance() {
61 try{
62 return LazyHolder.INSTANCE;
63 } catch (ExceptionInInitializerError err) {
64 throw processInitializerError(err);
65 }
66 }
67
68 /**
69 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData (visibility: PUBLIC, simpleName: ScienceData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
70 * <b>not</b> at the class load time of the outer class,
71 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData (visibility: PUBLIC, simpleName: ScienceData, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
72 *
73 * <p> This workaround is required e.g. to support recursion.
74 *
75 */
76 private static class LazyHolder {
77 private static final ScienceData INSTANCE = new ScienceData();
78
79 /**
80 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
81 * This initialization order is required to support indirect recursion.
82 *
83 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
84 *
85 */
86 private static final Object STATIC_INITIALIZER = ensureInitialized();
87
88 public static Object ensureInitialized() {
89 INSTANCE.ensureInitializedInternal();
90 return null;
91 }
92 }
93
94 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
95 private static final ScienceData.GeneratedPQuery INSTANCE = new GeneratedPQuery();
96
97 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
98
99 private final PParameter parameter_Data = new PParameter("Data", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
100
101 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_Data);
102
103 private GeneratedPQuery() {
104 super(PVisibility.PRIVATE);
105 }
106
107 @Override
108 public String getFullyQualifiedName() {
109 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.scienceData";
110 }
111
112 @Override
113 public List<String> getParameterNames() {
114 return Arrays.asList("Spacecraft","Data");
115 }
116
117 @Override
118 public List<PParameter> getParameters() {
119 return parameters;
120 }
121
122 @Override
123 public Set<PBody> doGetContainedBodies() {
124 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
125 Set<PBody> bodies = new LinkedHashSet<>();
126 {
127 PBody body = new PBody(this);
128 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
129 PVariable var_Data = body.getOrCreateVariableByName("Data");
130 PVariable var_Mission = body.getOrCreateVariableByName("Mission");
131 PVariable var_ObservationTime = body.getOrCreateVariableByName("ObservationTime");
132 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
133 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Data), new JavaTransitiveInstancesKey(java.lang.Double.class));
134 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
135 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
136 new ExportedParameter(body, var_Data, parameter_Data)
137 ));
138 // ConstellationMission.spacecraft(Mission, Spacecraft)
139 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission")));
140 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
141 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft")));
142 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
143 new Equality(body, var__virtual_0_, var_Spacecraft);
144 // InterferometryMission.observationTime(Mission, ObservationTime)
145 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
146 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
147 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "InterferometryMission", "observationTime")));
148 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EFloat")));
149 new Equality(body, var__virtual_1_, var_ObservationTime);
150 // Data == eval(12.0 * ObservationTime)
151 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
152 new ExpressionEvaluation(body, new IExpressionEvaluator() {
153
154 @Override
155 public String getShortDescription() {
156 return "Expression evaluation from pattern scienceData";
157 }
158
159 @Override
160 public Iterable<String> getInputParameterNames() {
161 return Arrays.asList("ObservationTime");}
162
163 @Override
164 public Object evaluateExpression(IValueProvider provider) throws Exception {
165 Float ObservationTime = (Float) provider.getValue("ObservationTime");
166 return evaluateExpression_1_1(ObservationTime);
167 }
168 }, var__virtual_2_ );
169 new Equality(body, var_Data, var__virtual_2_);
170 bodies.add(body);
171 }
172 return bodies;
173 }
174 }
175
176 private static double evaluateExpression_1_1(final Float ObservationTime) {
177 return (12.0 * (ObservationTime).floatValue());
178 }
179}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java
new file mode 100644
index 00000000..ca71cdd8
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftCost.java
@@ -0,0 +1,209 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SpacecraftOfKind;
7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.AdditionalCommSubsystemCost;
8import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.BasePrice;
9import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.InterferometryPayloadCost;
10import java.util.Arrays;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Set;
14import org.eclipse.emf.ecore.EClass;
15import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
16import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
17import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
18import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
19import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
20import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
21import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
22import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
23import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
24import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36
37/**
38 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
39 *
40 * <p>Original source:
41 * <code><pre>
42 * private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) {
43 * ConstellationMission.spacecraft(Mission, Spacecraft);
44 * find spacecraftOfKind(Spacecraft, Kind);
45 * KindCount == count find spacecraftOfKind(_, Kind);
46 * find basePrice(Spacecraft, BasePrice);
47 * find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost);
48 * find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost);
49 * Cost == eval(BasePrice Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost);
50 * }
51 * </pre></code>
52 *
53 * @see GenericPatternMatcher
54 * @see GenericPatternMatch
55 *
56 */
57@SuppressWarnings("all")
58public final class SpacecraftCost extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
59 private SpacecraftCost() {
60 super(GeneratedPQuery.INSTANCE);
61 }
62
63 /**
64 * @return the singleton instance of the query specification
65 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
66 *
67 */
68 public static SpacecraftCost instance() {
69 try{
70 return LazyHolder.INSTANCE;
71 } catch (ExceptionInInitializerError err) {
72 throw processInitializerError(err);
73 }
74 }
75
76 /**
77 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost (visibility: PUBLIC, simpleName: SpacecraftCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
78 * <b>not</b> at the class load time of the outer class,
79 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost (visibility: PUBLIC, simpleName: SpacecraftCost, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftCost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
80 *
81 * <p> This workaround is required e.g. to support recursion.
82 *
83 */
84 private static class LazyHolder {
85 private static final SpacecraftCost INSTANCE = new SpacecraftCost();
86
87 /**
88 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
89 * This initialization order is required to support indirect recursion.
90 *
91 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
92 *
93 */
94 private static final Object STATIC_INITIALIZER = ensureInitialized();
95
96 public static Object ensureInitialized() {
97 INSTANCE.ensureInitializedInternal();
98 return null;
99 }
100 }
101
102 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
103 private static final SpacecraftCost.GeneratedPQuery INSTANCE = new GeneratedPQuery();
104
105 private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
106
107 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
108
109 private final PParameter parameter_Cost = new PParameter("Cost", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
110
111 private final List<PParameter> parameters = Arrays.asList(parameter_Mission, parameter_Spacecraft, parameter_Cost);
112
113 private GeneratedPQuery() {
114 super(PVisibility.PRIVATE);
115 }
116
117 @Override
118 public String getFullyQualifiedName() {
119 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftCost";
120 }
121
122 @Override
123 public List<String> getParameterNames() {
124 return Arrays.asList("Mission","Spacecraft","Cost");
125 }
126
127 @Override
128 public List<PParameter> getParameters() {
129 return parameters;
130 }
131
132 @Override
133 public Set<PBody> doGetContainedBodies() {
134 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
135 Set<PBody> bodies = new LinkedHashSet<>();
136 {
137 PBody body = new PBody(this);
138 PVariable var_Mission = body.getOrCreateVariableByName("Mission");
139 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
140 PVariable var_Cost = body.getOrCreateVariableByName("Cost");
141 PVariable var_Kind = body.getOrCreateVariableByName("Kind");
142 PVariable var_KindCount = body.getOrCreateVariableByName("KindCount");
143 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
144 PVariable var_BasePrice = body.getOrCreateVariableByName("BasePrice");
145 PVariable var_InterferometryPayloadCost = body.getOrCreateVariableByName("InterferometryPayloadCost");
146 PVariable var_AdditionalCommSubsystemCost = body.getOrCreateVariableByName("AdditionalCommSubsystemCost");
147 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
148 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
149 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Cost), new JavaTransitiveInstancesKey(java.lang.Double.class));
150 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
151 new ExportedParameter(body, var_Mission, parameter_Mission),
152 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
153 new ExportedParameter(body, var_Cost, parameter_Cost)
154 ));
155 // ConstellationMission.spacecraft(Mission, Spacecraft)
156 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission")));
157 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
158 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft")));
159 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
160 new Equality(body, var__virtual_0_, var_Spacecraft);
161 // find spacecraftOfKind(Spacecraft, Kind)
162 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_Kind), SpacecraftOfKind.instance().getInternalQueryRepresentation());
163 // KindCount == count find spacecraftOfKind(_, Kind)
164 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
165 new PatternMatchCounter(body, Tuples.flatTupleOf(var___0_, var_Kind), SpacecraftOfKind.instance().getInternalQueryRepresentation(), var__virtual_1_);
166 new Equality(body, var_KindCount, var__virtual_1_);
167 // find basePrice(Spacecraft, BasePrice)
168 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_BasePrice), BasePrice.instance().getInternalQueryRepresentation());
169 // find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost)
170 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_InterferometryPayloadCost), InterferometryPayloadCost.instance().getInternalQueryRepresentation());
171 // find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost)
172 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_AdditionalCommSubsystemCost), AdditionalCommSubsystemCost.instance().getInternalQueryRepresentation());
173 // Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost)
174 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
175 new ExpressionEvaluation(body, new IExpressionEvaluator() {
176
177 @Override
178 public String getShortDescription() {
179 return "Expression evaluation from pattern spacecraftCost";
180 }
181
182 @Override
183 public Iterable<String> getInputParameterNames() {
184 return Arrays.asList("AdditionalCommSubsystemCost", "BasePrice", "InterferometryPayloadCost", "KindCount");}
185
186 @Override
187 public Object evaluateExpression(IValueProvider provider) throws Exception {
188 Double AdditionalCommSubsystemCost = (Double) provider.getValue("AdditionalCommSubsystemCost");
189 Double BasePrice = (Double) provider.getValue("BasePrice");
190 Double InterferometryPayloadCost = (Double) provider.getValue("InterferometryPayloadCost");
191 Integer KindCount = (Integer) provider.getValue("KindCount");
192 return evaluateExpression_1_1(AdditionalCommSubsystemCost, BasePrice, InterferometryPayloadCost, KindCount);
193 }
194 }, var__virtual_2_ );
195 new Equality(body, var_Cost, var__virtual_2_);
196 bodies.add(body);
197 }
198 return bodies;
199 }
200 }
201
202 private static double evaluateExpression_1_1(final Double AdditionalCommSubsystemCost, final Double BasePrice, final Double InterferometryPayloadCost, final Integer KindCount) {
203 double _pow = Math.pow((KindCount).intValue(), (-0.25));
204 double _multiply = ((BasePrice).doubleValue() * _pow);
205 double _plus = (_multiply + (InterferometryPayloadCost).doubleValue());
206 double _plus_1 = (_plus + (AdditionalCommSubsystemCost).doubleValue());
207 return _plus_1;
208 }
209}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftUplink.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftUplink.java
new file mode 100644
index 00000000..8ecc1717
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftUplink.java
@@ -0,0 +1,171 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.emf.ecore.EDataType;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
16import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
17import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
19import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
26import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
27
28/**
29 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
30 *
31 * <p>Original source:
32 * <code><pre>
33 * private pattern spacecraftUplink(Spacecraft : Spacecraft, Band : TransceiverBand, Target : CommunicatingElement) {
34 * CommunicatingElement.communicationLink(Spacecraft, Link);
35 * DirectedCommunicationLink.source.band(Link, Band);
36 * DirectedCommunicationLink.target(Link, TargetSubsystem);
37 * CommunicatingElement.commSubsystem(Target, TargetSubsystem);
38 * }
39 * </pre></code>
40 *
41 * @see GenericPatternMatcher
42 * @see GenericPatternMatch
43 *
44 */
45@SuppressWarnings("all")
46public final class SpacecraftUplink extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
47 private SpacecraftUplink() {
48 super(GeneratedPQuery.INSTANCE);
49 }
50
51 /**
52 * @return the singleton instance of the query specification
53 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
54 *
55 */
56 public static SpacecraftUplink instance() {
57 try{
58 return LazyHolder.INSTANCE;
59 } catch (ExceptionInInitializerError err) {
60 throw processInitializerError(err);
61 }
62 }
63
64 /**
65 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink (visibility: PUBLIC, simpleName: SpacecraftUplink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
66 * <b>not</b> at the class load time of the outer class,
67 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink (visibility: PUBLIC, simpleName: SpacecraftUplink, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
68 *
69 * <p> This workaround is required e.g. to support recursion.
70 *
71 */
72 private static class LazyHolder {
73 private static final SpacecraftUplink INSTANCE = new SpacecraftUplink();
74
75 /**
76 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
77 * This initialization order is required to support indirect recursion.
78 *
79 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
80 *
81 */
82 private static final Object STATIC_INITIALIZER = ensureInitialized();
83
84 public static Object ensureInitialized() {
85 INSTANCE.ensureInitializedInternal();
86 return null;
87 }
88 }
89
90 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
91 private static final SpacecraftUplink.GeneratedPQuery INSTANCE = new GeneratedPQuery();
92
93 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
94
95 private final PParameter parameter_Band = new PParameter("Band", "satellite.TransceiverBand", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.example.org/satellite", "TransceiverBand")), PParameterDirection.INOUT);
96
97 private final PParameter parameter_Target = new PParameter("Target", "satellite.CommunicatingElement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "CommunicatingElement")), PParameterDirection.INOUT);
98
99 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_Band, parameter_Target);
100
101 private GeneratedPQuery() {
102 super(PVisibility.PRIVATE);
103 }
104
105 @Override
106 public String getFullyQualifiedName() {
107 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftUplink";
108 }
109
110 @Override
111 public List<String> getParameterNames() {
112 return Arrays.asList("Spacecraft","Band","Target");
113 }
114
115 @Override
116 public List<PParameter> getParameters() {
117 return parameters;
118 }
119
120 @Override
121 public Set<PBody> doGetContainedBodies() {
122 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
123 Set<PBody> bodies = new LinkedHashSet<>();
124 {
125 PBody body = new PBody(this);
126 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
127 PVariable var_Band = body.getOrCreateVariableByName("Band");
128 PVariable var_Target = body.getOrCreateVariableByName("Target");
129 PVariable var_Link = body.getOrCreateVariableByName("Link");
130 PVariable var_TargetSubsystem = body.getOrCreateVariableByName("TargetSubsystem");
131 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
132 new TypeConstraint(body, Tuples.flatTupleOf(var_Band), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "TransceiverBand")));
133 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
134 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
135 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
136 new ExportedParameter(body, var_Band, parameter_Band),
137 new ExportedParameter(body, var_Target, parameter_Target)
138 ));
139 // CommunicatingElement.communicationLink(Spacecraft, Link)
140 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
141 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
142 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "communicationLink")));
143 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
144 new Equality(body, var__virtual_0_, var_Link);
145 // DirectedCommunicationLink.source.band(Link, Band)
146 new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
147 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
148 new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "source")));
149 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
150 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
151 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommSubsystem", "band")));
152 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.example.org/satellite", "TransceiverBand")));
153 new Equality(body, var__virtual_2_, var_Band);
154 // DirectedCommunicationLink.target(Link, TargetSubsystem)
155 new TypeConstraint(body, Tuples.flatTupleOf(var_Link), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "DirectedCommunicationLink")));
156 PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
157 new TypeConstraint(body, Tuples.flatTupleOf(var_Link, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "DirectedCommunicationLink", "target")));
158 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
159 new Equality(body, var__virtual_3_, var_TargetSubsystem);
160 // CommunicatingElement.commSubsystem(Target, TargetSubsystem)
161 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommunicatingElement")));
162 PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}");
163 new TypeConstraint(body, Tuples.flatTupleOf(var_Target, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
164 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
165 new Equality(body, var__virtual_4_, var_TargetSubsystem);
166 bodies.add(body);
167 }
168 return bodies;
169 }
170 }
171}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithTwoCommSubsystems.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithTwoCommSubsystems.java
new file mode 100644
index 00000000..a91f7b92
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/SpacecraftWithTwoCommSubsystems.java
@@ -0,0 +1,146 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
13import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
14import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
18import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
22import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
25import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
26
27/**
28 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
29 *
30 * <p>Original source:
31 * <code><pre>
32 * private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) {
33 * Spacecraft.commSubsystem(Spacecraft, Subsystem1);
34 * Spacecraft.commSubsystem(Spacecraft, Subsystem2);
35 * Subsystem1 != Subsystem2;
36 * }
37 * </pre></code>
38 *
39 * @see GenericPatternMatcher
40 * @see GenericPatternMatch
41 *
42 */
43@SuppressWarnings("all")
44public final class SpacecraftWithTwoCommSubsystems extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
45 private SpacecraftWithTwoCommSubsystems() {
46 super(GeneratedPQuery.INSTANCE);
47 }
48
49 /**
50 * @return the singleton instance of the query specification
51 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
52 *
53 */
54 public static SpacecraftWithTwoCommSubsystems instance() {
55 try{
56 return LazyHolder.INSTANCE;
57 } catch (ExceptionInInitializerError err) {
58 throw processInitializerError(err);
59 }
60 }
61
62 /**
63 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems (visibility: PUBLIC, simpleName: SpacecraftWithTwoCommSubsystems, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
64 * <b>not</b> at the class load time of the outer class,
65 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems (visibility: PUBLIC, simpleName: SpacecraftWithTwoCommSubsystems, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftWithTwoCommSubsystems, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
66 *
67 * <p> This workaround is required e.g. to support recursion.
68 *
69 */
70 private static class LazyHolder {
71 private static final SpacecraftWithTwoCommSubsystems INSTANCE = new SpacecraftWithTwoCommSubsystems();
72
73 /**
74 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
75 * This initialization order is required to support indirect recursion.
76 *
77 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
78 *
79 */
80 private static final Object STATIC_INITIALIZER = ensureInitialized();
81
82 public static Object ensureInitialized() {
83 INSTANCE.ensureInitializedInternal();
84 return null;
85 }
86 }
87
88 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
89 private static final SpacecraftWithTwoCommSubsystems.GeneratedPQuery INSTANCE = new GeneratedPQuery();
90
91 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
92
93 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft);
94
95 private GeneratedPQuery() {
96 super(PVisibility.PRIVATE);
97 }
98
99 @Override
100 public String getFullyQualifiedName() {
101 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.spacecraftWithTwoCommSubsystems";
102 }
103
104 @Override
105 public List<String> getParameterNames() {
106 return Arrays.asList("Spacecraft");
107 }
108
109 @Override
110 public List<PParameter> getParameters() {
111 return parameters;
112 }
113
114 @Override
115 public Set<PBody> doGetContainedBodies() {
116 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
117 Set<PBody> bodies = new LinkedHashSet<>();
118 {
119 PBody body = new PBody(this);
120 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
121 PVariable var_Subsystem1 = body.getOrCreateVariableByName("Subsystem1");
122 PVariable var_Subsystem2 = body.getOrCreateVariableByName("Subsystem2");
123 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
124 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
125 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft)
126 ));
127 // Spacecraft.commSubsystem(Spacecraft, Subsystem1)
128 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
129 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
131 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
132 new Equality(body, var__virtual_0_, var_Subsystem1);
133 // Spacecraft.commSubsystem(Spacecraft, Subsystem2)
134 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
135 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
136 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "CommunicatingElement", "commSubsystem")));
137 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "CommSubsystem")));
138 new Equality(body, var__virtual_1_, var_Subsystem2);
139 // Subsystem1 != Subsystem2
140 new Inequality(body, var_Subsystem1, var_Subsystem2);
141 bodies.add(body);
142 }
143 return bodies;
144 }
145 }
146}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitRate.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitRate.java
new file mode 100644
index 00000000..174e076a
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitRate.java
@@ -0,0 +1,277 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.SpacecraftUplink;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.ConstantValue;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
27import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
28import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
29
30/**
31 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
32 *
33 * <p>Original source:
34 * <code><pre>
35 * private pattern transmitRate(Spacecraft : Spacecraft, TransmitRate : java Double) {
36 * find spacecraftUplink(Spacecraft, TransceiverBand::UHF, Target);
37 * Spacecraft(Target);
38 * TransmitRate == 5.0;
39 * } or {
40 * find spacecraftUplink(Spacecraft, TransceiverBand::X, Target);
41 * Spacecraft(Target);
42 * TransmitRate == 1.6;
43 * } or {
44 * find spacecraftUplink(Spacecraft, TransceiverBand::X, Target);
45 * GroundStationNetwork(Target);
46 * TransmitRate == 0.7;
47 * } or {
48 * find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target);
49 * Spacecraft(Target);
50 * TransmitRate == 220.0;
51 * } or {
52 * find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target);
53 * GroundStationNetwork(Target);
54 * TransmitRate == 80.0;
55 * }
56 * </pre></code>
57 *
58 * @see GenericPatternMatcher
59 * @see GenericPatternMatch
60 *
61 */
62@SuppressWarnings("all")
63public final class TransmitRate extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
64 private TransmitRate() {
65 super(GeneratedPQuery.INSTANCE);
66 }
67
68 /**
69 * @return the singleton instance of the query specification
70 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
71 *
72 */
73 public static TransmitRate instance() {
74 try{
75 return LazyHolder.INSTANCE;
76 } catch (ExceptionInInitializerError err) {
77 throw processInitializerError(err);
78 }
79 }
80
81 /**
82 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate (visibility: PUBLIC, simpleName: TransmitRate, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
83 * <b>not</b> at the class load time of the outer class,
84 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate (visibility: PUBLIC, simpleName: TransmitRate, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
85 *
86 * <p> This workaround is required e.g. to support recursion.
87 *
88 */
89 private static class LazyHolder {
90 private static final TransmitRate INSTANCE = new TransmitRate();
91
92 /**
93 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
94 * This initialization order is required to support indirect recursion.
95 *
96 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
97 *
98 */
99 private static final Object STATIC_INITIALIZER = ensureInitialized();
100
101 public static Object ensureInitialized() {
102 INSTANCE.ensureInitializedInternal();
103 return null;
104 }
105 }
106
107 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
108 private static final TransmitRate.GeneratedPQuery INSTANCE = new GeneratedPQuery();
109
110 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
111
112 private final PParameter parameter_TransmitRate = new PParameter("TransmitRate", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
113
114 private final List<PParameter> parameters = Arrays.asList(parameter_Spacecraft, parameter_TransmitRate);
115
116 private GeneratedPQuery() {
117 super(PVisibility.PRIVATE);
118 }
119
120 @Override
121 public String getFullyQualifiedName() {
122 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.transmitRate";
123 }
124
125 @Override
126 public List<String> getParameterNames() {
127 return Arrays.asList("Spacecraft","TransmitRate");
128 }
129
130 @Override
131 public List<PParameter> getParameters() {
132 return parameters;
133 }
134
135 @Override
136 public Set<PBody> doGetContainedBodies() {
137 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
138 Set<PBody> bodies = new LinkedHashSet<>();
139 {
140 PBody body = new PBody(this);
141 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
142 PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
143 PVariable var_Target = body.getOrCreateVariableByName("Target");
144 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
145 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
146 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
147 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
148 new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
149 ));
150 // find spacecraftUplink(Spacecraft, TransceiverBand::UHF, Target)
151 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
152 new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "UHF").getInstance());
153 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
154 // Spacecraft(Target)
155 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
156 // TransmitRate == 5.0
157 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
158 new ConstantValue(body, var__virtual_1_, 5.0);
159 new Equality(body, var_TransmitRate, var__virtual_1_);
160 bodies.add(body);
161 }
162 {
163 PBody body = new PBody(this);
164 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
165 PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
166 PVariable var_Target = body.getOrCreateVariableByName("Target");
167 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
168 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
169 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
170 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
171 new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
172 ));
173 // find spacecraftUplink(Spacecraft, TransceiverBand::X, Target)
174 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
175 new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "X").getInstance());
176 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
177 // Spacecraft(Target)
178 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
179 // TransmitRate == 1.6
180 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
181 new ConstantValue(body, var__virtual_1_, 1.6);
182 new Equality(body, var_TransmitRate, var__virtual_1_);
183 bodies.add(body);
184 }
185 {
186 PBody body = new PBody(this);
187 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
188 PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
189 PVariable var_Target = body.getOrCreateVariableByName("Target");
190 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
191 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
192 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
193 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
194 new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
195 ));
196 // find spacecraftUplink(Spacecraft, TransceiverBand::X, Target)
197 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
198 new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "X").getInstance());
199 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
200 // GroundStationNetwork(Target)
201 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork")));
202 // TransmitRate == 0.7
203 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
204 new ConstantValue(body, var__virtual_1_, 0.7);
205 new Equality(body, var_TransmitRate, var__virtual_1_);
206 bodies.add(body);
207 }
208 {
209 PBody body = new PBody(this);
210 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
211 PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
212 PVariable var_Target = body.getOrCreateVariableByName("Target");
213 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
214 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
215 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
216 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
217 new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
218 ));
219 // find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target)
220 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
221 new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "Ka").getInstance());
222 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
223 // Spacecraft(Target)
224 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
225 // TransmitRate == 220.0
226 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
227 new ConstantValue(body, var__virtual_1_, 220.0);
228 new Equality(body, var_TransmitRate, var__virtual_1_);
229 bodies.add(body);
230 }
231 {
232 PBody body = new PBody(this);
233 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
234 PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
235 PVariable var_Target = body.getOrCreateVariableByName("Target");
236 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
237 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitRate), new JavaTransitiveInstancesKey(java.lang.Double.class));
238 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
239 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
240 new ExportedParameter(body, var_TransmitRate, parameter_TransmitRate)
241 ));
242 // find spacecraftUplink(Spacecraft, TransceiverBand::Ka, Target)
243 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
244 new ConstantValue(body, var__virtual_0_, getEnumLiteral("http://www.example.org/satellite", "TransceiverBand", "Ka").getInstance());
245 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var__virtual_0_, var_Target), SpacecraftUplink.instance().getInternalQueryRepresentation());
246 // GroundStationNetwork(Target)
247 new TypeConstraint(body, Tuples.flatTupleOf(var_Target), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "GroundStationNetwork")));
248 // TransmitRate == 80.0
249 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
250 new ConstantValue(body, var__virtual_1_, 80.0);
251 new Equality(body, var_TransmitRate, var__virtual_1_);
252 bodies.add(body);
253 }
254 return bodies;
255 }
256 }
257
258 private static double evaluateExpression_1_1() {
259 return 5.0;
260 }
261
262 private static double evaluateExpression_2_1() {
263 return 1.6;
264 }
265
266 private static double evaluateExpression_3_1() {
267 return 0.7;
268 }
269
270 private static double evaluateExpression_4_1() {
271 return 220.0;
272 }
273
274 private static double evaluateExpression_5_1() {
275 return 80.0;
276 }
277}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitTime.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitTime.java
new file mode 100644
index 00000000..a64c750a
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/internal/TransmitTime.java
@@ -0,0 +1,200 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.IncomingData;
7import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.ScienceData;
8import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitRate;
9import java.util.Arrays;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Set;
13import org.eclipse.emf.ecore.EClass;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
15import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
16import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
19import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
20import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
21import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
22import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
23import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
24import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
35import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
36import org.eclipse.xtext.xbase.lib.DoubleExtensions;
37
38/**
39 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
40 *
41 * <p>Original source:
42 * <code><pre>
43 * private pattern transmitTime(Mission : InterferometryMission, Spacecraft : Spacecraft, TransmitTime : java Double) {
44 * ConstellationMission.spacecraft(Mission, Spacecraft);
45 * find scienceData(Spacecraft, ScienceData);
46 * IncomingData == sum find incomingData(Spacecraft, _, #_);
47 * find transmitRate(Spacecraft, TransmitRate);
48 * TransmitTime == eval((ScienceData + IncomingData) / (7.5 TransmitRate));
49 * }
50 * </pre></code>
51 *
52 * @see GenericPatternMatcher
53 * @see GenericPatternMatch
54 *
55 */
56@SuppressWarnings("all")
57public final class TransmitTime extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
58 private TransmitTime() {
59 super(GeneratedPQuery.INSTANCE);
60 }
61
62 /**
63 * @return the singleton instance of the query specification
64 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
65 *
66 */
67 public static TransmitTime instance() {
68 try{
69 return LazyHolder.INSTANCE;
70 } catch (ExceptionInInitializerError err) {
71 throw processInitializerError(err);
72 }
73 }
74
75 /**
76 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime (visibility: PUBLIC, simpleName: TransmitTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
77 * <b>not</b> at the class load time of the outer class,
78 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime (visibility: PUBLIC, simpleName: TransmitTime, identifier: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal.TransmitTime, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
79 *
80 * <p> This workaround is required e.g. to support recursion.
81 *
82 */
83 private static class LazyHolder {
84 private static final TransmitTime INSTANCE = new TransmitTime();
85
86 /**
87 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
88 * This initialization order is required to support indirect recursion.
89 *
90 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
91 *
92 */
93 private static final Object STATIC_INITIALIZER = ensureInitialized();
94
95 public static Object ensureInitialized() {
96 INSTANCE.ensureInitializedInternal();
97 return null;
98 }
99 }
100
101 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
102 private static final TransmitTime.GeneratedPQuery INSTANCE = new GeneratedPQuery();
103
104 private final PParameter parameter_Mission = new PParameter("Mission", "satellite.InterferometryMission", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "InterferometryMission")), PParameterDirection.INOUT);
105
106 private final PParameter parameter_Spacecraft = new PParameter("Spacecraft", "satellite.Spacecraft", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/satellite", "Spacecraft")), PParameterDirection.INOUT);
107
108 private final PParameter parameter_TransmitTime = new PParameter("TransmitTime", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT);
109
110 private final List<PParameter> parameters = Arrays.asList(parameter_Mission, parameter_Spacecraft, parameter_TransmitTime);
111
112 private GeneratedPQuery() {
113 super(PVisibility.PRIVATE);
114 }
115
116 @Override
117 public String getFullyQualifiedName() {
118 return "hu.bme.mit.inf.dslreasoner.domains.satellite.queries.transmitTime";
119 }
120
121 @Override
122 public List<String> getParameterNames() {
123 return Arrays.asList("Mission","Spacecraft","TransmitTime");
124 }
125
126 @Override
127 public List<PParameter> getParameters() {
128 return parameters;
129 }
130
131 @Override
132 public Set<PBody> doGetContainedBodies() {
133 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
134 Set<PBody> bodies = new LinkedHashSet<>();
135 {
136 PBody body = new PBody(this);
137 PVariable var_Mission = body.getOrCreateVariableByName("Mission");
138 PVariable var_Spacecraft = body.getOrCreateVariableByName("Spacecraft");
139 PVariable var_TransmitTime = body.getOrCreateVariableByName("TransmitTime");
140 PVariable var_ScienceData = body.getOrCreateVariableByName("ScienceData");
141 PVariable var_IncomingData = body.getOrCreateVariableByName("IncomingData");
142 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
143 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
144 PVariable var_TransmitRate = body.getOrCreateVariableByName("TransmitRate");
145 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "InterferometryMission")));
146 new TypeConstraint(body, Tuples.flatTupleOf(var_Spacecraft), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
147 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_TransmitTime), new JavaTransitiveInstancesKey(java.lang.Double.class));
148 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
149 new ExportedParameter(body, var_Mission, parameter_Mission),
150 new ExportedParameter(body, var_Spacecraft, parameter_Spacecraft),
151 new ExportedParameter(body, var_TransmitTime, parameter_TransmitTime)
152 ));
153 // ConstellationMission.spacecraft(Mission, Spacecraft)
154 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "ConstellationMission")));
155 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
156 new TypeConstraint(body, Tuples.flatTupleOf(var_Mission, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/satellite", "ConstellationMission", "spacecraft")));
157 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/satellite", "Spacecraft")));
158 new Equality(body, var__virtual_0_, var_Spacecraft);
159 // find scienceData(Spacecraft, ScienceData)
160 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_ScienceData), ScienceData.instance().getInternalQueryRepresentation());
161 // IncomingData == sum find incomingData(Spacecraft, _, #_)
162 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
163 new AggregatorConstraint(new sum().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var_Spacecraft, var___0_, var___1_), IncomingData.instance().getInternalQueryRepresentation(), var__virtual_1_, 2);
164 new Equality(body, var_IncomingData, var__virtual_1_);
165 // find transmitRate(Spacecraft, TransmitRate)
166 new PositivePatternCall(body, Tuples.flatTupleOf(var_Spacecraft, var_TransmitRate), TransmitRate.instance().getInternalQueryRepresentation());
167 // TransmitTime == eval((ScienceData + IncomingData) / (7.5 * TransmitRate))
168 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
169 new ExpressionEvaluation(body, new IExpressionEvaluator() {
170
171 @Override
172 public String getShortDescription() {
173 return "Expression evaluation from pattern transmitTime";
174 }
175
176 @Override
177 public Iterable<String> getInputParameterNames() {
178 return Arrays.asList("IncomingData", "ScienceData", "TransmitRate");}
179
180 @Override
181 public Object evaluateExpression(IValueProvider provider) throws Exception {
182 Double IncomingData = (Double) provider.getValue("IncomingData");
183 Double ScienceData = (Double) provider.getValue("ScienceData");
184 Double TransmitRate = (Double) provider.getValue("TransmitRate");
185 return evaluateExpression_1_1(IncomingData, ScienceData, TransmitRate);
186 }
187 }, var__virtual_2_ );
188 new Equality(body, var_TransmitTime, var__virtual_2_);
189 bodies.add(body);
190 }
191 return bodies;
192 }
193 }
194
195 private static double evaluateExpression_1_1(final Double IncomingData, final Double ScienceData, final Double TransmitRate) {
196 double _plus = DoubleExtensions.operator_plus(ScienceData, IncomingData);
197 double _divide = (_plus / (7.5 * (TransmitRate).doubleValue()));
198 return _divide;
199 }
200}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
index 0207cfe3..9b77ef72 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql
@@ -210,7 +210,7 @@ pattern spacecraftOfKind(Spacecraft : Spacecraft, Kind : SpacecraftKind) {
210 Kind == SpacecraftKind::SmallSat; 210 Kind == SpacecraftKind::SmallSat;
211} 211}
212 212
213/* 213
214// 214//
215// Metrics 215// Metrics
216// 216//
@@ -310,13 +310,13 @@ private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spa
310} 310}
311 311
312private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) { 312private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) {
313 CubeSat3U(Spacecraft): 313 CubeSat3U(Spacecraft);
314 BasePrice == 250000.0; 314 BasePrice == 250000.0;
315} or { 315} or {
316 CubeSat6U(Spacecraft): 316 CubeSat6U(Spacecraft);
317 BasePrice == 750000.0; 317 BasePrice == 750000.0;
318} or { 318} or {
319 SmallSat(Spacecraft): 319 SmallSat(Spacecraft);
320 BasePrice == 3000000.0; 320 BasePrice == 3000000.0;
321} 321}
322 322
@@ -341,4 +341,3 @@ private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) {
341 Spacecraft.commSubsystem(Spacecraft, Subsystem2); 341 Spacecraft.commSubsystem(Spacecraft, Subsystem2);
342 Subsystem1 != Subsystem2; 342 Subsystem1 != Subsystem2;
343} 343}
344*/ \ No newline at end of file
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/.SatelliteGeneratorMain.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/.SatelliteGeneratorMain.xtendbin
deleted file mode 100644
index 2f1887a8..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/.SatelliteGeneratorMain.xtendbin
+++ /dev/null
Binary files differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.java
deleted file mode 100644
index f6890163..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.java
+++ /dev/null
@@ -1,15 +0,0 @@
1package hu.bme.mit.inf.dslreasoner.domains.satellite.runner;
2
3import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor;
4import org.eclipse.xtext.xbase.lib.InputOutput;
5
6@SuppressWarnings("all")
7public final class SatelliteGeneratorMain {
8 private SatelliteGeneratorMain() {
9 throw new IllegalStateException("This is a static utility class and should not be instantiated directly.");
10 }
11
12 public static void main(final String[] args) {
13 InputOutput.<String>println(StandaloneScriptExecutor.executeScript("configs/generation.vsconfig"));
14 }
15}