diff options
Diffstat (limited to 'Domains')
192 files changed, 34221 insertions, 718 deletions
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/.project b/Domains/Examples/ModelGenExampleFAM_plugin/.project index 70920828..6e1b3a06 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/.project +++ b/Domains/Examples/ModelGenExampleFAM_plugin/.project | |||
@@ -11,11 +11,6 @@ | |||
11 | </arguments> | 11 | </arguments> |
12 | </buildCommand> | 12 | </buildCommand> |
13 | <buildCommand> | 13 | <buildCommand> |
14 | <name>org.eclipse.xtext.ui.shared.xtextBuilder</name> | ||
15 | <arguments> | ||
16 | </arguments> | ||
17 | </buildCommand> | ||
18 | <buildCommand> | ||
19 | <name>org.eclipse.jdt.core.javabuilder</name> | 14 | <name>org.eclipse.jdt.core.javabuilder</name> |
20 | <arguments> | 15 | <arguments> |
21 | </arguments> | 16 | </arguments> |
@@ -33,7 +28,6 @@ | |||
33 | </buildSpec> | 28 | </buildSpec> |
34 | <natures> | 29 | <natures> |
35 | <nature>org.eclipse.jdt.core.javanature</nature> | 30 | <nature>org.eclipse.jdt.core.javanature</nature> |
36 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
37 | <nature>org.eclipse.viatra.query.projectnature</nature> | 31 | <nature>org.eclipse.viatra.query.projectnature</nature> |
38 | <nature>org.eclipse.pde.PluginNature</nature> | 32 | <nature>org.eclipse.pde.PluginNature</nature> |
39 | </natures> | 33 | </natures> |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/META-INF/MANIFEST.MF b/Domains/Examples/ModelGenExampleFAM_plugin/META-INF/MANIFEST.MF index f1f5d18c..077e646b 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/META-INF/MANIFEST.MF +++ b/Domains/Examples/ModelGenExampleFAM_plugin/META-INF/MANIFEST.MF | |||
@@ -7,16 +7,16 @@ Bundle-ClassPath: . | |||
7 | Bundle-Vendor: %providerName | 7 | Bundle-Vendor: %providerName |
8 | Bundle-Localization: plugin | 8 | Bundle-Localization: plugin |
9 | Export-Package: functionalarchitecture, | 9 | Export-Package: functionalarchitecture, |
10 | functionalarchitecture.impl, | 10 | functionalarchitecture.impl, |
11 | functionalarchitecture.util, | 11 | functionalarchitecture.util, |
12 | hu.bme.mit.inf.dslreasoner.domains.transima.fam | 12 | hu.bme.mit.inf.dslreasoner.domains.transima.fam |
13 | Require-Bundle: ModelGenExampleFAM_plugin, | 13 | Require-Bundle: ModelGenExampleFAM_plugin, |
14 | org.eclipse.viatra.addon.querybasedfeatures.runtime, | 14 | org.eclipse.viatra.addon.querybasedfeatures.runtime, |
15 | org.eclipse.viatra.query.runtime, | 15 | org.eclipse.viatra.query.runtime, |
16 | org.apache.log4j;bundle-version="1.2.15", | 16 | org.apache.log4j;bundle-version="1.2.15", |
17 | com.google.guava;bundle-version="15.0.0", | 17 | com.google.guava;bundle-version="15.0.0", |
18 | org.eclipse.core.runtime, | 18 | org.eclipse.core.runtime, |
19 | org.eclipse.emf.ecore;visibility:=reexport | 19 | org.eclipse.emf.ecore;visibility:=reexport |
20 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | 20 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
21 | Bundle-ActivationPolicy: lazy | 21 | Bundle-ActivationPolicy: lazy |
22 | Automatic-Module-Name: ModelGenExampleFAM_plugin | 22 | Automatic-Module-Name: ModelGenExampleFAM_plugin |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionType.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionType.java index 59fe3fb2..9f2316a0 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionType.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionType.java | |||
@@ -205,6 +205,7 @@ public enum FunctionType implements Enumerator { | |||
205 | * <!-- end-user-doc --> | 205 | * <!-- end-user-doc --> |
206 | * @generated | 206 | * @generated |
207 | */ | 207 | */ |
208 | @Override | ||
208 | public int getValue() { | 209 | public int getValue() { |
209 | return value; | 210 | return value; |
210 | } | 211 | } |
@@ -214,6 +215,7 @@ public enum FunctionType implements Enumerator { | |||
214 | * <!-- end-user-doc --> | 215 | * <!-- end-user-doc --> |
215 | * @generated | 216 | * @generated |
216 | */ | 217 | */ |
218 | @Override | ||
217 | public String getName() { | 219 | public String getName() { |
218 | return name; | 220 | return name; |
219 | } | 221 | } |
@@ -223,6 +225,7 @@ public enum FunctionType implements Enumerator { | |||
223 | * <!-- end-user-doc --> | 225 | * <!-- end-user-doc --> |
224 | * @generated | 226 | * @generated |
225 | */ | 227 | */ |
228 | @Override | ||
226 | public String getLiteral() { | 229 | public String getLiteral() { |
227 | return literal; | 230 | return literal; |
228 | } | 231 | } |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalData.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalData.java index 39639f99..59fa0fd4 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalData.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalData.java | |||
@@ -60,13 +60,13 @@ public interface FunctionalData extends EObject { | |||
60 | * </p> | 60 | * </p> |
61 | * <!-- end-user-doc --> | 61 | * <!-- end-user-doc --> |
62 | * @return the value of the '<em>Interface</em>' container reference. | 62 | * @return the value of the '<em>Interface</em>' container reference. |
63 | * @see #setInterface(FunctionalInterface) | 63 | * @see #setInterface(functionalarchitecture.FunctionalInterface) |
64 | * @see functionalarchitecture.FunctionalarchitecturePackage#getFunctionalData_Interface() | 64 | * @see functionalarchitecture.FunctionalarchitecturePackage#getFunctionalData_Interface() |
65 | * @see functionalarchitecture.FunctionalInterface#getData | 65 | * @see functionalarchitecture.FunctionalInterface#getData |
66 | * @model opposite="data" transient="false" | 66 | * @model opposite="data" transient="false" |
67 | * @generated | 67 | * @generated |
68 | */ | 68 | */ |
69 | FunctionalInterface getInterface(); | 69 | functionalarchitecture.FunctionalInterface getInterface(); |
70 | 70 | ||
71 | /** | 71 | /** |
72 | * Sets the value of the '{@link functionalarchitecture.FunctionalData#getInterface <em>Interface</em>}' container reference. | 72 | * Sets the value of the '{@link functionalarchitecture.FunctionalData#getInterface <em>Interface</em>}' container reference. |
@@ -76,6 +76,6 @@ public interface FunctionalData extends EObject { | |||
76 | * @see #getInterface() | 76 | * @see #getInterface() |
77 | * @generated | 77 | * @generated |
78 | */ | 78 | */ |
79 | void setInterface(FunctionalInterface value); | 79 | void setInterface(functionalarchitecture.FunctionalInterface value); |
80 | 80 | ||
81 | } // FunctionalData | 81 | } // FunctionalData |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalElement.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalElement.java index f5a2ff19..5d1d3254 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalElement.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/FunctionalElement.java | |||
@@ -33,13 +33,13 @@ public interface FunctionalElement extends EObject { | |||
33 | * </p> | 33 | * </p> |
34 | * <!-- end-user-doc --> | 34 | * <!-- end-user-doc --> |
35 | * @return the value of the '<em>Interface</em>' containment reference. | 35 | * @return the value of the '<em>Interface</em>' containment reference. |
36 | * @see #setInterface(FunctionalInterface) | 36 | * @see #setInterface(functionalarchitecture.FunctionalInterface) |
37 | * @see functionalarchitecture.FunctionalarchitecturePackage#getFunctionalElement_Interface() | 37 | * @see functionalarchitecture.FunctionalarchitecturePackage#getFunctionalElement_Interface() |
38 | * @see functionalarchitecture.FunctionalInterface#getElement | 38 | * @see functionalarchitecture.FunctionalInterface#getElement |
39 | * @model opposite="element" containment="true" | 39 | * @model opposite="element" containment="true" |
40 | * @generated | 40 | * @generated |
41 | */ | 41 | */ |
42 | FunctionalInterface getInterface(); | 42 | functionalarchitecture.FunctionalInterface getInterface(); |
43 | 43 | ||
44 | /** | 44 | /** |
45 | * Sets the value of the '{@link functionalarchitecture.FunctionalElement#getInterface <em>Interface</em>}' containment reference. | 45 | * Sets the value of the '{@link functionalarchitecture.FunctionalElement#getInterface <em>Interface</em>}' containment reference. |
@@ -49,7 +49,7 @@ public interface FunctionalElement extends EObject { | |||
49 | * @see #getInterface() | 49 | * @see #getInterface() |
50 | * @generated | 50 | * @generated |
51 | */ | 51 | */ |
52 | void setInterface(FunctionalInterface value); | 52 | void setInterface(functionalarchitecture.FunctionalInterface value); |
53 | 53 | ||
54 | /** | 54 | /** |
55 | * Returns the value of the '<em><b>Model</b></em>' reference. | 55 | * Returns the value of the '<em><b>Model</b></em>' reference. |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FAMTerminatorImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FAMTerminatorImpl.java index 382e0170..94cd240a 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FAMTerminatorImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FAMTerminatorImpl.java | |||
@@ -55,6 +55,7 @@ public class FAMTerminatorImpl extends MinimalEObjectImpl.Container implements F | |||
55 | * <!-- end-user-doc --> | 55 | * <!-- end-user-doc --> |
56 | * @generated | 56 | * @generated |
57 | */ | 57 | */ |
58 | @Override | ||
58 | public FunctionalData getData() { | 59 | public FunctionalData getData() { |
59 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FAM_TERMINATOR__DATA) return null; | 60 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FAM_TERMINATOR__DATA) return null; |
60 | return (FunctionalData)eInternalContainer(); | 61 | return (FunctionalData)eInternalContainer(); |
@@ -75,6 +76,7 @@ public class FAMTerminatorImpl extends MinimalEObjectImpl.Container implements F | |||
75 | * <!-- end-user-doc --> | 76 | * <!-- end-user-doc --> |
76 | * @generated | 77 | * @generated |
77 | */ | 78 | */ |
79 | @Override | ||
78 | public void setData(FunctionalData newData) { | 80 | public void setData(FunctionalData newData) { |
79 | if (newData != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FAM_TERMINATOR__DATA && newData != null)) { | 81 | if (newData != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FAM_TERMINATOR__DATA && newData != null)) { |
80 | if (EcoreUtil.isAncestor(this, newData)) | 82 | if (EcoreUtil.isAncestor(this, newData)) |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionImpl.java index 46736c8c..6e89bc65 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionImpl.java | |||
@@ -79,6 +79,7 @@ public class FunctionImpl extends FunctionalElementImpl implements Function { | |||
79 | * <!-- end-user-doc --> | 79 | * <!-- end-user-doc --> |
80 | * @generated | 80 | * @generated |
81 | */ | 81 | */ |
82 | @Override | ||
82 | public EList<FunctionalElement> getSubElements() { | 83 | public EList<FunctionalElement> getSubElements() { |
83 | if (subElements == null) { | 84 | if (subElements == null) { |
84 | subElements = new EObjectContainmentWithInverseEList<FunctionalElement>(FunctionalElement.class, this, FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT); | 85 | subElements = new EObjectContainmentWithInverseEList<FunctionalElement>(FunctionalElement.class, this, FunctionalarchitecturePackage.FUNCTION__SUB_ELEMENTS, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT); |
@@ -91,6 +92,7 @@ public class FunctionImpl extends FunctionalElementImpl implements Function { | |||
91 | * <!-- end-user-doc --> | 92 | * <!-- end-user-doc --> |
92 | * @generated | 93 | * @generated |
93 | */ | 94 | */ |
95 | @Override | ||
94 | public FunctionType getType() { | 96 | public FunctionType getType() { |
95 | return (FunctionType)TYPE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | 97 | return (FunctionType)TYPE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); |
96 | } | 98 | } |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalArchitectureModelImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalArchitectureModelImpl.java index 78f6d6f2..a7d6c919 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalArchitectureModelImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalArchitectureModelImpl.java | |||
@@ -68,6 +68,7 @@ public class FunctionalArchitectureModelImpl extends MinimalEObjectImpl.Containe | |||
68 | * <!-- end-user-doc --> | 68 | * <!-- end-user-doc --> |
69 | * @generated | 69 | * @generated |
70 | */ | 70 | */ |
71 | @Override | ||
71 | public EList<FunctionalElement> getRootElements() { | 72 | public EList<FunctionalElement> getRootElements() { |
72 | if (rootElements == null) { | 73 | if (rootElements == null) { |
73 | rootElements = new EObjectContainmentEList<FunctionalElement>(FunctionalElement.class, this, FunctionalarchitecturePackage.FUNCTIONAL_ARCHITECTURE_MODEL__ROOT_ELEMENTS); | 74 | rootElements = new EObjectContainmentEList<FunctionalElement>(FunctionalElement.class, this, FunctionalarchitecturePackage.FUNCTIONAL_ARCHITECTURE_MODEL__ROOT_ELEMENTS); |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalDataImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalDataImpl.java index 10937e8d..ec8f2cef 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalDataImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalDataImpl.java | |||
@@ -4,7 +4,6 @@ package functionalarchitecture.impl; | |||
4 | 4 | ||
5 | import functionalarchitecture.FAMTerminator; | 5 | import functionalarchitecture.FAMTerminator; |
6 | import functionalarchitecture.FunctionalData; | 6 | import functionalarchitecture.FunctionalData; |
7 | import functionalarchitecture.FunctionalInterface; | ||
8 | import functionalarchitecture.FunctionalarchitecturePackage; | 7 | import functionalarchitecture.FunctionalarchitecturePackage; |
9 | 8 | ||
10 | import org.eclipse.emf.common.notify.Notification; | 9 | import org.eclipse.emf.common.notify.Notification; |
@@ -67,6 +66,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
67 | * <!-- end-user-doc --> | 66 | * <!-- end-user-doc --> |
68 | * @generated | 67 | * @generated |
69 | */ | 68 | */ |
69 | @Override | ||
70 | public FAMTerminator getTerminator() { | 70 | public FAMTerminator getTerminator() { |
71 | return terminator; | 71 | return terminator; |
72 | } | 72 | } |
@@ -91,6 +91,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
91 | * <!-- end-user-doc --> | 91 | * <!-- end-user-doc --> |
92 | * @generated | 92 | * @generated |
93 | */ | 93 | */ |
94 | @Override | ||
94 | public void setTerminator(FAMTerminator newTerminator) { | 95 | public void setTerminator(FAMTerminator newTerminator) { |
95 | if (newTerminator != terminator) { | 96 | if (newTerminator != terminator) { |
96 | NotificationChain msgs = null; | 97 | NotificationChain msgs = null; |
@@ -110,9 +111,10 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
110 | * <!-- end-user-doc --> | 111 | * <!-- end-user-doc --> |
111 | * @generated | 112 | * @generated |
112 | */ | 113 | */ |
113 | public FunctionalInterface getInterface() { | 114 | @Override |
115 | public functionalarchitecture.FunctionalInterface getInterface() { | ||
114 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE) return null; | 116 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE) return null; |
115 | return (FunctionalInterface)eInternalContainer(); | 117 | return (functionalarchitecture.FunctionalInterface)eInternalContainer(); |
116 | } | 118 | } |
117 | 119 | ||
118 | /** | 120 | /** |
@@ -120,7 +122,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
120 | * <!-- end-user-doc --> | 122 | * <!-- end-user-doc --> |
121 | * @generated | 123 | * @generated |
122 | */ | 124 | */ |
123 | public NotificationChain basicSetInterface(FunctionalInterface newInterface, NotificationChain msgs) { | 125 | public NotificationChain basicSetInterface(functionalarchitecture.FunctionalInterface newInterface, NotificationChain msgs) { |
124 | msgs = eBasicSetContainer((InternalEObject)newInterface, FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE, msgs); | 126 | msgs = eBasicSetContainer((InternalEObject)newInterface, FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE, msgs); |
125 | return msgs; | 127 | return msgs; |
126 | } | 128 | } |
@@ -130,7 +132,8 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
130 | * <!-- end-user-doc --> | 132 | * <!-- end-user-doc --> |
131 | * @generated | 133 | * @generated |
132 | */ | 134 | */ |
133 | public void setInterface(FunctionalInterface newInterface) { | 135 | @Override |
136 | public void setInterface(functionalarchitecture.FunctionalInterface newInterface) { | ||
134 | if (newInterface != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE && newInterface != null)) { | 137 | if (newInterface != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE && newInterface != null)) { |
135 | if (EcoreUtil.isAncestor(this, newInterface)) | 138 | if (EcoreUtil.isAncestor(this, newInterface)) |
136 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | 139 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); |
@@ -138,7 +141,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
138 | if (eInternalContainer() != null) | 141 | if (eInternalContainer() != null) |
139 | msgs = eBasicRemoveFromContainer(msgs); | 142 | msgs = eBasicRemoveFromContainer(msgs); |
140 | if (newInterface != null) | 143 | if (newInterface != null) |
141 | msgs = ((InternalEObject)newInterface).eInverseAdd(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, FunctionalInterface.class, msgs); | 144 | msgs = ((InternalEObject)newInterface).eInverseAdd(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, functionalarchitecture.FunctionalInterface.class, msgs); |
142 | msgs = basicSetInterface(newInterface, msgs); | 145 | msgs = basicSetInterface(newInterface, msgs); |
143 | if (msgs != null) msgs.dispatch(); | 146 | if (msgs != null) msgs.dispatch(); |
144 | } | 147 | } |
@@ -161,7 +164,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
161 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: | 164 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: |
162 | if (eInternalContainer() != null) | 165 | if (eInternalContainer() != null) |
163 | msgs = eBasicRemoveFromContainer(msgs); | 166 | msgs = eBasicRemoveFromContainer(msgs); |
164 | return basicSetInterface((FunctionalInterface)otherEnd, msgs); | 167 | return basicSetInterface((functionalarchitecture.FunctionalInterface)otherEnd, msgs); |
165 | } | 168 | } |
166 | return super.eInverseAdd(otherEnd, featureID, msgs); | 169 | return super.eInverseAdd(otherEnd, featureID, msgs); |
167 | } | 170 | } |
@@ -191,7 +194,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
191 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { | 194 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { |
192 | switch (eContainerFeatureID()) { | 195 | switch (eContainerFeatureID()) { |
193 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: | 196 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: |
194 | return eInternalContainer().eInverseRemove(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, FunctionalInterface.class, msgs); | 197 | return eInternalContainer().eInverseRemove(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, functionalarchitecture.FunctionalInterface.class, msgs); |
195 | } | 198 | } |
196 | return super.eBasicRemoveFromContainerFeature(msgs); | 199 | return super.eBasicRemoveFromContainerFeature(msgs); |
197 | } | 200 | } |
@@ -224,7 +227,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
224 | setTerminator((FAMTerminator)newValue); | 227 | setTerminator((FAMTerminator)newValue); |
225 | return; | 228 | return; |
226 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: | 229 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: |
227 | setInterface((FunctionalInterface)newValue); | 230 | setInterface((functionalarchitecture.FunctionalInterface)newValue); |
228 | return; | 231 | return; |
229 | } | 232 | } |
230 | super.eSet(featureID, newValue); | 233 | super.eSet(featureID, newValue); |
@@ -242,7 +245,7 @@ public abstract class FunctionalDataImpl extends MinimalEObjectImpl.Container im | |||
242 | setTerminator((FAMTerminator)null); | 245 | setTerminator((FAMTerminator)null); |
243 | return; | 246 | return; |
244 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: | 247 | case FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE: |
245 | setInterface((FunctionalInterface)null); | 248 | setInterface((functionalarchitecture.FunctionalInterface)null); |
246 | return; | 249 | return; |
247 | } | 250 | } |
248 | super.eUnset(featureID); | 251 | super.eUnset(featureID); |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalElementImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalElementImpl.java index 809e9ed5..c923caae 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalElementImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalElementImpl.java | |||
@@ -5,7 +5,6 @@ package functionalarchitecture.impl; | |||
5 | import functionalarchitecture.Function; | 5 | import functionalarchitecture.Function; |
6 | import functionalarchitecture.FunctionalArchitectureModel; | 6 | import functionalarchitecture.FunctionalArchitectureModel; |
7 | import functionalarchitecture.FunctionalElement; | 7 | import functionalarchitecture.FunctionalElement; |
8 | import functionalarchitecture.FunctionalInterface; | ||
9 | import functionalarchitecture.FunctionalarchitecturePackage; | 8 | import functionalarchitecture.FunctionalarchitecturePackage; |
10 | 9 | ||
11 | import org.eclipse.emf.common.notify.Notification; | 10 | import org.eclipse.emf.common.notify.Notification; |
@@ -44,7 +43,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
44 | * @generated | 43 | * @generated |
45 | * @ordered | 44 | * @ordered |
46 | */ | 45 | */ |
47 | protected FunctionalInterface interface_; | 46 | protected functionalarchitecture.FunctionalInterface interface_; |
48 | 47 | ||
49 | /** | 48 | /** |
50 | * The cached setting delegate for the '{@link #getModel() <em>Model</em>}' reference. | 49 | * The cached setting delegate for the '{@link #getModel() <em>Model</em>}' reference. |
@@ -80,7 +79,8 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
80 | * <!-- end-user-doc --> | 79 | * <!-- end-user-doc --> |
81 | * @generated | 80 | * @generated |
82 | */ | 81 | */ |
83 | public FunctionalInterface getInterface() { | 82 | @Override |
83 | public functionalarchitecture.FunctionalInterface getInterface() { | ||
84 | return interface_; | 84 | return interface_; |
85 | } | 85 | } |
86 | 86 | ||
@@ -89,8 +89,8 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
89 | * <!-- end-user-doc --> | 89 | * <!-- end-user-doc --> |
90 | * @generated | 90 | * @generated |
91 | */ | 91 | */ |
92 | public NotificationChain basicSetInterface(FunctionalInterface newInterface, NotificationChain msgs) { | 92 | public NotificationChain basicSetInterface(functionalarchitecture.FunctionalInterface newInterface, NotificationChain msgs) { |
93 | FunctionalInterface oldInterface = interface_; | 93 | functionalarchitecture.FunctionalInterface oldInterface = interface_; |
94 | interface_ = newInterface; | 94 | interface_ = newInterface; |
95 | if (eNotificationRequired()) { | 95 | if (eNotificationRequired()) { |
96 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE, oldInterface, newInterface); | 96 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE, oldInterface, newInterface); |
@@ -104,13 +104,14 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
104 | * <!-- end-user-doc --> | 104 | * <!-- end-user-doc --> |
105 | * @generated | 105 | * @generated |
106 | */ | 106 | */ |
107 | public void setInterface(FunctionalInterface newInterface) { | 107 | @Override |
108 | public void setInterface(functionalarchitecture.FunctionalInterface newInterface) { | ||
108 | if (newInterface != interface_) { | 109 | if (newInterface != interface_) { |
109 | NotificationChain msgs = null; | 110 | NotificationChain msgs = null; |
110 | if (interface_ != null) | 111 | if (interface_ != null) |
111 | msgs = ((InternalEObject)interface_).eInverseRemove(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT, FunctionalInterface.class, msgs); | 112 | msgs = ((InternalEObject)interface_).eInverseRemove(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT, functionalarchitecture.FunctionalInterface.class, msgs); |
112 | if (newInterface != null) | 113 | if (newInterface != null) |
113 | msgs = ((InternalEObject)newInterface).eInverseAdd(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT, FunctionalInterface.class, msgs); | 114 | msgs = ((InternalEObject)newInterface).eInverseAdd(this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT, functionalarchitecture.FunctionalInterface.class, msgs); |
114 | msgs = basicSetInterface(newInterface, msgs); | 115 | msgs = basicSetInterface(newInterface, msgs); |
115 | if (msgs != null) msgs.dispatch(); | 116 | if (msgs != null) msgs.dispatch(); |
116 | } | 117 | } |
@@ -123,6 +124,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
123 | * <!-- end-user-doc --> | 124 | * <!-- end-user-doc --> |
124 | * @generated | 125 | * @generated |
125 | */ | 126 | */ |
127 | @Override | ||
126 | public FunctionalArchitectureModel getModel() { | 128 | public FunctionalArchitectureModel getModel() { |
127 | return (FunctionalArchitectureModel)MODEL__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | 129 | return (FunctionalArchitectureModel)MODEL__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); |
128 | } | 130 | } |
@@ -141,6 +143,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
141 | * <!-- end-user-doc --> | 143 | * <!-- end-user-doc --> |
142 | * @generated | 144 | * @generated |
143 | */ | 145 | */ |
146 | @Override | ||
144 | public void setModel(FunctionalArchitectureModel newModel) { | 147 | public void setModel(FunctionalArchitectureModel newModel) { |
145 | MODEL__ESETTING_DELEGATE.dynamicSet(this, null, 0, newModel); | 148 | MODEL__ESETTING_DELEGATE.dynamicSet(this, null, 0, newModel); |
146 | } | 149 | } |
@@ -150,6 +153,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
150 | * <!-- end-user-doc --> | 153 | * <!-- end-user-doc --> |
151 | * @generated | 154 | * @generated |
152 | */ | 155 | */ |
156 | @Override | ||
153 | public Function getParent() { | 157 | public Function getParent() { |
154 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT) return null; | 158 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT) return null; |
155 | return (Function)eInternalContainer(); | 159 | return (Function)eInternalContainer(); |
@@ -170,6 +174,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
170 | * <!-- end-user-doc --> | 174 | * <!-- end-user-doc --> |
171 | * @generated | 175 | * @generated |
172 | */ | 176 | */ |
177 | @Override | ||
173 | public void setParent(Function newParent) { | 178 | public void setParent(Function newParent) { |
174 | if (newParent != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT && newParent != null)) { | 179 | if (newParent != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT && newParent != null)) { |
175 | if (EcoreUtil.isAncestor(this, newParent)) | 180 | if (EcoreUtil.isAncestor(this, newParent)) |
@@ -197,7 +202,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
197 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE: | 202 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE: |
198 | if (interface_ != null) | 203 | if (interface_ != null) |
199 | msgs = ((InternalEObject)interface_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE, null, msgs); | 204 | msgs = ((InternalEObject)interface_).eInverseRemove(this, EOPPOSITE_FEATURE_BASE - FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE, null, msgs); |
200 | return basicSetInterface((FunctionalInterface)otherEnd, msgs); | 205 | return basicSetInterface((functionalarchitecture.FunctionalInterface)otherEnd, msgs); |
201 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT: | 206 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__PARENT: |
202 | if (eInternalContainer() != null) | 207 | if (eInternalContainer() != null) |
203 | msgs = eBasicRemoveFromContainer(msgs); | 208 | msgs = eBasicRemoveFromContainer(msgs); |
@@ -264,7 +269,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
264 | public void eSet(int featureID, Object newValue) { | 269 | public void eSet(int featureID, Object newValue) { |
265 | switch (featureID) { | 270 | switch (featureID) { |
266 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE: | 271 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE: |
267 | setInterface((FunctionalInterface)newValue); | 272 | setInterface((functionalarchitecture.FunctionalInterface)newValue); |
268 | return; | 273 | return; |
269 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL: | 274 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL: |
270 | setModel((FunctionalArchitectureModel)newValue); | 275 | setModel((FunctionalArchitectureModel)newValue); |
@@ -285,7 +290,7 @@ public abstract class FunctionalElementImpl extends MinimalEObjectImpl.Container | |||
285 | public void eUnset(int featureID) { | 290 | public void eUnset(int featureID) { |
286 | switch (featureID) { | 291 | switch (featureID) { |
287 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE: | 292 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__INTERFACE: |
288 | setInterface((FunctionalInterface)null); | 293 | setInterface((functionalarchitecture.FunctionalInterface)null); |
289 | return; | 294 | return; |
290 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL: | 295 | case FunctionalarchitecturePackage.FUNCTIONAL_ELEMENT__MODEL: |
291 | setModel((FunctionalArchitectureModel)null); | 296 | setModel((FunctionalArchitectureModel)null); |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInputImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInputImpl.java index 9df1ec0c..33a136ed 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInputImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInputImpl.java | |||
@@ -66,6 +66,7 @@ public class FunctionalInputImpl extends FunctionalDataImpl implements Functiona | |||
66 | * <!-- end-user-doc --> | 66 | * <!-- end-user-doc --> |
67 | * @generated | 67 | * @generated |
68 | */ | 68 | */ |
69 | @Override | ||
69 | public EList<InformationLink> getIncomingLinks() { | 70 | public EList<InformationLink> getIncomingLinks() { |
70 | if (incomingLinks == null) { | 71 | if (incomingLinks == null) { |
71 | incomingLinks = new EObjectWithInverseResolvingEList<InformationLink>(InformationLink.class, this, FunctionalarchitecturePackage.FUNCTIONAL_INPUT__INCOMING_LINKS, FunctionalarchitecturePackage.INFORMATION_LINK__TO); | 72 | incomingLinks = new EObjectWithInverseResolvingEList<InformationLink>(InformationLink.class, this, FunctionalarchitecturePackage.FUNCTIONAL_INPUT__INCOMING_LINKS, FunctionalarchitecturePackage.INFORMATION_LINK__TO); |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInterfaceImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInterfaceImpl.java index 20151886..53aa2dac 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInterfaceImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalInterfaceImpl.java | |||
@@ -4,7 +4,6 @@ package functionalarchitecture.impl; | |||
4 | 4 | ||
5 | import functionalarchitecture.FunctionalData; | 5 | import functionalarchitecture.FunctionalData; |
6 | import functionalarchitecture.FunctionalElement; | 6 | import functionalarchitecture.FunctionalElement; |
7 | import functionalarchitecture.FunctionalInterface; | ||
8 | import functionalarchitecture.FunctionalarchitecturePackage; | 7 | import functionalarchitecture.FunctionalarchitecturePackage; |
9 | 8 | ||
10 | import java.util.Collection; | 9 | import java.util.Collection; |
@@ -38,7 +37,7 @@ import org.eclipse.emf.ecore.util.InternalEList; | |||
38 | * | 37 | * |
39 | * @generated | 38 | * @generated |
40 | */ | 39 | */ |
41 | public class FunctionalInterfaceImpl extends MinimalEObjectImpl.Container implements FunctionalInterface { | 40 | public class FunctionalInterfaceImpl extends MinimalEObjectImpl.Container implements functionalarchitecture.FunctionalInterface { |
42 | /** | 41 | /** |
43 | * The cached value of the '{@link #getData() <em>Data</em>}' containment reference list. | 42 | * The cached value of the '{@link #getData() <em>Data</em>}' containment reference list. |
44 | * <!-- begin-user-doc --> | 43 | * <!-- begin-user-doc --> |
@@ -73,6 +72,7 @@ public class FunctionalInterfaceImpl extends MinimalEObjectImpl.Container implem | |||
73 | * <!-- end-user-doc --> | 72 | * <!-- end-user-doc --> |
74 | * @generated | 73 | * @generated |
75 | */ | 74 | */ |
75 | @Override | ||
76 | public EList<FunctionalData> getData() { | 76 | public EList<FunctionalData> getData() { |
77 | if (data == null) { | 77 | if (data == null) { |
78 | data = new EObjectContainmentWithInverseEList<FunctionalData>(FunctionalData.class, this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE); | 78 | data = new EObjectContainmentWithInverseEList<FunctionalData>(FunctionalData.class, this, FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__DATA, FunctionalarchitecturePackage.FUNCTIONAL_DATA__INTERFACE); |
@@ -85,6 +85,7 @@ public class FunctionalInterfaceImpl extends MinimalEObjectImpl.Container implem | |||
85 | * <!-- end-user-doc --> | 85 | * <!-- end-user-doc --> |
86 | * @generated | 86 | * @generated |
87 | */ | 87 | */ |
88 | @Override | ||
88 | public FunctionalElement getElement() { | 89 | public FunctionalElement getElement() { |
89 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT) return null; | 90 | if (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT) return null; |
90 | return (FunctionalElement)eInternalContainer(); | 91 | return (FunctionalElement)eInternalContainer(); |
@@ -105,6 +106,7 @@ public class FunctionalInterfaceImpl extends MinimalEObjectImpl.Container implem | |||
105 | * <!-- end-user-doc --> | 106 | * <!-- end-user-doc --> |
106 | * @generated | 107 | * @generated |
107 | */ | 108 | */ |
109 | @Override | ||
108 | public void setElement(FunctionalElement newElement) { | 110 | public void setElement(FunctionalElement newElement) { |
109 | if (newElement != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT && newElement != null)) { | 111 | if (newElement != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE__ELEMENT && newElement != null)) { |
110 | if (EcoreUtil.isAncestor(this, newElement)) | 112 | if (EcoreUtil.isAncestor(this, newElement)) |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalOutputImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalOutputImpl.java index 1ae2a964..061af113 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalOutputImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalOutputImpl.java | |||
@@ -66,6 +66,7 @@ public class FunctionalOutputImpl extends FunctionalDataImpl implements Function | |||
66 | * <!-- end-user-doc --> | 66 | * <!-- end-user-doc --> |
67 | * @generated | 67 | * @generated |
68 | */ | 68 | */ |
69 | @Override | ||
69 | public EList<InformationLink> getOutgoingLinks() { | 70 | public EList<InformationLink> getOutgoingLinks() { |
70 | if (outgoingLinks == null) { | 71 | if (outgoingLinks == null) { |
71 | outgoingLinks = new EObjectContainmentWithInverseEList<InformationLink>(InformationLink.class, this, FunctionalarchitecturePackage.FUNCTIONAL_OUTPUT__OUTGOING_LINKS, FunctionalarchitecturePackage.INFORMATION_LINK__FROM); | 72 | outgoingLinks = new EObjectContainmentWithInverseEList<InformationLink>(InformationLink.class, this, FunctionalarchitecturePackage.FUNCTIONAL_OUTPUT__OUTGOING_LINKS, FunctionalarchitecturePackage.INFORMATION_LINK__FROM); |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitectureFactoryImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitectureFactoryImpl.java index 56ecfa25..9c9f495a 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitectureFactoryImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitectureFactoryImpl.java | |||
@@ -2,9 +2,15 @@ | |||
2 | */ | 2 | */ |
3 | package functionalarchitecture.impl; | 3 | package functionalarchitecture.impl; |
4 | 4 | ||
5 | import functionalarchitecture.*; | 5 | import functionalarchitecture.FAMTerminator; |
6 | import functionalarchitecture.FunctionalInterface; | 6 | import functionalarchitecture.Function; |
7 | 7 | import functionalarchitecture.FunctionType; | |
8 | import functionalarchitecture.FunctionalArchitectureModel; | ||
9 | import functionalarchitecture.FunctionalInput; | ||
10 | import functionalarchitecture.FunctionalOutput; | ||
11 | import functionalarchitecture.FunctionalarchitectureFactory; | ||
12 | import functionalarchitecture.FunctionalarchitecturePackage; | ||
13 | import functionalarchitecture.InformationLink; | ||
8 | import org.eclipse.emf.ecore.EClass; | 14 | import org.eclipse.emf.ecore.EClass; |
9 | import org.eclipse.emf.ecore.EDataType; | 15 | import org.eclipse.emf.ecore.EDataType; |
10 | import org.eclipse.emf.ecore.EObject; | 16 | import org.eclipse.emf.ecore.EObject; |
@@ -105,6 +111,7 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
105 | * <!-- end-user-doc --> | 111 | * <!-- end-user-doc --> |
106 | * @generated | 112 | * @generated |
107 | */ | 113 | */ |
114 | @Override | ||
108 | public FunctionalArchitectureModel createFunctionalArchitectureModel() { | 115 | public FunctionalArchitectureModel createFunctionalArchitectureModel() { |
109 | FunctionalArchitectureModelImpl functionalArchitectureModel = new FunctionalArchitectureModelImpl(); | 116 | FunctionalArchitectureModelImpl functionalArchitectureModel = new FunctionalArchitectureModelImpl(); |
110 | return functionalArchitectureModel; | 117 | return functionalArchitectureModel; |
@@ -115,6 +122,7 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
115 | * <!-- end-user-doc --> | 122 | * <!-- end-user-doc --> |
116 | * @generated | 123 | * @generated |
117 | */ | 124 | */ |
125 | @Override | ||
118 | public Function createFunction() { | 126 | public Function createFunction() { |
119 | FunctionImpl function = new FunctionImpl(); | 127 | FunctionImpl function = new FunctionImpl(); |
120 | return function; | 128 | return function; |
@@ -125,6 +133,7 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
125 | * <!-- end-user-doc --> | 133 | * <!-- end-user-doc --> |
126 | * @generated | 134 | * @generated |
127 | */ | 135 | */ |
136 | @Override | ||
128 | public FAMTerminator createFAMTerminator() { | 137 | public FAMTerminator createFAMTerminator() { |
129 | FAMTerminatorImpl famTerminator = new FAMTerminatorImpl(); | 138 | FAMTerminatorImpl famTerminator = new FAMTerminatorImpl(); |
130 | return famTerminator; | 139 | return famTerminator; |
@@ -135,6 +144,7 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
135 | * <!-- end-user-doc --> | 144 | * <!-- end-user-doc --> |
136 | * @generated | 145 | * @generated |
137 | */ | 146 | */ |
147 | @Override | ||
138 | public InformationLink createInformationLink() { | 148 | public InformationLink createInformationLink() { |
139 | InformationLinkImpl informationLink = new InformationLinkImpl(); | 149 | InformationLinkImpl informationLink = new InformationLinkImpl(); |
140 | return informationLink; | 150 | return informationLink; |
@@ -145,7 +155,8 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
145 | * <!-- end-user-doc --> | 155 | * <!-- end-user-doc --> |
146 | * @generated | 156 | * @generated |
147 | */ | 157 | */ |
148 | public FunctionalInterface createFunctionalInterface() { | 158 | @Override |
159 | public functionalarchitecture.FunctionalInterface createFunctionalInterface() { | ||
149 | FunctionalInterfaceImpl functionalInterface = new FunctionalInterfaceImpl(); | 160 | FunctionalInterfaceImpl functionalInterface = new FunctionalInterfaceImpl(); |
150 | return functionalInterface; | 161 | return functionalInterface; |
151 | } | 162 | } |
@@ -155,6 +166,7 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
155 | * <!-- end-user-doc --> | 166 | * <!-- end-user-doc --> |
156 | * @generated | 167 | * @generated |
157 | */ | 168 | */ |
169 | @Override | ||
158 | public FunctionalInput createFunctionalInput() { | 170 | public FunctionalInput createFunctionalInput() { |
159 | FunctionalInputImpl functionalInput = new FunctionalInputImpl(); | 171 | FunctionalInputImpl functionalInput = new FunctionalInputImpl(); |
160 | return functionalInput; | 172 | return functionalInput; |
@@ -165,6 +177,7 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
165 | * <!-- end-user-doc --> | 177 | * <!-- end-user-doc --> |
166 | * @generated | 178 | * @generated |
167 | */ | 179 | */ |
180 | @Override | ||
168 | public FunctionalOutput createFunctionalOutput() { | 181 | public FunctionalOutput createFunctionalOutput() { |
169 | FunctionalOutputImpl functionalOutput = new FunctionalOutputImpl(); | 182 | FunctionalOutputImpl functionalOutput = new FunctionalOutputImpl(); |
170 | return functionalOutput; | 183 | return functionalOutput; |
@@ -195,6 +208,7 @@ public class FunctionalarchitectureFactoryImpl extends EFactoryImpl implements F | |||
195 | * <!-- end-user-doc --> | 208 | * <!-- end-user-doc --> |
196 | * @generated | 209 | * @generated |
197 | */ | 210 | */ |
211 | @Override | ||
198 | public FunctionalarchitecturePackage getFunctionalarchitecturePackage() { | 212 | public FunctionalarchitecturePackage getFunctionalarchitecturePackage() { |
199 | return (FunctionalarchitecturePackage)getEPackage(); | 213 | return (FunctionalarchitecturePackage)getEPackage(); |
200 | } | 214 | } |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitecturePackageImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitecturePackageImpl.java index 22c15533..04945f1c 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitecturePackageImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/FunctionalarchitecturePackageImpl.java | |||
@@ -9,7 +9,6 @@ import functionalarchitecture.FunctionalArchitectureModel; | |||
9 | import functionalarchitecture.FunctionalData; | 9 | import functionalarchitecture.FunctionalData; |
10 | import functionalarchitecture.FunctionalElement; | 10 | import functionalarchitecture.FunctionalElement; |
11 | import functionalarchitecture.FunctionalInput; | 11 | import functionalarchitecture.FunctionalInput; |
12 | import functionalarchitecture.FunctionalInterface; | ||
13 | import functionalarchitecture.FunctionalOutput; | 12 | import functionalarchitecture.FunctionalOutput; |
14 | import functionalarchitecture.FunctionalarchitectureFactory; | 13 | import functionalarchitecture.FunctionalarchitectureFactory; |
15 | import functionalarchitecture.FunctionalarchitecturePackage; | 14 | import functionalarchitecture.FunctionalarchitecturePackage; |
@@ -128,7 +127,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
128 | 127 | ||
129 | /** | 128 | /** |
130 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | 129 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
131 | * | 130 | * |
132 | * <p>This method is used to initialize {@link FunctionalarchitecturePackage#eINSTANCE} when that field is accessed. | 131 | * <p>This method is used to initialize {@link FunctionalarchitecturePackage#eINSTANCE} when that field is accessed. |
133 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | 132 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
134 | * <!-- begin-user-doc --> | 133 | * <!-- begin-user-doc --> |
@@ -142,7 +141,8 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
142 | if (isInited) return (FunctionalarchitecturePackage)EPackage.Registry.INSTANCE.getEPackage(FunctionalarchitecturePackage.eNS_URI); | 141 | if (isInited) return (FunctionalarchitecturePackage)EPackage.Registry.INSTANCE.getEPackage(FunctionalarchitecturePackage.eNS_URI); |
143 | 142 | ||
144 | // Obtain or create and register package | 143 | // Obtain or create and register package |
145 | FunctionalarchitecturePackageImpl theFunctionalarchitecturePackage = (FunctionalarchitecturePackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FunctionalarchitecturePackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FunctionalarchitecturePackageImpl()); | 144 | Object registeredFunctionalarchitecturePackage = EPackage.Registry.INSTANCE.get(eNS_URI); |
145 | FunctionalarchitecturePackageImpl theFunctionalarchitecturePackage = registeredFunctionalarchitecturePackage instanceof FunctionalarchitecturePackageImpl ? (FunctionalarchitecturePackageImpl)registeredFunctionalarchitecturePackage : new FunctionalarchitecturePackageImpl(); | ||
146 | 146 | ||
147 | isInited = true; | 147 | isInited = true; |
148 | 148 | ||
@@ -155,7 +155,6 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
155 | // Mark meta-data to indicate it can't be changed | 155 | // Mark meta-data to indicate it can't be changed |
156 | theFunctionalarchitecturePackage.freeze(); | 156 | theFunctionalarchitecturePackage.freeze(); |
157 | 157 | ||
158 | |||
159 | // Update the registry and return the package | 158 | // Update the registry and return the package |
160 | EPackage.Registry.INSTANCE.put(FunctionalarchitecturePackage.eNS_URI, theFunctionalarchitecturePackage); | 159 | EPackage.Registry.INSTANCE.put(FunctionalarchitecturePackage.eNS_URI, theFunctionalarchitecturePackage); |
161 | return theFunctionalarchitecturePackage; | 160 | return theFunctionalarchitecturePackage; |
@@ -166,6 +165,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
166 | * <!-- end-user-doc --> | 165 | * <!-- end-user-doc --> |
167 | * @generated | 166 | * @generated |
168 | */ | 167 | */ |
168 | @Override | ||
169 | public EClass getFunctionalElement() { | 169 | public EClass getFunctionalElement() { |
170 | return functionalElementEClass; | 170 | return functionalElementEClass; |
171 | } | 171 | } |
@@ -175,6 +175,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
175 | * <!-- end-user-doc --> | 175 | * <!-- end-user-doc --> |
176 | * @generated | 176 | * @generated |
177 | */ | 177 | */ |
178 | @Override | ||
178 | public EReference getFunctionalElement_Interface() { | 179 | public EReference getFunctionalElement_Interface() { |
179 | return (EReference)functionalElementEClass.getEStructuralFeatures().get(0); | 180 | return (EReference)functionalElementEClass.getEStructuralFeatures().get(0); |
180 | } | 181 | } |
@@ -184,6 +185,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
184 | * <!-- end-user-doc --> | 185 | * <!-- end-user-doc --> |
185 | * @generated | 186 | * @generated |
186 | */ | 187 | */ |
188 | @Override | ||
187 | public EReference getFunctionalElement_Model() { | 189 | public EReference getFunctionalElement_Model() { |
188 | return (EReference)functionalElementEClass.getEStructuralFeatures().get(1); | 190 | return (EReference)functionalElementEClass.getEStructuralFeatures().get(1); |
189 | } | 191 | } |
@@ -193,6 +195,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
193 | * <!-- end-user-doc --> | 195 | * <!-- end-user-doc --> |
194 | * @generated | 196 | * @generated |
195 | */ | 197 | */ |
198 | @Override | ||
196 | public EReference getFunctionalElement_Parent() { | 199 | public EReference getFunctionalElement_Parent() { |
197 | return (EReference)functionalElementEClass.getEStructuralFeatures().get(2); | 200 | return (EReference)functionalElementEClass.getEStructuralFeatures().get(2); |
198 | } | 201 | } |
@@ -202,6 +205,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
202 | * <!-- end-user-doc --> | 205 | * <!-- end-user-doc --> |
203 | * @generated | 206 | * @generated |
204 | */ | 207 | */ |
208 | @Override | ||
205 | public EClass getFunctionalArchitectureModel() { | 209 | public EClass getFunctionalArchitectureModel() { |
206 | return functionalArchitectureModelEClass; | 210 | return functionalArchitectureModelEClass; |
207 | } | 211 | } |
@@ -211,6 +215,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
211 | * <!-- end-user-doc --> | 215 | * <!-- end-user-doc --> |
212 | * @generated | 216 | * @generated |
213 | */ | 217 | */ |
218 | @Override | ||
214 | public EReference getFunctionalArchitectureModel_RootElements() { | 219 | public EReference getFunctionalArchitectureModel_RootElements() { |
215 | return (EReference)functionalArchitectureModelEClass.getEStructuralFeatures().get(0); | 220 | return (EReference)functionalArchitectureModelEClass.getEStructuralFeatures().get(0); |
216 | } | 221 | } |
@@ -220,6 +225,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
220 | * <!-- end-user-doc --> | 225 | * <!-- end-user-doc --> |
221 | * @generated | 226 | * @generated |
222 | */ | 227 | */ |
228 | @Override | ||
223 | public EClass getFunction() { | 229 | public EClass getFunction() { |
224 | return functionEClass; | 230 | return functionEClass; |
225 | } | 231 | } |
@@ -229,6 +235,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
229 | * <!-- end-user-doc --> | 235 | * <!-- end-user-doc --> |
230 | * @generated | 236 | * @generated |
231 | */ | 237 | */ |
238 | @Override | ||
232 | public EReference getFunction_SubElements() { | 239 | public EReference getFunction_SubElements() { |
233 | return (EReference)functionEClass.getEStructuralFeatures().get(0); | 240 | return (EReference)functionEClass.getEStructuralFeatures().get(0); |
234 | } | 241 | } |
@@ -238,6 +245,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
238 | * <!-- end-user-doc --> | 245 | * <!-- end-user-doc --> |
239 | * @generated | 246 | * @generated |
240 | */ | 247 | */ |
248 | @Override | ||
241 | public EAttribute getFunction_Type() { | 249 | public EAttribute getFunction_Type() { |
242 | return (EAttribute)functionEClass.getEStructuralFeatures().get(1); | 250 | return (EAttribute)functionEClass.getEStructuralFeatures().get(1); |
243 | } | 251 | } |
@@ -247,6 +255,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
247 | * <!-- end-user-doc --> | 255 | * <!-- end-user-doc --> |
248 | * @generated | 256 | * @generated |
249 | */ | 257 | */ |
258 | @Override | ||
250 | public EClass getFAMTerminator() { | 259 | public EClass getFAMTerminator() { |
251 | return famTerminatorEClass; | 260 | return famTerminatorEClass; |
252 | } | 261 | } |
@@ -256,6 +265,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
256 | * <!-- end-user-doc --> | 265 | * <!-- end-user-doc --> |
257 | * @generated | 266 | * @generated |
258 | */ | 267 | */ |
268 | @Override | ||
259 | public EReference getFAMTerminator_Data() { | 269 | public EReference getFAMTerminator_Data() { |
260 | return (EReference)famTerminatorEClass.getEStructuralFeatures().get(0); | 270 | return (EReference)famTerminatorEClass.getEStructuralFeatures().get(0); |
261 | } | 271 | } |
@@ -265,6 +275,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
265 | * <!-- end-user-doc --> | 275 | * <!-- end-user-doc --> |
266 | * @generated | 276 | * @generated |
267 | */ | 277 | */ |
278 | @Override | ||
268 | public EClass getInformationLink() { | 279 | public EClass getInformationLink() { |
269 | return informationLinkEClass; | 280 | return informationLinkEClass; |
270 | } | 281 | } |
@@ -274,6 +285,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
274 | * <!-- end-user-doc --> | 285 | * <!-- end-user-doc --> |
275 | * @generated | 286 | * @generated |
276 | */ | 287 | */ |
288 | @Override | ||
277 | public EReference getInformationLink_From() { | 289 | public EReference getInformationLink_From() { |
278 | return (EReference)informationLinkEClass.getEStructuralFeatures().get(0); | 290 | return (EReference)informationLinkEClass.getEStructuralFeatures().get(0); |
279 | } | 291 | } |
@@ -283,6 +295,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
283 | * <!-- end-user-doc --> | 295 | * <!-- end-user-doc --> |
284 | * @generated | 296 | * @generated |
285 | */ | 297 | */ |
298 | @Override | ||
286 | public EReference getInformationLink_To() { | 299 | public EReference getInformationLink_To() { |
287 | return (EReference)informationLinkEClass.getEStructuralFeatures().get(1); | 300 | return (EReference)informationLinkEClass.getEStructuralFeatures().get(1); |
288 | } | 301 | } |
@@ -292,6 +305,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
292 | * <!-- end-user-doc --> | 305 | * <!-- end-user-doc --> |
293 | * @generated | 306 | * @generated |
294 | */ | 307 | */ |
308 | @Override | ||
295 | public EClass getFunctionalInterface() { | 309 | public EClass getFunctionalInterface() { |
296 | return functionalInterfaceEClass; | 310 | return functionalInterfaceEClass; |
297 | } | 311 | } |
@@ -301,6 +315,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
301 | * <!-- end-user-doc --> | 315 | * <!-- end-user-doc --> |
302 | * @generated | 316 | * @generated |
303 | */ | 317 | */ |
318 | @Override | ||
304 | public EReference getFunctionalInterface_Data() { | 319 | public EReference getFunctionalInterface_Data() { |
305 | return (EReference)functionalInterfaceEClass.getEStructuralFeatures().get(0); | 320 | return (EReference)functionalInterfaceEClass.getEStructuralFeatures().get(0); |
306 | } | 321 | } |
@@ -310,6 +325,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
310 | * <!-- end-user-doc --> | 325 | * <!-- end-user-doc --> |
311 | * @generated | 326 | * @generated |
312 | */ | 327 | */ |
328 | @Override | ||
313 | public EReference getFunctionalInterface_Element() { | 329 | public EReference getFunctionalInterface_Element() { |
314 | return (EReference)functionalInterfaceEClass.getEStructuralFeatures().get(1); | 330 | return (EReference)functionalInterfaceEClass.getEStructuralFeatures().get(1); |
315 | } | 331 | } |
@@ -319,6 +335,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
319 | * <!-- end-user-doc --> | 335 | * <!-- end-user-doc --> |
320 | * @generated | 336 | * @generated |
321 | */ | 337 | */ |
338 | @Override | ||
322 | public EClass getFunctionalInput() { | 339 | public EClass getFunctionalInput() { |
323 | return functionalInputEClass; | 340 | return functionalInputEClass; |
324 | } | 341 | } |
@@ -328,6 +345,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
328 | * <!-- end-user-doc --> | 345 | * <!-- end-user-doc --> |
329 | * @generated | 346 | * @generated |
330 | */ | 347 | */ |
348 | @Override | ||
331 | public EReference getFunctionalInput_IncomingLinks() { | 349 | public EReference getFunctionalInput_IncomingLinks() { |
332 | return (EReference)functionalInputEClass.getEStructuralFeatures().get(0); | 350 | return (EReference)functionalInputEClass.getEStructuralFeatures().get(0); |
333 | } | 351 | } |
@@ -337,6 +355,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
337 | * <!-- end-user-doc --> | 355 | * <!-- end-user-doc --> |
338 | * @generated | 356 | * @generated |
339 | */ | 357 | */ |
358 | @Override | ||
340 | public EClass getFunctionalOutput() { | 359 | public EClass getFunctionalOutput() { |
341 | return functionalOutputEClass; | 360 | return functionalOutputEClass; |
342 | } | 361 | } |
@@ -346,6 +365,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
346 | * <!-- end-user-doc --> | 365 | * <!-- end-user-doc --> |
347 | * @generated | 366 | * @generated |
348 | */ | 367 | */ |
368 | @Override | ||
349 | public EReference getFunctionalOutput_OutgoingLinks() { | 369 | public EReference getFunctionalOutput_OutgoingLinks() { |
350 | return (EReference)functionalOutputEClass.getEStructuralFeatures().get(0); | 370 | return (EReference)functionalOutputEClass.getEStructuralFeatures().get(0); |
351 | } | 371 | } |
@@ -355,6 +375,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
355 | * <!-- end-user-doc --> | 375 | * <!-- end-user-doc --> |
356 | * @generated | 376 | * @generated |
357 | */ | 377 | */ |
378 | @Override | ||
358 | public EClass getFunctionalData() { | 379 | public EClass getFunctionalData() { |
359 | return functionalDataEClass; | 380 | return functionalDataEClass; |
360 | } | 381 | } |
@@ -364,6 +385,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
364 | * <!-- end-user-doc --> | 385 | * <!-- end-user-doc --> |
365 | * @generated | 386 | * @generated |
366 | */ | 387 | */ |
388 | @Override | ||
367 | public EReference getFunctionalData_Terminator() { | 389 | public EReference getFunctionalData_Terminator() { |
368 | return (EReference)functionalDataEClass.getEStructuralFeatures().get(0); | 390 | return (EReference)functionalDataEClass.getEStructuralFeatures().get(0); |
369 | } | 391 | } |
@@ -373,6 +395,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
373 | * <!-- end-user-doc --> | 395 | * <!-- end-user-doc --> |
374 | * @generated | 396 | * @generated |
375 | */ | 397 | */ |
398 | @Override | ||
376 | public EReference getFunctionalData_Interface() { | 399 | public EReference getFunctionalData_Interface() { |
377 | return (EReference)functionalDataEClass.getEStructuralFeatures().get(1); | 400 | return (EReference)functionalDataEClass.getEStructuralFeatures().get(1); |
378 | } | 401 | } |
@@ -382,6 +405,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
382 | * <!-- end-user-doc --> | 405 | * <!-- end-user-doc --> |
383 | * @generated | 406 | * @generated |
384 | */ | 407 | */ |
408 | @Override | ||
385 | public EEnum getFunctionType() { | 409 | public EEnum getFunctionType() { |
386 | return functionTypeEEnum; | 410 | return functionTypeEEnum; |
387 | } | 411 | } |
@@ -391,6 +415,7 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
391 | * <!-- end-user-doc --> | 415 | * <!-- end-user-doc --> |
392 | * @generated | 416 | * @generated |
393 | */ | 417 | */ |
418 | @Override | ||
394 | public FunctionalarchitectureFactory getFunctionalarchitectureFactory() { | 419 | public FunctionalarchitectureFactory getFunctionalarchitectureFactory() { |
395 | return (FunctionalarchitectureFactory)getEFactoryInstance(); | 420 | return (FunctionalarchitectureFactory)getEFactoryInstance(); |
396 | } | 421 | } |
@@ -503,9 +528,9 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
503 | initEReference(getInformationLink_From(), this.getFunctionalOutput(), this.getFunctionalOutput_OutgoingLinks(), "from", null, 0, 1, InformationLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | 528 | initEReference(getInformationLink_From(), this.getFunctionalOutput(), this.getFunctionalOutput_OutgoingLinks(), "from", null, 0, 1, InformationLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
504 | initEReference(getInformationLink_To(), this.getFunctionalInput(), this.getFunctionalInput_IncomingLinks(), "to", null, 1, 1, InformationLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | 529 | initEReference(getInformationLink_To(), this.getFunctionalInput(), this.getFunctionalInput_IncomingLinks(), "to", null, 1, 1, InformationLink.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
505 | 530 | ||
506 | initEClass(functionalInterfaceEClass, FunctionalInterface.class, "FunctionalInterface", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | 531 | initEClass(functionalInterfaceEClass, functionalarchitecture.FunctionalInterface.class, "FunctionalInterface", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
507 | initEReference(getFunctionalInterface_Data(), this.getFunctionalData(), this.getFunctionalData_Interface(), "data", null, 0, -1, FunctionalInterface.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | 532 | initEReference(getFunctionalInterface_Data(), this.getFunctionalData(), this.getFunctionalData_Interface(), "data", null, 0, -1, functionalarchitecture.FunctionalInterface.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
508 | initEReference(getFunctionalInterface_Element(), this.getFunctionalElement(), this.getFunctionalElement_Interface(), "element", null, 0, 1, FunctionalInterface.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | 533 | initEReference(getFunctionalInterface_Element(), this.getFunctionalElement(), this.getFunctionalElement_Interface(), "element", null, 0, 1, functionalarchitecture.FunctionalInterface.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
509 | 534 | ||
510 | initEClass(functionalInputEClass, FunctionalInput.class, "FunctionalInput", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | 535 | initEClass(functionalInputEClass, FunctionalInput.class, "FunctionalInput", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
511 | initEReference(getFunctionalInput_IncomingLinks(), this.getInformationLink(), this.getInformationLink_To(), "IncomingLinks", null, 0, -1, FunctionalInput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | 536 | initEReference(getFunctionalInput_IncomingLinks(), this.getInformationLink(), this.getInformationLink_To(), "IncomingLinks", null, 0, -1, FunctionalInput.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
@@ -540,12 +565,12 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
540 | * @generated | 565 | * @generated |
541 | */ | 566 | */ |
542 | protected void createEcoreAnnotations() { | 567 | protected void createEcoreAnnotations() { |
543 | String source = "http://www.eclipse.org/emf/2002/Ecore"; | 568 | String source = "http://www.eclipse.org/emf/2002/Ecore"; |
544 | addAnnotation | 569 | addAnnotation |
545 | (this, | 570 | (this, |
546 | source, | 571 | source, |
547 | new String[] { | 572 | new String[] { |
548 | "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" | 573 | "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" |
549 | }); | 574 | }); |
550 | } | 575 | } |
551 | 576 | ||
@@ -556,18 +581,18 @@ public class FunctionalarchitecturePackageImpl extends EPackageImpl implements F | |||
556 | * @generated | 581 | * @generated |
557 | */ | 582 | */ |
558 | protected void createOrgAnnotations() { | 583 | protected void createOrgAnnotations() { |
559 | String source = "org.eclipse.viatra.query.querybasedfeature"; | 584 | String source = "org.eclipse.viatra.query.querybasedfeature"; |
560 | addAnnotation | 585 | addAnnotation |
561 | (getFunctionalElement_Model(), | 586 | (getFunctionalElement_Model(), |
562 | source, | 587 | source, |
563 | new String[] { | 588 | new String[] { |
564 | "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.transima.fam.model" | 589 | "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.transima.fam.model" |
565 | }); | 590 | }); |
566 | addAnnotation | 591 | addAnnotation |
567 | (getFunction_Type(), | 592 | (getFunction_Type(), |
568 | source, | 593 | source, |
569 | new String[] { | 594 | new String[] { |
570 | "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.transima.fam.type" | 595 | "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.transima.fam.type" |
571 | }); | 596 | }); |
572 | } | 597 | } |
573 | 598 | ||
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/InformationLinkImpl.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/InformationLinkImpl.java index 4b46fef8..ead4f9e9 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/InformationLinkImpl.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/impl/InformationLinkImpl.java | |||
@@ -67,6 +67,7 @@ public class InformationLinkImpl extends MinimalEObjectImpl.Container implements | |||
67 | * <!-- end-user-doc --> | 67 | * <!-- end-user-doc --> |
68 | * @generated | 68 | * @generated |
69 | */ | 69 | */ |
70 | @Override | ||
70 | public FunctionalOutput getFrom() { | 71 | public FunctionalOutput getFrom() { |
71 | if (eContainerFeatureID() != FunctionalarchitecturePackage.INFORMATION_LINK__FROM) return null; | 72 | if (eContainerFeatureID() != FunctionalarchitecturePackage.INFORMATION_LINK__FROM) return null; |
72 | return (FunctionalOutput)eInternalContainer(); | 73 | return (FunctionalOutput)eInternalContainer(); |
@@ -87,6 +88,7 @@ public class InformationLinkImpl extends MinimalEObjectImpl.Container implements | |||
87 | * <!-- end-user-doc --> | 88 | * <!-- end-user-doc --> |
88 | * @generated | 89 | * @generated |
89 | */ | 90 | */ |
91 | @Override | ||
90 | public void setFrom(FunctionalOutput newFrom) { | 92 | public void setFrom(FunctionalOutput newFrom) { |
91 | if (newFrom != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.INFORMATION_LINK__FROM && newFrom != null)) { | 93 | if (newFrom != eInternalContainer() || (eContainerFeatureID() != FunctionalarchitecturePackage.INFORMATION_LINK__FROM && newFrom != null)) { |
92 | if (EcoreUtil.isAncestor(this, newFrom)) | 94 | if (EcoreUtil.isAncestor(this, newFrom)) |
@@ -108,6 +110,7 @@ public class InformationLinkImpl extends MinimalEObjectImpl.Container implements | |||
108 | * <!-- end-user-doc --> | 110 | * <!-- end-user-doc --> |
109 | * @generated | 111 | * @generated |
110 | */ | 112 | */ |
113 | @Override | ||
111 | public FunctionalInput getTo() { | 114 | public FunctionalInput getTo() { |
112 | if (to != null && to.eIsProxy()) { | 115 | if (to != null && to.eIsProxy()) { |
113 | InternalEObject oldTo = (InternalEObject)to; | 116 | InternalEObject oldTo = (InternalEObject)to; |
@@ -149,6 +152,7 @@ public class InformationLinkImpl extends MinimalEObjectImpl.Container implements | |||
149 | * <!-- end-user-doc --> | 152 | * <!-- end-user-doc --> |
150 | * @generated | 153 | * @generated |
151 | */ | 154 | */ |
155 | @Override | ||
152 | public void setTo(FunctionalInput newTo) { | 156 | public void setTo(FunctionalInput newTo) { |
153 | if (newTo != to) { | 157 | if (newTo != to) { |
154 | NotificationChain msgs = null; | 158 | NotificationChain msgs = null; |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureAdapterFactory.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureAdapterFactory.java index f990a7a4..9846bd62 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureAdapterFactory.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureAdapterFactory.java | |||
@@ -2,9 +2,15 @@ | |||
2 | */ | 2 | */ |
3 | package functionalarchitecture.util; | 3 | package functionalarchitecture.util; |
4 | 4 | ||
5 | import functionalarchitecture.*; | 5 | import functionalarchitecture.FAMTerminator; |
6 | import functionalarchitecture.FunctionalInterface; | 6 | import functionalarchitecture.Function; |
7 | 7 | import functionalarchitecture.FunctionalArchitectureModel; | |
8 | import functionalarchitecture.FunctionalData; | ||
9 | import functionalarchitecture.FunctionalElement; | ||
10 | import functionalarchitecture.FunctionalInput; | ||
11 | import functionalarchitecture.FunctionalOutput; | ||
12 | import functionalarchitecture.FunctionalarchitecturePackage; | ||
13 | import functionalarchitecture.InformationLink; | ||
8 | import org.eclipse.emf.common.notify.Adapter; | 14 | import org.eclipse.emf.common.notify.Adapter; |
9 | import org.eclipse.emf.common.notify.Notifier; | 15 | import org.eclipse.emf.common.notify.Notifier; |
10 | 16 | ||
@@ -89,7 +95,7 @@ public class FunctionalarchitectureAdapterFactory extends AdapterFactoryImpl { | |||
89 | return createInformationLinkAdapter(); | 95 | return createInformationLinkAdapter(); |
90 | } | 96 | } |
91 | @Override | 97 | @Override |
92 | public Adapter caseFunctionalInterface(FunctionalInterface object) { | 98 | public Adapter caseFunctionalInterface(functionalarchitecture.FunctionalInterface object) { |
93 | return createFunctionalInterfaceAdapter(); | 99 | return createFunctionalInterfaceAdapter(); |
94 | } | 100 | } |
95 | @Override | 101 | @Override |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureSwitch.java b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureSwitch.java index b481a978..a1bbb480 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureSwitch.java +++ b/Domains/Examples/ModelGenExampleFAM_plugin/ecore-gen/functionalarchitecture/util/FunctionalarchitectureSwitch.java | |||
@@ -2,9 +2,15 @@ | |||
2 | */ | 2 | */ |
3 | package functionalarchitecture.util; | 3 | package functionalarchitecture.util; |
4 | 4 | ||
5 | import functionalarchitecture.*; | 5 | import functionalarchitecture.FAMTerminator; |
6 | import functionalarchitecture.FunctionalInterface; | 6 | import functionalarchitecture.Function; |
7 | 7 | import functionalarchitecture.FunctionalArchitectureModel; | |
8 | import functionalarchitecture.FunctionalData; | ||
9 | import functionalarchitecture.FunctionalElement; | ||
10 | import functionalarchitecture.FunctionalInput; | ||
11 | import functionalarchitecture.FunctionalOutput; | ||
12 | import functionalarchitecture.FunctionalarchitecturePackage; | ||
13 | import functionalarchitecture.InformationLink; | ||
8 | import org.eclipse.emf.ecore.EObject; | 14 | import org.eclipse.emf.ecore.EObject; |
9 | import org.eclipse.emf.ecore.EPackage; | 15 | import org.eclipse.emf.ecore.EPackage; |
10 | 16 | ||
@@ -99,7 +105,7 @@ public class FunctionalarchitectureSwitch<T> extends Switch<T> { | |||
99 | return result; | 105 | return result; |
100 | } | 106 | } |
101 | case FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE: { | 107 | case FunctionalarchitecturePackage.FUNCTIONAL_INTERFACE: { |
102 | FunctionalInterface functionalInterface = (FunctionalInterface)theEObject; | 108 | functionalarchitecture.FunctionalInterface functionalInterface = (functionalarchitecture.FunctionalInterface)theEObject; |
103 | T result = caseFunctionalInterface(functionalInterface); | 109 | T result = caseFunctionalInterface(functionalInterface); |
104 | if (result == null) result = defaultCase(theEObject); | 110 | if (result == null) result = defaultCase(theEObject); |
105 | return result; | 111 | return result; |
@@ -214,7 +220,7 @@ public class FunctionalarchitectureSwitch<T> extends Switch<T> { | |||
214 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | 220 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) |
215 | * @generated | 221 | * @generated |
216 | */ | 222 | */ |
217 | public T caseFunctionalInterface(FunctionalInterface object) { | 223 | public T caseFunctionalInterface(functionalarchitecture.FunctionalInterface object) { |
218 | return null; | 224 | return null; |
219 | } | 225 | } |
220 | 226 | ||
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore b/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore index d8331ba8..9654ba41 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore +++ b/Domains/Examples/ModelGenExampleFAM_plugin/model/FamMetamodel.ecore | |||
@@ -1,69 +1,69 @@ | |||
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="functionalarchitecture" nsURI="http://www.inf.mit.bme.hu/viatrasolver/example/fam" | 3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="functionalarchitecture" nsURI="http://www.inf.mit.bme.hu/viatrasolver/example/fam" |
4 | nsPrefix="functionalarchitecture"> | 4 | nsPrefix="functionalarchitecture"> |
5 | <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> | 5 | <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> |
6 | <details key="settingDelegates" value="org.eclipse.viatra.query.querybasedfeature"/> | 6 | <details key="settingDelegates" value="org.eclipse.viatra.query.querybasedfeature"/> |
7 | </eAnnotations> | 7 | </eAnnotations> |
8 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalElement" abstract="true"> | 8 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalElement" abstract="true"> |
9 | <eStructuralFeatures xsi:type="ecore:EReference" name="interface" eType="#//FunctionalInterface" | 9 | <eStructuralFeatures xsi:type="ecore:EReference" name="interface" eType="#//FunctionalInterface" |
10 | containment="true" eOpposite="#//FunctionalInterface/element"/> | 10 | containment="true" eOpposite="#//FunctionalInterface/element"/> |
11 | <eStructuralFeatures xsi:type="ecore:EReference" name="model" lowerBound="1" eType="#//FunctionalArchitectureModel" | 11 | <eStructuralFeatures xsi:type="ecore:EReference" name="model" lowerBound="1" eType="#//FunctionalArchitectureModel" |
12 | volatile="true" transient="true" derived="true"> | 12 | volatile="true" transient="true" derived="true"> |
13 | <eAnnotations source="org.eclipse.viatra.query.querybasedfeature"> | 13 | <eAnnotations source="org.eclipse.viatra.query.querybasedfeature"> |
14 | <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.transima.fam.model"/> | 14 | <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.transima.fam.model"/> |
15 | </eAnnotations> | 15 | </eAnnotations> |
16 | </eStructuralFeatures> | 16 | </eStructuralFeatures> |
17 | <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Function" | 17 | <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Function" |
18 | eOpposite="#//Function/subElements"/> | 18 | eOpposite="#//Function/subElements"/> |
19 | </eClassifiers> | 19 | </eClassifiers> |
20 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalArchitectureModel"> | 20 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalArchitectureModel"> |
21 | <eStructuralFeatures xsi:type="ecore:EReference" name="rootElements" upperBound="-1" | 21 | <eStructuralFeatures xsi:type="ecore:EReference" name="rootElements" upperBound="-1" |
22 | eType="#//FunctionalElement" containment="true"/> | 22 | eType="#//FunctionalElement" containment="true"/> |
23 | </eClassifiers> | 23 | </eClassifiers> |
24 | <eClassifiers xsi:type="ecore:EClass" name="Function" eSuperTypes="#//FunctionalElement"> | 24 | <eClassifiers xsi:type="ecore:EClass" name="Function" eSuperTypes="#//FunctionalElement"> |
25 | <eStructuralFeatures xsi:type="ecore:EReference" name="subElements" upperBound="-1" | 25 | <eStructuralFeatures xsi:type="ecore:EReference" name="subElements" upperBound="-1" |
26 | eType="#//FunctionalElement" containment="true" eOpposite="#//FunctionalElement/parent"/> | 26 | eType="#//FunctionalElement" containment="true" eOpposite="#//FunctionalElement/parent"/> |
27 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="#//FunctionType" | 27 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="type" lowerBound="1" eType="#//FunctionType" |
28 | changeable="false" volatile="true" transient="true" derived="true"> | 28 | changeable="false" volatile="true" transient="true" derived="true"> |
29 | <eAnnotations source="org.eclipse.viatra.query.querybasedfeature"> | 29 | <eAnnotations source="org.eclipse.viatra.query.querybasedfeature"> |
30 | <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.transima.fam.type"/> | 30 | <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.transima.fam.type"/> |
31 | </eAnnotations> | 31 | </eAnnotations> |
32 | </eStructuralFeatures> | 32 | </eStructuralFeatures> |
33 | </eClassifiers> | 33 | </eClassifiers> |
34 | <eClassifiers xsi:type="ecore:EClass" name="FAMTerminator"> | 34 | <eClassifiers xsi:type="ecore:EClass" name="FAMTerminator"> |
35 | <eStructuralFeatures xsi:type="ecore:EReference" name="data" eType="#//FunctionalData" | 35 | <eStructuralFeatures xsi:type="ecore:EReference" name="data" eType="#//FunctionalData" |
36 | eOpposite="#//FunctionalData/terminator"/> | 36 | eOpposite="#//FunctionalData/terminator"/> |
37 | </eClassifiers> | 37 | </eClassifiers> |
38 | <eClassifiers xsi:type="ecore:EClass" name="InformationLink"> | 38 | <eClassifiers xsi:type="ecore:EClass" name="InformationLink"> |
39 | <eStructuralFeatures xsi:type="ecore:EReference" name="from" eType="#//FunctionalOutput" | 39 | <eStructuralFeatures xsi:type="ecore:EReference" name="from" eType="#//FunctionalOutput" |
40 | eOpposite="#//FunctionalOutput/outgoingLinks"/> | 40 | eOpposite="#//FunctionalOutput/outgoingLinks"/> |
41 | <eStructuralFeatures xsi:type="ecore:EReference" name="to" lowerBound="1" eType="#//FunctionalInput" | 41 | <eStructuralFeatures xsi:type="ecore:EReference" name="to" lowerBound="1" eType="#//FunctionalInput" |
42 | eOpposite="#//FunctionalInput/IncomingLinks"/> | 42 | eOpposite="#//FunctionalInput/IncomingLinks"/> |
43 | </eClassifiers> | 43 | </eClassifiers> |
44 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalInterface"> | 44 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalInterface"> |
45 | <eStructuralFeatures xsi:type="ecore:EReference" name="data" upperBound="-1" eType="#//FunctionalData" | 45 | <eStructuralFeatures xsi:type="ecore:EReference" name="data" upperBound="-1" eType="#//FunctionalData" |
46 | containment="true" eOpposite="#//FunctionalData/interface"/> | 46 | containment="true" eOpposite="#//FunctionalData/interface"/> |
47 | <eStructuralFeatures xsi:type="ecore:EReference" name="element" eType="#//FunctionalElement" | 47 | <eStructuralFeatures xsi:type="ecore:EReference" name="element" eType="#//FunctionalElement" |
48 | eOpposite="#//FunctionalElement/interface"/> | 48 | eOpposite="#//FunctionalElement/interface"/> |
49 | </eClassifiers> | 49 | </eClassifiers> |
50 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalInput" eSuperTypes="#//FunctionalData"> | 50 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalInput" eSuperTypes="#//FunctionalData"> |
51 | <eStructuralFeatures xsi:type="ecore:EReference" name="IncomingLinks" upperBound="-1" | 51 | <eStructuralFeatures xsi:type="ecore:EReference" name="IncomingLinks" upperBound="-1" |
52 | eType="#//InformationLink" eOpposite="#//InformationLink/to"/> | 52 | eType="#//InformationLink" eOpposite="#//InformationLink/to"/> |
53 | </eClassifiers> | 53 | </eClassifiers> |
54 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalOutput" eSuperTypes="#//FunctionalData"> | 54 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalOutput" eSuperTypes="#//FunctionalData"> |
55 | <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingLinks" upperBound="-1" | 55 | <eStructuralFeatures xsi:type="ecore:EReference" name="outgoingLinks" upperBound="-1" |
56 | eType="#//InformationLink" containment="true" eOpposite="#//InformationLink/from"/> | 56 | eType="#//InformationLink" containment="true" eOpposite="#//InformationLink/from"/> |
57 | </eClassifiers> | 57 | </eClassifiers> |
58 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalData" abstract="true"> | 58 | <eClassifiers xsi:type="ecore:EClass" name="FunctionalData" abstract="true"> |
59 | <eStructuralFeatures xsi:type="ecore:EReference" name="terminator" eType="#//FAMTerminator" | 59 | <eStructuralFeatures xsi:type="ecore:EReference" name="terminator" eType="#//FAMTerminator" |
60 | containment="true" eOpposite="#//FAMTerminator/data"/> | 60 | containment="true" eOpposite="#//FAMTerminator/data"/> |
61 | <eStructuralFeatures xsi:type="ecore:EReference" name="interface" eType="#//FunctionalInterface" | 61 | <eStructuralFeatures xsi:type="ecore:EReference" name="interface" eType="#//FunctionalInterface" |
62 | eOpposite="#//FunctionalInterface/data"/> | 62 | eOpposite="#//FunctionalInterface/data"/> |
63 | </eClassifiers> | 63 | </eClassifiers> |
64 | <eClassifiers xsi:type="ecore:EEnum" name="FunctionType"> | 64 | <eClassifiers xsi:type="ecore:EEnum" name="FunctionType"> |
65 | <eLiterals name="Root"/> | 65 | <eLiterals name="Root"/> |
66 | <eLiterals name="Intermediate" value="1"/> | 66 | <eLiterals name="Intermediate" value="1"/> |
67 | <eLiterals name="Leaf" value="2"/> | 67 | <eLiterals name="Leaf" value="2"/> |
68 | </eClassifiers> | 68 | </eClassifiers> |
69 | </ecore:EPackage> | 69 | </ecore:EPackage> |
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml b/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml index 3dce57aa..c117a28e 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml +++ b/Domains/Examples/ModelGenExampleFAM_plugin/plugin.xml | |||
@@ -1,24 +1,27 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?><plugin> | 1 | <?xml version="1.0" encoding="UTF-8"?><plugin> |
2 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.transima.fam.model" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> | 2 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.transima.fam.model" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> |
3 | <wellbehaving-derived-feature classifier-name="FunctionalElement" feature-name="model" package-nsUri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> | 3 | <wellbehaving-derived-feature classifier-name="FunctionalElement" feature-name="model" package-nsUri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> |
4 | </extension> | 4 | </extension> |
5 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.transima.fam.type" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> | 5 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.transima.fam.type" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> |
6 | <wellbehaving-derived-feature classifier-name="Function" feature-name="type" package-nsUri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> | 6 | <wellbehaving-derived-feature classifier-name="Function" feature-name="type" package-nsUri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> |
7 | </extension> | 7 | </extension> |
8 | <extension point="org.eclipse.emf.ecore.generated_package"> | 8 | <extension point="org.eclipse.emf.ecore.generated_package"> |
9 | <!-- @generated FamMetamodel --> | 9 | <!-- @generated FamMetamodel --> |
10 | <package class="functionalarchitecture.FunctionalarchitecturePackage" genModel="model/FamMetamodel.genmodel" uri="http://www.inf.mit.bme.hu/viatrasolver/example/fam"/> | 10 | <package |
11 | </extension> | 11 | uri="http://www.inf.mit.bme.hu/viatrasolver/example/fam" |
12 | <extension id="hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns" point="org.eclipse.viatra.query.runtime.queryspecification"> | 12 | class="functionalarchitecture.FunctionalarchitecturePackage" |
13 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns" id="hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns"> | 13 | genModel="model/FamMetamodel.genmodel"/> |
14 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.terminatorAndInformation"/> | 14 | </extension> |
15 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.type"/> | 15 | <extension id="hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns" point="org.eclipse.viatra.query.runtime.queryspecification"> |
16 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.rootElements"/> | 16 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns" id="hu.bme.mit.inf.dslreasoner.domains.transima.fam.FamPatterns"> |
17 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.parent"/> | 17 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.terminatorAndInformation"/> |
18 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.model"/> | 18 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.type"/> |
19 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.hasRoot"/> | 19 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.rootElements"/> |
20 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.hasInt"/> | 20 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.parent"/> |
21 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.hasLeaf"/> | 21 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.model"/> |
22 | </group> | 22 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.hasRoot"/> |
23 | </extension> | 23 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.hasInt"/> |
24 | </plugin> | 24 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.transima.fam.hasLeaf"/> |
25 | </group> | ||
26 | </extension> | ||
27 | </plugin> | ||
diff --git a/Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql b/Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql index f0e48d42..1d9a6b6d 100644 --- a/Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql +++ b/Domains/Examples/ModelGenExampleFAM_plugin/src/hu/bme/mit/inf/dslreasoner/domains/transima/fam/FamPatterns.vql | |||
@@ -10,7 +10,7 @@ pattern terminatorAndInformation(T : FAMTerminator, I : InformationLink) = { | |||
10 | InformationLink.to(I,In); | 10 | InformationLink.to(I,In); |
11 | FunctionalInput.terminator(In,T); | 11 | FunctionalInput.terminator(In,T); |
12 | } | 12 | } |
13 | 13 | /* | |
14 | @QueryBasedFeature | 14 | @QueryBasedFeature |
15 | pattern type(This : Function, Target : FunctionType) = { | 15 | pattern type(This : Function, Target : FunctionType) = { |
16 | find rootElements(_Model, This); | 16 | find rootElements(_Model, This); |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/.classpath b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/.classpath index 3b808ec0..7f459bda 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/.classpath +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/.classpath | |||
@@ -1,10 +1,13 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | <classpath> | 2 | <classpath> |
3 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/> | 3 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> |
4 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | 4 | <attributes> |
5 | <classpathentry kind="src" path="src"/> | 5 | <attribute name="module" value="true"/> |
6 | <classpathentry kind="src" path="xtend-gen"/> | 6 | </attributes> |
7 | <classpathentry kind="src" path="patterns"/> | 7 | </classpathentry> |
8 | <classpathentry kind="src" path="src-gen/"/> | 8 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> |
9 | <classpathentry kind="output" path="bin"/> | 9 | <classpathentry kind="src" path="src"/> |
10 | </classpath> | 10 | <classpathentry kind="src" path="patterns"/> |
11 | <classpathentry kind="src" path="src-gen"/> | ||
12 | <classpathentry kind="output" path="bin"/> | ||
13 | </classpath> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/META-INF/MANIFEST.MF b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/META-INF/MANIFEST.MF index 41726ae6..d5f7db65 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/META-INF/MANIFEST.MF +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/META-INF/MANIFEST.MF | |||
@@ -6,20 +6,20 @@ Bundle-Version: 1.0.0.qualifier | |||
6 | Bundle-ClassPath: . | 6 | Bundle-ClassPath: . |
7 | Bundle-Vendor: %providerName | 7 | Bundle-Vendor: %providerName |
8 | Bundle-Localization: plugin | 8 | Bundle-Localization: plugin |
9 | Export-Package: hu.bme.mit.inf.dslreasoner.domains.alloyexamples, | 9 | Export-Package: hu.bme.mit.inf.dslreasoner.domains.alloyexamples, |
10 | hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem, | 10 | hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem, |
11 | hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl, | 11 | hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl, |
12 | hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.util, | 12 | hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.util |
13 | hu.bme.mit.inf.dslreasoner.domains.alloyexamples.util | 13 | Require-Bundle: org.eclipse.viatra.addon.querybasedfeatures.runtime, |
14 | Require-Bundle: org.eclipse.viatra.addon.querybasedfeatures.runtime, | 14 | org.eclipse.viatra.query.runtime, |
15 | org.eclipse.viatra.query.runtime, | 15 | org.eclipse.core.runtime, |
16 | org.eclipse.core.runtime, | 16 | org.eclipse.emf.ecore;visibility:=reexport, |
17 | org.eclipse.emf.ecore;visibility:=reexport, | 17 | org.eclipse.emf.emfstore.common, |
18 | org.eclipse.emf.emfstore.common, | 18 | com.google.guava, |
19 | com.google.guava, | 19 | org.eclipse.xtext.xbase.lib, |
20 | org.eclipse.xtext.xbase.lib, | 20 | org.eclipse.xtend.lib, |
21 | org.eclipse.xtend.lib, | ||
22 | org.eclipse.xtend.lib.macro | 21 | org.eclipse.xtend.lib.macro |
23 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
24 | Bundle-ActivationPolicy: lazy | ||
25 | Import-Package: org.apache.log4j | 22 | Import-Package: org.apache.log4j |
23 | Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.domains.alloyexamples | ||
24 | Bundle-ActivationPolicy: lazy | ||
25 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/build.properties b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/build.properties index a9ab8b56..418a7a43 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/build.properties +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/build.properties | |||
@@ -5,5 +5,6 @@ bin.includes = .,\ | |||
5 | plugin.properties | 5 | plugin.properties |
6 | jars.compile.order = . | 6 | jars.compile.order = . |
7 | source.. = src/,\ | 7 | source.. = src/,\ |
8 | src-gen/ | 8 | src-gen/,\ |
9 | patterns/ | ||
9 | output.. = bin/ | 10 | output.. = bin/ |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.ecore b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.ecore index c928d2b0..32874953 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.ecore +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.ecore | |||
@@ -1,32 +1,32 @@ | |||
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="Filesystem" nsURI="FS" nsPrefix="FS"> | 3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="Filesystem" nsURI="FS" nsPrefix="FS"> |
4 | <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> | 4 | <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore"> |
5 | <details key="settingDelegates" value="org.eclipse.viatra.query.querybasedfeature"/> | 5 | <details key="settingDelegates" value="org.eclipse.viatra.query.querybasedfeature"/> |
6 | </eAnnotations> | 6 | </eAnnotations> |
7 | <eClassifiers xsi:type="ecore:EClass" name="FileSystem"> | 7 | <eClassifiers xsi:type="ecore:EClass" name="FileSystem"> |
8 | <eStructuralFeatures xsi:type="ecore:EReference" name="root" lowerBound="1" eType="#//Dir" | 8 | <eStructuralFeatures xsi:type="ecore:EReference" name="root" lowerBound="1" eType="#//FSObject" |
9 | containment="true"/> | 9 | containment="true"/> |
10 | <eStructuralFeatures xsi:type="ecore:EReference" name="live" upperBound="-1" eType="#//FSObject" | 10 | <eStructuralFeatures xsi:type="ecore:EReference" name="live" upperBound="-1" eType="#//FSObject" |
11 | changeable="false" volatile="true" transient="true" derived="true"> | 11 | changeable="false" volatile="true" transient="true" derived="true"> |
12 | <eAnnotations source="org.eclipse.viatra.query.querybasedfeature"> | 12 | <eAnnotations source="org.eclipse.viatra.query.querybasedfeature"> |
13 | <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live"/> | 13 | <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live"/> |
14 | </eAnnotations> | 14 | </eAnnotations> |
15 | </eStructuralFeatures> | 15 | </eStructuralFeatures> |
16 | </eClassifiers> | 16 | </eClassifiers> |
17 | <eClassifiers xsi:type="ecore:EClass" name="FSObject" abstract="true"> | 17 | <eClassifiers xsi:type="ecore:EClass" name="FSObject" abstract="true"> |
18 | <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Dir" | 18 | <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Dir" |
19 | eOpposite="#//Dir/contents"/> | 19 | eOpposite="#//Dir/contents"/> |
20 | </eClassifiers> | 20 | </eClassifiers> |
21 | <eClassifiers xsi:type="ecore:EClass" name="Dir" eSuperTypes="#//FSObject"> | 21 | <eClassifiers xsi:type="ecore:EClass" name="Dir" eSuperTypes="#//FSObject"> |
22 | <eStructuralFeatures xsi:type="ecore:EReference" name="contents" upperBound="-1" | 22 | <eStructuralFeatures xsi:type="ecore:EReference" name="contents" upperBound="-1" |
23 | eType="#//FSObject" containment="true" eOpposite="#//FSObject/parent"/> | 23 | eType="#//FSObject" containment="true" eOpposite="#//FSObject/parent"/> |
24 | </eClassifiers> | 24 | </eClassifiers> |
25 | <eClassifiers xsi:type="ecore:EClass" name="File" eSuperTypes="#//FSObject"/> | 25 | <eClassifiers xsi:type="ecore:EClass" name="File" eSuperTypes="#//FSObject"/> |
26 | <eClassifiers xsi:type="ecore:EClass" name="Model"> | 26 | <eClassifiers xsi:type="ecore:EClass" name="Model"> |
27 | <eStructuralFeatures xsi:type="ecore:EReference" name="filesystems" lowerBound="1" | 27 | <eStructuralFeatures xsi:type="ecore:EReference" name="filesystems" lowerBound="1" |
28 | eType="#//FileSystem" containment="true"/> | 28 | eType="#//FileSystem" containment="true"/> |
29 | <eStructuralFeatures xsi:type="ecore:EReference" name="otherFSObjects" upperBound="-1" | 29 | <eStructuralFeatures xsi:type="ecore:EReference" name="otherFSObjects" upperBound="-1" |
30 | eType="#//FSObject" containment="true"/> | 30 | eType="#//FSObject" containment="true"/> |
31 | </eClassifiers> | 31 | </eClassifiers> |
32 | </ecore:EPackage> | 32 | </ecore:EPackage> |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.genmodel b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.genmodel index 355ac109..daa44727 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.genmodel +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/model/FileSytem.genmodel | |||
@@ -11,13 +11,13 @@ | |||
11 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//FileSystem/root"/> | 11 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//FileSystem/root"/> |
12 | <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference FileSytem.ecore#//FileSystem/live"/> | 12 | <genFeatures property="Readonly" notify="false" createChild="false" ecoreFeature="ecore:EReference FileSytem.ecore#//FileSystem/live"/> |
13 | </genClasses> | 13 | </genClasses> |
14 | <genClasses image="false" ecoreClass="FileSytem.ecore#//FSObject"/> | 14 | <genClasses image="false" ecoreClass="FileSytem.ecore#//FSObject"> |
15 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference FileSytem.ecore#//FSObject/parent"/> | ||
16 | </genClasses> | ||
15 | <genClasses ecoreClass="FileSytem.ecore#//Dir"> | 17 | <genClasses ecoreClass="FileSytem.ecore#//Dir"> |
16 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//Dir/contents"/> | 18 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//Dir/contents"/> |
17 | </genClasses> | 19 | </genClasses> |
18 | <genClasses ecoreClass="FileSytem.ecore#//File"> | 20 | <genClasses ecoreClass="FileSytem.ecore#//File"/> |
19 | <genFeatures property="None" notify="false" createChild="false" ecoreFeature="ecore:EReference FileSytem.ecore#//File/parent"/> | ||
20 | </genClasses> | ||
21 | <genClasses ecoreClass="FileSytem.ecore#//Model"> | 21 | <genClasses ecoreClass="FileSytem.ecore#//Model"> |
22 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//Model/filesystems"/> | 22 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//Model/filesystems"/> |
23 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//Model/otherFSObjects"/> | 23 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference FileSytem.ecore#//Model/otherFSObjects"/> |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql index 719a9d96..c785c2fc 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | |||
@@ -2,7 +2,7 @@ package hu.bme.mit.inf.dslreasoner.domains.alloyexamples | |||
2 | 2 | ||
3 | import epackage "FS" | 3 | import epackage "FS" |
4 | 4 | ||
5 | pattern patternContent(o1: FSObject, o2: FSObject) { | 5 | pattern patternContent(o1: Dir, o2: FSObject) { |
6 | Dir.contents(o1,o2); | 6 | Dir.contents(o1,o2); |
7 | } | 7 | } |
8 | 8 | ||
@@ -22,3 +22,13 @@ pattern contentInNotLive(parent : Dir, child: FSObject) { | |||
22 | Dir.contents(parent,child); | 22 | Dir.contents(parent,child); |
23 | neg find live(_,child); | 23 | neg find live(_,child); |
24 | } | 24 | } |
25 | |||
26 | pattern dir(d: Dir) { | ||
27 | Dir(d); | ||
28 | } | ||
29 | |||
30 | @Constraint(key={fs}, severity="error", message="error") | ||
31 | pattern rootIsNotDir(fs: FileSystem) { | ||
32 | FileSystem.root(fs, root); | ||
33 | neg find dir(root); | ||
34 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/plugin.xml index 576aa06e..6eae8535 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/plugin.xml +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/plugin.xml | |||
@@ -1,26 +1,28 @@ | |||
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 point="org.eclipse.emf.ecore.generated_package"> | 3 | <extension point="org.eclipse.emf.ecore.generated_package"> |
4 | <!-- @generated FileSytem --> | 4 | <!-- @generated FileSytem --> |
5 | <package class="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage" genModel="model/FileSytem.genmodel" uri="FS"/> | 5 | <package class="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage" genModel="model/FileSytem.genmodel" uri="FS"/> |
6 | </extension> | 6 | </extension> |
7 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> | 7 | <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features"> |
8 | <wellbehaving-derived-feature classifier-name="FileSystem" feature-name="live" package-nsUri="FS"/> | 8 | <wellbehaving-derived-feature classifier-name="FileSystem" feature-name="live" package-nsUri="FS"/> |
9 | </extension> | 9 | </extension> |
10 | <extension id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Ecore" point="org.eclipse.viatra.query.runtime.queryspecification"> | 10 | <extension id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Ecore" point="org.eclipse.viatra.query.runtime.queryspecification"> |
11 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Ecore" id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Ecore"> | 11 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Ecore" id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Ecore"> |
12 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.directSupertype"/> | 12 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.directSupertype"/> |
13 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.loopInInheritence"/> | 13 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.loopInInheritence"/> |
14 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.opposite"/> | 14 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.opposite"/> |
15 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.oppositeDifferentClass"/> | 15 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.oppositeDifferentClass"/> |
16 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.nonSymmetricOpposite"/> | 16 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.nonSymmetricOpposite"/> |
17 | </group> | 17 | </group> |
18 | </extension> | 18 | </extension> |
19 | <extension id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.FileSystem" point="org.eclipse.viatra.query.runtime.queryspecification"> | 19 | <extension id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.FileSystem" point="org.eclipse.viatra.query.runtime.queryspecification"> |
20 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.alloyexamples.FileSystem" id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.FileSystem"> | 20 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.alloyexamples.FileSystem" id="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.FileSystem"> |
21 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.patternContent"/> | 21 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.patternContent"/> |
22 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live"/> | 22 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live"/> |
23 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.contentInNotLive"/> | 23 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.contentInNotLive"/> |
24 | </group> | 24 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir"/> |
25 | </extension> | 25 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.alloyexamples.rootIsNotDir"/> |
26 | </plugin> | 26 | </group> |
27 | </extension> | ||
28 | </plugin> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/.gitignore index 9d608403..fa9b1325 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/.gitignore +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/.gitignore | |||
@@ -34,3 +34,21 @@ | |||
34 | /OppositeMatcher.java | 34 | /OppositeMatcher.java |
35 | /PatternContentMatch.java | 35 | /PatternContentMatch.java |
36 | /PatternContentMatcher.java | 36 | /PatternContentMatcher.java |
37 | /.ContentInNotLive.java._trace | ||
38 | /.DirectSupertype.java._trace | ||
39 | /.Live.java._trace | ||
40 | /.LoopInInheritence.java._trace | ||
41 | /.NonSymmetricOpposite.java._trace | ||
42 | /.Opposite.java._trace | ||
43 | /.OppositeDifferentClass.java._trace | ||
44 | /.PatternContent.java._trace | ||
45 | /ContentInNotLive.java | ||
46 | /DirectSupertype.java | ||
47 | /Live.java | ||
48 | /LoopInInheritence.java | ||
49 | /NonSymmetricOpposite.java | ||
50 | /Opposite.java | ||
51 | /OppositeDifferentClass.java | ||
52 | /PatternContent.java | ||
53 | /.Dir.java._trace | ||
54 | /.RootIsNotDir.java._trace | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/ContentInNotLive.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/ContentInNotLive.java new file mode 100644 index 00000000..ffdc1a69 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/ContentInNotLive.java | |||
@@ -0,0 +1,741 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Live; | ||
9 | import java.util.Arrays; | ||
10 | import java.util.Collection; | ||
11 | import java.util.LinkedHashSet; | ||
12 | import java.util.List; | ||
13 | import java.util.Objects; | ||
14 | import java.util.Optional; | ||
15 | import java.util.Set; | ||
16 | import java.util.function.Consumer; | ||
17 | import java.util.stream.Collectors; | ||
18 | import java.util.stream.Stream; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
44 | import 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(key={child}, severity="error", message="error") | ||
52 | * pattern contentInNotLive(parent : Dir, child: FSObject) { | ||
53 | * Dir.contents(parent,child); | ||
54 | * neg find live(_,parent); | ||
55 | * } or { | ||
56 | * Dir.contents(parent,child); | ||
57 | * neg find live(_,child); | ||
58 | * } | ||
59 | * </pre></code> | ||
60 | * | ||
61 | * @see Matcher | ||
62 | * @see Match | ||
63 | * | ||
64 | */ | ||
65 | @SuppressWarnings("all") | ||
66 | public final class ContentInNotLive extends BaseGeneratedEMFQuerySpecification<ContentInNotLive.Matcher> { | ||
67 | /** | ||
68 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.contentInNotLive pattern, | ||
69 | * to be used in conjunction with {@link Matcher}. | ||
70 | * | ||
71 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
72 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
73 | * usable to represent a match of the pattern in the result of a query, | ||
74 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
75 | * | ||
76 | * @see Matcher | ||
77 | * | ||
78 | */ | ||
79 | public static abstract class Match extends BasePatternMatch { | ||
80 | private Dir fParent; | ||
81 | |||
82 | private FSObject fChild; | ||
83 | |||
84 | private static List<String> parameterNames = makeImmutableList("parent", "child"); | ||
85 | |||
86 | private Match(final Dir pParent, final FSObject pChild) { | ||
87 | this.fParent = pParent; | ||
88 | this.fChild = pChild; | ||
89 | } | ||
90 | |||
91 | @Override | ||
92 | public Object get(final String parameterName) { | ||
93 | if ("parent".equals(parameterName)) return this.fParent; | ||
94 | if ("child".equals(parameterName)) return this.fChild; | ||
95 | return null; | ||
96 | } | ||
97 | |||
98 | public Dir getParent() { | ||
99 | return this.fParent; | ||
100 | } | ||
101 | |||
102 | public FSObject getChild() { | ||
103 | return this.fChild; | ||
104 | } | ||
105 | |||
106 | @Override | ||
107 | public boolean set(final String parameterName, final Object newValue) { | ||
108 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
109 | if ("parent".equals(parameterName) ) { | ||
110 | this.fParent = (Dir) newValue; | ||
111 | return true; | ||
112 | } | ||
113 | if ("child".equals(parameterName) ) { | ||
114 | this.fChild = (FSObject) newValue; | ||
115 | return true; | ||
116 | } | ||
117 | return false; | ||
118 | } | ||
119 | |||
120 | public void setParent(final Dir pParent) { | ||
121 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
122 | this.fParent = pParent; | ||
123 | } | ||
124 | |||
125 | public void setChild(final FSObject pChild) { | ||
126 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
127 | this.fChild = pChild; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public String patternName() { | ||
132 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.contentInNotLive"; | ||
133 | } | ||
134 | |||
135 | @Override | ||
136 | public List<String> parameterNames() { | ||
137 | return ContentInNotLive.Match.parameterNames; | ||
138 | } | ||
139 | |||
140 | @Override | ||
141 | public Object[] toArray() { | ||
142 | return new Object[]{fParent, fChild}; | ||
143 | } | ||
144 | |||
145 | @Override | ||
146 | public ContentInNotLive.Match toImmutable() { | ||
147 | return isMutable() ? newMatch(fParent, fChild) : this; | ||
148 | } | ||
149 | |||
150 | @Override | ||
151 | public String prettyPrint() { | ||
152 | StringBuilder result = new StringBuilder(); | ||
153 | result.append("\"parent\"=" + prettyPrintValue(fParent) + ", "); | ||
154 | result.append("\"child\"=" + prettyPrintValue(fChild)); | ||
155 | return result.toString(); | ||
156 | } | ||
157 | |||
158 | @Override | ||
159 | public int hashCode() { | ||
160 | return Objects.hash(fParent, fChild); | ||
161 | } | ||
162 | |||
163 | @Override | ||
164 | public boolean equals(final Object obj) { | ||
165 | if (this == obj) | ||
166 | return true; | ||
167 | if (obj == null) { | ||
168 | return false; | ||
169 | } | ||
170 | if ((obj instanceof ContentInNotLive.Match)) { | ||
171 | ContentInNotLive.Match other = (ContentInNotLive.Match) obj; | ||
172 | return Objects.equals(fParent, other.fParent) && Objects.equals(fChild, other.fChild); | ||
173 | } else { | ||
174 | // this should be infrequent | ||
175 | if (!(obj instanceof IPatternMatch)) { | ||
176 | return false; | ||
177 | } | ||
178 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
179 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
180 | } | ||
181 | } | ||
182 | |||
183 | @Override | ||
184 | public ContentInNotLive specification() { | ||
185 | return ContentInNotLive.instance(); | ||
186 | } | ||
187 | |||
188 | /** | ||
189 | * Returns an empty, mutable match. | ||
190 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
191 | * | ||
192 | * @return the empty match. | ||
193 | * | ||
194 | */ | ||
195 | public static ContentInNotLive.Match newEmptyMatch() { | ||
196 | return new Mutable(null, null); | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * Returns a mutable (partial) match. | ||
201 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
202 | * | ||
203 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
204 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
205 | * @return the new, mutable (partial) match object. | ||
206 | * | ||
207 | */ | ||
208 | public static ContentInNotLive.Match newMutableMatch(final Dir pParent, final FSObject pChild) { | ||
209 | return new Mutable(pParent, pChild); | ||
210 | } | ||
211 | |||
212 | /** | ||
213 | * Returns a new (partial) match. | ||
214 | * This can be used e.g. to call the matcher with a partial match. | ||
215 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
216 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
217 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
218 | * @return the (partial) match object. | ||
219 | * | ||
220 | */ | ||
221 | public static ContentInNotLive.Match newMatch(final Dir pParent, final FSObject pChild) { | ||
222 | return new Immutable(pParent, pChild); | ||
223 | } | ||
224 | |||
225 | private static final class Mutable extends ContentInNotLive.Match { | ||
226 | Mutable(final Dir pParent, final FSObject pChild) { | ||
227 | super(pParent, pChild); | ||
228 | } | ||
229 | |||
230 | @Override | ||
231 | public boolean isMutable() { | ||
232 | return true; | ||
233 | } | ||
234 | } | ||
235 | |||
236 | private static final class Immutable extends ContentInNotLive.Match { | ||
237 | Immutable(final Dir pParent, final FSObject pChild) { | ||
238 | super(pParent, pChild); | ||
239 | } | ||
240 | |||
241 | @Override | ||
242 | public boolean isMutable() { | ||
243 | return false; | ||
244 | } | ||
245 | } | ||
246 | } | ||
247 | |||
248 | /** | ||
249 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.contentInNotLive pattern, | ||
250 | * providing pattern-specific query methods. | ||
251 | * | ||
252 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
253 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
254 | * | ||
255 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
256 | * | ||
257 | * <p>Original source: | ||
258 | * <code><pre> | ||
259 | * {@literal @}Constraint(key={child}, severity="error", message="error") | ||
260 | * pattern contentInNotLive(parent : Dir, child: FSObject) { | ||
261 | * Dir.contents(parent,child); | ||
262 | * neg find live(_,parent); | ||
263 | * } or { | ||
264 | * Dir.contents(parent,child); | ||
265 | * neg find live(_,child); | ||
266 | * } | ||
267 | * </pre></code> | ||
268 | * | ||
269 | * @see Match | ||
270 | * @see ContentInNotLive | ||
271 | * | ||
272 | */ | ||
273 | public static class Matcher extends BaseMatcher<ContentInNotLive.Match> { | ||
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 | public static ContentInNotLive.Matcher on(final ViatraQueryEngine engine) { | ||
283 | // check if matcher already exists | ||
284 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
285 | if (matcher == null) { | ||
286 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
287 | } | ||
288 | return matcher; | ||
289 | } | ||
290 | |||
291 | /** | ||
292 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
293 | * @return an initialized matcher | ||
294 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
295 | * | ||
296 | */ | ||
297 | public static ContentInNotLive.Matcher create() { | ||
298 | return new Matcher(); | ||
299 | } | ||
300 | |||
301 | private static final int POSITION_PARENT = 0; | ||
302 | |||
303 | private static final int POSITION_CHILD = 1; | ||
304 | |||
305 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ContentInNotLive.Matcher.class); | ||
306 | |||
307 | /** | ||
308 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
309 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
310 | * | ||
311 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
312 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
313 | * | ||
314 | */ | ||
315 | private Matcher() { | ||
316 | super(querySpecification()); | ||
317 | } | ||
318 | |||
319 | /** | ||
320 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
321 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
322 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
323 | * @return matches represented as a Match object. | ||
324 | * | ||
325 | */ | ||
326 | public Collection<ContentInNotLive.Match> getAllMatches(final Dir pParent, final FSObject pChild) { | ||
327 | return rawStreamAllMatches(new Object[]{pParent, pChild}).collect(Collectors.toSet()); | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
332 | * </p> | ||
333 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
334 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
335 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
336 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
337 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
338 | * @return a stream of matches represented as a Match object. | ||
339 | * | ||
340 | */ | ||
341 | public Stream<ContentInNotLive.Match> streamAllMatches(final Dir pParent, final FSObject pChild) { | ||
342 | return rawStreamAllMatches(new Object[]{pParent, pChild}); | ||
343 | } | ||
344 | |||
345 | /** | ||
346 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
347 | * Neither determinism nor randomness of selection is guaranteed. | ||
348 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
349 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
350 | * @return a match represented as a Match object, or null if no match is found. | ||
351 | * | ||
352 | */ | ||
353 | public Optional<ContentInNotLive.Match> getOneArbitraryMatch(final Dir pParent, final FSObject pChild) { | ||
354 | return rawGetOneArbitraryMatch(new Object[]{pParent, pChild}); | ||
355 | } | ||
356 | |||
357 | /** | ||
358 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
359 | * under any possible substitution of the unspecified parameters (if any). | ||
360 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
361 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
362 | * @return true if the input is a valid (partial) match of the pattern. | ||
363 | * | ||
364 | */ | ||
365 | public boolean hasMatch(final Dir pParent, final FSObject pChild) { | ||
366 | return rawHasMatch(new Object[]{pParent, pChild}); | ||
367 | } | ||
368 | |||
369 | /** | ||
370 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
371 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
372 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
373 | * @return the number of pattern matches found. | ||
374 | * | ||
375 | */ | ||
376 | public int countMatches(final Dir pParent, final FSObject pChild) { | ||
377 | return rawCountMatches(new Object[]{pParent, pChild}); | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
382 | * Neither determinism nor randomness of selection is guaranteed. | ||
383 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
384 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
385 | * @param processor the action that will process the selected match. | ||
386 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
387 | * | ||
388 | */ | ||
389 | public boolean forOneArbitraryMatch(final Dir pParent, final FSObject pChild, final Consumer<? super ContentInNotLive.Match> processor) { | ||
390 | return rawForOneArbitraryMatch(new Object[]{pParent, pChild}, processor); | ||
391 | } | ||
392 | |||
393 | /** | ||
394 | * Returns a new (partial) match. | ||
395 | * This can be used e.g. to call the matcher with a partial match. | ||
396 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
397 | * @param pParent the fixed value of pattern parameter parent, or null if not bound. | ||
398 | * @param pChild the fixed value of pattern parameter child, or null if not bound. | ||
399 | * @return the (partial) match object. | ||
400 | * | ||
401 | */ | ||
402 | public ContentInNotLive.Match newMatch(final Dir pParent, final FSObject pChild) { | ||
403 | return ContentInNotLive.Match.newMatch(pParent, pChild); | ||
404 | } | ||
405 | |||
406 | /** | ||
407 | * Retrieve the set of values that occur in matches for parent. | ||
408 | * @return the Set of all values or empty set if there are no matches | ||
409 | * | ||
410 | */ | ||
411 | protected Stream<Dir> rawStreamAllValuesOfparent(final Object[] parameters) { | ||
412 | return rawStreamAllValues(POSITION_PARENT, parameters).map(Dir.class::cast); | ||
413 | } | ||
414 | |||
415 | /** | ||
416 | * Retrieve the set of values that occur in matches for parent. | ||
417 | * @return the Set of all values or empty set if there are no matches | ||
418 | * | ||
419 | */ | ||
420 | public Set<Dir> getAllValuesOfparent() { | ||
421 | return rawStreamAllValuesOfparent(emptyArray()).collect(Collectors.toSet()); | ||
422 | } | ||
423 | |||
424 | /** | ||
425 | * Retrieve the set of values that occur in matches for parent. | ||
426 | * @return the Set of all values or empty set if there are no matches | ||
427 | * | ||
428 | */ | ||
429 | public Stream<Dir> streamAllValuesOfparent() { | ||
430 | return rawStreamAllValuesOfparent(emptyArray()); | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * Retrieve the set of values that occur in matches for parent. | ||
435 | * </p> | ||
436 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
437 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
438 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
439 | * | ||
440 | * @return the Stream of all values or empty set if there are no matches | ||
441 | * | ||
442 | */ | ||
443 | public Stream<Dir> streamAllValuesOfparent(final ContentInNotLive.Match partialMatch) { | ||
444 | return rawStreamAllValuesOfparent(partialMatch.toArray()); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * Retrieve the set of values that occur in matches for parent. | ||
449 | * </p> | ||
450 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
451 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
452 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
453 | * | ||
454 | * @return the Stream of all values or empty set if there are no matches | ||
455 | * | ||
456 | */ | ||
457 | public Stream<Dir> streamAllValuesOfparent(final FSObject pChild) { | ||
458 | return rawStreamAllValuesOfparent(new Object[]{null, pChild}); | ||
459 | } | ||
460 | |||
461 | /** | ||
462 | * Retrieve the set of values that occur in matches for parent. | ||
463 | * @return the Set of all values or empty set if there are no matches | ||
464 | * | ||
465 | */ | ||
466 | public Set<Dir> getAllValuesOfparent(final ContentInNotLive.Match partialMatch) { | ||
467 | return rawStreamAllValuesOfparent(partialMatch.toArray()).collect(Collectors.toSet()); | ||
468 | } | ||
469 | |||
470 | /** | ||
471 | * Retrieve the set of values that occur in matches for parent. | ||
472 | * @return the Set of all values or empty set if there are no matches | ||
473 | * | ||
474 | */ | ||
475 | public Set<Dir> getAllValuesOfparent(final FSObject pChild) { | ||
476 | return rawStreamAllValuesOfparent(new Object[]{null, pChild}).collect(Collectors.toSet()); | ||
477 | } | ||
478 | |||
479 | /** | ||
480 | * Retrieve the set of values that occur in matches for child. | ||
481 | * @return the Set of all values or empty set if there are no matches | ||
482 | * | ||
483 | */ | ||
484 | protected Stream<FSObject> rawStreamAllValuesOfchild(final Object[] parameters) { | ||
485 | return rawStreamAllValues(POSITION_CHILD, parameters).map(FSObject.class::cast); | ||
486 | } | ||
487 | |||
488 | /** | ||
489 | * Retrieve the set of values that occur in matches for child. | ||
490 | * @return the Set of all values or empty set if there are no matches | ||
491 | * | ||
492 | */ | ||
493 | public Set<FSObject> getAllValuesOfchild() { | ||
494 | return rawStreamAllValuesOfchild(emptyArray()).collect(Collectors.toSet()); | ||
495 | } | ||
496 | |||
497 | /** | ||
498 | * Retrieve the set of values that occur in matches for child. | ||
499 | * @return the Set of all values or empty set if there are no matches | ||
500 | * | ||
501 | */ | ||
502 | public Stream<FSObject> streamAllValuesOfchild() { | ||
503 | return rawStreamAllValuesOfchild(emptyArray()); | ||
504 | } | ||
505 | |||
506 | /** | ||
507 | * Retrieve the set of values that occur in matches for child. | ||
508 | * </p> | ||
509 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
510 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
511 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
512 | * | ||
513 | * @return the Stream of all values or empty set if there are no matches | ||
514 | * | ||
515 | */ | ||
516 | public Stream<FSObject> streamAllValuesOfchild(final ContentInNotLive.Match partialMatch) { | ||
517 | return rawStreamAllValuesOfchild(partialMatch.toArray()); | ||
518 | } | ||
519 | |||
520 | /** | ||
521 | * Retrieve the set of values that occur in matches for child. | ||
522 | * </p> | ||
523 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
524 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
525 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
526 | * | ||
527 | * @return the Stream of all values or empty set if there are no matches | ||
528 | * | ||
529 | */ | ||
530 | public Stream<FSObject> streamAllValuesOfchild(final Dir pParent) { | ||
531 | return rawStreamAllValuesOfchild(new Object[]{pParent, null}); | ||
532 | } | ||
533 | |||
534 | /** | ||
535 | * Retrieve the set of values that occur in matches for child. | ||
536 | * @return the Set of all values or empty set if there are no matches | ||
537 | * | ||
538 | */ | ||
539 | public Set<FSObject> getAllValuesOfchild(final ContentInNotLive.Match partialMatch) { | ||
540 | return rawStreamAllValuesOfchild(partialMatch.toArray()).collect(Collectors.toSet()); | ||
541 | } | ||
542 | |||
543 | /** | ||
544 | * Retrieve the set of values that occur in matches for child. | ||
545 | * @return the Set of all values or empty set if there are no matches | ||
546 | * | ||
547 | */ | ||
548 | public Set<FSObject> getAllValuesOfchild(final Dir pParent) { | ||
549 | return rawStreamAllValuesOfchild(new Object[]{pParent, null}).collect(Collectors.toSet()); | ||
550 | } | ||
551 | |||
552 | @Override | ||
553 | protected ContentInNotLive.Match tupleToMatch(final Tuple t) { | ||
554 | try { | ||
555 | return ContentInNotLive.Match.newMatch((Dir) t.get(POSITION_PARENT), (FSObject) t.get(POSITION_CHILD)); | ||
556 | } catch(ClassCastException e) { | ||
557 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
558 | return null; | ||
559 | } | ||
560 | } | ||
561 | |||
562 | @Override | ||
563 | protected ContentInNotLive.Match arrayToMatch(final Object[] match) { | ||
564 | try { | ||
565 | return ContentInNotLive.Match.newMatch((Dir) match[POSITION_PARENT], (FSObject) match[POSITION_CHILD]); | ||
566 | } catch(ClassCastException e) { | ||
567 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
568 | return null; | ||
569 | } | ||
570 | } | ||
571 | |||
572 | @Override | ||
573 | protected ContentInNotLive.Match arrayToMatchMutable(final Object[] match) { | ||
574 | try { | ||
575 | return ContentInNotLive.Match.newMutableMatch((Dir) match[POSITION_PARENT], (FSObject) match[POSITION_CHILD]); | ||
576 | } catch(ClassCastException e) { | ||
577 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
578 | return null; | ||
579 | } | ||
580 | } | ||
581 | |||
582 | /** | ||
583 | * @return the singleton instance of the query specification of this pattern | ||
584 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
585 | * | ||
586 | */ | ||
587 | public static IQuerySpecification<ContentInNotLive.Matcher> querySpecification() { | ||
588 | return ContentInNotLive.instance(); | ||
589 | } | ||
590 | } | ||
591 | |||
592 | private ContentInNotLive() { | ||
593 | super(GeneratedPQuery.INSTANCE); | ||
594 | } | ||
595 | |||
596 | /** | ||
597 | * @return the singleton instance of the query specification | ||
598 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
599 | * | ||
600 | */ | ||
601 | public static ContentInNotLive instance() { | ||
602 | try{ | ||
603 | return LazyHolder.INSTANCE; | ||
604 | } catch (ExceptionInInitializerError err) { | ||
605 | throw processInitializerError(err); | ||
606 | } | ||
607 | } | ||
608 | |||
609 | @Override | ||
610 | protected ContentInNotLive.Matcher instantiate(final ViatraQueryEngine engine) { | ||
611 | return ContentInNotLive.Matcher.on(engine); | ||
612 | } | ||
613 | |||
614 | @Override | ||
615 | public ContentInNotLive.Matcher instantiate() { | ||
616 | return ContentInNotLive.Matcher.create(); | ||
617 | } | ||
618 | |||
619 | @Override | ||
620 | public ContentInNotLive.Match newEmptyMatch() { | ||
621 | return ContentInNotLive.Match.newEmptyMatch(); | ||
622 | } | ||
623 | |||
624 | @Override | ||
625 | public ContentInNotLive.Match newMatch(final Object... parameters) { | ||
626 | return ContentInNotLive.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject) parameters[1]); | ||
627 | } | ||
628 | |||
629 | /** | ||
630 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.ContentInNotLive (visibility: PUBLIC, simpleName: ContentInNotLive, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.ContentInNotLive, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
631 | * <b>not</b> at the class load time of the outer class, | ||
632 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.ContentInNotLive (visibility: PUBLIC, simpleName: ContentInNotLive, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.ContentInNotLive, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
633 | * | ||
634 | * <p> This workaround is required e.g. to support recursion. | ||
635 | * | ||
636 | */ | ||
637 | private static class LazyHolder { | ||
638 | private static final ContentInNotLive INSTANCE = new ContentInNotLive(); | ||
639 | |||
640 | /** | ||
641 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
642 | * This initialization order is required to support indirect recursion. | ||
643 | * | ||
644 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
645 | * | ||
646 | */ | ||
647 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
648 | |||
649 | public static Object ensureInitialized() { | ||
650 | INSTANCE.ensureInitializedInternal(); | ||
651 | return null; | ||
652 | } | ||
653 | } | ||
654 | |||
655 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
656 | private static final ContentInNotLive.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
657 | |||
658 | private final PParameter parameter_parent = new PParameter("parent", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "Dir")), PParameterDirection.INOUT); | ||
659 | |||
660 | private final PParameter parameter_child = new PParameter("child", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "FSObject")), PParameterDirection.INOUT); | ||
661 | |||
662 | private final List<PParameter> parameters = Arrays.asList(parameter_parent, parameter_child); | ||
663 | |||
664 | private GeneratedPQuery() { | ||
665 | super(PVisibility.PUBLIC); | ||
666 | } | ||
667 | |||
668 | @Override | ||
669 | public String getFullyQualifiedName() { | ||
670 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.contentInNotLive"; | ||
671 | } | ||
672 | |||
673 | @Override | ||
674 | public List<String> getParameterNames() { | ||
675 | return Arrays.asList("parent","child"); | ||
676 | } | ||
677 | |||
678 | @Override | ||
679 | public List<PParameter> getParameters() { | ||
680 | return parameters; | ||
681 | } | ||
682 | |||
683 | @Override | ||
684 | public Set<PBody> doGetContainedBodies() { | ||
685 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
686 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
687 | { | ||
688 | PBody body = new PBody(this); | ||
689 | PVariable var_parent = body.getOrCreateVariableByName("parent"); | ||
690 | PVariable var_child = body.getOrCreateVariableByName("child"); | ||
691 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
692 | new TypeConstraint(body, Tuples.flatTupleOf(var_parent), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
693 | new TypeConstraint(body, Tuples.flatTupleOf(var_child), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
694 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
695 | new ExportedParameter(body, var_parent, parameter_parent), | ||
696 | new ExportedParameter(body, var_child, parameter_child) | ||
697 | )); | ||
698 | // Dir.contents(parent,child) | ||
699 | new TypeConstraint(body, Tuples.flatTupleOf(var_parent), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
700 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
701 | new TypeConstraint(body, Tuples.flatTupleOf(var_parent, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("FS", "Dir", "contents"))); | ||
702 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
703 | new Equality(body, var__virtual_0_, var_child); | ||
704 | // neg find live(_,parent) | ||
705 | new NegativePatternCall(body, Tuples.flatTupleOf(var___0_, var_parent), Live.instance().getInternalQueryRepresentation()); | ||
706 | bodies.add(body); | ||
707 | } | ||
708 | { | ||
709 | PBody body = new PBody(this); | ||
710 | PVariable var_parent = body.getOrCreateVariableByName("parent"); | ||
711 | PVariable var_child = body.getOrCreateVariableByName("child"); | ||
712 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
713 | new TypeConstraint(body, Tuples.flatTupleOf(var_parent), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
714 | new TypeConstraint(body, Tuples.flatTupleOf(var_child), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
715 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
716 | new ExportedParameter(body, var_parent, parameter_parent), | ||
717 | new ExportedParameter(body, var_child, parameter_child) | ||
718 | )); | ||
719 | // Dir.contents(parent,child) | ||
720 | new TypeConstraint(body, Tuples.flatTupleOf(var_parent), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
721 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
722 | new TypeConstraint(body, Tuples.flatTupleOf(var_parent, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("FS", "Dir", "contents"))); | ||
723 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
724 | new Equality(body, var__virtual_0_, var_child); | ||
725 | // neg find live(_,child) | ||
726 | new NegativePatternCall(body, Tuples.flatTupleOf(var___0_, var_child), Live.instance().getInternalQueryRepresentation()); | ||
727 | bodies.add(body); | ||
728 | } | ||
729 | { | ||
730 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
731 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
732 | new ParameterReference("child") | ||
733 | })); | ||
734 | annotation.addAttribute("severity", "error"); | ||
735 | annotation.addAttribute("message", "error"); | ||
736 | addAnnotation(annotation); | ||
737 | } | ||
738 | return bodies; | ||
739 | } | ||
740 | } | ||
741 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java new file mode 100644 index 00000000..ad04c098 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Dir.java | |||
@@ -0,0 +1,533 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import org.apache.log4j.Logger; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
19 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
20 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
25 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
36 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
37 | |||
38 | /** | ||
39 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
40 | * | ||
41 | * <p>Original source: | ||
42 | * <code><pre> | ||
43 | * pattern dir(d: Dir) { | ||
44 | * Dir(d); | ||
45 | * } | ||
46 | * </pre></code> | ||
47 | * | ||
48 | * @see Matcher | ||
49 | * @see Match | ||
50 | * | ||
51 | */ | ||
52 | @SuppressWarnings("all") | ||
53 | public final class Dir extends BaseGeneratedEMFQuerySpecification<Dir.Matcher> { | ||
54 | /** | ||
55 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir pattern, | ||
56 | * to be used in conjunction with {@link Matcher}. | ||
57 | * | ||
58 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
59 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
60 | * usable to represent a match of the pattern in the result of a query, | ||
61 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
62 | * | ||
63 | * @see Matcher | ||
64 | * | ||
65 | */ | ||
66 | public static abstract class Match extends BasePatternMatch { | ||
67 | private hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir fD; | ||
68 | |||
69 | private static List<String> parameterNames = makeImmutableList("d"); | ||
70 | |||
71 | private Match(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
72 | this.fD = pD; | ||
73 | } | ||
74 | |||
75 | @Override | ||
76 | public Object get(final String parameterName) { | ||
77 | if ("d".equals(parameterName)) return this.fD; | ||
78 | return null; | ||
79 | } | ||
80 | |||
81 | public hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir getD() { | ||
82 | return this.fD; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public boolean set(final String parameterName, final Object newValue) { | ||
87 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
88 | if ("d".equals(parameterName) ) { | ||
89 | this.fD = (hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) newValue; | ||
90 | return true; | ||
91 | } | ||
92 | return false; | ||
93 | } | ||
94 | |||
95 | public void setD(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
96 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
97 | this.fD = pD; | ||
98 | } | ||
99 | |||
100 | @Override | ||
101 | public String patternName() { | ||
102 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir"; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public List<String> parameterNames() { | ||
107 | return Dir.Match.parameterNames; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public Object[] toArray() { | ||
112 | return new Object[]{fD}; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Dir.Match toImmutable() { | ||
117 | return isMutable() ? newMatch(fD) : this; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public String prettyPrint() { | ||
122 | StringBuilder result = new StringBuilder(); | ||
123 | result.append("\"d\"=" + prettyPrintValue(fD)); | ||
124 | return result.toString(); | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public int hashCode() { | ||
129 | return Objects.hash(fD); | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public boolean equals(final Object obj) { | ||
134 | if (this == obj) | ||
135 | return true; | ||
136 | if (obj == null) { | ||
137 | return false; | ||
138 | } | ||
139 | if ((obj instanceof Dir.Match)) { | ||
140 | Dir.Match other = (Dir.Match) obj; | ||
141 | return Objects.equals(fD, other.fD); | ||
142 | } else { | ||
143 | // this should be infrequent | ||
144 | if (!(obj instanceof IPatternMatch)) { | ||
145 | return false; | ||
146 | } | ||
147 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
148 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
149 | } | ||
150 | } | ||
151 | |||
152 | @Override | ||
153 | public Dir specification() { | ||
154 | return Dir.instance(); | ||
155 | } | ||
156 | |||
157 | /** | ||
158 | * Returns an empty, mutable match. | ||
159 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
160 | * | ||
161 | * @return the empty match. | ||
162 | * | ||
163 | */ | ||
164 | public static Dir.Match newEmptyMatch() { | ||
165 | return new Mutable(null); | ||
166 | } | ||
167 | |||
168 | /** | ||
169 | * Returns a mutable (partial) match. | ||
170 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
171 | * | ||
172 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
173 | * @return the new, mutable (partial) match object. | ||
174 | * | ||
175 | */ | ||
176 | public static Dir.Match newMutableMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
177 | return new Mutable(pD); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * Returns a new (partial) match. | ||
182 | * This can be used e.g. to call the matcher with a partial match. | ||
183 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
184 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
185 | * @return the (partial) match object. | ||
186 | * | ||
187 | */ | ||
188 | public static Dir.Match newMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
189 | return new Immutable(pD); | ||
190 | } | ||
191 | |||
192 | private static final class Mutable extends Dir.Match { | ||
193 | Mutable(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
194 | super(pD); | ||
195 | } | ||
196 | |||
197 | @Override | ||
198 | public boolean isMutable() { | ||
199 | return true; | ||
200 | } | ||
201 | } | ||
202 | |||
203 | private static final class Immutable extends Dir.Match { | ||
204 | Immutable(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
205 | super(pD); | ||
206 | } | ||
207 | |||
208 | @Override | ||
209 | public boolean isMutable() { | ||
210 | return false; | ||
211 | } | ||
212 | } | ||
213 | } | ||
214 | |||
215 | /** | ||
216 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir pattern, | ||
217 | * providing pattern-specific query methods. | ||
218 | * | ||
219 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
220 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
221 | * | ||
222 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
223 | * | ||
224 | * <p>Original source: | ||
225 | * <code><pre> | ||
226 | * pattern dir(d: Dir) { | ||
227 | * Dir(d); | ||
228 | * } | ||
229 | * </pre></code> | ||
230 | * | ||
231 | * @see Match | ||
232 | * @see Dir | ||
233 | * | ||
234 | */ | ||
235 | public static class Matcher extends BaseMatcher<Dir.Match> { | ||
236 | /** | ||
237 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
238 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
239 | * | ||
240 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
241 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
242 | * | ||
243 | */ | ||
244 | public static Dir.Matcher on(final ViatraQueryEngine engine) { | ||
245 | // check if matcher already exists | ||
246 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
247 | if (matcher == null) { | ||
248 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
249 | } | ||
250 | return matcher; | ||
251 | } | ||
252 | |||
253 | /** | ||
254 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
255 | * @return an initialized matcher | ||
256 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
257 | * | ||
258 | */ | ||
259 | public static Dir.Matcher create() { | ||
260 | return new Matcher(); | ||
261 | } | ||
262 | |||
263 | private static final int POSITION_D = 0; | ||
264 | |||
265 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Dir.Matcher.class); | ||
266 | |||
267 | /** | ||
268 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
269 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
270 | * | ||
271 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
272 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
273 | * | ||
274 | */ | ||
275 | private Matcher() { | ||
276 | super(querySpecification()); | ||
277 | } | ||
278 | |||
279 | /** | ||
280 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
281 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
282 | * @return matches represented as a Match object. | ||
283 | * | ||
284 | */ | ||
285 | public Collection<Dir.Match> getAllMatches(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
286 | return rawStreamAllMatches(new Object[]{pD}).collect(Collectors.toSet()); | ||
287 | } | ||
288 | |||
289 | /** | ||
290 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
291 | * </p> | ||
292 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
293 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
294 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
295 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
296 | * @return a stream of matches represented as a Match object. | ||
297 | * | ||
298 | */ | ||
299 | public Stream<Dir.Match> streamAllMatches(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
300 | return rawStreamAllMatches(new Object[]{pD}); | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
305 | * Neither determinism nor randomness of selection is guaranteed. | ||
306 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
307 | * @return a match represented as a Match object, or null if no match is found. | ||
308 | * | ||
309 | */ | ||
310 | public Optional<Dir.Match> getOneArbitraryMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
311 | return rawGetOneArbitraryMatch(new Object[]{pD}); | ||
312 | } | ||
313 | |||
314 | /** | ||
315 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
316 | * under any possible substitution of the unspecified parameters (if any). | ||
317 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
318 | * @return true if the input is a valid (partial) match of the pattern. | ||
319 | * | ||
320 | */ | ||
321 | public boolean hasMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
322 | return rawHasMatch(new Object[]{pD}); | ||
323 | } | ||
324 | |||
325 | /** | ||
326 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
327 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
328 | * @return the number of pattern matches found. | ||
329 | * | ||
330 | */ | ||
331 | public int countMatches(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
332 | return rawCountMatches(new Object[]{pD}); | ||
333 | } | ||
334 | |||
335 | /** | ||
336 | * Executes the given processor on 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 pD the fixed value of pattern parameter d, or null if not bound. | ||
339 | * @param processor the action that will process the selected match. | ||
340 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
341 | * | ||
342 | */ | ||
343 | public boolean forOneArbitraryMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD, final Consumer<? super Dir.Match> processor) { | ||
344 | return rawForOneArbitraryMatch(new Object[]{pD}, processor); | ||
345 | } | ||
346 | |||
347 | /** | ||
348 | * Returns a new (partial) match. | ||
349 | * This can be used e.g. to call the matcher with a partial match. | ||
350 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
351 | * @param pD the fixed value of pattern parameter d, or null if not bound. | ||
352 | * @return the (partial) match object. | ||
353 | * | ||
354 | */ | ||
355 | public Dir.Match newMatch(final hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir pD) { | ||
356 | return Dir.Match.newMatch(pD); | ||
357 | } | ||
358 | |||
359 | /** | ||
360 | * Retrieve the set of values that occur in matches for d. | ||
361 | * @return the Set of all values or empty set if there are no matches | ||
362 | * | ||
363 | */ | ||
364 | protected Stream<hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir> rawStreamAllValuesOfd(final Object[] parameters) { | ||
365 | return rawStreamAllValues(POSITION_D, parameters).map(hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir.class::cast); | ||
366 | } | ||
367 | |||
368 | /** | ||
369 | * Retrieve the set of values that occur in matches for d. | ||
370 | * @return the Set of all values or empty set if there are no matches | ||
371 | * | ||
372 | */ | ||
373 | public Set<hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir> getAllValuesOfd() { | ||
374 | return rawStreamAllValuesOfd(emptyArray()).collect(Collectors.toSet()); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Retrieve the set of values that occur in matches for d. | ||
379 | * @return the Set of all values or empty set if there are no matches | ||
380 | * | ||
381 | */ | ||
382 | public Stream<hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir> streamAllValuesOfd() { | ||
383 | return rawStreamAllValuesOfd(emptyArray()); | ||
384 | } | ||
385 | |||
386 | @Override | ||
387 | protected Dir.Match tupleToMatch(final Tuple t) { | ||
388 | try { | ||
389 | return Dir.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) t.get(POSITION_D)); | ||
390 | } catch(ClassCastException e) { | ||
391 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
392 | return null; | ||
393 | } | ||
394 | } | ||
395 | |||
396 | @Override | ||
397 | protected Dir.Match arrayToMatch(final Object[] match) { | ||
398 | try { | ||
399 | return Dir.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) match[POSITION_D]); | ||
400 | } catch(ClassCastException e) { | ||
401 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
402 | return null; | ||
403 | } | ||
404 | } | ||
405 | |||
406 | @Override | ||
407 | protected Dir.Match arrayToMatchMutable(final Object[] match) { | ||
408 | try { | ||
409 | return Dir.Match.newMutableMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) match[POSITION_D]); | ||
410 | } catch(ClassCastException e) { | ||
411 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
412 | return null; | ||
413 | } | ||
414 | } | ||
415 | |||
416 | /** | ||
417 | * @return the singleton instance of the query specification of this pattern | ||
418 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
419 | * | ||
420 | */ | ||
421 | public static IQuerySpecification<Dir.Matcher> querySpecification() { | ||
422 | return Dir.instance(); | ||
423 | } | ||
424 | } | ||
425 | |||
426 | private Dir() { | ||
427 | super(GeneratedPQuery.INSTANCE); | ||
428 | } | ||
429 | |||
430 | /** | ||
431 | * @return the singleton instance of the query specification | ||
432 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
433 | * | ||
434 | */ | ||
435 | public static Dir instance() { | ||
436 | try{ | ||
437 | return LazyHolder.INSTANCE; | ||
438 | } catch (ExceptionInInitializerError err) { | ||
439 | throw processInitializerError(err); | ||
440 | } | ||
441 | } | ||
442 | |||
443 | @Override | ||
444 | protected Dir.Matcher instantiate(final ViatraQueryEngine engine) { | ||
445 | return Dir.Matcher.on(engine); | ||
446 | } | ||
447 | |||
448 | @Override | ||
449 | public Dir.Matcher instantiate() { | ||
450 | return Dir.Matcher.create(); | ||
451 | } | ||
452 | |||
453 | @Override | ||
454 | public Dir.Match newEmptyMatch() { | ||
455 | return Dir.Match.newEmptyMatch(); | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | public Dir.Match newMatch(final Object... parameters) { | ||
460 | return Dir.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) parameters[0]); | ||
461 | } | ||
462 | |||
463 | /** | ||
464 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir (visibility: PUBLIC, simpleName: Dir, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
465 | * <b>not</b> at the class load time of the outer class, | ||
466 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir (visibility: PUBLIC, simpleName: Dir, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
467 | * | ||
468 | * <p> This workaround is required e.g. to support recursion. | ||
469 | * | ||
470 | */ | ||
471 | private static class LazyHolder { | ||
472 | private static final Dir INSTANCE = new Dir(); | ||
473 | |||
474 | /** | ||
475 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
476 | * This initialization order is required to support indirect recursion. | ||
477 | * | ||
478 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
479 | * | ||
480 | */ | ||
481 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
482 | |||
483 | public static Object ensureInitialized() { | ||
484 | INSTANCE.ensureInitializedInternal(); | ||
485 | return null; | ||
486 | } | ||
487 | } | ||
488 | |||
489 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
490 | private static final Dir.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
491 | |||
492 | private final PParameter parameter_d = new PParameter("d", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "Dir")), PParameterDirection.INOUT); | ||
493 | |||
494 | private final List<PParameter> parameters = Arrays.asList(parameter_d); | ||
495 | |||
496 | private GeneratedPQuery() { | ||
497 | super(PVisibility.PUBLIC); | ||
498 | } | ||
499 | |||
500 | @Override | ||
501 | public String getFullyQualifiedName() { | ||
502 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.dir"; | ||
503 | } | ||
504 | |||
505 | @Override | ||
506 | public List<String> getParameterNames() { | ||
507 | return Arrays.asList("d"); | ||
508 | } | ||
509 | |||
510 | @Override | ||
511 | public List<PParameter> getParameters() { | ||
512 | return parameters; | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public Set<PBody> doGetContainedBodies() { | ||
517 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
518 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
519 | { | ||
520 | PBody body = new PBody(this); | ||
521 | PVariable var_d = body.getOrCreateVariableByName("d"); | ||
522 | new TypeConstraint(body, Tuples.flatTupleOf(var_d), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
523 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
524 | new ExportedParameter(body, var_d, parameter_d) | ||
525 | )); | ||
526 | // Dir(d) | ||
527 | new TypeConstraint(body, Tuples.flatTupleOf(var_d), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
528 | bodies.add(body); | ||
529 | } | ||
530 | return bodies; | ||
531 | } | ||
532 | } | ||
533 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/DirectSupertype.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/DirectSupertype.java new file mode 100644 index 00000000..03020a7c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/DirectSupertype.java | |||
@@ -0,0 +1,692 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Ecore.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import org.apache.log4j.Logger; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
19 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
20 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
25 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
38 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
39 | |||
40 | /** | ||
41 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
42 | * | ||
43 | * <p>Original source: | ||
44 | * <code><pre> | ||
45 | * pattern directSupertype(a: EClass, b:EClass) { | ||
46 | * EClass.eSuperTypes(a,b); | ||
47 | * } | ||
48 | * </pre></code> | ||
49 | * | ||
50 | * @see Matcher | ||
51 | * @see Match | ||
52 | * | ||
53 | */ | ||
54 | @SuppressWarnings("all") | ||
55 | public final class DirectSupertype extends BaseGeneratedEMFQuerySpecification<DirectSupertype.Matcher> { | ||
56 | /** | ||
57 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.directSupertype pattern, | ||
58 | * to be used in conjunction with {@link Matcher}. | ||
59 | * | ||
60 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
61 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
62 | * usable to represent a match of the pattern in the result of a query, | ||
63 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
64 | * | ||
65 | * @see Matcher | ||
66 | * | ||
67 | */ | ||
68 | public static abstract class Match extends BasePatternMatch { | ||
69 | private EClass fA; | ||
70 | |||
71 | private EClass fB; | ||
72 | |||
73 | private static List<String> parameterNames = makeImmutableList("a", "b"); | ||
74 | |||
75 | private Match(final EClass pA, final EClass pB) { | ||
76 | this.fA = pA; | ||
77 | this.fB = pB; | ||
78 | } | ||
79 | |||
80 | @Override | ||
81 | public Object get(final String parameterName) { | ||
82 | if ("a".equals(parameterName)) return this.fA; | ||
83 | if ("b".equals(parameterName)) return this.fB; | ||
84 | return null; | ||
85 | } | ||
86 | |||
87 | public EClass getA() { | ||
88 | return this.fA; | ||
89 | } | ||
90 | |||
91 | public EClass getB() { | ||
92 | return this.fB; | ||
93 | } | ||
94 | |||
95 | @Override | ||
96 | public boolean set(final String parameterName, final Object newValue) { | ||
97 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
98 | if ("a".equals(parameterName) ) { | ||
99 | this.fA = (EClass) newValue; | ||
100 | return true; | ||
101 | } | ||
102 | if ("b".equals(parameterName) ) { | ||
103 | this.fB = (EClass) newValue; | ||
104 | return true; | ||
105 | } | ||
106 | return false; | ||
107 | } | ||
108 | |||
109 | public void setA(final EClass pA) { | ||
110 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
111 | this.fA = pA; | ||
112 | } | ||
113 | |||
114 | public void setB(final EClass pB) { | ||
115 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
116 | this.fB = pB; | ||
117 | } | ||
118 | |||
119 | @Override | ||
120 | public String patternName() { | ||
121 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.directSupertype"; | ||
122 | } | ||
123 | |||
124 | @Override | ||
125 | public List<String> parameterNames() { | ||
126 | return DirectSupertype.Match.parameterNames; | ||
127 | } | ||
128 | |||
129 | @Override | ||
130 | public Object[] toArray() { | ||
131 | return new Object[]{fA, fB}; | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public DirectSupertype.Match toImmutable() { | ||
136 | return isMutable() ? newMatch(fA, fB) : this; | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public String prettyPrint() { | ||
141 | StringBuilder result = new StringBuilder(); | ||
142 | result.append("\"a\"=" + prettyPrintValue(fA) + ", "); | ||
143 | result.append("\"b\"=" + prettyPrintValue(fB)); | ||
144 | return result.toString(); | ||
145 | } | ||
146 | |||
147 | @Override | ||
148 | public int hashCode() { | ||
149 | return Objects.hash(fA, fB); | ||
150 | } | ||
151 | |||
152 | @Override | ||
153 | public boolean equals(final Object obj) { | ||
154 | if (this == obj) | ||
155 | return true; | ||
156 | if (obj == null) { | ||
157 | return false; | ||
158 | } | ||
159 | if ((obj instanceof DirectSupertype.Match)) { | ||
160 | DirectSupertype.Match other = (DirectSupertype.Match) obj; | ||
161 | return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); | ||
162 | } else { | ||
163 | // this should be infrequent | ||
164 | if (!(obj instanceof IPatternMatch)) { | ||
165 | return false; | ||
166 | } | ||
167 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
168 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
169 | } | ||
170 | } | ||
171 | |||
172 | @Override | ||
173 | public DirectSupertype specification() { | ||
174 | return DirectSupertype.instance(); | ||
175 | } | ||
176 | |||
177 | /** | ||
178 | * Returns an empty, mutable match. | ||
179 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
180 | * | ||
181 | * @return the empty match. | ||
182 | * | ||
183 | */ | ||
184 | public static DirectSupertype.Match newEmptyMatch() { | ||
185 | return new Mutable(null, null); | ||
186 | } | ||
187 | |||
188 | /** | ||
189 | * Returns a mutable (partial) match. | ||
190 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
191 | * | ||
192 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
193 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
194 | * @return the new, mutable (partial) match object. | ||
195 | * | ||
196 | */ | ||
197 | public static DirectSupertype.Match newMutableMatch(final EClass pA, final EClass pB) { | ||
198 | return new Mutable(pA, pB); | ||
199 | } | ||
200 | |||
201 | /** | ||
202 | * Returns a new (partial) match. | ||
203 | * This can be used e.g. to call the matcher with a partial match. | ||
204 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
205 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
206 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
207 | * @return the (partial) match object. | ||
208 | * | ||
209 | */ | ||
210 | public static DirectSupertype.Match newMatch(final EClass pA, final EClass pB) { | ||
211 | return new Immutable(pA, pB); | ||
212 | } | ||
213 | |||
214 | private static final class Mutable extends DirectSupertype.Match { | ||
215 | Mutable(final EClass pA, final EClass pB) { | ||
216 | super(pA, pB); | ||
217 | } | ||
218 | |||
219 | @Override | ||
220 | public boolean isMutable() { | ||
221 | return true; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | private static final class Immutable extends DirectSupertype.Match { | ||
226 | Immutable(final EClass pA, final EClass pB) { | ||
227 | super(pA, pB); | ||
228 | } | ||
229 | |||
230 | @Override | ||
231 | public boolean isMutable() { | ||
232 | return false; | ||
233 | } | ||
234 | } | ||
235 | } | ||
236 | |||
237 | /** | ||
238 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.directSupertype pattern, | ||
239 | * providing pattern-specific query methods. | ||
240 | * | ||
241 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
242 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
243 | * | ||
244 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
245 | * | ||
246 | * <p>Original source: | ||
247 | * <code><pre> | ||
248 | * pattern directSupertype(a: EClass, b:EClass) { | ||
249 | * EClass.eSuperTypes(a,b); | ||
250 | * } | ||
251 | * </pre></code> | ||
252 | * | ||
253 | * @see Match | ||
254 | * @see DirectSupertype | ||
255 | * | ||
256 | */ | ||
257 | public static class Matcher extends BaseMatcher<DirectSupertype.Match> { | ||
258 | /** | ||
259 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
260 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
261 | * | ||
262 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
263 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
264 | * | ||
265 | */ | ||
266 | public static DirectSupertype.Matcher on(final ViatraQueryEngine engine) { | ||
267 | // check if matcher already exists | ||
268 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
269 | if (matcher == null) { | ||
270 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
271 | } | ||
272 | return matcher; | ||
273 | } | ||
274 | |||
275 | /** | ||
276 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
277 | * @return an initialized matcher | ||
278 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
279 | * | ||
280 | */ | ||
281 | public static DirectSupertype.Matcher create() { | ||
282 | return new Matcher(); | ||
283 | } | ||
284 | |||
285 | private static final int POSITION_A = 0; | ||
286 | |||
287 | private static final int POSITION_B = 1; | ||
288 | |||
289 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(DirectSupertype.Matcher.class); | ||
290 | |||
291 | /** | ||
292 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
293 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
294 | * | ||
295 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
296 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
297 | * | ||
298 | */ | ||
299 | private Matcher() { | ||
300 | super(querySpecification()); | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
305 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
306 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
307 | * @return matches represented as a Match object. | ||
308 | * | ||
309 | */ | ||
310 | public Collection<DirectSupertype.Match> getAllMatches(final EClass pA, final EClass pB) { | ||
311 | return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); | ||
312 | } | ||
313 | |||
314 | /** | ||
315 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
316 | * </p> | ||
317 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
318 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
319 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
320 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
321 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
322 | * @return a stream of matches represented as a Match object. | ||
323 | * | ||
324 | */ | ||
325 | public Stream<DirectSupertype.Match> streamAllMatches(final EClass pA, final EClass pB) { | ||
326 | return rawStreamAllMatches(new Object[]{pA, pB}); | ||
327 | } | ||
328 | |||
329 | /** | ||
330 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
331 | * Neither determinism nor randomness of selection is guaranteed. | ||
332 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
333 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
334 | * @return a match represented as a Match object, or null if no match is found. | ||
335 | * | ||
336 | */ | ||
337 | public Optional<DirectSupertype.Match> getOneArbitraryMatch(final EClass pA, final EClass pB) { | ||
338 | return rawGetOneArbitraryMatch(new Object[]{pA, pB}); | ||
339 | } | ||
340 | |||
341 | /** | ||
342 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
343 | * under any possible substitution of the unspecified parameters (if any). | ||
344 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
345 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
346 | * @return true if the input is a valid (partial) match of the pattern. | ||
347 | * | ||
348 | */ | ||
349 | public boolean hasMatch(final EClass pA, final EClass pB) { | ||
350 | return rawHasMatch(new Object[]{pA, pB}); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
355 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
356 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
357 | * @return the number of pattern matches found. | ||
358 | * | ||
359 | */ | ||
360 | public int countMatches(final EClass pA, final EClass pB) { | ||
361 | return rawCountMatches(new Object[]{pA, pB}); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
366 | * Neither determinism nor randomness of selection is guaranteed. | ||
367 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
368 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
369 | * @param processor the action that will process the selected match. | ||
370 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
371 | * | ||
372 | */ | ||
373 | public boolean forOneArbitraryMatch(final EClass pA, final EClass pB, final Consumer<? super DirectSupertype.Match> processor) { | ||
374 | return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Returns a new (partial) match. | ||
379 | * This can be used e.g. to call the matcher with a partial match. | ||
380 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
381 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
382 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
383 | * @return the (partial) match object. | ||
384 | * | ||
385 | */ | ||
386 | public DirectSupertype.Match newMatch(final EClass pA, final EClass pB) { | ||
387 | return DirectSupertype.Match.newMatch(pA, pB); | ||
388 | } | ||
389 | |||
390 | /** | ||
391 | * Retrieve the set of values that occur in matches for a. | ||
392 | * @return the Set of all values or empty set if there are no matches | ||
393 | * | ||
394 | */ | ||
395 | protected Stream<EClass> rawStreamAllValuesOfa(final Object[] parameters) { | ||
396 | return rawStreamAllValues(POSITION_A, parameters).map(EClass.class::cast); | ||
397 | } | ||
398 | |||
399 | /** | ||
400 | * Retrieve the set of values that occur in matches for a. | ||
401 | * @return the Set of all values or empty set if there are no matches | ||
402 | * | ||
403 | */ | ||
404 | public Set<EClass> getAllValuesOfa() { | ||
405 | return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); | ||
406 | } | ||
407 | |||
408 | /** | ||
409 | * Retrieve the set of values that occur in matches for a. | ||
410 | * @return the Set of all values or empty set if there are no matches | ||
411 | * | ||
412 | */ | ||
413 | public Stream<EClass> streamAllValuesOfa() { | ||
414 | return rawStreamAllValuesOfa(emptyArray()); | ||
415 | } | ||
416 | |||
417 | /** | ||
418 | * Retrieve the set of values that occur in matches for a. | ||
419 | * </p> | ||
420 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
421 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
422 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
423 | * | ||
424 | * @return the Stream of all values or empty set if there are no matches | ||
425 | * | ||
426 | */ | ||
427 | public Stream<EClass> streamAllValuesOfa(final DirectSupertype.Match partialMatch) { | ||
428 | return rawStreamAllValuesOfa(partialMatch.toArray()); | ||
429 | } | ||
430 | |||
431 | /** | ||
432 | * Retrieve the set of values that occur in matches for a. | ||
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<EClass> streamAllValuesOfa(final EClass pB) { | ||
442 | return rawStreamAllValuesOfa(new Object[]{null, pB}); | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * Retrieve the set of values that occur in matches for a. | ||
447 | * @return the Set of all values or empty set if there are no matches | ||
448 | * | ||
449 | */ | ||
450 | public Set<EClass> getAllValuesOfa(final DirectSupertype.Match partialMatch) { | ||
451 | return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); | ||
452 | } | ||
453 | |||
454 | /** | ||
455 | * Retrieve the set of values that occur in matches for a. | ||
456 | * @return the Set of all values or empty set if there are no matches | ||
457 | * | ||
458 | */ | ||
459 | public Set<EClass> getAllValuesOfa(final EClass pB) { | ||
460 | return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); | ||
461 | } | ||
462 | |||
463 | /** | ||
464 | * Retrieve the set of values that occur in matches for b. | ||
465 | * @return the Set of all values or empty set if there are no matches | ||
466 | * | ||
467 | */ | ||
468 | protected Stream<EClass> rawStreamAllValuesOfb(final Object[] parameters) { | ||
469 | return rawStreamAllValues(POSITION_B, parameters).map(EClass.class::cast); | ||
470 | } | ||
471 | |||
472 | /** | ||
473 | * Retrieve the set of values that occur in matches for b. | ||
474 | * @return the Set of all values or empty set if there are no matches | ||
475 | * | ||
476 | */ | ||
477 | public Set<EClass> getAllValuesOfb() { | ||
478 | return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); | ||
479 | } | ||
480 | |||
481 | /** | ||
482 | * Retrieve the set of values that occur in matches for b. | ||
483 | * @return the Set of all values or empty set if there are no matches | ||
484 | * | ||
485 | */ | ||
486 | public Stream<EClass> streamAllValuesOfb() { | ||
487 | return rawStreamAllValuesOfb(emptyArray()); | ||
488 | } | ||
489 | |||
490 | /** | ||
491 | * Retrieve the set of values that occur in matches for b. | ||
492 | * </p> | ||
493 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
494 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
495 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
496 | * | ||
497 | * @return the Stream of all values or empty set if there are no matches | ||
498 | * | ||
499 | */ | ||
500 | public Stream<EClass> streamAllValuesOfb(final DirectSupertype.Match partialMatch) { | ||
501 | return rawStreamAllValuesOfb(partialMatch.toArray()); | ||
502 | } | ||
503 | |||
504 | /** | ||
505 | * Retrieve the set of values that occur in matches for b. | ||
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<EClass> streamAllValuesOfb(final EClass pA) { | ||
515 | return rawStreamAllValuesOfb(new Object[]{pA, null}); | ||
516 | } | ||
517 | |||
518 | /** | ||
519 | * Retrieve the set of values that occur in matches for b. | ||
520 | * @return the Set of all values or empty set if there are no matches | ||
521 | * | ||
522 | */ | ||
523 | public Set<EClass> getAllValuesOfb(final DirectSupertype.Match partialMatch) { | ||
524 | return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); | ||
525 | } | ||
526 | |||
527 | /** | ||
528 | * Retrieve the set of values that occur in matches for b. | ||
529 | * @return the Set of all values or empty set if there are no matches | ||
530 | * | ||
531 | */ | ||
532 | public Set<EClass> getAllValuesOfb(final EClass pA) { | ||
533 | return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); | ||
534 | } | ||
535 | |||
536 | @Override | ||
537 | protected DirectSupertype.Match tupleToMatch(final Tuple t) { | ||
538 | try { | ||
539 | return DirectSupertype.Match.newMatch((EClass) t.get(POSITION_A), (EClass) t.get(POSITION_B)); | ||
540 | } catch(ClassCastException e) { | ||
541 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
542 | return null; | ||
543 | } | ||
544 | } | ||
545 | |||
546 | @Override | ||
547 | protected DirectSupertype.Match arrayToMatch(final Object[] match) { | ||
548 | try { | ||
549 | return DirectSupertype.Match.newMatch((EClass) match[POSITION_A], (EClass) match[POSITION_B]); | ||
550 | } catch(ClassCastException e) { | ||
551 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
552 | return null; | ||
553 | } | ||
554 | } | ||
555 | |||
556 | @Override | ||
557 | protected DirectSupertype.Match arrayToMatchMutable(final Object[] match) { | ||
558 | try { | ||
559 | return DirectSupertype.Match.newMutableMatch((EClass) match[POSITION_A], (EClass) match[POSITION_B]); | ||
560 | } catch(ClassCastException e) { | ||
561 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
562 | return null; | ||
563 | } | ||
564 | } | ||
565 | |||
566 | /** | ||
567 | * @return the singleton instance of the query specification of this pattern | ||
568 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
569 | * | ||
570 | */ | ||
571 | public static IQuerySpecification<DirectSupertype.Matcher> querySpecification() { | ||
572 | return DirectSupertype.instance(); | ||
573 | } | ||
574 | } | ||
575 | |||
576 | private DirectSupertype() { | ||
577 | super(GeneratedPQuery.INSTANCE); | ||
578 | } | ||
579 | |||
580 | /** | ||
581 | * @return the singleton instance of the query specification | ||
582 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
583 | * | ||
584 | */ | ||
585 | public static DirectSupertype instance() { | ||
586 | try{ | ||
587 | return LazyHolder.INSTANCE; | ||
588 | } catch (ExceptionInInitializerError err) { | ||
589 | throw processInitializerError(err); | ||
590 | } | ||
591 | } | ||
592 | |||
593 | @Override | ||
594 | protected DirectSupertype.Matcher instantiate(final ViatraQueryEngine engine) { | ||
595 | return DirectSupertype.Matcher.on(engine); | ||
596 | } | ||
597 | |||
598 | @Override | ||
599 | public DirectSupertype.Matcher instantiate() { | ||
600 | return DirectSupertype.Matcher.create(); | ||
601 | } | ||
602 | |||
603 | @Override | ||
604 | public DirectSupertype.Match newEmptyMatch() { | ||
605 | return DirectSupertype.Match.newEmptyMatch(); | ||
606 | } | ||
607 | |||
608 | @Override | ||
609 | public DirectSupertype.Match newMatch(final Object... parameters) { | ||
610 | return DirectSupertype.Match.newMatch((org.eclipse.emf.ecore.EClass) parameters[0], (org.eclipse.emf.ecore.EClass) parameters[1]); | ||
611 | } | ||
612 | |||
613 | /** | ||
614 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.DirectSupertype (visibility: PUBLIC, simpleName: DirectSupertype, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.DirectSupertype, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
615 | * <b>not</b> at the class load time of the outer class, | ||
616 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.DirectSupertype (visibility: PUBLIC, simpleName: DirectSupertype, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.DirectSupertype, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
617 | * | ||
618 | * <p> This workaround is required e.g. to support recursion. | ||
619 | * | ||
620 | */ | ||
621 | private static class LazyHolder { | ||
622 | private static final DirectSupertype INSTANCE = new DirectSupertype(); | ||
623 | |||
624 | /** | ||
625 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
626 | * This initialization order is required to support indirect recursion. | ||
627 | * | ||
628 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
629 | * | ||
630 | */ | ||
631 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
632 | |||
633 | public static Object ensureInitialized() { | ||
634 | INSTANCE.ensureInitializedInternal(); | ||
635 | return null; | ||
636 | } | ||
637 | } | ||
638 | |||
639 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
640 | private static final DirectSupertype.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
641 | |||
642 | private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); | ||
643 | |||
644 | private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); | ||
645 | |||
646 | private final List<PParameter> parameters = Arrays.asList(parameter_a, parameter_b); | ||
647 | |||
648 | private GeneratedPQuery() { | ||
649 | super(PVisibility.PUBLIC); | ||
650 | } | ||
651 | |||
652 | @Override | ||
653 | public String getFullyQualifiedName() { | ||
654 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.directSupertype"; | ||
655 | } | ||
656 | |||
657 | @Override | ||
658 | public List<String> getParameterNames() { | ||
659 | return Arrays.asList("a","b"); | ||
660 | } | ||
661 | |||
662 | @Override | ||
663 | public List<PParameter> getParameters() { | ||
664 | return parameters; | ||
665 | } | ||
666 | |||
667 | @Override | ||
668 | public Set<PBody> doGetContainedBodies() { | ||
669 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
670 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
671 | { | ||
672 | PBody body = new PBody(this); | ||
673 | PVariable var_a = body.getOrCreateVariableByName("a"); | ||
674 | PVariable var_b = body.getOrCreateVariableByName("b"); | ||
675 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); | ||
676 | new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); | ||
677 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
678 | new ExportedParameter(body, var_a, parameter_a), | ||
679 | new ExportedParameter(body, var_b, parameter_b) | ||
680 | )); | ||
681 | // EClass.eSuperTypes(a,b) | ||
682 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); | ||
683 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
684 | new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass", "eSuperTypes"))); | ||
685 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); | ||
686 | new Equality(body, var__virtual_0_, var_b); | ||
687 | bodies.add(body); | ||
688 | } | ||
689 | return bodies; | ||
690 | } | ||
691 | } | ||
692 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Live.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Live.java new file mode 100644 index 00000000..14a4c5c0 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Live.java | |||
@@ -0,0 +1,730 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.PatternContent; | ||
9 | import java.util.Arrays; | ||
10 | import java.util.Collection; | ||
11 | import java.util.LinkedHashSet; | ||
12 | import java.util.List; | ||
13 | import java.util.Objects; | ||
14 | import java.util.Optional; | ||
15 | import java.util.Set; | ||
16 | import java.util.function.Consumer; | ||
17 | import java.util.stream.Collectors; | ||
18 | import java.util.stream.Stream; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
43 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * {@literal @}QueryBasedFeature | ||
51 | * pattern live(this: FileSystem, l: FSObject) { | ||
52 | * FileSystem.root(this,l); | ||
53 | * } or { | ||
54 | * FileSystem.root(this,root); | ||
55 | * find patternContent+(root,l); | ||
56 | * } | ||
57 | * </pre></code> | ||
58 | * | ||
59 | * @see Matcher | ||
60 | * @see Match | ||
61 | * | ||
62 | */ | ||
63 | @SuppressWarnings("all") | ||
64 | public final class Live extends BaseGeneratedEMFQuerySpecification<Live.Matcher> { | ||
65 | /** | ||
66 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live 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 FileSystem fThis; | ||
79 | |||
80 | private FSObject fL; | ||
81 | |||
82 | private static List<String> parameterNames = makeImmutableList("this", "l"); | ||
83 | |||
84 | private Match(final FileSystem pThis, final FSObject pL) { | ||
85 | this.fThis = pThis; | ||
86 | this.fL = pL; | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Object get(final String parameterName) { | ||
91 | if ("this".equals(parameterName)) return this.fThis; | ||
92 | if ("l".equals(parameterName)) return this.fL; | ||
93 | return null; | ||
94 | } | ||
95 | |||
96 | public FileSystem getThis() { | ||
97 | return this.fThis; | ||
98 | } | ||
99 | |||
100 | public FSObject getL() { | ||
101 | return this.fL; | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public boolean set(final String parameterName, final Object newValue) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | if ("this".equals(parameterName) ) { | ||
108 | this.fThis = (FileSystem) newValue; | ||
109 | return true; | ||
110 | } | ||
111 | if ("l".equals(parameterName) ) { | ||
112 | this.fL = (FSObject) newValue; | ||
113 | return true; | ||
114 | } | ||
115 | return false; | ||
116 | } | ||
117 | |||
118 | public void setThis(final FileSystem pThis) { | ||
119 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
120 | this.fThis = pThis; | ||
121 | } | ||
122 | |||
123 | public void setL(final FSObject pL) { | ||
124 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
125 | this.fL = pL; | ||
126 | } | ||
127 | |||
128 | @Override | ||
129 | public String patternName() { | ||
130 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live"; | ||
131 | } | ||
132 | |||
133 | @Override | ||
134 | public List<String> parameterNames() { | ||
135 | return Live.Match.parameterNames; | ||
136 | } | ||
137 | |||
138 | @Override | ||
139 | public Object[] toArray() { | ||
140 | return new Object[]{fThis, fL}; | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public Live.Match toImmutable() { | ||
145 | return isMutable() ? newMatch(fThis, fL) : this; | ||
146 | } | ||
147 | |||
148 | @Override | ||
149 | public String prettyPrint() { | ||
150 | StringBuilder result = new StringBuilder(); | ||
151 | result.append("\"this\"=" + prettyPrintValue(fThis) + ", "); | ||
152 | result.append("\"l\"=" + prettyPrintValue(fL)); | ||
153 | return result.toString(); | ||
154 | } | ||
155 | |||
156 | @Override | ||
157 | public int hashCode() { | ||
158 | return Objects.hash(fThis, fL); | ||
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 Live.Match)) { | ||
169 | Live.Match other = (Live.Match) obj; | ||
170 | return Objects.equals(fThis, other.fThis) && Objects.equals(fL, other.fL); | ||
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 Live specification() { | ||
183 | return Live.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 Live.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 pThis the fixed value of pattern parameter this, or null if not bound. | ||
202 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
203 | * @return the new, mutable (partial) match object. | ||
204 | * | ||
205 | */ | ||
206 | public static Live.Match newMutableMatch(final FileSystem pThis, final FSObject pL) { | ||
207 | return new Mutable(pThis, pL); | ||
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 pThis the fixed value of pattern parameter this, or null if not bound. | ||
215 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
216 | * @return the (partial) match object. | ||
217 | * | ||
218 | */ | ||
219 | public static Live.Match newMatch(final FileSystem pThis, final FSObject pL) { | ||
220 | return new Immutable(pThis, pL); | ||
221 | } | ||
222 | |||
223 | private static final class Mutable extends Live.Match { | ||
224 | Mutable(final FileSystem pThis, final FSObject pL) { | ||
225 | super(pThis, pL); | ||
226 | } | ||
227 | |||
228 | @Override | ||
229 | public boolean isMutable() { | ||
230 | return true; | ||
231 | } | ||
232 | } | ||
233 | |||
234 | private static final class Immutable extends Live.Match { | ||
235 | Immutable(final FileSystem pThis, final FSObject pL) { | ||
236 | super(pThis, pL); | ||
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.alloyexamples.live 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 @}QueryBasedFeature | ||
258 | * pattern live(this: FileSystem, l: FSObject) { | ||
259 | * FileSystem.root(this,l); | ||
260 | * } or { | ||
261 | * FileSystem.root(this,root); | ||
262 | * find patternContent+(root,l); | ||
263 | * } | ||
264 | * </pre></code> | ||
265 | * | ||
266 | * @see Match | ||
267 | * @see Live | ||
268 | * | ||
269 | */ | ||
270 | public static class Matcher extends BaseMatcher<Live.Match> { | ||
271 | /** | ||
272 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
273 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
274 | * | ||
275 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
276 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
277 | * | ||
278 | */ | ||
279 | public static Live.Matcher on(final ViatraQueryEngine engine) { | ||
280 | // check if matcher already exists | ||
281 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
282 | if (matcher == null) { | ||
283 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
284 | } | ||
285 | return matcher; | ||
286 | } | ||
287 | |||
288 | /** | ||
289 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
290 | * @return an initialized matcher | ||
291 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
292 | * | ||
293 | */ | ||
294 | public static Live.Matcher create() { | ||
295 | return new Matcher(); | ||
296 | } | ||
297 | |||
298 | private static final int POSITION_THIS = 0; | ||
299 | |||
300 | private static final int POSITION_L = 1; | ||
301 | |||
302 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Live.Matcher.class); | ||
303 | |||
304 | /** | ||
305 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
306 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
307 | * | ||
308 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
309 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
310 | * | ||
311 | */ | ||
312 | private Matcher() { | ||
313 | super(querySpecification()); | ||
314 | } | ||
315 | |||
316 | /** | ||
317 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
318 | * @param pThis the fixed value of pattern parameter this, or null if not bound. | ||
319 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
320 | * @return matches represented as a Match object. | ||
321 | * | ||
322 | */ | ||
323 | public Collection<Live.Match> getAllMatches(final FileSystem pThis, final FSObject pL) { | ||
324 | return rawStreamAllMatches(new Object[]{pThis, pL}).collect(Collectors.toSet()); | ||
325 | } | ||
326 | |||
327 | /** | ||
328 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
329 | * </p> | ||
330 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
331 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
332 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
333 | * @param pThis the fixed value of pattern parameter this, or null if not bound. | ||
334 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
335 | * @return a stream of matches represented as a Match object. | ||
336 | * | ||
337 | */ | ||
338 | public Stream<Live.Match> streamAllMatches(final FileSystem pThis, final FSObject pL) { | ||
339 | return rawStreamAllMatches(new Object[]{pThis, pL}); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Returns 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 pThis the fixed value of pattern parameter this, or null if not bound. | ||
346 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
347 | * @return a match represented as a Match object, or null if no match is found. | ||
348 | * | ||
349 | */ | ||
350 | public Optional<Live.Match> getOneArbitraryMatch(final FileSystem pThis, final FSObject pL) { | ||
351 | return rawGetOneArbitraryMatch(new Object[]{pThis, pL}); | ||
352 | } | ||
353 | |||
354 | /** | ||
355 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
356 | * under any possible substitution of the unspecified parameters (if any). | ||
357 | * @param pThis the fixed value of pattern parameter this, or null if not bound. | ||
358 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
359 | * @return true if the input is a valid (partial) match of the pattern. | ||
360 | * | ||
361 | */ | ||
362 | public boolean hasMatch(final FileSystem pThis, final FSObject pL) { | ||
363 | return rawHasMatch(new Object[]{pThis, pL}); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
368 | * @param pThis the fixed value of pattern parameter this, or null if not bound. | ||
369 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
370 | * @return the number of pattern matches found. | ||
371 | * | ||
372 | */ | ||
373 | public int countMatches(final FileSystem pThis, final FSObject pL) { | ||
374 | return rawCountMatches(new Object[]{pThis, pL}); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
379 | * Neither determinism nor randomness of selection is guaranteed. | ||
380 | * @param pThis the fixed value of pattern parameter this, or null if not bound. | ||
381 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
382 | * @param processor the action that will process the selected match. | ||
383 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
384 | * | ||
385 | */ | ||
386 | public boolean forOneArbitraryMatch(final FileSystem pThis, final FSObject pL, final Consumer<? super Live.Match> processor) { | ||
387 | return rawForOneArbitraryMatch(new Object[]{pThis, pL}, processor); | ||
388 | } | ||
389 | |||
390 | /** | ||
391 | * Returns a new (partial) match. | ||
392 | * This can be used e.g. to call the matcher with a partial match. | ||
393 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
394 | * @param pThis the fixed value of pattern parameter this, or null if not bound. | ||
395 | * @param pL the fixed value of pattern parameter l, or null if not bound. | ||
396 | * @return the (partial) match object. | ||
397 | * | ||
398 | */ | ||
399 | public Live.Match newMatch(final FileSystem pThis, final FSObject pL) { | ||
400 | return Live.Match.newMatch(pThis, pL); | ||
401 | } | ||
402 | |||
403 | /** | ||
404 | * Retrieve the set of values that occur in matches for this. | ||
405 | * @return the Set of all values or empty set if there are no matches | ||
406 | * | ||
407 | */ | ||
408 | protected Stream<FileSystem> rawStreamAllValuesOfthis(final Object[] parameters) { | ||
409 | return rawStreamAllValues(POSITION_THIS, parameters).map(FileSystem.class::cast); | ||
410 | } | ||
411 | |||
412 | /** | ||
413 | * Retrieve the set of values that occur in matches for this. | ||
414 | * @return the Set of all values or empty set if there are no matches | ||
415 | * | ||
416 | */ | ||
417 | public Set<FileSystem> getAllValuesOfthis() { | ||
418 | return rawStreamAllValuesOfthis(emptyArray()).collect(Collectors.toSet()); | ||
419 | } | ||
420 | |||
421 | /** | ||
422 | * Retrieve the set of values that occur in matches for this. | ||
423 | * @return the Set of all values or empty set if there are no matches | ||
424 | * | ||
425 | */ | ||
426 | public Stream<FileSystem> streamAllValuesOfthis() { | ||
427 | return rawStreamAllValuesOfthis(emptyArray()); | ||
428 | } | ||
429 | |||
430 | /** | ||
431 | * Retrieve the set of values that occur in matches for this. | ||
432 | * </p> | ||
433 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
434 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
435 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
436 | * | ||
437 | * @return the Stream of all values or empty set if there are no matches | ||
438 | * | ||
439 | */ | ||
440 | public Stream<FileSystem> streamAllValuesOfthis(final Live.Match partialMatch) { | ||
441 | return rawStreamAllValuesOfthis(partialMatch.toArray()); | ||
442 | } | ||
443 | |||
444 | /** | ||
445 | * Retrieve the set of values that occur in matches for this. | ||
446 | * </p> | ||
447 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
448 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
449 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
450 | * | ||
451 | * @return the Stream of all values or empty set if there are no matches | ||
452 | * | ||
453 | */ | ||
454 | public Stream<FileSystem> streamAllValuesOfthis(final FSObject pL) { | ||
455 | return rawStreamAllValuesOfthis(new Object[]{null, pL}); | ||
456 | } | ||
457 | |||
458 | /** | ||
459 | * Retrieve the set of values that occur in matches for this. | ||
460 | * @return the Set of all values or empty set if there are no matches | ||
461 | * | ||
462 | */ | ||
463 | public Set<FileSystem> getAllValuesOfthis(final Live.Match partialMatch) { | ||
464 | return rawStreamAllValuesOfthis(partialMatch.toArray()).collect(Collectors.toSet()); | ||
465 | } | ||
466 | |||
467 | /** | ||
468 | * Retrieve the set of values that occur in matches for this. | ||
469 | * @return the Set of all values or empty set if there are no matches | ||
470 | * | ||
471 | */ | ||
472 | public Set<FileSystem> getAllValuesOfthis(final FSObject pL) { | ||
473 | return rawStreamAllValuesOfthis(new Object[]{null, pL}).collect(Collectors.toSet()); | ||
474 | } | ||
475 | |||
476 | /** | ||
477 | * Retrieve the set of values that occur in matches for l. | ||
478 | * @return the Set of all values or empty set if there are no matches | ||
479 | * | ||
480 | */ | ||
481 | protected Stream<FSObject> rawStreamAllValuesOfl(final Object[] parameters) { | ||
482 | return rawStreamAllValues(POSITION_L, parameters).map(FSObject.class::cast); | ||
483 | } | ||
484 | |||
485 | /** | ||
486 | * Retrieve the set of values that occur in matches for l. | ||
487 | * @return the Set of all values or empty set if there are no matches | ||
488 | * | ||
489 | */ | ||
490 | public Set<FSObject> getAllValuesOfl() { | ||
491 | return rawStreamAllValuesOfl(emptyArray()).collect(Collectors.toSet()); | ||
492 | } | ||
493 | |||
494 | /** | ||
495 | * Retrieve the set of values that occur in matches for l. | ||
496 | * @return the Set of all values or empty set if there are no matches | ||
497 | * | ||
498 | */ | ||
499 | public Stream<FSObject> streamAllValuesOfl() { | ||
500 | return rawStreamAllValuesOfl(emptyArray()); | ||
501 | } | ||
502 | |||
503 | /** | ||
504 | * Retrieve the set of values that occur in matches for l. | ||
505 | * </p> | ||
506 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
507 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
508 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
509 | * | ||
510 | * @return the Stream of all values or empty set if there are no matches | ||
511 | * | ||
512 | */ | ||
513 | public Stream<FSObject> streamAllValuesOfl(final Live.Match partialMatch) { | ||
514 | return rawStreamAllValuesOfl(partialMatch.toArray()); | ||
515 | } | ||
516 | |||
517 | /** | ||
518 | * Retrieve the set of values that occur in matches for l. | ||
519 | * </p> | ||
520 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
521 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
522 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
523 | * | ||
524 | * @return the Stream of all values or empty set if there are no matches | ||
525 | * | ||
526 | */ | ||
527 | public Stream<FSObject> streamAllValuesOfl(final FileSystem pThis) { | ||
528 | return rawStreamAllValuesOfl(new Object[]{pThis, null}); | ||
529 | } | ||
530 | |||
531 | /** | ||
532 | * Retrieve the set of values that occur in matches for l. | ||
533 | * @return the Set of all values or empty set if there are no matches | ||
534 | * | ||
535 | */ | ||
536 | public Set<FSObject> getAllValuesOfl(final Live.Match partialMatch) { | ||
537 | return rawStreamAllValuesOfl(partialMatch.toArray()).collect(Collectors.toSet()); | ||
538 | } | ||
539 | |||
540 | /** | ||
541 | * Retrieve the set of values that occur in matches for l. | ||
542 | * @return the Set of all values or empty set if there are no matches | ||
543 | * | ||
544 | */ | ||
545 | public Set<FSObject> getAllValuesOfl(final FileSystem pThis) { | ||
546 | return rawStreamAllValuesOfl(new Object[]{pThis, null}).collect(Collectors.toSet()); | ||
547 | } | ||
548 | |||
549 | @Override | ||
550 | protected Live.Match tupleToMatch(final Tuple t) { | ||
551 | try { | ||
552 | return Live.Match.newMatch((FileSystem) t.get(POSITION_THIS), (FSObject) t.get(POSITION_L)); | ||
553 | } catch(ClassCastException e) { | ||
554 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
555 | return null; | ||
556 | } | ||
557 | } | ||
558 | |||
559 | @Override | ||
560 | protected Live.Match arrayToMatch(final Object[] match) { | ||
561 | try { | ||
562 | return Live.Match.newMatch((FileSystem) match[POSITION_THIS], (FSObject) match[POSITION_L]); | ||
563 | } catch(ClassCastException e) { | ||
564 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
565 | return null; | ||
566 | } | ||
567 | } | ||
568 | |||
569 | @Override | ||
570 | protected Live.Match arrayToMatchMutable(final Object[] match) { | ||
571 | try { | ||
572 | return Live.Match.newMutableMatch((FileSystem) match[POSITION_THIS], (FSObject) match[POSITION_L]); | ||
573 | } catch(ClassCastException e) { | ||
574 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
575 | return null; | ||
576 | } | ||
577 | } | ||
578 | |||
579 | /** | ||
580 | * @return the singleton instance of the query specification of this pattern | ||
581 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
582 | * | ||
583 | */ | ||
584 | public static IQuerySpecification<Live.Matcher> querySpecification() { | ||
585 | return Live.instance(); | ||
586 | } | ||
587 | } | ||
588 | |||
589 | private Live() { | ||
590 | super(GeneratedPQuery.INSTANCE); | ||
591 | } | ||
592 | |||
593 | /** | ||
594 | * @return the singleton instance of the query specification | ||
595 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
596 | * | ||
597 | */ | ||
598 | public static Live instance() { | ||
599 | try{ | ||
600 | return LazyHolder.INSTANCE; | ||
601 | } catch (ExceptionInInitializerError err) { | ||
602 | throw processInitializerError(err); | ||
603 | } | ||
604 | } | ||
605 | |||
606 | @Override | ||
607 | protected Live.Matcher instantiate(final ViatraQueryEngine engine) { | ||
608 | return Live.Matcher.on(engine); | ||
609 | } | ||
610 | |||
611 | @Override | ||
612 | public Live.Matcher instantiate() { | ||
613 | return Live.Matcher.create(); | ||
614 | } | ||
615 | |||
616 | @Override | ||
617 | public Live.Match newEmptyMatch() { | ||
618 | return Live.Match.newEmptyMatch(); | ||
619 | } | ||
620 | |||
621 | @Override | ||
622 | public Live.Match newMatch(final Object... parameters) { | ||
623 | return Live.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject) parameters[1]); | ||
624 | } | ||
625 | |||
626 | /** | ||
627 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Live (visibility: PUBLIC, simpleName: Live, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Live, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
628 | * <b>not</b> at the class load time of the outer class, | ||
629 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Live (visibility: PUBLIC, simpleName: Live, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Live, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
630 | * | ||
631 | * <p> This workaround is required e.g. to support recursion. | ||
632 | * | ||
633 | */ | ||
634 | private static class LazyHolder { | ||
635 | private static final Live INSTANCE = new Live(); | ||
636 | |||
637 | /** | ||
638 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
639 | * This initialization order is required to support indirect recursion. | ||
640 | * | ||
641 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
642 | * | ||
643 | */ | ||
644 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
645 | |||
646 | public static Object ensureInitialized() { | ||
647 | INSTANCE.ensureInitializedInternal(); | ||
648 | return null; | ||
649 | } | ||
650 | } | ||
651 | |||
652 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
653 | private static final Live.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
654 | |||
655 | private final PParameter parameter_this = new PParameter("this", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "FileSystem")), PParameterDirection.INOUT); | ||
656 | |||
657 | private final PParameter parameter_l = new PParameter("l", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "FSObject")), PParameterDirection.INOUT); | ||
658 | |||
659 | private final List<PParameter> parameters = Arrays.asList(parameter_this, parameter_l); | ||
660 | |||
661 | private GeneratedPQuery() { | ||
662 | super(PVisibility.PUBLIC); | ||
663 | } | ||
664 | |||
665 | @Override | ||
666 | public String getFullyQualifiedName() { | ||
667 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live"; | ||
668 | } | ||
669 | |||
670 | @Override | ||
671 | public List<String> getParameterNames() { | ||
672 | return Arrays.asList("this","l"); | ||
673 | } | ||
674 | |||
675 | @Override | ||
676 | public List<PParameter> getParameters() { | ||
677 | return parameters; | ||
678 | } | ||
679 | |||
680 | @Override | ||
681 | public Set<PBody> doGetContainedBodies() { | ||
682 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
683 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
684 | { | ||
685 | PBody body = new PBody(this); | ||
686 | PVariable var_this = body.getOrCreateVariableByName("this"); | ||
687 | PVariable var_l = body.getOrCreateVariableByName("l"); | ||
688 | new TypeConstraint(body, Tuples.flatTupleOf(var_this), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FileSystem"))); | ||
689 | new TypeConstraint(body, Tuples.flatTupleOf(var_l), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
690 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
691 | new ExportedParameter(body, var_this, parameter_this), | ||
692 | new ExportedParameter(body, var_l, parameter_l) | ||
693 | )); | ||
694 | // FileSystem.root(this,l) | ||
695 | new TypeConstraint(body, Tuples.flatTupleOf(var_this), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FileSystem"))); | ||
696 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
697 | new TypeConstraint(body, Tuples.flatTupleOf(var_this, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("FS", "FileSystem", "root"))); | ||
698 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
699 | new Equality(body, var__virtual_0_, var_l); | ||
700 | bodies.add(body); | ||
701 | } | ||
702 | { | ||
703 | PBody body = new PBody(this); | ||
704 | PVariable var_this = body.getOrCreateVariableByName("this"); | ||
705 | PVariable var_l = body.getOrCreateVariableByName("l"); | ||
706 | PVariable var_root = body.getOrCreateVariableByName("root"); | ||
707 | new TypeConstraint(body, Tuples.flatTupleOf(var_this), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FileSystem"))); | ||
708 | new TypeConstraint(body, Tuples.flatTupleOf(var_l), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
709 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
710 | new ExportedParameter(body, var_this, parameter_this), | ||
711 | new ExportedParameter(body, var_l, parameter_l) | ||
712 | )); | ||
713 | // FileSystem.root(this,root) | ||
714 | new TypeConstraint(body, Tuples.flatTupleOf(var_this), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FileSystem"))); | ||
715 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
716 | new TypeConstraint(body, Tuples.flatTupleOf(var_this, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("FS", "FileSystem", "root"))); | ||
717 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
718 | new Equality(body, var__virtual_0_, var_root); | ||
719 | // find patternContent+(root,l) | ||
720 | new BinaryTransitiveClosure(body, Tuples.flatTupleOf(var_root, var_l), PatternContent.instance().getInternalQueryRepresentation()); | ||
721 | bodies.add(body); | ||
722 | } | ||
723 | { | ||
724 | PAnnotation annotation = new PAnnotation("QueryBasedFeature"); | ||
725 | addAnnotation(annotation); | ||
726 | } | ||
727 | return bodies; | ||
728 | } | ||
729 | } | ||
730 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/LoopInInheritence.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/LoopInInheritence.java new file mode 100644 index 00000000..51bd83a9 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/LoopInInheritence.java | |||
@@ -0,0 +1,548 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Ecore.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.DirectSupertype; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.BinaryTransitiveClosure; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
41 | |||
42 | /** | ||
43 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
44 | * | ||
45 | * <p>Original source: | ||
46 | * <code><pre> | ||
47 | * {@literal @}Constraint(key={a}, severity="error", message="error") | ||
48 | * pattern loopInInheritence(a: EClass) { | ||
49 | * find directSupertype+(a,a); | ||
50 | * } | ||
51 | * </pre></code> | ||
52 | * | ||
53 | * @see Matcher | ||
54 | * @see Match | ||
55 | * | ||
56 | */ | ||
57 | @SuppressWarnings("all") | ||
58 | public final class LoopInInheritence extends BaseGeneratedEMFQuerySpecification<LoopInInheritence.Matcher> { | ||
59 | /** | ||
60 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.loopInInheritence 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 EClass fA; | ||
73 | |||
74 | private static List<String> parameterNames = makeImmutableList("a"); | ||
75 | |||
76 | private Match(final EClass pA) { | ||
77 | this.fA = pA; | ||
78 | } | ||
79 | |||
80 | @Override | ||
81 | public Object get(final String parameterName) { | ||
82 | if ("a".equals(parameterName)) return this.fA; | ||
83 | return null; | ||
84 | } | ||
85 | |||
86 | public EClass getA() { | ||
87 | return this.fA; | ||
88 | } | ||
89 | |||
90 | @Override | ||
91 | public boolean set(final String parameterName, final Object newValue) { | ||
92 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
93 | if ("a".equals(parameterName) ) { | ||
94 | this.fA = (EClass) newValue; | ||
95 | return true; | ||
96 | } | ||
97 | return false; | ||
98 | } | ||
99 | |||
100 | public void setA(final EClass pA) { | ||
101 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
102 | this.fA = pA; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public String patternName() { | ||
107 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.loopInInheritence"; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public List<String> parameterNames() { | ||
112 | return LoopInInheritence.Match.parameterNames; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Object[] toArray() { | ||
117 | return new Object[]{fA}; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public LoopInInheritence.Match toImmutable() { | ||
122 | return isMutable() ? newMatch(fA) : this; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public String prettyPrint() { | ||
127 | StringBuilder result = new StringBuilder(); | ||
128 | result.append("\"a\"=" + prettyPrintValue(fA)); | ||
129 | return result.toString(); | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public int hashCode() { | ||
134 | return Objects.hash(fA); | ||
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 LoopInInheritence.Match)) { | ||
145 | LoopInInheritence.Match other = (LoopInInheritence.Match) obj; | ||
146 | return Objects.equals(fA, other.fA); | ||
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 LoopInInheritence specification() { | ||
159 | return LoopInInheritence.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 LoopInInheritence.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 pA the fixed value of pattern parameter a, or null if not bound. | ||
178 | * @return the new, mutable (partial) match object. | ||
179 | * | ||
180 | */ | ||
181 | public static LoopInInheritence.Match newMutableMatch(final EClass pA) { | ||
182 | return new Mutable(pA); | ||
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 pA the fixed value of pattern parameter a, or null if not bound. | ||
190 | * @return the (partial) match object. | ||
191 | * | ||
192 | */ | ||
193 | public static LoopInInheritence.Match newMatch(final EClass pA) { | ||
194 | return new Immutable(pA); | ||
195 | } | ||
196 | |||
197 | private static final class Mutable extends LoopInInheritence.Match { | ||
198 | Mutable(final EClass pA) { | ||
199 | super(pA); | ||
200 | } | ||
201 | |||
202 | @Override | ||
203 | public boolean isMutable() { | ||
204 | return true; | ||
205 | } | ||
206 | } | ||
207 | |||
208 | private static final class Immutable extends LoopInInheritence.Match { | ||
209 | Immutable(final EClass pA) { | ||
210 | super(pA); | ||
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.alloyexamples.loopInInheritence 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 | * {@literal @}Constraint(key={a}, severity="error", message="error") | ||
232 | * pattern loopInInheritence(a: EClass) { | ||
233 | * find directSupertype+(a,a); | ||
234 | * } | ||
235 | * </pre></code> | ||
236 | * | ||
237 | * @see Match | ||
238 | * @see LoopInInheritence | ||
239 | * | ||
240 | */ | ||
241 | public static class Matcher extends BaseMatcher<LoopInInheritence.Match> { | ||
242 | /** | ||
243 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
244 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
245 | * | ||
246 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
247 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
248 | * | ||
249 | */ | ||
250 | public static LoopInInheritence.Matcher on(final ViatraQueryEngine engine) { | ||
251 | // check if matcher already exists | ||
252 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
253 | if (matcher == null) { | ||
254 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
255 | } | ||
256 | return matcher; | ||
257 | } | ||
258 | |||
259 | /** | ||
260 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
261 | * @return an initialized matcher | ||
262 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
263 | * | ||
264 | */ | ||
265 | public static LoopInInheritence.Matcher create() { | ||
266 | return new Matcher(); | ||
267 | } | ||
268 | |||
269 | private static final int POSITION_A = 0; | ||
270 | |||
271 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(LoopInInheritence.Matcher.class); | ||
272 | |||
273 | /** | ||
274 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
275 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
276 | * | ||
277 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
278 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
279 | * | ||
280 | */ | ||
281 | private Matcher() { | ||
282 | super(querySpecification()); | ||
283 | } | ||
284 | |||
285 | /** | ||
286 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
287 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
288 | * @return matches represented as a Match object. | ||
289 | * | ||
290 | */ | ||
291 | public Collection<LoopInInheritence.Match> getAllMatches(final EClass pA) { | ||
292 | return rawStreamAllMatches(new Object[]{pA}).collect(Collectors.toSet()); | ||
293 | } | ||
294 | |||
295 | /** | ||
296 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
297 | * </p> | ||
298 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
299 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
300 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
301 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
302 | * @return a stream of matches represented as a Match object. | ||
303 | * | ||
304 | */ | ||
305 | public Stream<LoopInInheritence.Match> streamAllMatches(final EClass pA) { | ||
306 | return rawStreamAllMatches(new Object[]{pA}); | ||
307 | } | ||
308 | |||
309 | /** | ||
310 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
311 | * Neither determinism nor randomness of selection is guaranteed. | ||
312 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
313 | * @return a match represented as a Match object, or null if no match is found. | ||
314 | * | ||
315 | */ | ||
316 | public Optional<LoopInInheritence.Match> getOneArbitraryMatch(final EClass pA) { | ||
317 | return rawGetOneArbitraryMatch(new Object[]{pA}); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
322 | * under any possible substitution of the unspecified parameters (if any). | ||
323 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
324 | * @return true if the input is a valid (partial) match of the pattern. | ||
325 | * | ||
326 | */ | ||
327 | public boolean hasMatch(final EClass pA) { | ||
328 | return rawHasMatch(new Object[]{pA}); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
333 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
334 | * @return the number of pattern matches found. | ||
335 | * | ||
336 | */ | ||
337 | public int countMatches(final EClass pA) { | ||
338 | return rawCountMatches(new Object[]{pA}); | ||
339 | } | ||
340 | |||
341 | /** | ||
342 | * Executes the given processor on 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 pA the fixed value of pattern parameter a, or null if not bound. | ||
345 | * @param processor the action that will process the selected match. | ||
346 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
347 | * | ||
348 | */ | ||
349 | public boolean forOneArbitraryMatch(final EClass pA, final Consumer<? super LoopInInheritence.Match> processor) { | ||
350 | return rawForOneArbitraryMatch(new Object[]{pA}, processor); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * Returns a new (partial) match. | ||
355 | * This can be used e.g. to call the matcher with a partial match. | ||
356 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
357 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
358 | * @return the (partial) match object. | ||
359 | * | ||
360 | */ | ||
361 | public LoopInInheritence.Match newMatch(final EClass pA) { | ||
362 | return LoopInInheritence.Match.newMatch(pA); | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * Retrieve the set of values that occur in matches for a. | ||
367 | * @return the Set of all values or empty set if there are no matches | ||
368 | * | ||
369 | */ | ||
370 | protected Stream<EClass> rawStreamAllValuesOfa(final Object[] parameters) { | ||
371 | return rawStreamAllValues(POSITION_A, parameters).map(EClass.class::cast); | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * Retrieve the set of values that occur in matches for a. | ||
376 | * @return the Set of all values or empty set if there are no matches | ||
377 | * | ||
378 | */ | ||
379 | public Set<EClass> getAllValuesOfa() { | ||
380 | return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); | ||
381 | } | ||
382 | |||
383 | /** | ||
384 | * Retrieve the set of values that occur in matches for a. | ||
385 | * @return the Set of all values or empty set if there are no matches | ||
386 | * | ||
387 | */ | ||
388 | public Stream<EClass> streamAllValuesOfa() { | ||
389 | return rawStreamAllValuesOfa(emptyArray()); | ||
390 | } | ||
391 | |||
392 | @Override | ||
393 | protected LoopInInheritence.Match tupleToMatch(final Tuple t) { | ||
394 | try { | ||
395 | return LoopInInheritence.Match.newMatch((EClass) t.get(POSITION_A)); | ||
396 | } catch(ClassCastException e) { | ||
397 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
398 | return null; | ||
399 | } | ||
400 | } | ||
401 | |||
402 | @Override | ||
403 | protected LoopInInheritence.Match arrayToMatch(final Object[] match) { | ||
404 | try { | ||
405 | return LoopInInheritence.Match.newMatch((EClass) match[POSITION_A]); | ||
406 | } catch(ClassCastException e) { | ||
407 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
408 | return null; | ||
409 | } | ||
410 | } | ||
411 | |||
412 | @Override | ||
413 | protected LoopInInheritence.Match arrayToMatchMutable(final Object[] match) { | ||
414 | try { | ||
415 | return LoopInInheritence.Match.newMutableMatch((EClass) match[POSITION_A]); | ||
416 | } catch(ClassCastException e) { | ||
417 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
418 | return null; | ||
419 | } | ||
420 | } | ||
421 | |||
422 | /** | ||
423 | * @return the singleton instance of the query specification of this pattern | ||
424 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
425 | * | ||
426 | */ | ||
427 | public static IQuerySpecification<LoopInInheritence.Matcher> querySpecification() { | ||
428 | return LoopInInheritence.instance(); | ||
429 | } | ||
430 | } | ||
431 | |||
432 | private LoopInInheritence() { | ||
433 | super(GeneratedPQuery.INSTANCE); | ||
434 | } | ||
435 | |||
436 | /** | ||
437 | * @return the singleton instance of the query specification | ||
438 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
439 | * | ||
440 | */ | ||
441 | public static LoopInInheritence instance() { | ||
442 | try{ | ||
443 | return LazyHolder.INSTANCE; | ||
444 | } catch (ExceptionInInitializerError err) { | ||
445 | throw processInitializerError(err); | ||
446 | } | ||
447 | } | ||
448 | |||
449 | @Override | ||
450 | protected LoopInInheritence.Matcher instantiate(final ViatraQueryEngine engine) { | ||
451 | return LoopInInheritence.Matcher.on(engine); | ||
452 | } | ||
453 | |||
454 | @Override | ||
455 | public LoopInInheritence.Matcher instantiate() { | ||
456 | return LoopInInheritence.Matcher.create(); | ||
457 | } | ||
458 | |||
459 | @Override | ||
460 | public LoopInInheritence.Match newEmptyMatch() { | ||
461 | return LoopInInheritence.Match.newEmptyMatch(); | ||
462 | } | ||
463 | |||
464 | @Override | ||
465 | public LoopInInheritence.Match newMatch(final Object... parameters) { | ||
466 | return LoopInInheritence.Match.newMatch((org.eclipse.emf.ecore.EClass) parameters[0]); | ||
467 | } | ||
468 | |||
469 | /** | ||
470 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.LoopInInheritence (visibility: PUBLIC, simpleName: LoopInInheritence, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.LoopInInheritence, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
471 | * <b>not</b> at the class load time of the outer class, | ||
472 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.LoopInInheritence (visibility: PUBLIC, simpleName: LoopInInheritence, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.LoopInInheritence, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
473 | * | ||
474 | * <p> This workaround is required e.g. to support recursion. | ||
475 | * | ||
476 | */ | ||
477 | private static class LazyHolder { | ||
478 | private static final LoopInInheritence INSTANCE = new LoopInInheritence(); | ||
479 | |||
480 | /** | ||
481 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
482 | * This initialization order is required to support indirect recursion. | ||
483 | * | ||
484 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
485 | * | ||
486 | */ | ||
487 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
488 | |||
489 | public static Object ensureInitialized() { | ||
490 | INSTANCE.ensureInitializedInternal(); | ||
491 | return null; | ||
492 | } | ||
493 | } | ||
494 | |||
495 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
496 | private static final LoopInInheritence.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
497 | |||
498 | private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EClass", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EClass")), PParameterDirection.INOUT); | ||
499 | |||
500 | private final List<PParameter> parameters = Arrays.asList(parameter_a); | ||
501 | |||
502 | private GeneratedPQuery() { | ||
503 | super(PVisibility.PUBLIC); | ||
504 | } | ||
505 | |||
506 | @Override | ||
507 | public String getFullyQualifiedName() { | ||
508 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.loopInInheritence"; | ||
509 | } | ||
510 | |||
511 | @Override | ||
512 | public List<String> getParameterNames() { | ||
513 | return Arrays.asList("a"); | ||
514 | } | ||
515 | |||
516 | @Override | ||
517 | public List<PParameter> getParameters() { | ||
518 | return parameters; | ||
519 | } | ||
520 | |||
521 | @Override | ||
522 | public Set<PBody> doGetContainedBodies() { | ||
523 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
524 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
525 | { | ||
526 | PBody body = new PBody(this); | ||
527 | PVariable var_a = body.getOrCreateVariableByName("a"); | ||
528 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); | ||
529 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
530 | new ExportedParameter(body, var_a, parameter_a) | ||
531 | )); | ||
532 | // find directSupertype+(a,a) | ||
533 | new BinaryTransitiveClosure(body, Tuples.flatTupleOf(var_a, var_a), DirectSupertype.instance().getInternalQueryRepresentation()); | ||
534 | bodies.add(body); | ||
535 | } | ||
536 | { | ||
537 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
538 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
539 | new ParameterReference("a") | ||
540 | })); | ||
541 | annotation.addAttribute("severity", "error"); | ||
542 | annotation.addAttribute("message", "error"); | ||
543 | addAnnotation(annotation); | ||
544 | } | ||
545 | return bodies; | ||
546 | } | ||
547 | } | ||
548 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/NonSymmetricOpposite.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/NonSymmetricOpposite.java new file mode 100644 index 00000000..bd2833a7 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/NonSymmetricOpposite.java | |||
@@ -0,0 +1,707 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Ecore.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Opposite; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.emf.ecore.EReference; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import 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 @}Constraint(key={a}, severity="error", message="error") | ||
50 | * pattern nonSymmetricOpposite(a:EReference, b:EReference) { | ||
51 | * find opposite(a,b); | ||
52 | * neg find opposite(b,a); | ||
53 | * } | ||
54 | * </pre></code> | ||
55 | * | ||
56 | * @see Matcher | ||
57 | * @see Match | ||
58 | * | ||
59 | */ | ||
60 | @SuppressWarnings("all") | ||
61 | public final class NonSymmetricOpposite extends BaseGeneratedEMFQuerySpecification<NonSymmetricOpposite.Matcher> { | ||
62 | /** | ||
63 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.nonSymmetricOpposite pattern, | ||
64 | * to be used in conjunction with {@link Matcher}. | ||
65 | * | ||
66 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
67 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
68 | * usable to represent a match of the pattern in the result of a query, | ||
69 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
70 | * | ||
71 | * @see Matcher | ||
72 | * | ||
73 | */ | ||
74 | public static abstract class Match extends BasePatternMatch { | ||
75 | private EReference fA; | ||
76 | |||
77 | private EReference fB; | ||
78 | |||
79 | private static List<String> parameterNames = makeImmutableList("a", "b"); | ||
80 | |||
81 | private Match(final EReference pA, final EReference pB) { | ||
82 | this.fA = pA; | ||
83 | this.fB = pB; | ||
84 | } | ||
85 | |||
86 | @Override | ||
87 | public Object get(final String parameterName) { | ||
88 | if ("a".equals(parameterName)) return this.fA; | ||
89 | if ("b".equals(parameterName)) return this.fB; | ||
90 | return null; | ||
91 | } | ||
92 | |||
93 | public EReference getA() { | ||
94 | return this.fA; | ||
95 | } | ||
96 | |||
97 | public EReference getB() { | ||
98 | return this.fB; | ||
99 | } | ||
100 | |||
101 | @Override | ||
102 | public boolean set(final String parameterName, final Object newValue) { | ||
103 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
104 | if ("a".equals(parameterName) ) { | ||
105 | this.fA = (EReference) newValue; | ||
106 | return true; | ||
107 | } | ||
108 | if ("b".equals(parameterName) ) { | ||
109 | this.fB = (EReference) newValue; | ||
110 | return true; | ||
111 | } | ||
112 | return false; | ||
113 | } | ||
114 | |||
115 | public void setA(final EReference pA) { | ||
116 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
117 | this.fA = pA; | ||
118 | } | ||
119 | |||
120 | public void setB(final EReference pB) { | ||
121 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
122 | this.fB = pB; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public String patternName() { | ||
127 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.nonSymmetricOpposite"; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public List<String> parameterNames() { | ||
132 | return NonSymmetricOpposite.Match.parameterNames; | ||
133 | } | ||
134 | |||
135 | @Override | ||
136 | public Object[] toArray() { | ||
137 | return new Object[]{fA, fB}; | ||
138 | } | ||
139 | |||
140 | @Override | ||
141 | public NonSymmetricOpposite.Match toImmutable() { | ||
142 | return isMutable() ? newMatch(fA, fB) : this; | ||
143 | } | ||
144 | |||
145 | @Override | ||
146 | public String prettyPrint() { | ||
147 | StringBuilder result = new StringBuilder(); | ||
148 | result.append("\"a\"=" + prettyPrintValue(fA) + ", "); | ||
149 | result.append("\"b\"=" + prettyPrintValue(fB)); | ||
150 | return result.toString(); | ||
151 | } | ||
152 | |||
153 | @Override | ||
154 | public int hashCode() { | ||
155 | return Objects.hash(fA, fB); | ||
156 | } | ||
157 | |||
158 | @Override | ||
159 | public boolean equals(final Object obj) { | ||
160 | if (this == obj) | ||
161 | return true; | ||
162 | if (obj == null) { | ||
163 | return false; | ||
164 | } | ||
165 | if ((obj instanceof NonSymmetricOpposite.Match)) { | ||
166 | NonSymmetricOpposite.Match other = (NonSymmetricOpposite.Match) obj; | ||
167 | return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); | ||
168 | } else { | ||
169 | // this should be infrequent | ||
170 | if (!(obj instanceof IPatternMatch)) { | ||
171 | return false; | ||
172 | } | ||
173 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
174 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
175 | } | ||
176 | } | ||
177 | |||
178 | @Override | ||
179 | public NonSymmetricOpposite specification() { | ||
180 | return NonSymmetricOpposite.instance(); | ||
181 | } | ||
182 | |||
183 | /** | ||
184 | * Returns an empty, mutable match. | ||
185 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
186 | * | ||
187 | * @return the empty match. | ||
188 | * | ||
189 | */ | ||
190 | public static NonSymmetricOpposite.Match newEmptyMatch() { | ||
191 | return new Mutable(null, null); | ||
192 | } | ||
193 | |||
194 | /** | ||
195 | * Returns a mutable (partial) match. | ||
196 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
197 | * | ||
198 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
199 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
200 | * @return the new, mutable (partial) match object. | ||
201 | * | ||
202 | */ | ||
203 | public static NonSymmetricOpposite.Match newMutableMatch(final EReference pA, final EReference pB) { | ||
204 | return new Mutable(pA, pB); | ||
205 | } | ||
206 | |||
207 | /** | ||
208 | * Returns a new (partial) match. | ||
209 | * This can be used e.g. to call the matcher with a partial match. | ||
210 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
211 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
212 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
213 | * @return the (partial) match object. | ||
214 | * | ||
215 | */ | ||
216 | public static NonSymmetricOpposite.Match newMatch(final EReference pA, final EReference pB) { | ||
217 | return new Immutable(pA, pB); | ||
218 | } | ||
219 | |||
220 | private static final class Mutable extends NonSymmetricOpposite.Match { | ||
221 | Mutable(final EReference pA, final EReference pB) { | ||
222 | super(pA, pB); | ||
223 | } | ||
224 | |||
225 | @Override | ||
226 | public boolean isMutable() { | ||
227 | return true; | ||
228 | } | ||
229 | } | ||
230 | |||
231 | private static final class Immutable extends NonSymmetricOpposite.Match { | ||
232 | Immutable(final EReference pA, final EReference pB) { | ||
233 | super(pA, pB); | ||
234 | } | ||
235 | |||
236 | @Override | ||
237 | public boolean isMutable() { | ||
238 | return false; | ||
239 | } | ||
240 | } | ||
241 | } | ||
242 | |||
243 | /** | ||
244 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.nonSymmetricOpposite pattern, | ||
245 | * providing pattern-specific query methods. | ||
246 | * | ||
247 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
248 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
249 | * | ||
250 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
251 | * | ||
252 | * <p>Original source: | ||
253 | * <code><pre> | ||
254 | * {@literal @}Constraint(key={a}, severity="error", message="error") | ||
255 | * pattern nonSymmetricOpposite(a:EReference, b:EReference) { | ||
256 | * find opposite(a,b); | ||
257 | * neg find opposite(b,a); | ||
258 | * } | ||
259 | * </pre></code> | ||
260 | * | ||
261 | * @see Match | ||
262 | * @see NonSymmetricOpposite | ||
263 | * | ||
264 | */ | ||
265 | public static class Matcher extends BaseMatcher<NonSymmetricOpposite.Match> { | ||
266 | /** | ||
267 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
268 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
269 | * | ||
270 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
271 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
272 | * | ||
273 | */ | ||
274 | public static NonSymmetricOpposite.Matcher on(final ViatraQueryEngine engine) { | ||
275 | // check if matcher already exists | ||
276 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
277 | if (matcher == null) { | ||
278 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
279 | } | ||
280 | return matcher; | ||
281 | } | ||
282 | |||
283 | /** | ||
284 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
285 | * @return an initialized matcher | ||
286 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
287 | * | ||
288 | */ | ||
289 | public static NonSymmetricOpposite.Matcher create() { | ||
290 | return new Matcher(); | ||
291 | } | ||
292 | |||
293 | private static final int POSITION_A = 0; | ||
294 | |||
295 | private static final int POSITION_B = 1; | ||
296 | |||
297 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(NonSymmetricOpposite.Matcher.class); | ||
298 | |||
299 | /** | ||
300 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
301 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
302 | * | ||
303 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
304 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
305 | * | ||
306 | */ | ||
307 | private Matcher() { | ||
308 | super(querySpecification()); | ||
309 | } | ||
310 | |||
311 | /** | ||
312 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
313 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
314 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
315 | * @return matches represented as a Match object. | ||
316 | * | ||
317 | */ | ||
318 | public Collection<NonSymmetricOpposite.Match> getAllMatches(final EReference pA, final EReference pB) { | ||
319 | return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); | ||
320 | } | ||
321 | |||
322 | /** | ||
323 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
324 | * </p> | ||
325 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
326 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
327 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
328 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
329 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
330 | * @return a stream of matches represented as a Match object. | ||
331 | * | ||
332 | */ | ||
333 | public Stream<NonSymmetricOpposite.Match> streamAllMatches(final EReference pA, final EReference pB) { | ||
334 | return rawStreamAllMatches(new Object[]{pA, pB}); | ||
335 | } | ||
336 | |||
337 | /** | ||
338 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
339 | * Neither determinism nor randomness of selection is guaranteed. | ||
340 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
341 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
342 | * @return a match represented as a Match object, or null if no match is found. | ||
343 | * | ||
344 | */ | ||
345 | public Optional<NonSymmetricOpposite.Match> getOneArbitraryMatch(final EReference pA, final EReference pB) { | ||
346 | return rawGetOneArbitraryMatch(new Object[]{pA, pB}); | ||
347 | } | ||
348 | |||
349 | /** | ||
350 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
351 | * under any possible substitution of the unspecified parameters (if any). | ||
352 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
353 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
354 | * @return true if the input is a valid (partial) match of the pattern. | ||
355 | * | ||
356 | */ | ||
357 | public boolean hasMatch(final EReference pA, final EReference pB) { | ||
358 | return rawHasMatch(new Object[]{pA, pB}); | ||
359 | } | ||
360 | |||
361 | /** | ||
362 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
363 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
364 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
365 | * @return the number of pattern matches found. | ||
366 | * | ||
367 | */ | ||
368 | public int countMatches(final EReference pA, final EReference pB) { | ||
369 | return rawCountMatches(new Object[]{pA, pB}); | ||
370 | } | ||
371 | |||
372 | /** | ||
373 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
374 | * Neither determinism nor randomness of selection is guaranteed. | ||
375 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
376 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
377 | * @param processor the action that will process the selected match. | ||
378 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
379 | * | ||
380 | */ | ||
381 | public boolean forOneArbitraryMatch(final EReference pA, final EReference pB, final Consumer<? super NonSymmetricOpposite.Match> processor) { | ||
382 | return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); | ||
383 | } | ||
384 | |||
385 | /** | ||
386 | * Returns a new (partial) match. | ||
387 | * This can be used e.g. to call the matcher with a partial match. | ||
388 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
389 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
390 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
391 | * @return the (partial) match object. | ||
392 | * | ||
393 | */ | ||
394 | public NonSymmetricOpposite.Match newMatch(final EReference pA, final EReference pB) { | ||
395 | return NonSymmetricOpposite.Match.newMatch(pA, pB); | ||
396 | } | ||
397 | |||
398 | /** | ||
399 | * Retrieve the set of values that occur in matches for a. | ||
400 | * @return the Set of all values or empty set if there are no matches | ||
401 | * | ||
402 | */ | ||
403 | protected Stream<EReference> rawStreamAllValuesOfa(final Object[] parameters) { | ||
404 | return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); | ||
405 | } | ||
406 | |||
407 | /** | ||
408 | * Retrieve the set of values that occur in matches for a. | ||
409 | * @return the Set of all values or empty set if there are no matches | ||
410 | * | ||
411 | */ | ||
412 | public Set<EReference> getAllValuesOfa() { | ||
413 | return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); | ||
414 | } | ||
415 | |||
416 | /** | ||
417 | * Retrieve the set of values that occur in matches for a. | ||
418 | * @return the Set of all values or empty set if there are no matches | ||
419 | * | ||
420 | */ | ||
421 | public Stream<EReference> streamAllValuesOfa() { | ||
422 | return rawStreamAllValuesOfa(emptyArray()); | ||
423 | } | ||
424 | |||
425 | /** | ||
426 | * Retrieve the set of values that occur in matches for a. | ||
427 | * </p> | ||
428 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
429 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
430 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
431 | * | ||
432 | * @return the Stream of all values or empty set if there are no matches | ||
433 | * | ||
434 | */ | ||
435 | public Stream<EReference> streamAllValuesOfa(final NonSymmetricOpposite.Match partialMatch) { | ||
436 | return rawStreamAllValuesOfa(partialMatch.toArray()); | ||
437 | } | ||
438 | |||
439 | /** | ||
440 | * Retrieve the set of values that occur in matches for a. | ||
441 | * </p> | ||
442 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
443 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
444 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
445 | * | ||
446 | * @return the Stream of all values or empty set if there are no matches | ||
447 | * | ||
448 | */ | ||
449 | public Stream<EReference> streamAllValuesOfa(final EReference pB) { | ||
450 | return rawStreamAllValuesOfa(new Object[]{null, pB}); | ||
451 | } | ||
452 | |||
453 | /** | ||
454 | * Retrieve the set of values that occur in matches for a. | ||
455 | * @return the Set of all values or empty set if there are no matches | ||
456 | * | ||
457 | */ | ||
458 | public Set<EReference> getAllValuesOfa(final NonSymmetricOpposite.Match partialMatch) { | ||
459 | return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); | ||
460 | } | ||
461 | |||
462 | /** | ||
463 | * Retrieve the set of values that occur in matches for a. | ||
464 | * @return the Set of all values or empty set if there are no matches | ||
465 | * | ||
466 | */ | ||
467 | public Set<EReference> getAllValuesOfa(final EReference pB) { | ||
468 | return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); | ||
469 | } | ||
470 | |||
471 | /** | ||
472 | * Retrieve the set of values that occur in matches for b. | ||
473 | * @return the Set of all values or empty set if there are no matches | ||
474 | * | ||
475 | */ | ||
476 | protected Stream<EReference> rawStreamAllValuesOfb(final Object[] parameters) { | ||
477 | return rawStreamAllValues(POSITION_B, parameters).map(EReference.class::cast); | ||
478 | } | ||
479 | |||
480 | /** | ||
481 | * Retrieve the set of values that occur in matches for b. | ||
482 | * @return the Set of all values or empty set if there are no matches | ||
483 | * | ||
484 | */ | ||
485 | public Set<EReference> getAllValuesOfb() { | ||
486 | return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); | ||
487 | } | ||
488 | |||
489 | /** | ||
490 | * Retrieve the set of values that occur in matches for b. | ||
491 | * @return the Set of all values or empty set if there are no matches | ||
492 | * | ||
493 | */ | ||
494 | public Stream<EReference> streamAllValuesOfb() { | ||
495 | return rawStreamAllValuesOfb(emptyArray()); | ||
496 | } | ||
497 | |||
498 | /** | ||
499 | * Retrieve the set of values that occur in matches for b. | ||
500 | * </p> | ||
501 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
502 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
503 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
504 | * | ||
505 | * @return the Stream of all values or empty set if there are no matches | ||
506 | * | ||
507 | */ | ||
508 | public Stream<EReference> streamAllValuesOfb(final NonSymmetricOpposite.Match partialMatch) { | ||
509 | return rawStreamAllValuesOfb(partialMatch.toArray()); | ||
510 | } | ||
511 | |||
512 | /** | ||
513 | * Retrieve the set of values that occur in matches for b. | ||
514 | * </p> | ||
515 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
516 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
517 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
518 | * | ||
519 | * @return the Stream of all values or empty set if there are no matches | ||
520 | * | ||
521 | */ | ||
522 | public Stream<EReference> streamAllValuesOfb(final EReference pA) { | ||
523 | return rawStreamAllValuesOfb(new Object[]{pA, null}); | ||
524 | } | ||
525 | |||
526 | /** | ||
527 | * Retrieve the set of values that occur in matches for b. | ||
528 | * @return the Set of all values or empty set if there are no matches | ||
529 | * | ||
530 | */ | ||
531 | public Set<EReference> getAllValuesOfb(final NonSymmetricOpposite.Match partialMatch) { | ||
532 | return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); | ||
533 | } | ||
534 | |||
535 | /** | ||
536 | * Retrieve the set of values that occur in matches for b. | ||
537 | * @return the Set of all values or empty set if there are no matches | ||
538 | * | ||
539 | */ | ||
540 | public Set<EReference> getAllValuesOfb(final EReference pA) { | ||
541 | return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); | ||
542 | } | ||
543 | |||
544 | @Override | ||
545 | protected NonSymmetricOpposite.Match tupleToMatch(final Tuple t) { | ||
546 | try { | ||
547 | return NonSymmetricOpposite.Match.newMatch((EReference) t.get(POSITION_A), (EReference) t.get(POSITION_B)); | ||
548 | } catch(ClassCastException e) { | ||
549 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
550 | return null; | ||
551 | } | ||
552 | } | ||
553 | |||
554 | @Override | ||
555 | protected NonSymmetricOpposite.Match arrayToMatch(final Object[] match) { | ||
556 | try { | ||
557 | return NonSymmetricOpposite.Match.newMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); | ||
558 | } catch(ClassCastException e) { | ||
559 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
560 | return null; | ||
561 | } | ||
562 | } | ||
563 | |||
564 | @Override | ||
565 | protected NonSymmetricOpposite.Match arrayToMatchMutable(final Object[] match) { | ||
566 | try { | ||
567 | return NonSymmetricOpposite.Match.newMutableMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); | ||
568 | } catch(ClassCastException e) { | ||
569 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
570 | return null; | ||
571 | } | ||
572 | } | ||
573 | |||
574 | /** | ||
575 | * @return the singleton instance of the query specification of this pattern | ||
576 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
577 | * | ||
578 | */ | ||
579 | public static IQuerySpecification<NonSymmetricOpposite.Matcher> querySpecification() { | ||
580 | return NonSymmetricOpposite.instance(); | ||
581 | } | ||
582 | } | ||
583 | |||
584 | private NonSymmetricOpposite() { | ||
585 | super(GeneratedPQuery.INSTANCE); | ||
586 | } | ||
587 | |||
588 | /** | ||
589 | * @return the singleton instance of the query specification | ||
590 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
591 | * | ||
592 | */ | ||
593 | public static NonSymmetricOpposite instance() { | ||
594 | try{ | ||
595 | return LazyHolder.INSTANCE; | ||
596 | } catch (ExceptionInInitializerError err) { | ||
597 | throw processInitializerError(err); | ||
598 | } | ||
599 | } | ||
600 | |||
601 | @Override | ||
602 | protected NonSymmetricOpposite.Matcher instantiate(final ViatraQueryEngine engine) { | ||
603 | return NonSymmetricOpposite.Matcher.on(engine); | ||
604 | } | ||
605 | |||
606 | @Override | ||
607 | public NonSymmetricOpposite.Matcher instantiate() { | ||
608 | return NonSymmetricOpposite.Matcher.create(); | ||
609 | } | ||
610 | |||
611 | @Override | ||
612 | public NonSymmetricOpposite.Match newEmptyMatch() { | ||
613 | return NonSymmetricOpposite.Match.newEmptyMatch(); | ||
614 | } | ||
615 | |||
616 | @Override | ||
617 | public NonSymmetricOpposite.Match newMatch(final Object... parameters) { | ||
618 | return NonSymmetricOpposite.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0], (org.eclipse.emf.ecore.EReference) parameters[1]); | ||
619 | } | ||
620 | |||
621 | /** | ||
622 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.NonSymmetricOpposite (visibility: PUBLIC, simpleName: NonSymmetricOpposite, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.NonSymmetricOpposite, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
623 | * <b>not</b> at the class load time of the outer class, | ||
624 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.NonSymmetricOpposite (visibility: PUBLIC, simpleName: NonSymmetricOpposite, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.NonSymmetricOpposite, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
625 | * | ||
626 | * <p> This workaround is required e.g. to support recursion. | ||
627 | * | ||
628 | */ | ||
629 | private static class LazyHolder { | ||
630 | private static final NonSymmetricOpposite INSTANCE = new NonSymmetricOpposite(); | ||
631 | |||
632 | /** | ||
633 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
634 | * This initialization order is required to support indirect recursion. | ||
635 | * | ||
636 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
637 | * | ||
638 | */ | ||
639 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
640 | |||
641 | public static Object ensureInitialized() { | ||
642 | INSTANCE.ensureInitializedInternal(); | ||
643 | return null; | ||
644 | } | ||
645 | } | ||
646 | |||
647 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
648 | private static final NonSymmetricOpposite.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
649 | |||
650 | private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); | ||
651 | |||
652 | private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); | ||
653 | |||
654 | private final List<PParameter> parameters = Arrays.asList(parameter_a, parameter_b); | ||
655 | |||
656 | private GeneratedPQuery() { | ||
657 | super(PVisibility.PUBLIC); | ||
658 | } | ||
659 | |||
660 | @Override | ||
661 | public String getFullyQualifiedName() { | ||
662 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.nonSymmetricOpposite"; | ||
663 | } | ||
664 | |||
665 | @Override | ||
666 | public List<String> getParameterNames() { | ||
667 | return Arrays.asList("a","b"); | ||
668 | } | ||
669 | |||
670 | @Override | ||
671 | public List<PParameter> getParameters() { | ||
672 | return parameters; | ||
673 | } | ||
674 | |||
675 | @Override | ||
676 | public Set<PBody> doGetContainedBodies() { | ||
677 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
678 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
679 | { | ||
680 | PBody body = new PBody(this); | ||
681 | PVariable var_a = body.getOrCreateVariableByName("a"); | ||
682 | PVariable var_b = body.getOrCreateVariableByName("b"); | ||
683 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
684 | new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
685 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
686 | new ExportedParameter(body, var_a, parameter_a), | ||
687 | new ExportedParameter(body, var_b, parameter_b) | ||
688 | )); | ||
689 | // find opposite(a,b) | ||
690 | new PositivePatternCall(body, Tuples.flatTupleOf(var_a, var_b), Opposite.instance().getInternalQueryRepresentation()); | ||
691 | // neg find opposite(b,a) | ||
692 | new NegativePatternCall(body, Tuples.flatTupleOf(var_b, var_a), Opposite.instance().getInternalQueryRepresentation()); | ||
693 | bodies.add(body); | ||
694 | } | ||
695 | { | ||
696 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
697 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
698 | new ParameterReference("a") | ||
699 | })); | ||
700 | annotation.addAttribute("severity", "error"); | ||
701 | annotation.addAttribute("message", "error"); | ||
702 | addAnnotation(annotation); | ||
703 | } | ||
704 | return bodies; | ||
705 | } | ||
706 | } | ||
707 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Opposite.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Opposite.java new file mode 100644 index 00000000..c4832370 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Opposite.java | |||
@@ -0,0 +1,693 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Ecore.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import org.apache.log4j.Logger; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.EReference; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
39 | import 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 opposite(a:EReference, b: EReference) { | ||
47 | * EReference.eOpposite(a,b); | ||
48 | * } | ||
49 | * </pre></code> | ||
50 | * | ||
51 | * @see Matcher | ||
52 | * @see Match | ||
53 | * | ||
54 | */ | ||
55 | @SuppressWarnings("all") | ||
56 | public final class Opposite extends BaseGeneratedEMFQuerySpecification<Opposite.Matcher> { | ||
57 | /** | ||
58 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.opposite 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 EReference fA; | ||
71 | |||
72 | private EReference fB; | ||
73 | |||
74 | private static List<String> parameterNames = makeImmutableList("a", "b"); | ||
75 | |||
76 | private Match(final EReference pA, final EReference pB) { | ||
77 | this.fA = pA; | ||
78 | this.fB = pB; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | if ("a".equals(parameterName)) return this.fA; | ||
84 | if ("b".equals(parameterName)) return this.fB; | ||
85 | return null; | ||
86 | } | ||
87 | |||
88 | public EReference getA() { | ||
89 | return this.fA; | ||
90 | } | ||
91 | |||
92 | public EReference getB() { | ||
93 | return this.fB; | ||
94 | } | ||
95 | |||
96 | @Override | ||
97 | public boolean set(final String parameterName, final Object newValue) { | ||
98 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
99 | if ("a".equals(parameterName) ) { | ||
100 | this.fA = (EReference) newValue; | ||
101 | return true; | ||
102 | } | ||
103 | if ("b".equals(parameterName) ) { | ||
104 | this.fB = (EReference) newValue; | ||
105 | return true; | ||
106 | } | ||
107 | return false; | ||
108 | } | ||
109 | |||
110 | public void setA(final EReference pA) { | ||
111 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
112 | this.fA = pA; | ||
113 | } | ||
114 | |||
115 | public void setB(final EReference pB) { | ||
116 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
117 | this.fB = pB; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public String patternName() { | ||
122 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.opposite"; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public List<String> parameterNames() { | ||
127 | return Opposite.Match.parameterNames; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public Object[] toArray() { | ||
132 | return new Object[]{fA, fB}; | ||
133 | } | ||
134 | |||
135 | @Override | ||
136 | public Opposite.Match toImmutable() { | ||
137 | return isMutable() ? newMatch(fA, fB) : this; | ||
138 | } | ||
139 | |||
140 | @Override | ||
141 | public String prettyPrint() { | ||
142 | StringBuilder result = new StringBuilder(); | ||
143 | result.append("\"a\"=" + prettyPrintValue(fA) + ", "); | ||
144 | result.append("\"b\"=" + prettyPrintValue(fB)); | ||
145 | return result.toString(); | ||
146 | } | ||
147 | |||
148 | @Override | ||
149 | public int hashCode() { | ||
150 | return Objects.hash(fA, fB); | ||
151 | } | ||
152 | |||
153 | @Override | ||
154 | public boolean equals(final Object obj) { | ||
155 | if (this == obj) | ||
156 | return true; | ||
157 | if (obj == null) { | ||
158 | return false; | ||
159 | } | ||
160 | if ((obj instanceof Opposite.Match)) { | ||
161 | Opposite.Match other = (Opposite.Match) obj; | ||
162 | return Objects.equals(fA, other.fA) && Objects.equals(fB, other.fB); | ||
163 | } else { | ||
164 | // this should be infrequent | ||
165 | if (!(obj instanceof IPatternMatch)) { | ||
166 | return false; | ||
167 | } | ||
168 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
169 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
170 | } | ||
171 | } | ||
172 | |||
173 | @Override | ||
174 | public Opposite specification() { | ||
175 | return Opposite.instance(); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * Returns an empty, mutable match. | ||
180 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
181 | * | ||
182 | * @return the empty match. | ||
183 | * | ||
184 | */ | ||
185 | public static Opposite.Match newEmptyMatch() { | ||
186 | return new Mutable(null, null); | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * Returns a mutable (partial) match. | ||
191 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
192 | * | ||
193 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
194 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
195 | * @return the new, mutable (partial) match object. | ||
196 | * | ||
197 | */ | ||
198 | public static Opposite.Match newMutableMatch(final EReference pA, final EReference pB) { | ||
199 | return new Mutable(pA, pB); | ||
200 | } | ||
201 | |||
202 | /** | ||
203 | * Returns a new (partial) match. | ||
204 | * This can be used e.g. to call the matcher with a partial match. | ||
205 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
206 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
207 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
208 | * @return the (partial) match object. | ||
209 | * | ||
210 | */ | ||
211 | public static Opposite.Match newMatch(final EReference pA, final EReference pB) { | ||
212 | return new Immutable(pA, pB); | ||
213 | } | ||
214 | |||
215 | private static final class Mutable extends Opposite.Match { | ||
216 | Mutable(final EReference pA, final EReference pB) { | ||
217 | super(pA, pB); | ||
218 | } | ||
219 | |||
220 | @Override | ||
221 | public boolean isMutable() { | ||
222 | return true; | ||
223 | } | ||
224 | } | ||
225 | |||
226 | private static final class Immutable extends Opposite.Match { | ||
227 | Immutable(final EReference pA, final EReference pB) { | ||
228 | super(pA, pB); | ||
229 | } | ||
230 | |||
231 | @Override | ||
232 | public boolean isMutable() { | ||
233 | return false; | ||
234 | } | ||
235 | } | ||
236 | } | ||
237 | |||
238 | /** | ||
239 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.opposite pattern, | ||
240 | * providing pattern-specific query methods. | ||
241 | * | ||
242 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
243 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
244 | * | ||
245 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
246 | * | ||
247 | * <p>Original source: | ||
248 | * <code><pre> | ||
249 | * pattern opposite(a:EReference, b: EReference) { | ||
250 | * EReference.eOpposite(a,b); | ||
251 | * } | ||
252 | * </pre></code> | ||
253 | * | ||
254 | * @see Match | ||
255 | * @see Opposite | ||
256 | * | ||
257 | */ | ||
258 | public static class Matcher extends BaseMatcher<Opposite.Match> { | ||
259 | /** | ||
260 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
261 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
262 | * | ||
263 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
264 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
265 | * | ||
266 | */ | ||
267 | public static Opposite.Matcher on(final ViatraQueryEngine engine) { | ||
268 | // check if matcher already exists | ||
269 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
270 | if (matcher == null) { | ||
271 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
272 | } | ||
273 | return matcher; | ||
274 | } | ||
275 | |||
276 | /** | ||
277 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
278 | * @return an initialized matcher | ||
279 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
280 | * | ||
281 | */ | ||
282 | public static Opposite.Matcher create() { | ||
283 | return new Matcher(); | ||
284 | } | ||
285 | |||
286 | private static final int POSITION_A = 0; | ||
287 | |||
288 | private static final int POSITION_B = 1; | ||
289 | |||
290 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Opposite.Matcher.class); | ||
291 | |||
292 | /** | ||
293 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
294 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
295 | * | ||
296 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
297 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
298 | * | ||
299 | */ | ||
300 | private Matcher() { | ||
301 | super(querySpecification()); | ||
302 | } | ||
303 | |||
304 | /** | ||
305 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
306 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
307 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
308 | * @return matches represented as a Match object. | ||
309 | * | ||
310 | */ | ||
311 | public Collection<Opposite.Match> getAllMatches(final EReference pA, final EReference pB) { | ||
312 | return rawStreamAllMatches(new Object[]{pA, pB}).collect(Collectors.toSet()); | ||
313 | } | ||
314 | |||
315 | /** | ||
316 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
317 | * </p> | ||
318 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
319 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
320 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
321 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
322 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
323 | * @return a stream of matches represented as a Match object. | ||
324 | * | ||
325 | */ | ||
326 | public Stream<Opposite.Match> streamAllMatches(final EReference pA, final EReference pB) { | ||
327 | return rawStreamAllMatches(new Object[]{pA, pB}); | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
332 | * Neither determinism nor randomness of selection is guaranteed. | ||
333 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
334 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
335 | * @return a match represented as a Match object, or null if no match is found. | ||
336 | * | ||
337 | */ | ||
338 | public Optional<Opposite.Match> getOneArbitraryMatch(final EReference pA, final EReference pB) { | ||
339 | return rawGetOneArbitraryMatch(new Object[]{pA, pB}); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
344 | * under any possible substitution of the unspecified parameters (if any). | ||
345 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
346 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
347 | * @return true if the input is a valid (partial) match of the pattern. | ||
348 | * | ||
349 | */ | ||
350 | public boolean hasMatch(final EReference pA, final EReference pB) { | ||
351 | return rawHasMatch(new Object[]{pA, pB}); | ||
352 | } | ||
353 | |||
354 | /** | ||
355 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
356 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
357 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
358 | * @return the number of pattern matches found. | ||
359 | * | ||
360 | */ | ||
361 | public int countMatches(final EReference pA, final EReference pB) { | ||
362 | return rawCountMatches(new Object[]{pA, pB}); | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
367 | * Neither determinism nor randomness of selection is guaranteed. | ||
368 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
369 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
370 | * @param processor the action that will process the selected match. | ||
371 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
372 | * | ||
373 | */ | ||
374 | public boolean forOneArbitraryMatch(final EReference pA, final EReference pB, final Consumer<? super Opposite.Match> processor) { | ||
375 | return rawForOneArbitraryMatch(new Object[]{pA, pB}, processor); | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * Returns a new (partial) match. | ||
380 | * This can be used e.g. to call the matcher with a partial match. | ||
381 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
382 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
383 | * @param pB the fixed value of pattern parameter b, or null if not bound. | ||
384 | * @return the (partial) match object. | ||
385 | * | ||
386 | */ | ||
387 | public Opposite.Match newMatch(final EReference pA, final EReference pB) { | ||
388 | return Opposite.Match.newMatch(pA, pB); | ||
389 | } | ||
390 | |||
391 | /** | ||
392 | * Retrieve the set of values that occur in matches for a. | ||
393 | * @return the Set of all values or empty set if there are no matches | ||
394 | * | ||
395 | */ | ||
396 | protected Stream<EReference> rawStreamAllValuesOfa(final Object[] parameters) { | ||
397 | return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); | ||
398 | } | ||
399 | |||
400 | /** | ||
401 | * Retrieve the set of values that occur in matches for a. | ||
402 | * @return the Set of all values or empty set if there are no matches | ||
403 | * | ||
404 | */ | ||
405 | public Set<EReference> getAllValuesOfa() { | ||
406 | return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); | ||
407 | } | ||
408 | |||
409 | /** | ||
410 | * Retrieve the set of values that occur in matches for a. | ||
411 | * @return the Set of all values or empty set if there are no matches | ||
412 | * | ||
413 | */ | ||
414 | public Stream<EReference> streamAllValuesOfa() { | ||
415 | return rawStreamAllValuesOfa(emptyArray()); | ||
416 | } | ||
417 | |||
418 | /** | ||
419 | * Retrieve the set of values that occur in matches for a. | ||
420 | * </p> | ||
421 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
422 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
423 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
424 | * | ||
425 | * @return the Stream of all values or empty set if there are no matches | ||
426 | * | ||
427 | */ | ||
428 | public Stream<EReference> streamAllValuesOfa(final Opposite.Match partialMatch) { | ||
429 | return rawStreamAllValuesOfa(partialMatch.toArray()); | ||
430 | } | ||
431 | |||
432 | /** | ||
433 | * Retrieve the set of values that occur in matches for a. | ||
434 | * </p> | ||
435 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
436 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
437 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
438 | * | ||
439 | * @return the Stream of all values or empty set if there are no matches | ||
440 | * | ||
441 | */ | ||
442 | public Stream<EReference> streamAllValuesOfa(final EReference pB) { | ||
443 | return rawStreamAllValuesOfa(new Object[]{null, pB}); | ||
444 | } | ||
445 | |||
446 | /** | ||
447 | * Retrieve the set of values that occur in matches for a. | ||
448 | * @return the Set of all values or empty set if there are no matches | ||
449 | * | ||
450 | */ | ||
451 | public Set<EReference> getAllValuesOfa(final Opposite.Match partialMatch) { | ||
452 | return rawStreamAllValuesOfa(partialMatch.toArray()).collect(Collectors.toSet()); | ||
453 | } | ||
454 | |||
455 | /** | ||
456 | * Retrieve the set of values that occur in matches for a. | ||
457 | * @return the Set of all values or empty set if there are no matches | ||
458 | * | ||
459 | */ | ||
460 | public Set<EReference> getAllValuesOfa(final EReference pB) { | ||
461 | return rawStreamAllValuesOfa(new Object[]{null, pB}).collect(Collectors.toSet()); | ||
462 | } | ||
463 | |||
464 | /** | ||
465 | * Retrieve the set of values that occur in matches for b. | ||
466 | * @return the Set of all values or empty set if there are no matches | ||
467 | * | ||
468 | */ | ||
469 | protected Stream<EReference> rawStreamAllValuesOfb(final Object[] parameters) { | ||
470 | return rawStreamAllValues(POSITION_B, parameters).map(EReference.class::cast); | ||
471 | } | ||
472 | |||
473 | /** | ||
474 | * Retrieve the set of values that occur in matches for b. | ||
475 | * @return the Set of all values or empty set if there are no matches | ||
476 | * | ||
477 | */ | ||
478 | public Set<EReference> getAllValuesOfb() { | ||
479 | return rawStreamAllValuesOfb(emptyArray()).collect(Collectors.toSet()); | ||
480 | } | ||
481 | |||
482 | /** | ||
483 | * Retrieve the set of values that occur in matches for b. | ||
484 | * @return the Set of all values or empty set if there are no matches | ||
485 | * | ||
486 | */ | ||
487 | public Stream<EReference> streamAllValuesOfb() { | ||
488 | return rawStreamAllValuesOfb(emptyArray()); | ||
489 | } | ||
490 | |||
491 | /** | ||
492 | * Retrieve the set of values that occur in matches for b. | ||
493 | * </p> | ||
494 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
495 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
496 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
497 | * | ||
498 | * @return the Stream of all values or empty set if there are no matches | ||
499 | * | ||
500 | */ | ||
501 | public Stream<EReference> streamAllValuesOfb(final Opposite.Match partialMatch) { | ||
502 | return rawStreamAllValuesOfb(partialMatch.toArray()); | ||
503 | } | ||
504 | |||
505 | /** | ||
506 | * Retrieve the set of values that occur in matches for b. | ||
507 | * </p> | ||
508 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
509 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
510 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
511 | * | ||
512 | * @return the Stream of all values or empty set if there are no matches | ||
513 | * | ||
514 | */ | ||
515 | public Stream<EReference> streamAllValuesOfb(final EReference pA) { | ||
516 | return rawStreamAllValuesOfb(new Object[]{pA, null}); | ||
517 | } | ||
518 | |||
519 | /** | ||
520 | * Retrieve the set of values that occur in matches for b. | ||
521 | * @return the Set of all values or empty set if there are no matches | ||
522 | * | ||
523 | */ | ||
524 | public Set<EReference> getAllValuesOfb(final Opposite.Match partialMatch) { | ||
525 | return rawStreamAllValuesOfb(partialMatch.toArray()).collect(Collectors.toSet()); | ||
526 | } | ||
527 | |||
528 | /** | ||
529 | * Retrieve the set of values that occur in matches for b. | ||
530 | * @return the Set of all values or empty set if there are no matches | ||
531 | * | ||
532 | */ | ||
533 | public Set<EReference> getAllValuesOfb(final EReference pA) { | ||
534 | return rawStreamAllValuesOfb(new Object[]{pA, null}).collect(Collectors.toSet()); | ||
535 | } | ||
536 | |||
537 | @Override | ||
538 | protected Opposite.Match tupleToMatch(final Tuple t) { | ||
539 | try { | ||
540 | return Opposite.Match.newMatch((EReference) t.get(POSITION_A), (EReference) t.get(POSITION_B)); | ||
541 | } catch(ClassCastException e) { | ||
542 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
543 | return null; | ||
544 | } | ||
545 | } | ||
546 | |||
547 | @Override | ||
548 | protected Opposite.Match arrayToMatch(final Object[] match) { | ||
549 | try { | ||
550 | return Opposite.Match.newMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); | ||
551 | } catch(ClassCastException e) { | ||
552 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
553 | return null; | ||
554 | } | ||
555 | } | ||
556 | |||
557 | @Override | ||
558 | protected Opposite.Match arrayToMatchMutable(final Object[] match) { | ||
559 | try { | ||
560 | return Opposite.Match.newMutableMatch((EReference) match[POSITION_A], (EReference) match[POSITION_B]); | ||
561 | } catch(ClassCastException e) { | ||
562 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
563 | return null; | ||
564 | } | ||
565 | } | ||
566 | |||
567 | /** | ||
568 | * @return the singleton instance of the query specification of this pattern | ||
569 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
570 | * | ||
571 | */ | ||
572 | public static IQuerySpecification<Opposite.Matcher> querySpecification() { | ||
573 | return Opposite.instance(); | ||
574 | } | ||
575 | } | ||
576 | |||
577 | private Opposite() { | ||
578 | super(GeneratedPQuery.INSTANCE); | ||
579 | } | ||
580 | |||
581 | /** | ||
582 | * @return the singleton instance of the query specification | ||
583 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
584 | * | ||
585 | */ | ||
586 | public static Opposite instance() { | ||
587 | try{ | ||
588 | return LazyHolder.INSTANCE; | ||
589 | } catch (ExceptionInInitializerError err) { | ||
590 | throw processInitializerError(err); | ||
591 | } | ||
592 | } | ||
593 | |||
594 | @Override | ||
595 | protected Opposite.Matcher instantiate(final ViatraQueryEngine engine) { | ||
596 | return Opposite.Matcher.on(engine); | ||
597 | } | ||
598 | |||
599 | @Override | ||
600 | public Opposite.Matcher instantiate() { | ||
601 | return Opposite.Matcher.create(); | ||
602 | } | ||
603 | |||
604 | @Override | ||
605 | public Opposite.Match newEmptyMatch() { | ||
606 | return Opposite.Match.newEmptyMatch(); | ||
607 | } | ||
608 | |||
609 | @Override | ||
610 | public Opposite.Match newMatch(final Object... parameters) { | ||
611 | return Opposite.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0], (org.eclipse.emf.ecore.EReference) parameters[1]); | ||
612 | } | ||
613 | |||
614 | /** | ||
615 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Opposite (visibility: PUBLIC, simpleName: Opposite, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Opposite, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
616 | * <b>not</b> at the class load time of the outer class, | ||
617 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Opposite (visibility: PUBLIC, simpleName: Opposite, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Opposite, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
618 | * | ||
619 | * <p> This workaround is required e.g. to support recursion. | ||
620 | * | ||
621 | */ | ||
622 | private static class LazyHolder { | ||
623 | private static final Opposite INSTANCE = new Opposite(); | ||
624 | |||
625 | /** | ||
626 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
627 | * This initialization order is required to support indirect recursion. | ||
628 | * | ||
629 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
630 | * | ||
631 | */ | ||
632 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
633 | |||
634 | public static Object ensureInitialized() { | ||
635 | INSTANCE.ensureInitializedInternal(); | ||
636 | return null; | ||
637 | } | ||
638 | } | ||
639 | |||
640 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
641 | private static final Opposite.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
642 | |||
643 | private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); | ||
644 | |||
645 | private final PParameter parameter_b = new PParameter("b", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); | ||
646 | |||
647 | private final List<PParameter> parameters = Arrays.asList(parameter_a, parameter_b); | ||
648 | |||
649 | private GeneratedPQuery() { | ||
650 | super(PVisibility.PUBLIC); | ||
651 | } | ||
652 | |||
653 | @Override | ||
654 | public String getFullyQualifiedName() { | ||
655 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.opposite"; | ||
656 | } | ||
657 | |||
658 | @Override | ||
659 | public List<String> getParameterNames() { | ||
660 | return Arrays.asList("a","b"); | ||
661 | } | ||
662 | |||
663 | @Override | ||
664 | public List<PParameter> getParameters() { | ||
665 | return parameters; | ||
666 | } | ||
667 | |||
668 | @Override | ||
669 | public Set<PBody> doGetContainedBodies() { | ||
670 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
671 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
672 | { | ||
673 | PBody body = new PBody(this); | ||
674 | PVariable var_a = body.getOrCreateVariableByName("a"); | ||
675 | PVariable var_b = body.getOrCreateVariableByName("b"); | ||
676 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
677 | new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
678 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
679 | new ExportedParameter(body, var_a, parameter_a), | ||
680 | new ExportedParameter(body, var_b, parameter_b) | ||
681 | )); | ||
682 | // EReference.eOpposite(a,b) | ||
683 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
684 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
685 | new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference", "eOpposite"))); | ||
686 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
687 | new Equality(body, var__virtual_0_, var_b); | ||
688 | bodies.add(body); | ||
689 | } | ||
690 | return bodies; | ||
691 | } | ||
692 | } | ||
693 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/OppositeDifferentClass.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/OppositeDifferentClass.java new file mode 100644 index 00000000..887f8584 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/OppositeDifferentClass.java | |||
@@ -0,0 +1,577 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Ecore.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collection; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Objects; | ||
11 | import java.util.Optional; | ||
12 | import java.util.Set; | ||
13 | import java.util.function.Consumer; | ||
14 | import java.util.stream.Collectors; | ||
15 | import java.util.stream.Stream; | ||
16 | import org.apache.log4j.Logger; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.EReference; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import 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 @}Constraint(key={a}, severity="error", message="error") | ||
50 | * pattern oppositeDifferentClass(a:EReference) { | ||
51 | * EReference.eOpposite(a,b); | ||
52 | * EReference.eContainingClass(a,aContaining); | ||
53 | * EReference.eType(b,bTarget); | ||
54 | * aContaining != bTarget; | ||
55 | * } | ||
56 | * </pre></code> | ||
57 | * | ||
58 | * @see Matcher | ||
59 | * @see Match | ||
60 | * | ||
61 | */ | ||
62 | @SuppressWarnings("all") | ||
63 | public final class OppositeDifferentClass extends BaseGeneratedEMFQuerySpecification<OppositeDifferentClass.Matcher> { | ||
64 | /** | ||
65 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.oppositeDifferentClass pattern, | ||
66 | * to be used in conjunction with {@link Matcher}. | ||
67 | * | ||
68 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
69 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
70 | * usable to represent a match of the pattern in the result of a query, | ||
71 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
72 | * | ||
73 | * @see Matcher | ||
74 | * | ||
75 | */ | ||
76 | public static abstract class Match extends BasePatternMatch { | ||
77 | private EReference fA; | ||
78 | |||
79 | private static List<String> parameterNames = makeImmutableList("a"); | ||
80 | |||
81 | private Match(final EReference pA) { | ||
82 | this.fA = pA; | ||
83 | } | ||
84 | |||
85 | @Override | ||
86 | public Object get(final String parameterName) { | ||
87 | if ("a".equals(parameterName)) return this.fA; | ||
88 | return null; | ||
89 | } | ||
90 | |||
91 | public EReference getA() { | ||
92 | return this.fA; | ||
93 | } | ||
94 | |||
95 | @Override | ||
96 | public boolean set(final String parameterName, final Object newValue) { | ||
97 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
98 | if ("a".equals(parameterName) ) { | ||
99 | this.fA = (EReference) newValue; | ||
100 | return true; | ||
101 | } | ||
102 | return false; | ||
103 | } | ||
104 | |||
105 | public void setA(final EReference pA) { | ||
106 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
107 | this.fA = pA; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public String patternName() { | ||
112 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.oppositeDifferentClass"; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public List<String> parameterNames() { | ||
117 | return OppositeDifferentClass.Match.parameterNames; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public Object[] toArray() { | ||
122 | return new Object[]{fA}; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public OppositeDifferentClass.Match toImmutable() { | ||
127 | return isMutable() ? newMatch(fA) : this; | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public String prettyPrint() { | ||
132 | StringBuilder result = new StringBuilder(); | ||
133 | result.append("\"a\"=" + prettyPrintValue(fA)); | ||
134 | return result.toString(); | ||
135 | } | ||
136 | |||
137 | @Override | ||
138 | public int hashCode() { | ||
139 | return Objects.hash(fA); | ||
140 | } | ||
141 | |||
142 | @Override | ||
143 | public boolean equals(final Object obj) { | ||
144 | if (this == obj) | ||
145 | return true; | ||
146 | if (obj == null) { | ||
147 | return false; | ||
148 | } | ||
149 | if ((obj instanceof OppositeDifferentClass.Match)) { | ||
150 | OppositeDifferentClass.Match other = (OppositeDifferentClass.Match) obj; | ||
151 | return Objects.equals(fA, other.fA); | ||
152 | } else { | ||
153 | // this should be infrequent | ||
154 | if (!(obj instanceof IPatternMatch)) { | ||
155 | return false; | ||
156 | } | ||
157 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
158 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
159 | } | ||
160 | } | ||
161 | |||
162 | @Override | ||
163 | public OppositeDifferentClass specification() { | ||
164 | return OppositeDifferentClass.instance(); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * Returns an empty, mutable match. | ||
169 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
170 | * | ||
171 | * @return the empty match. | ||
172 | * | ||
173 | */ | ||
174 | public static OppositeDifferentClass.Match newEmptyMatch() { | ||
175 | return new Mutable(null); | ||
176 | } | ||
177 | |||
178 | /** | ||
179 | * Returns a mutable (partial) match. | ||
180 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
181 | * | ||
182 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
183 | * @return the new, mutable (partial) match object. | ||
184 | * | ||
185 | */ | ||
186 | public static OppositeDifferentClass.Match newMutableMatch(final EReference pA) { | ||
187 | return new Mutable(pA); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * Returns a new (partial) match. | ||
192 | * This can be used e.g. to call the matcher with a partial match. | ||
193 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
194 | * @param pA the fixed value of pattern parameter a, or null if not bound. | ||
195 | * @return the (partial) match object. | ||
196 | * | ||
197 | */ | ||
198 | public static OppositeDifferentClass.Match newMatch(final EReference pA) { | ||
199 | return new Immutable(pA); | ||
200 | } | ||
201 | |||
202 | private static final class Mutable extends OppositeDifferentClass.Match { | ||
203 | Mutable(final EReference pA) { | ||
204 | super(pA); | ||
205 | } | ||
206 | |||
207 | @Override | ||
208 | public boolean isMutable() { | ||
209 | return true; | ||
210 | } | ||
211 | } | ||
212 | |||
213 | private static final class Immutable extends OppositeDifferentClass.Match { | ||
214 | Immutable(final EReference pA) { | ||
215 | super(pA); | ||
216 | } | ||
217 | |||
218 | @Override | ||
219 | public boolean isMutable() { | ||
220 | return false; | ||
221 | } | ||
222 | } | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.oppositeDifferentClass pattern, | ||
227 | * providing pattern-specific query methods. | ||
228 | * | ||
229 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
230 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
231 | * | ||
232 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
233 | * | ||
234 | * <p>Original source: | ||
235 | * <code><pre> | ||
236 | * {@literal @}Constraint(key={a}, severity="error", message="error") | ||
237 | * pattern oppositeDifferentClass(a:EReference) { | ||
238 | * EReference.eOpposite(a,b); | ||
239 | * EReference.eContainingClass(a,aContaining); | ||
240 | * EReference.eType(b,bTarget); | ||
241 | * aContaining != bTarget; | ||
242 | * } | ||
243 | * </pre></code> | ||
244 | * | ||
245 | * @see Match | ||
246 | * @see OppositeDifferentClass | ||
247 | * | ||
248 | */ | ||
249 | public static class Matcher extends BaseMatcher<OppositeDifferentClass.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 OppositeDifferentClass.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 OppositeDifferentClass.Matcher create() { | ||
274 | return new Matcher(); | ||
275 | } | ||
276 | |||
277 | private static final int POSITION_A = 0; | ||
278 | |||
279 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(OppositeDifferentClass.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 pA the fixed value of pattern parameter a, or null if not bound. | ||
296 | * @return matches represented as a Match object. | ||
297 | * | ||
298 | */ | ||
299 | public Collection<OppositeDifferentClass.Match> getAllMatches(final EReference pA) { | ||
300 | return rawStreamAllMatches(new Object[]{pA}).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 pA the fixed value of pattern parameter a, or null if not bound. | ||
310 | * @return a stream of matches represented as a Match object. | ||
311 | * | ||
312 | */ | ||
313 | public Stream<OppositeDifferentClass.Match> streamAllMatches(final EReference pA) { | ||
314 | return rawStreamAllMatches(new Object[]{pA}); | ||
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 pA the fixed value of pattern parameter a, 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<OppositeDifferentClass.Match> getOneArbitraryMatch(final EReference pA) { | ||
325 | return rawGetOneArbitraryMatch(new Object[]{pA}); | ||
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 pA the fixed value of pattern parameter a, 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 EReference pA) { | ||
336 | return rawHasMatch(new Object[]{pA}); | ||
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 pA the fixed value of pattern parameter a, or null if not bound. | ||
342 | * @return the number of pattern matches found. | ||
343 | * | ||
344 | */ | ||
345 | public int countMatches(final EReference pA) { | ||
346 | return rawCountMatches(new Object[]{pA}); | ||
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 pA the fixed value of pattern parameter a, 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 EReference pA, final Consumer<? super OppositeDifferentClass.Match> processor) { | ||
358 | return rawForOneArbitraryMatch(new Object[]{pA}, 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 pA the fixed value of pattern parameter a, or null if not bound. | ||
366 | * @return the (partial) match object. | ||
367 | * | ||
368 | */ | ||
369 | public OppositeDifferentClass.Match newMatch(final EReference pA) { | ||
370 | return OppositeDifferentClass.Match.newMatch(pA); | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * Retrieve the set of values that occur in matches for a. | ||
375 | * @return the Set of all values or empty set if there are no matches | ||
376 | * | ||
377 | */ | ||
378 | protected Stream<EReference> rawStreamAllValuesOfa(final Object[] parameters) { | ||
379 | return rawStreamAllValues(POSITION_A, parameters).map(EReference.class::cast); | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * Retrieve the set of values that occur in matches for a. | ||
384 | * @return the Set of all values or empty set if there are no matches | ||
385 | * | ||
386 | */ | ||
387 | public Set<EReference> getAllValuesOfa() { | ||
388 | return rawStreamAllValuesOfa(emptyArray()).collect(Collectors.toSet()); | ||
389 | } | ||
390 | |||
391 | /** | ||
392 | * Retrieve the set of values that occur in matches for a. | ||
393 | * @return the Set of all values or empty set if there are no matches | ||
394 | * | ||
395 | */ | ||
396 | public Stream<EReference> streamAllValuesOfa() { | ||
397 | return rawStreamAllValuesOfa(emptyArray()); | ||
398 | } | ||
399 | |||
400 | @Override | ||
401 | protected OppositeDifferentClass.Match tupleToMatch(final Tuple t) { | ||
402 | try { | ||
403 | return OppositeDifferentClass.Match.newMatch((EReference) t.get(POSITION_A)); | ||
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 OppositeDifferentClass.Match arrayToMatch(final Object[] match) { | ||
412 | try { | ||
413 | return OppositeDifferentClass.Match.newMatch((EReference) match[POSITION_A]); | ||
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 OppositeDifferentClass.Match arrayToMatchMutable(final Object[] match) { | ||
422 | try { | ||
423 | return OppositeDifferentClass.Match.newMutableMatch((EReference) match[POSITION_A]); | ||
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<OppositeDifferentClass.Matcher> querySpecification() { | ||
436 | return OppositeDifferentClass.instance(); | ||
437 | } | ||
438 | } | ||
439 | |||
440 | private OppositeDifferentClass() { | ||
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 OppositeDifferentClass instance() { | ||
450 | try{ | ||
451 | return LazyHolder.INSTANCE; | ||
452 | } catch (ExceptionInInitializerError err) { | ||
453 | throw processInitializerError(err); | ||
454 | } | ||
455 | } | ||
456 | |||
457 | @Override | ||
458 | protected OppositeDifferentClass.Matcher instantiate(final ViatraQueryEngine engine) { | ||
459 | return OppositeDifferentClass.Matcher.on(engine); | ||
460 | } | ||
461 | |||
462 | @Override | ||
463 | public OppositeDifferentClass.Matcher instantiate() { | ||
464 | return OppositeDifferentClass.Matcher.create(); | ||
465 | } | ||
466 | |||
467 | @Override | ||
468 | public OppositeDifferentClass.Match newEmptyMatch() { | ||
469 | return OppositeDifferentClass.Match.newEmptyMatch(); | ||
470 | } | ||
471 | |||
472 | @Override | ||
473 | public OppositeDifferentClass.Match newMatch(final Object... parameters) { | ||
474 | return OppositeDifferentClass.Match.newMatch((org.eclipse.emf.ecore.EReference) parameters[0]); | ||
475 | } | ||
476 | |||
477 | /** | ||
478 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.OppositeDifferentClass (visibility: PUBLIC, simpleName: OppositeDifferentClass, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.OppositeDifferentClass, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (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.alloyexamples.OppositeDifferentClass (visibility: PUBLIC, simpleName: OppositeDifferentClass, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.OppositeDifferentClass, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (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 OppositeDifferentClass INSTANCE = new OppositeDifferentClass(); | ||
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 OppositeDifferentClass.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
505 | |||
506 | private final PParameter parameter_a = new PParameter("a", "org.eclipse.emf.ecore.EReference", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EReference")), PParameterDirection.INOUT); | ||
507 | |||
508 | private final List<PParameter> parameters = Arrays.asList(parameter_a); | ||
509 | |||
510 | private GeneratedPQuery() { | ||
511 | super(PVisibility.PUBLIC); | ||
512 | } | ||
513 | |||
514 | @Override | ||
515 | public String getFullyQualifiedName() { | ||
516 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.oppositeDifferentClass"; | ||
517 | } | ||
518 | |||
519 | @Override | ||
520 | public List<String> getParameterNames() { | ||
521 | return Arrays.asList("a"); | ||
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_a = body.getOrCreateVariableByName("a"); | ||
536 | PVariable var_b = body.getOrCreateVariableByName("b"); | ||
537 | PVariable var_aContaining = body.getOrCreateVariableByName("aContaining"); | ||
538 | PVariable var_bTarget = body.getOrCreateVariableByName("bTarget"); | ||
539 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
540 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
541 | new ExportedParameter(body, var_a, parameter_a) | ||
542 | )); | ||
543 | // EReference.eOpposite(a,b) | ||
544 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
545 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
546 | new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference", "eOpposite"))); | ||
547 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
548 | new Equality(body, var__virtual_0_, var_b); | ||
549 | // EReference.eContainingClass(a,aContaining) | ||
550 | new TypeConstraint(body, Tuples.flatTupleOf(var_a), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
551 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
552 | new TypeConstraint(body, Tuples.flatTupleOf(var_a, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "EStructuralFeature", "eContainingClass"))); | ||
553 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClass"))); | ||
554 | new Equality(body, var__virtual_1_, var_aContaining); | ||
555 | // EReference.eType(b,bTarget) | ||
556 | new TypeConstraint(body, Tuples.flatTupleOf(var_b), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EReference"))); | ||
557 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
558 | new TypeConstraint(body, Tuples.flatTupleOf(var_b, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.eclipse.org/emf/2002/Ecore", "ETypedElement", "eType"))); | ||
559 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EClassifier"))); | ||
560 | new Equality(body, var__virtual_2_, var_bTarget); | ||
561 | // aContaining != bTarget | ||
562 | new Inequality(body, var_aContaining, var_bTarget); | ||
563 | bodies.add(body); | ||
564 | } | ||
565 | { | ||
566 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
567 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
568 | new ParameterReference("a") | ||
569 | })); | ||
570 | annotation.addAttribute("severity", "error"); | ||
571 | annotation.addAttribute("message", "error"); | ||
572 | addAnnotation(annotation); | ||
573 | } | ||
574 | return bodies; | ||
575 | } | ||
576 | } | ||
577 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/PatternContent.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/PatternContent.java new file mode 100644 index 00000000..5410b693 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/PatternContent.java | |||
@@ -0,0 +1,694 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
41 | |||
42 | /** | ||
43 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
44 | * | ||
45 | * <p>Original source: | ||
46 | * <code><pre> | ||
47 | * pattern patternContent(o1: Dir, o2: FSObject) { | ||
48 | * Dir.contents(o1,o2); | ||
49 | * } | ||
50 | * </pre></code> | ||
51 | * | ||
52 | * @see Matcher | ||
53 | * @see Match | ||
54 | * | ||
55 | */ | ||
56 | @SuppressWarnings("all") | ||
57 | public final class PatternContent extends BaseGeneratedEMFQuerySpecification<PatternContent.Matcher> { | ||
58 | /** | ||
59 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.patternContent pattern, | ||
60 | * to be used in conjunction with {@link Matcher}. | ||
61 | * | ||
62 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
63 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
64 | * usable to represent a match of the pattern in the result of a query, | ||
65 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
66 | * | ||
67 | * @see Matcher | ||
68 | * | ||
69 | */ | ||
70 | public static abstract class Match extends BasePatternMatch { | ||
71 | private Dir fO1; | ||
72 | |||
73 | private FSObject fO2; | ||
74 | |||
75 | private static List<String> parameterNames = makeImmutableList("o1", "o2"); | ||
76 | |||
77 | private Match(final Dir pO1, final FSObject pO2) { | ||
78 | this.fO1 = pO1; | ||
79 | this.fO2 = pO2; | ||
80 | } | ||
81 | |||
82 | @Override | ||
83 | public Object get(final String parameterName) { | ||
84 | if ("o1".equals(parameterName)) return this.fO1; | ||
85 | if ("o2".equals(parameterName)) return this.fO2; | ||
86 | return null; | ||
87 | } | ||
88 | |||
89 | public Dir getO1() { | ||
90 | return this.fO1; | ||
91 | } | ||
92 | |||
93 | public FSObject getO2() { | ||
94 | return this.fO2; | ||
95 | } | ||
96 | |||
97 | @Override | ||
98 | public boolean set(final String parameterName, final Object newValue) { | ||
99 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
100 | if ("o1".equals(parameterName) ) { | ||
101 | this.fO1 = (Dir) newValue; | ||
102 | return true; | ||
103 | } | ||
104 | if ("o2".equals(parameterName) ) { | ||
105 | this.fO2 = (FSObject) newValue; | ||
106 | return true; | ||
107 | } | ||
108 | return false; | ||
109 | } | ||
110 | |||
111 | public void setO1(final Dir pO1) { | ||
112 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
113 | this.fO1 = pO1; | ||
114 | } | ||
115 | |||
116 | public void setO2(final FSObject pO2) { | ||
117 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
118 | this.fO2 = pO2; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public String patternName() { | ||
123 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.patternContent"; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public List<String> parameterNames() { | ||
128 | return PatternContent.Match.parameterNames; | ||
129 | } | ||
130 | |||
131 | @Override | ||
132 | public Object[] toArray() { | ||
133 | return new Object[]{fO1, fO2}; | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public PatternContent.Match toImmutable() { | ||
138 | return isMutable() ? newMatch(fO1, fO2) : this; | ||
139 | } | ||
140 | |||
141 | @Override | ||
142 | public String prettyPrint() { | ||
143 | StringBuilder result = new StringBuilder(); | ||
144 | result.append("\"o1\"=" + prettyPrintValue(fO1) + ", "); | ||
145 | result.append("\"o2\"=" + prettyPrintValue(fO2)); | ||
146 | return result.toString(); | ||
147 | } | ||
148 | |||
149 | @Override | ||
150 | public int hashCode() { | ||
151 | return Objects.hash(fO1, fO2); | ||
152 | } | ||
153 | |||
154 | @Override | ||
155 | public boolean equals(final Object obj) { | ||
156 | if (this == obj) | ||
157 | return true; | ||
158 | if (obj == null) { | ||
159 | return false; | ||
160 | } | ||
161 | if ((obj instanceof PatternContent.Match)) { | ||
162 | PatternContent.Match other = (PatternContent.Match) obj; | ||
163 | return Objects.equals(fO1, other.fO1) && Objects.equals(fO2, other.fO2); | ||
164 | } else { | ||
165 | // this should be infrequent | ||
166 | if (!(obj instanceof IPatternMatch)) { | ||
167 | return false; | ||
168 | } | ||
169 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
170 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
171 | } | ||
172 | } | ||
173 | |||
174 | @Override | ||
175 | public PatternContent specification() { | ||
176 | return PatternContent.instance(); | ||
177 | } | ||
178 | |||
179 | /** | ||
180 | * Returns an empty, mutable match. | ||
181 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
182 | * | ||
183 | * @return the empty match. | ||
184 | * | ||
185 | */ | ||
186 | public static PatternContent.Match newEmptyMatch() { | ||
187 | return new Mutable(null, null); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * Returns a mutable (partial) match. | ||
192 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
193 | * | ||
194 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
195 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
196 | * @return the new, mutable (partial) match object. | ||
197 | * | ||
198 | */ | ||
199 | public static PatternContent.Match newMutableMatch(final Dir pO1, final FSObject pO2) { | ||
200 | return new Mutable(pO1, pO2); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * Returns a new (partial) match. | ||
205 | * This can be used e.g. to call the matcher with a partial match. | ||
206 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
207 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
208 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
209 | * @return the (partial) match object. | ||
210 | * | ||
211 | */ | ||
212 | public static PatternContent.Match newMatch(final Dir pO1, final FSObject pO2) { | ||
213 | return new Immutable(pO1, pO2); | ||
214 | } | ||
215 | |||
216 | private static final class Mutable extends PatternContent.Match { | ||
217 | Mutable(final Dir pO1, final FSObject pO2) { | ||
218 | super(pO1, pO2); | ||
219 | } | ||
220 | |||
221 | @Override | ||
222 | public boolean isMutable() { | ||
223 | return true; | ||
224 | } | ||
225 | } | ||
226 | |||
227 | private static final class Immutable extends PatternContent.Match { | ||
228 | Immutable(final Dir pO1, final FSObject pO2) { | ||
229 | super(pO1, pO2); | ||
230 | } | ||
231 | |||
232 | @Override | ||
233 | public boolean isMutable() { | ||
234 | return false; | ||
235 | } | ||
236 | } | ||
237 | } | ||
238 | |||
239 | /** | ||
240 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.patternContent pattern, | ||
241 | * providing pattern-specific query methods. | ||
242 | * | ||
243 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
244 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
245 | * | ||
246 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
247 | * | ||
248 | * <p>Original source: | ||
249 | * <code><pre> | ||
250 | * pattern patternContent(o1: Dir, o2: FSObject) { | ||
251 | * Dir.contents(o1,o2); | ||
252 | * } | ||
253 | * </pre></code> | ||
254 | * | ||
255 | * @see Match | ||
256 | * @see PatternContent | ||
257 | * | ||
258 | */ | ||
259 | public static class Matcher extends BaseMatcher<PatternContent.Match> { | ||
260 | /** | ||
261 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
262 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
263 | * | ||
264 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
265 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
266 | * | ||
267 | */ | ||
268 | public static PatternContent.Matcher on(final ViatraQueryEngine engine) { | ||
269 | // check if matcher already exists | ||
270 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
271 | if (matcher == null) { | ||
272 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
273 | } | ||
274 | return matcher; | ||
275 | } | ||
276 | |||
277 | /** | ||
278 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
279 | * @return an initialized matcher | ||
280 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
281 | * | ||
282 | */ | ||
283 | public static PatternContent.Matcher create() { | ||
284 | return new Matcher(); | ||
285 | } | ||
286 | |||
287 | private static final int POSITION_O1 = 0; | ||
288 | |||
289 | private static final int POSITION_O2 = 1; | ||
290 | |||
291 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(PatternContent.Matcher.class); | ||
292 | |||
293 | /** | ||
294 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
295 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
296 | * | ||
297 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
298 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
299 | * | ||
300 | */ | ||
301 | private Matcher() { | ||
302 | super(querySpecification()); | ||
303 | } | ||
304 | |||
305 | /** | ||
306 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
307 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
308 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
309 | * @return matches represented as a Match object. | ||
310 | * | ||
311 | */ | ||
312 | public Collection<PatternContent.Match> getAllMatches(final Dir pO1, final FSObject pO2) { | ||
313 | return rawStreamAllMatches(new Object[]{pO1, pO2}).collect(Collectors.toSet()); | ||
314 | } | ||
315 | |||
316 | /** | ||
317 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
318 | * </p> | ||
319 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
320 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
321 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
322 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
323 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
324 | * @return a stream of matches represented as a Match object. | ||
325 | * | ||
326 | */ | ||
327 | public Stream<PatternContent.Match> streamAllMatches(final Dir pO1, final FSObject pO2) { | ||
328 | return rawStreamAllMatches(new Object[]{pO1, pO2}); | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
333 | * Neither determinism nor randomness of selection is guaranteed. | ||
334 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
335 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
336 | * @return a match represented as a Match object, or null if no match is found. | ||
337 | * | ||
338 | */ | ||
339 | public Optional<PatternContent.Match> getOneArbitraryMatch(final Dir pO1, final FSObject pO2) { | ||
340 | return rawGetOneArbitraryMatch(new Object[]{pO1, pO2}); | ||
341 | } | ||
342 | |||
343 | /** | ||
344 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
345 | * under any possible substitution of the unspecified parameters (if any). | ||
346 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
347 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
348 | * @return true if the input is a valid (partial) match of the pattern. | ||
349 | * | ||
350 | */ | ||
351 | public boolean hasMatch(final Dir pO1, final FSObject pO2) { | ||
352 | return rawHasMatch(new Object[]{pO1, pO2}); | ||
353 | } | ||
354 | |||
355 | /** | ||
356 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
357 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
358 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
359 | * @return the number of pattern matches found. | ||
360 | * | ||
361 | */ | ||
362 | public int countMatches(final Dir pO1, final FSObject pO2) { | ||
363 | return rawCountMatches(new Object[]{pO1, pO2}); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
368 | * Neither determinism nor randomness of selection is guaranteed. | ||
369 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
370 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
371 | * @param processor the action that will process the selected match. | ||
372 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
373 | * | ||
374 | */ | ||
375 | public boolean forOneArbitraryMatch(final Dir pO1, final FSObject pO2, final Consumer<? super PatternContent.Match> processor) { | ||
376 | return rawForOneArbitraryMatch(new Object[]{pO1, pO2}, processor); | ||
377 | } | ||
378 | |||
379 | /** | ||
380 | * Returns a new (partial) match. | ||
381 | * This can be used e.g. to call the matcher with a partial match. | ||
382 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
383 | * @param pO1 the fixed value of pattern parameter o1, or null if not bound. | ||
384 | * @param pO2 the fixed value of pattern parameter o2, or null if not bound. | ||
385 | * @return the (partial) match object. | ||
386 | * | ||
387 | */ | ||
388 | public PatternContent.Match newMatch(final Dir pO1, final FSObject pO2) { | ||
389 | return PatternContent.Match.newMatch(pO1, pO2); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Retrieve the set of values that occur in matches for o1. | ||
394 | * @return the Set of all values or empty set if there are no matches | ||
395 | * | ||
396 | */ | ||
397 | protected Stream<Dir> rawStreamAllValuesOfo1(final Object[] parameters) { | ||
398 | return rawStreamAllValues(POSITION_O1, parameters).map(Dir.class::cast); | ||
399 | } | ||
400 | |||
401 | /** | ||
402 | * Retrieve the set of values that occur in matches for o1. | ||
403 | * @return the Set of all values or empty set if there are no matches | ||
404 | * | ||
405 | */ | ||
406 | public Set<Dir> getAllValuesOfo1() { | ||
407 | return rawStreamAllValuesOfo1(emptyArray()).collect(Collectors.toSet()); | ||
408 | } | ||
409 | |||
410 | /** | ||
411 | * Retrieve the set of values that occur in matches for o1. | ||
412 | * @return the Set of all values or empty set if there are no matches | ||
413 | * | ||
414 | */ | ||
415 | public Stream<Dir> streamAllValuesOfo1() { | ||
416 | return rawStreamAllValuesOfo1(emptyArray()); | ||
417 | } | ||
418 | |||
419 | /** | ||
420 | * Retrieve the set of values that occur in matches for o1. | ||
421 | * </p> | ||
422 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
423 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
424 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
425 | * | ||
426 | * @return the Stream of all values or empty set if there are no matches | ||
427 | * | ||
428 | */ | ||
429 | public Stream<Dir> streamAllValuesOfo1(final PatternContent.Match partialMatch) { | ||
430 | return rawStreamAllValuesOfo1(partialMatch.toArray()); | ||
431 | } | ||
432 | |||
433 | /** | ||
434 | * Retrieve the set of values that occur in matches for o1. | ||
435 | * </p> | ||
436 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
437 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
438 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
439 | * | ||
440 | * @return the Stream of all values or empty set if there are no matches | ||
441 | * | ||
442 | */ | ||
443 | public Stream<Dir> streamAllValuesOfo1(final FSObject pO2) { | ||
444 | return rawStreamAllValuesOfo1(new Object[]{null, pO2}); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * Retrieve the set of values that occur in matches for o1. | ||
449 | * @return the Set of all values or empty set if there are no matches | ||
450 | * | ||
451 | */ | ||
452 | public Set<Dir> getAllValuesOfo1(final PatternContent.Match partialMatch) { | ||
453 | return rawStreamAllValuesOfo1(partialMatch.toArray()).collect(Collectors.toSet()); | ||
454 | } | ||
455 | |||
456 | /** | ||
457 | * Retrieve the set of values that occur in matches for o1. | ||
458 | * @return the Set of all values or empty set if there are no matches | ||
459 | * | ||
460 | */ | ||
461 | public Set<Dir> getAllValuesOfo1(final FSObject pO2) { | ||
462 | return rawStreamAllValuesOfo1(new Object[]{null, pO2}).collect(Collectors.toSet()); | ||
463 | } | ||
464 | |||
465 | /** | ||
466 | * Retrieve the set of values that occur in matches for o2. | ||
467 | * @return the Set of all values or empty set if there are no matches | ||
468 | * | ||
469 | */ | ||
470 | protected Stream<FSObject> rawStreamAllValuesOfo2(final Object[] parameters) { | ||
471 | return rawStreamAllValues(POSITION_O2, parameters).map(FSObject.class::cast); | ||
472 | } | ||
473 | |||
474 | /** | ||
475 | * Retrieve the set of values that occur in matches for o2. | ||
476 | * @return the Set of all values or empty set if there are no matches | ||
477 | * | ||
478 | */ | ||
479 | public Set<FSObject> getAllValuesOfo2() { | ||
480 | return rawStreamAllValuesOfo2(emptyArray()).collect(Collectors.toSet()); | ||
481 | } | ||
482 | |||
483 | /** | ||
484 | * Retrieve the set of values that occur in matches for o2. | ||
485 | * @return the Set of all values or empty set if there are no matches | ||
486 | * | ||
487 | */ | ||
488 | public Stream<FSObject> streamAllValuesOfo2() { | ||
489 | return rawStreamAllValuesOfo2(emptyArray()); | ||
490 | } | ||
491 | |||
492 | /** | ||
493 | * Retrieve the set of values that occur in matches for o2. | ||
494 | * </p> | ||
495 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
496 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
497 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
498 | * | ||
499 | * @return the Stream of all values or empty set if there are no matches | ||
500 | * | ||
501 | */ | ||
502 | public Stream<FSObject> streamAllValuesOfo2(final PatternContent.Match partialMatch) { | ||
503 | return rawStreamAllValuesOfo2(partialMatch.toArray()); | ||
504 | } | ||
505 | |||
506 | /** | ||
507 | * Retrieve the set of values that occur in matches for o2. | ||
508 | * </p> | ||
509 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
510 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
511 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
512 | * | ||
513 | * @return the Stream of all values or empty set if there are no matches | ||
514 | * | ||
515 | */ | ||
516 | public Stream<FSObject> streamAllValuesOfo2(final Dir pO1) { | ||
517 | return rawStreamAllValuesOfo2(new Object[]{pO1, null}); | ||
518 | } | ||
519 | |||
520 | /** | ||
521 | * Retrieve the set of values that occur in matches for o2. | ||
522 | * @return the Set of all values or empty set if there are no matches | ||
523 | * | ||
524 | */ | ||
525 | public Set<FSObject> getAllValuesOfo2(final PatternContent.Match partialMatch) { | ||
526 | return rawStreamAllValuesOfo2(partialMatch.toArray()).collect(Collectors.toSet()); | ||
527 | } | ||
528 | |||
529 | /** | ||
530 | * Retrieve the set of values that occur in matches for o2. | ||
531 | * @return the Set of all values or empty set if there are no matches | ||
532 | * | ||
533 | */ | ||
534 | public Set<FSObject> getAllValuesOfo2(final Dir pO1) { | ||
535 | return rawStreamAllValuesOfo2(new Object[]{pO1, null}).collect(Collectors.toSet()); | ||
536 | } | ||
537 | |||
538 | @Override | ||
539 | protected PatternContent.Match tupleToMatch(final Tuple t) { | ||
540 | try { | ||
541 | return PatternContent.Match.newMatch((Dir) t.get(POSITION_O1), (FSObject) t.get(POSITION_O2)); | ||
542 | } catch(ClassCastException e) { | ||
543 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
544 | return null; | ||
545 | } | ||
546 | } | ||
547 | |||
548 | @Override | ||
549 | protected PatternContent.Match arrayToMatch(final Object[] match) { | ||
550 | try { | ||
551 | return PatternContent.Match.newMatch((Dir) match[POSITION_O1], (FSObject) match[POSITION_O2]); | ||
552 | } catch(ClassCastException e) { | ||
553 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
554 | return null; | ||
555 | } | ||
556 | } | ||
557 | |||
558 | @Override | ||
559 | protected PatternContent.Match arrayToMatchMutable(final Object[] match) { | ||
560 | try { | ||
561 | return PatternContent.Match.newMutableMatch((Dir) match[POSITION_O1], (FSObject) match[POSITION_O2]); | ||
562 | } catch(ClassCastException e) { | ||
563 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
564 | return null; | ||
565 | } | ||
566 | } | ||
567 | |||
568 | /** | ||
569 | * @return the singleton instance of the query specification of this pattern | ||
570 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
571 | * | ||
572 | */ | ||
573 | public static IQuerySpecification<PatternContent.Matcher> querySpecification() { | ||
574 | return PatternContent.instance(); | ||
575 | } | ||
576 | } | ||
577 | |||
578 | private PatternContent() { | ||
579 | super(GeneratedPQuery.INSTANCE); | ||
580 | } | ||
581 | |||
582 | /** | ||
583 | * @return the singleton instance of the query specification | ||
584 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
585 | * | ||
586 | */ | ||
587 | public static PatternContent instance() { | ||
588 | try{ | ||
589 | return LazyHolder.INSTANCE; | ||
590 | } catch (ExceptionInInitializerError err) { | ||
591 | throw processInitializerError(err); | ||
592 | } | ||
593 | } | ||
594 | |||
595 | @Override | ||
596 | protected PatternContent.Matcher instantiate(final ViatraQueryEngine engine) { | ||
597 | return PatternContent.Matcher.on(engine); | ||
598 | } | ||
599 | |||
600 | @Override | ||
601 | public PatternContent.Matcher instantiate() { | ||
602 | return PatternContent.Matcher.create(); | ||
603 | } | ||
604 | |||
605 | @Override | ||
606 | public PatternContent.Match newEmptyMatch() { | ||
607 | return PatternContent.Match.newEmptyMatch(); | ||
608 | } | ||
609 | |||
610 | @Override | ||
611 | public PatternContent.Match newMatch(final Object... parameters) { | ||
612 | return PatternContent.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject) parameters[1]); | ||
613 | } | ||
614 | |||
615 | /** | ||
616 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.PatternContent (visibility: PUBLIC, simpleName: PatternContent, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.PatternContent, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
617 | * <b>not</b> at the class load time of the outer class, | ||
618 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.PatternContent (visibility: PUBLIC, simpleName: PatternContent, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.PatternContent, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
619 | * | ||
620 | * <p> This workaround is required e.g. to support recursion. | ||
621 | * | ||
622 | */ | ||
623 | private static class LazyHolder { | ||
624 | private static final PatternContent INSTANCE = new PatternContent(); | ||
625 | |||
626 | /** | ||
627 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
628 | * This initialization order is required to support indirect recursion. | ||
629 | * | ||
630 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
631 | * | ||
632 | */ | ||
633 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
634 | |||
635 | public static Object ensureInitialized() { | ||
636 | INSTANCE.ensureInitializedInternal(); | ||
637 | return null; | ||
638 | } | ||
639 | } | ||
640 | |||
641 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
642 | private static final PatternContent.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
643 | |||
644 | private final PParameter parameter_o1 = new PParameter("o1", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "Dir")), PParameterDirection.INOUT); | ||
645 | |||
646 | private final PParameter parameter_o2 = new PParameter("o2", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "FSObject")), PParameterDirection.INOUT); | ||
647 | |||
648 | private final List<PParameter> parameters = Arrays.asList(parameter_o1, parameter_o2); | ||
649 | |||
650 | private GeneratedPQuery() { | ||
651 | super(PVisibility.PUBLIC); | ||
652 | } | ||
653 | |||
654 | @Override | ||
655 | public String getFullyQualifiedName() { | ||
656 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.patternContent"; | ||
657 | } | ||
658 | |||
659 | @Override | ||
660 | public List<String> getParameterNames() { | ||
661 | return Arrays.asList("o1","o2"); | ||
662 | } | ||
663 | |||
664 | @Override | ||
665 | public List<PParameter> getParameters() { | ||
666 | return parameters; | ||
667 | } | ||
668 | |||
669 | @Override | ||
670 | public Set<PBody> doGetContainedBodies() { | ||
671 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
672 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
673 | { | ||
674 | PBody body = new PBody(this); | ||
675 | PVariable var_o1 = body.getOrCreateVariableByName("o1"); | ||
676 | PVariable var_o2 = body.getOrCreateVariableByName("o2"); | ||
677 | new TypeConstraint(body, Tuples.flatTupleOf(var_o1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
678 | new TypeConstraint(body, Tuples.flatTupleOf(var_o2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
679 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
680 | new ExportedParameter(body, var_o1, parameter_o1), | ||
681 | new ExportedParameter(body, var_o2, parameter_o2) | ||
682 | )); | ||
683 | // Dir.contents(o1,o2) | ||
684 | new TypeConstraint(body, Tuples.flatTupleOf(var_o1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "Dir"))); | ||
685 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
686 | new TypeConstraint(body, Tuples.flatTupleOf(var_o1, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("FS", "Dir", "contents"))); | ||
687 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
688 | new Equality(body, var__virtual_0_, var_o2); | ||
689 | bodies.add(body); | ||
690 | } | ||
691 | return bodies; | ||
692 | } | ||
693 | } | ||
694 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/RootIsNotDir.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/RootIsNotDir.java new file mode 100644 index 00000000..22c31158 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/RootIsNotDir.java | |||
@@ -0,0 +1,560 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/patterns/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/FileSystem.vql | ||
3 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Dir; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
43 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
44 | |||
45 | /** | ||
46 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
47 | * | ||
48 | * <p>Original source: | ||
49 | * <code><pre> | ||
50 | * {@literal @}Constraint(key={fs}, severity="error", message="error") | ||
51 | * pattern rootIsNotDir(fs: FileSystem) { | ||
52 | * FileSystem.root(fs, root); | ||
53 | * neg find dir(root); | ||
54 | * } | ||
55 | * </pre></code> | ||
56 | * | ||
57 | * @see Matcher | ||
58 | * @see Match | ||
59 | * | ||
60 | */ | ||
61 | @SuppressWarnings("all") | ||
62 | public final class RootIsNotDir extends BaseGeneratedEMFQuerySpecification<RootIsNotDir.Matcher> { | ||
63 | /** | ||
64 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.alloyexamples.rootIsNotDir 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 FileSystem fFs; | ||
77 | |||
78 | private static List<String> parameterNames = makeImmutableList("fs"); | ||
79 | |||
80 | private Match(final FileSystem pFs) { | ||
81 | this.fFs = pFs; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | if ("fs".equals(parameterName)) return this.fFs; | ||
87 | return null; | ||
88 | } | ||
89 | |||
90 | public FileSystem getFs() { | ||
91 | return this.fFs; | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public boolean set(final String parameterName, final Object newValue) { | ||
96 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
97 | if ("fs".equals(parameterName) ) { | ||
98 | this.fFs = (FileSystem) newValue; | ||
99 | return true; | ||
100 | } | ||
101 | return false; | ||
102 | } | ||
103 | |||
104 | public void setFs(final FileSystem pFs) { | ||
105 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
106 | this.fFs = pFs; | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public String patternName() { | ||
111 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.rootIsNotDir"; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public List<String> parameterNames() { | ||
116 | return RootIsNotDir.Match.parameterNames; | ||
117 | } | ||
118 | |||
119 | @Override | ||
120 | public Object[] toArray() { | ||
121 | return new Object[]{fFs}; | ||
122 | } | ||
123 | |||
124 | @Override | ||
125 | public RootIsNotDir.Match toImmutable() { | ||
126 | return isMutable() ? newMatch(fFs) : this; | ||
127 | } | ||
128 | |||
129 | @Override | ||
130 | public String prettyPrint() { | ||
131 | StringBuilder result = new StringBuilder(); | ||
132 | result.append("\"fs\"=" + prettyPrintValue(fFs)); | ||
133 | return result.toString(); | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public int hashCode() { | ||
138 | return Objects.hash(fFs); | ||
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 RootIsNotDir.Match)) { | ||
149 | RootIsNotDir.Match other = (RootIsNotDir.Match) obj; | ||
150 | return Objects.equals(fFs, other.fFs); | ||
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 RootIsNotDir specification() { | ||
163 | return RootIsNotDir.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 RootIsNotDir.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 pFs the fixed value of pattern parameter fs, or null if not bound. | ||
182 | * @return the new, mutable (partial) match object. | ||
183 | * | ||
184 | */ | ||
185 | public static RootIsNotDir.Match newMutableMatch(final FileSystem pFs) { | ||
186 | return new Mutable(pFs); | ||
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 pFs the fixed value of pattern parameter fs, or null if not bound. | ||
194 | * @return the (partial) match object. | ||
195 | * | ||
196 | */ | ||
197 | public static RootIsNotDir.Match newMatch(final FileSystem pFs) { | ||
198 | return new Immutable(pFs); | ||
199 | } | ||
200 | |||
201 | private static final class Mutable extends RootIsNotDir.Match { | ||
202 | Mutable(final FileSystem pFs) { | ||
203 | super(pFs); | ||
204 | } | ||
205 | |||
206 | @Override | ||
207 | public boolean isMutable() { | ||
208 | return true; | ||
209 | } | ||
210 | } | ||
211 | |||
212 | private static final class Immutable extends RootIsNotDir.Match { | ||
213 | Immutable(final FileSystem pFs) { | ||
214 | super(pFs); | ||
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.alloyexamples.rootIsNotDir 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 | * {@literal @}Constraint(key={fs}, severity="error", message="error") | ||
236 | * pattern rootIsNotDir(fs: FileSystem) { | ||
237 | * FileSystem.root(fs, root); | ||
238 | * neg find dir(root); | ||
239 | * } | ||
240 | * </pre></code> | ||
241 | * | ||
242 | * @see Match | ||
243 | * @see RootIsNotDir | ||
244 | * | ||
245 | */ | ||
246 | public static class Matcher extends BaseMatcher<RootIsNotDir.Match> { | ||
247 | /** | ||
248 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
249 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
250 | * | ||
251 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
252 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
253 | * | ||
254 | */ | ||
255 | public static RootIsNotDir.Matcher on(final ViatraQueryEngine engine) { | ||
256 | // check if matcher already exists | ||
257 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
258 | if (matcher == null) { | ||
259 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
260 | } | ||
261 | return matcher; | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
266 | * @return an initialized matcher | ||
267 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
268 | * | ||
269 | */ | ||
270 | public static RootIsNotDir.Matcher create() { | ||
271 | return new Matcher(); | ||
272 | } | ||
273 | |||
274 | private static final int POSITION_FS = 0; | ||
275 | |||
276 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(RootIsNotDir.Matcher.class); | ||
277 | |||
278 | /** | ||
279 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
280 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
281 | * | ||
282 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
283 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
284 | * | ||
285 | */ | ||
286 | private Matcher() { | ||
287 | super(querySpecification()); | ||
288 | } | ||
289 | |||
290 | /** | ||
291 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
292 | * @param pFs the fixed value of pattern parameter fs, or null if not bound. | ||
293 | * @return matches represented as a Match object. | ||
294 | * | ||
295 | */ | ||
296 | public Collection<RootIsNotDir.Match> getAllMatches(final FileSystem pFs) { | ||
297 | return rawStreamAllMatches(new Object[]{pFs}).collect(Collectors.toSet()); | ||
298 | } | ||
299 | |||
300 | /** | ||
301 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
302 | * </p> | ||
303 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
304 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
305 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
306 | * @param pFs the fixed value of pattern parameter fs, or null if not bound. | ||
307 | * @return a stream of matches represented as a Match object. | ||
308 | * | ||
309 | */ | ||
310 | public Stream<RootIsNotDir.Match> streamAllMatches(final FileSystem pFs) { | ||
311 | return rawStreamAllMatches(new Object[]{pFs}); | ||
312 | } | ||
313 | |||
314 | /** | ||
315 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
316 | * Neither determinism nor randomness of selection is guaranteed. | ||
317 | * @param pFs the fixed value of pattern parameter fs, or null if not bound. | ||
318 | * @return a match represented as a Match object, or null if no match is found. | ||
319 | * | ||
320 | */ | ||
321 | public Optional<RootIsNotDir.Match> getOneArbitraryMatch(final FileSystem pFs) { | ||
322 | return rawGetOneArbitraryMatch(new Object[]{pFs}); | ||
323 | } | ||
324 | |||
325 | /** | ||
326 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
327 | * under any possible substitution of the unspecified parameters (if any). | ||
328 | * @param pFs the fixed value of pattern parameter fs, or null if not bound. | ||
329 | * @return true if the input is a valid (partial) match of the pattern. | ||
330 | * | ||
331 | */ | ||
332 | public boolean hasMatch(final FileSystem pFs) { | ||
333 | return rawHasMatch(new Object[]{pFs}); | ||
334 | } | ||
335 | |||
336 | /** | ||
337 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
338 | * @param pFs the fixed value of pattern parameter fs, or null if not bound. | ||
339 | * @return the number of pattern matches found. | ||
340 | * | ||
341 | */ | ||
342 | public int countMatches(final FileSystem pFs) { | ||
343 | return rawCountMatches(new Object[]{pFs}); | ||
344 | } | ||
345 | |||
346 | /** | ||
347 | * Executes the given processor on 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 pFs the fixed value of pattern parameter fs, or null if not bound. | ||
350 | * @param processor the action that will process the selected match. | ||
351 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
352 | * | ||
353 | */ | ||
354 | public boolean forOneArbitraryMatch(final FileSystem pFs, final Consumer<? super RootIsNotDir.Match> processor) { | ||
355 | return rawForOneArbitraryMatch(new Object[]{pFs}, processor); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Returns a new (partial) match. | ||
360 | * This can be used e.g. to call the matcher with a partial match. | ||
361 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
362 | * @param pFs the fixed value of pattern parameter fs, or null if not bound. | ||
363 | * @return the (partial) match object. | ||
364 | * | ||
365 | */ | ||
366 | public RootIsNotDir.Match newMatch(final FileSystem pFs) { | ||
367 | return RootIsNotDir.Match.newMatch(pFs); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * Retrieve the set of values that occur in matches for fs. | ||
372 | * @return the Set of all values or empty set if there are no matches | ||
373 | * | ||
374 | */ | ||
375 | protected Stream<FileSystem> rawStreamAllValuesOffs(final Object[] parameters) { | ||
376 | return rawStreamAllValues(POSITION_FS, parameters).map(FileSystem.class::cast); | ||
377 | } | ||
378 | |||
379 | /** | ||
380 | * Retrieve the set of values that occur in matches for fs. | ||
381 | * @return the Set of all values or empty set if there are no matches | ||
382 | * | ||
383 | */ | ||
384 | public Set<FileSystem> getAllValuesOffs() { | ||
385 | return rawStreamAllValuesOffs(emptyArray()).collect(Collectors.toSet()); | ||
386 | } | ||
387 | |||
388 | /** | ||
389 | * Retrieve the set of values that occur in matches for fs. | ||
390 | * @return the Set of all values or empty set if there are no matches | ||
391 | * | ||
392 | */ | ||
393 | public Stream<FileSystem> streamAllValuesOffs() { | ||
394 | return rawStreamAllValuesOffs(emptyArray()); | ||
395 | } | ||
396 | |||
397 | @Override | ||
398 | protected RootIsNotDir.Match tupleToMatch(final Tuple t) { | ||
399 | try { | ||
400 | return RootIsNotDir.Match.newMatch((FileSystem) t.get(POSITION_FS)); | ||
401 | } catch(ClassCastException e) { | ||
402 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
403 | return null; | ||
404 | } | ||
405 | } | ||
406 | |||
407 | @Override | ||
408 | protected RootIsNotDir.Match arrayToMatch(final Object[] match) { | ||
409 | try { | ||
410 | return RootIsNotDir.Match.newMatch((FileSystem) match[POSITION_FS]); | ||
411 | } catch(ClassCastException e) { | ||
412 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
413 | return null; | ||
414 | } | ||
415 | } | ||
416 | |||
417 | @Override | ||
418 | protected RootIsNotDir.Match arrayToMatchMutable(final Object[] match) { | ||
419 | try { | ||
420 | return RootIsNotDir.Match.newMutableMatch((FileSystem) match[POSITION_FS]); | ||
421 | } catch(ClassCastException e) { | ||
422 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
423 | return null; | ||
424 | } | ||
425 | } | ||
426 | |||
427 | /** | ||
428 | * @return the singleton instance of the query specification of this pattern | ||
429 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
430 | * | ||
431 | */ | ||
432 | public static IQuerySpecification<RootIsNotDir.Matcher> querySpecification() { | ||
433 | return RootIsNotDir.instance(); | ||
434 | } | ||
435 | } | ||
436 | |||
437 | private RootIsNotDir() { | ||
438 | super(GeneratedPQuery.INSTANCE); | ||
439 | } | ||
440 | |||
441 | /** | ||
442 | * @return the singleton instance of the query specification | ||
443 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
444 | * | ||
445 | */ | ||
446 | public static RootIsNotDir instance() { | ||
447 | try{ | ||
448 | return LazyHolder.INSTANCE; | ||
449 | } catch (ExceptionInInitializerError err) { | ||
450 | throw processInitializerError(err); | ||
451 | } | ||
452 | } | ||
453 | |||
454 | @Override | ||
455 | protected RootIsNotDir.Matcher instantiate(final ViatraQueryEngine engine) { | ||
456 | return RootIsNotDir.Matcher.on(engine); | ||
457 | } | ||
458 | |||
459 | @Override | ||
460 | public RootIsNotDir.Matcher instantiate() { | ||
461 | return RootIsNotDir.Matcher.create(); | ||
462 | } | ||
463 | |||
464 | @Override | ||
465 | public RootIsNotDir.Match newEmptyMatch() { | ||
466 | return RootIsNotDir.Match.newEmptyMatch(); | ||
467 | } | ||
468 | |||
469 | @Override | ||
470 | public RootIsNotDir.Match newMatch(final Object... parameters) { | ||
471 | return RootIsNotDir.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem) parameters[0]); | ||
472 | } | ||
473 | |||
474 | /** | ||
475 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.RootIsNotDir (visibility: PUBLIC, simpleName: RootIsNotDir, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.RootIsNotDir, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created | ||
476 | * <b>not</b> at the class load time of the outer class, | ||
477 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.RootIsNotDir (visibility: PUBLIC, simpleName: RootIsNotDir, identifier: hu.bme.mit.inf.dslreasoner.domains.alloyexamples.RootIsNotDir, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.alloyexamples) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
478 | * | ||
479 | * <p> This workaround is required e.g. to support recursion. | ||
480 | * | ||
481 | */ | ||
482 | private static class LazyHolder { | ||
483 | private static final RootIsNotDir INSTANCE = new RootIsNotDir(); | ||
484 | |||
485 | /** | ||
486 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
487 | * This initialization order is required to support indirect recursion. | ||
488 | * | ||
489 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
490 | * | ||
491 | */ | ||
492 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
493 | |||
494 | public static Object ensureInitialized() { | ||
495 | INSTANCE.ensureInitializedInternal(); | ||
496 | return null; | ||
497 | } | ||
498 | } | ||
499 | |||
500 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
501 | private static final RootIsNotDir.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
502 | |||
503 | private final PParameter parameter_fs = new PParameter("fs", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("FS", "FileSystem")), PParameterDirection.INOUT); | ||
504 | |||
505 | private final List<PParameter> parameters = Arrays.asList(parameter_fs); | ||
506 | |||
507 | private GeneratedPQuery() { | ||
508 | super(PVisibility.PUBLIC); | ||
509 | } | ||
510 | |||
511 | @Override | ||
512 | public String getFullyQualifiedName() { | ||
513 | return "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.rootIsNotDir"; | ||
514 | } | ||
515 | |||
516 | @Override | ||
517 | public List<String> getParameterNames() { | ||
518 | return Arrays.asList("fs"); | ||
519 | } | ||
520 | |||
521 | @Override | ||
522 | public List<PParameter> getParameters() { | ||
523 | return parameters; | ||
524 | } | ||
525 | |||
526 | @Override | ||
527 | public Set<PBody> doGetContainedBodies() { | ||
528 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
529 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
530 | { | ||
531 | PBody body = new PBody(this); | ||
532 | PVariable var_fs = body.getOrCreateVariableByName("fs"); | ||
533 | PVariable var_root = body.getOrCreateVariableByName("root"); | ||
534 | new TypeConstraint(body, Tuples.flatTupleOf(var_fs), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FileSystem"))); | ||
535 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
536 | new ExportedParameter(body, var_fs, parameter_fs) | ||
537 | )); | ||
538 | // FileSystem.root(fs, root) | ||
539 | new TypeConstraint(body, Tuples.flatTupleOf(var_fs), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FileSystem"))); | ||
540 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
541 | new TypeConstraint(body, Tuples.flatTupleOf(var_fs, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("FS", "FileSystem", "root"))); | ||
542 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("FS", "FSObject"))); | ||
543 | new Equality(body, var__virtual_0_, var_root); | ||
544 | // neg find dir(root) | ||
545 | new NegativePatternCall(body, Tuples.flatTupleOf(var_root), Dir.instance().getInternalQueryRepresentation()); | ||
546 | bodies.add(body); | ||
547 | } | ||
548 | { | ||
549 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
550 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
551 | new ParameterReference("fs") | ||
552 | })); | ||
553 | annotation.addAttribute("severity", "error"); | ||
554 | annotation.addAttribute("message", "error"); | ||
555 | addAnnotation(annotation); | ||
556 | } | ||
557 | return bodies; | ||
558 | } | ||
559 | } | ||
560 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/util/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/util/.gitignore deleted file mode 100644 index 4b17cd82..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src-gen/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/util/.gitignore +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | /.ContentInNotLiveProcessor.java._trace | ||
2 | /.ContentInNotLiveQuerySpecification.java._trace | ||
3 | /.DirectSupertypeProcessor.java._trace | ||
4 | /.DirectSupertypeQuerySpecification.java._trace | ||
5 | /.LiveProcessor.java._trace | ||
6 | /.LiveQuerySpecification.java._trace | ||
7 | /.LoopInInheritenceProcessor.java._trace | ||
8 | /.LoopInInheritenceQuerySpecification.java._trace | ||
9 | /.NonSymmetricOppositeProcessor.java._trace | ||
10 | /.NonSymmetricOppositeQuerySpecification.java._trace | ||
11 | /.OppositeDifferentClassProcessor.java._trace | ||
12 | /.OppositeDifferentClassQuerySpecification.java._trace | ||
13 | /.OppositeProcessor.java._trace | ||
14 | /.OppositeQuerySpecification.java._trace | ||
15 | /.PatternContentProcessor.java._trace | ||
16 | /.PatternContentQuerySpecification.java._trace | ||
17 | /ContentInNotLiveProcessor.java | ||
18 | /ContentInNotLiveQuerySpecification.java | ||
19 | /DirectSupertypeProcessor.java | ||
20 | /DirectSupertypeQuerySpecification.java | ||
21 | /LiveProcessor.java | ||
22 | /LiveQuerySpecification.java | ||
23 | /LoopInInheritenceProcessor.java | ||
24 | /LoopInInheritenceQuerySpecification.java | ||
25 | /NonSymmetricOppositeProcessor.java | ||
26 | /NonSymmetricOppositeQuerySpecification.java | ||
27 | /OppositeDifferentClassProcessor.java | ||
28 | /OppositeDifferentClassQuerySpecification.java | ||
29 | /OppositeProcessor.java | ||
30 | /OppositeQuerySpecification.java | ||
31 | /PatternContentProcessor.java | ||
32 | /PatternContentQuerySpecification.java | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java index 1896e31e..f0066955 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/FileSystem.java | |||
@@ -33,12 +33,12 @@ public interface FileSystem extends EObject { | |||
33 | * </p> | 33 | * </p> |
34 | * <!-- end-user-doc --> | 34 | * <!-- end-user-doc --> |
35 | * @return the value of the '<em>Root</em>' containment reference. | 35 | * @return the value of the '<em>Root</em>' containment reference. |
36 | * @see #setRoot(Dir) | 36 | * @see #setRoot(FSObject) |
37 | * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFileSystem_Root() | 37 | * @see hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage#getFileSystem_Root() |
38 | * @model containment="true" required="true" | 38 | * @model containment="true" required="true" |
39 | * @generated | 39 | * @generated |
40 | */ | 40 | */ |
41 | Dir getRoot(); | 41 | FSObject getRoot(); |
42 | 42 | ||
43 | /** | 43 | /** |
44 | * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem#getRoot <em>Root</em>}' containment reference. | 44 | * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem#getRoot <em>Root</em>}' containment reference. |
@@ -48,7 +48,7 @@ public interface FileSystem extends EObject { | |||
48 | * @see #getRoot() | 48 | * @see #getRoot() |
49 | * @generated | 49 | * @generated |
50 | */ | 50 | */ |
51 | void setRoot(Dir value); | 51 | void setRoot(FSObject value); |
52 | 52 | ||
53 | /** | 53 | /** |
54 | * Returns the value of the '<em><b>Live</b></em>' reference list. | 54 | * Returns the value of the '<em><b>Live</b></em>' reference list. |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java index 62df04af..c2d417d2 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/DirImpl.java | |||
@@ -66,6 +66,7 @@ public class DirImpl extends FSObjectImpl implements Dir { | |||
66 | * <!-- end-user-doc --> | 66 | * <!-- end-user-doc --> |
67 | * @generated | 67 | * @generated |
68 | */ | 68 | */ |
69 | @Override | ||
69 | public EList<FSObject> getContents() { | 70 | public EList<FSObject> getContents() { |
70 | if (contents == null) { | 71 | if (contents == null) { |
71 | contents = new EObjectContainmentWithInverseEList<FSObject>(FSObject.class, this, FilesystemPackage.DIR__CONTENTS, FilesystemPackage.FS_OBJECT__PARENT); | 72 | contents = new EObjectContainmentWithInverseEList<FSObject>(FSObject.class, this, FilesystemPackage.DIR__CONTENTS, FilesystemPackage.FS_OBJECT__PARENT); |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java index c8e73b4e..d87935d6 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FSObjectImpl.java | |||
@@ -53,6 +53,7 @@ public abstract class FSObjectImpl extends MinimalEObjectImpl.Container implemen | |||
53 | * <!-- end-user-doc --> | 53 | * <!-- end-user-doc --> |
54 | * @generated | 54 | * @generated |
55 | */ | 55 | */ |
56 | @Override | ||
56 | public Dir getParent() { | 57 | public Dir getParent() { |
57 | if (eContainerFeatureID() != FilesystemPackage.FS_OBJECT__PARENT) return null; | 58 | if (eContainerFeatureID() != FilesystemPackage.FS_OBJECT__PARENT) return null; |
58 | return (Dir)eInternalContainer(); | 59 | return (Dir)eInternalContainer(); |
@@ -73,6 +74,7 @@ public abstract class FSObjectImpl extends MinimalEObjectImpl.Container implemen | |||
73 | * <!-- end-user-doc --> | 74 | * <!-- end-user-doc --> |
74 | * @generated | 75 | * @generated |
75 | */ | 76 | */ |
77 | @Override | ||
76 | public void setParent(Dir newParent) { | 78 | public void setParent(Dir newParent) { |
77 | if (newParent != eInternalContainer() || (eContainerFeatureID() != FilesystemPackage.FS_OBJECT__PARENT && newParent != null)) { | 79 | if (newParent != eInternalContainer() || (eContainerFeatureID() != FilesystemPackage.FS_OBJECT__PARENT && newParent != null)) { |
78 | if (EcoreUtil.isAncestor(this, newParent)) | 80 | if (EcoreUtil.isAncestor(this, newParent)) |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java index adf30f3a..e6859cab 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FileSystemImpl.java | |||
@@ -2,7 +2,6 @@ | |||
2 | */ | 2 | */ |
3 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; | 3 | package hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.impl; |
4 | 4 | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.Dir; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; | 5 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FSObject; |
7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; | 6 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FileSystem; |
8 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; | 7 | import hu.bme.mit.inf.dslreasoner.domains.alloyexamples.Filesystem.FilesystemPackage; |
@@ -42,7 +41,7 @@ public class FileSystemImpl extends MinimalEObjectImpl.Container implements File | |||
42 | * @generated | 41 | * @generated |
43 | * @ordered | 42 | * @ordered |
44 | */ | 43 | */ |
45 | protected Dir root; | 44 | protected FSObject root; |
46 | 45 | ||
47 | /** | 46 | /** |
48 | * The cached setting delegate for the '{@link #getLive() <em>Live</em>}' reference list. | 47 | * The cached setting delegate for the '{@link #getLive() <em>Live</em>}' reference list. |
@@ -78,7 +77,8 @@ public class FileSystemImpl extends MinimalEObjectImpl.Container implements File | |||
78 | * <!-- end-user-doc --> | 77 | * <!-- end-user-doc --> |
79 | * @generated | 78 | * @generated |
80 | */ | 79 | */ |
81 | public Dir getRoot() { | 80 | @Override |
81 | public FSObject getRoot() { | ||
82 | return root; | 82 | return root; |
83 | } | 83 | } |
84 | 84 | ||
@@ -87,8 +87,8 @@ public class FileSystemImpl extends MinimalEObjectImpl.Container implements File | |||
87 | * <!-- end-user-doc --> | 87 | * <!-- end-user-doc --> |
88 | * @generated | 88 | * @generated |
89 | */ | 89 | */ |
90 | public NotificationChain basicSetRoot(Dir newRoot, NotificationChain msgs) { | 90 | public NotificationChain basicSetRoot(FSObject newRoot, NotificationChain msgs) { |
91 | Dir oldRoot = root; | 91 | FSObject oldRoot = root; |
92 | root = newRoot; | 92 | root = newRoot; |
93 | if (eNotificationRequired()) { | 93 | if (eNotificationRequired()) { |
94 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, oldRoot, newRoot); | 94 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, FilesystemPackage.FILE_SYSTEM__ROOT, oldRoot, newRoot); |
@@ -102,7 +102,8 @@ public class FileSystemImpl extends MinimalEObjectImpl.Container implements File | |||
102 | * <!-- end-user-doc --> | 102 | * <!-- end-user-doc --> |
103 | * @generated | 103 | * @generated |
104 | */ | 104 | */ |
105 | public void setRoot(Dir newRoot) { | 105 | @Override |
106 | public void setRoot(FSObject newRoot) { | ||
106 | if (newRoot != root) { | 107 | if (newRoot != root) { |
107 | NotificationChain msgs = null; | 108 | NotificationChain msgs = null; |
108 | if (root != null) | 109 | if (root != null) |
@@ -122,6 +123,7 @@ public class FileSystemImpl extends MinimalEObjectImpl.Container implements File | |||
122 | * @generated | 123 | * @generated |
123 | */ | 124 | */ |
124 | @SuppressWarnings("unchecked") | 125 | @SuppressWarnings("unchecked") |
126 | @Override | ||
125 | public EList<FSObject> getLive() { | 127 | public EList<FSObject> getLive() { |
126 | return (EList<FSObject>)LIVE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); | 128 | return (EList<FSObject>)LIVE__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false); |
127 | } | 129 | } |
@@ -165,7 +167,7 @@ public class FileSystemImpl extends MinimalEObjectImpl.Container implements File | |||
165 | public void eSet(int featureID, Object newValue) { | 167 | public void eSet(int featureID, Object newValue) { |
166 | switch (featureID) { | 168 | switch (featureID) { |
167 | case FilesystemPackage.FILE_SYSTEM__ROOT: | 169 | case FilesystemPackage.FILE_SYSTEM__ROOT: |
168 | setRoot((Dir)newValue); | 170 | setRoot((FSObject)newValue); |
169 | return; | 171 | return; |
170 | } | 172 | } |
171 | super.eSet(featureID, newValue); | 173 | super.eSet(featureID, newValue); |
@@ -180,7 +182,7 @@ public class FileSystemImpl extends MinimalEObjectImpl.Container implements File | |||
180 | public void eUnset(int featureID) { | 182 | public void eUnset(int featureID) { |
181 | switch (featureID) { | 183 | switch (featureID) { |
182 | case FilesystemPackage.FILE_SYSTEM__ROOT: | 184 | case FilesystemPackage.FILE_SYSTEM__ROOT: |
183 | setRoot((Dir)null); | 185 | setRoot((FSObject)null); |
184 | return; | 186 | return; |
185 | } | 187 | } |
186 | super.eUnset(featureID); | 188 | super.eUnset(featureID); |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java index e40b0bd1..b4b09e15 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemFactoryImpl.java | |||
@@ -70,6 +70,7 @@ public class FilesystemFactoryImpl extends EFactoryImpl implements FilesystemFac | |||
70 | * <!-- end-user-doc --> | 70 | * <!-- end-user-doc --> |
71 | * @generated | 71 | * @generated |
72 | */ | 72 | */ |
73 | @Override | ||
73 | public FileSystem createFileSystem() { | 74 | public FileSystem createFileSystem() { |
74 | FileSystemImpl fileSystem = new FileSystemImpl(); | 75 | FileSystemImpl fileSystem = new FileSystemImpl(); |
75 | return fileSystem; | 76 | return fileSystem; |
@@ -80,6 +81,7 @@ public class FilesystemFactoryImpl extends EFactoryImpl implements FilesystemFac | |||
80 | * <!-- end-user-doc --> | 81 | * <!-- end-user-doc --> |
81 | * @generated | 82 | * @generated |
82 | */ | 83 | */ |
84 | @Override | ||
83 | public Dir createDir() { | 85 | public Dir createDir() { |
84 | DirImpl dir = new DirImpl(); | 86 | DirImpl dir = new DirImpl(); |
85 | return dir; | 87 | return dir; |
@@ -90,6 +92,7 @@ public class FilesystemFactoryImpl extends EFactoryImpl implements FilesystemFac | |||
90 | * <!-- end-user-doc --> | 92 | * <!-- end-user-doc --> |
91 | * @generated | 93 | * @generated |
92 | */ | 94 | */ |
95 | @Override | ||
93 | public File createFile() { | 96 | public File createFile() { |
94 | FileImpl file = new FileImpl(); | 97 | FileImpl file = new FileImpl(); |
95 | return file; | 98 | return file; |
@@ -100,6 +103,7 @@ public class FilesystemFactoryImpl extends EFactoryImpl implements FilesystemFac | |||
100 | * <!-- end-user-doc --> | 103 | * <!-- end-user-doc --> |
101 | * @generated | 104 | * @generated |
102 | */ | 105 | */ |
106 | @Override | ||
103 | public Model createModel() { | 107 | public Model createModel() { |
104 | ModelImpl model = new ModelImpl(); | 108 | ModelImpl model = new ModelImpl(); |
105 | return model; | 109 | return model; |
@@ -110,6 +114,7 @@ public class FilesystemFactoryImpl extends EFactoryImpl implements FilesystemFac | |||
110 | * <!-- end-user-doc --> | 114 | * <!-- end-user-doc --> |
111 | * @generated | 115 | * @generated |
112 | */ | 116 | */ |
117 | @Override | ||
113 | public FilesystemPackage getFilesystemPackage() { | 118 | public FilesystemPackage getFilesystemPackage() { |
114 | return (FilesystemPackage)getEPackage(); | 119 | return (FilesystemPackage)getEPackage(); |
115 | } | 120 | } |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java index 87390fee..4c0ca4c5 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/FilesystemPackageImpl.java | |||
@@ -86,7 +86,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
86 | 86 | ||
87 | /** | 87 | /** |
88 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | 88 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. |
89 | * | 89 | * |
90 | * <p>This method is used to initialize {@link FilesystemPackage#eINSTANCE} when that field is accessed. | 90 | * <p>This method is used to initialize {@link FilesystemPackage#eINSTANCE} when that field is accessed. |
91 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | 91 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. |
92 | * <!-- begin-user-doc --> | 92 | * <!-- begin-user-doc --> |
@@ -100,7 +100,8 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
100 | if (isInited) return (FilesystemPackage)EPackage.Registry.INSTANCE.getEPackage(FilesystemPackage.eNS_URI); | 100 | if (isInited) return (FilesystemPackage)EPackage.Registry.INSTANCE.getEPackage(FilesystemPackage.eNS_URI); |
101 | 101 | ||
102 | // Obtain or create and register package | 102 | // Obtain or create and register package |
103 | FilesystemPackageImpl theFilesystemPackage = (FilesystemPackageImpl)(EPackage.Registry.INSTANCE.get(eNS_URI) instanceof FilesystemPackageImpl ? EPackage.Registry.INSTANCE.get(eNS_URI) : new FilesystemPackageImpl()); | 103 | Object registeredFilesystemPackage = EPackage.Registry.INSTANCE.get(eNS_URI); |
104 | FilesystemPackageImpl theFilesystemPackage = registeredFilesystemPackage instanceof FilesystemPackageImpl ? (FilesystemPackageImpl)registeredFilesystemPackage : new FilesystemPackageImpl(); | ||
104 | 105 | ||
105 | isInited = true; | 106 | isInited = true; |
106 | 107 | ||
@@ -113,7 +114,6 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
113 | // Mark meta-data to indicate it can't be changed | 114 | // Mark meta-data to indicate it can't be changed |
114 | theFilesystemPackage.freeze(); | 115 | theFilesystemPackage.freeze(); |
115 | 116 | ||
116 | |||
117 | // Update the registry and return the package | 117 | // Update the registry and return the package |
118 | EPackage.Registry.INSTANCE.put(FilesystemPackage.eNS_URI, theFilesystemPackage); | 118 | EPackage.Registry.INSTANCE.put(FilesystemPackage.eNS_URI, theFilesystemPackage); |
119 | return theFilesystemPackage; | 119 | return theFilesystemPackage; |
@@ -124,6 +124,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
124 | * <!-- end-user-doc --> | 124 | * <!-- end-user-doc --> |
125 | * @generated | 125 | * @generated |
126 | */ | 126 | */ |
127 | @Override | ||
127 | public EClass getFileSystem() { | 128 | public EClass getFileSystem() { |
128 | return fileSystemEClass; | 129 | return fileSystemEClass; |
129 | } | 130 | } |
@@ -133,6 +134,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
133 | * <!-- end-user-doc --> | 134 | * <!-- end-user-doc --> |
134 | * @generated | 135 | * @generated |
135 | */ | 136 | */ |
137 | @Override | ||
136 | public EReference getFileSystem_Root() { | 138 | public EReference getFileSystem_Root() { |
137 | return (EReference)fileSystemEClass.getEStructuralFeatures().get(0); | 139 | return (EReference)fileSystemEClass.getEStructuralFeatures().get(0); |
138 | } | 140 | } |
@@ -142,6 +144,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
142 | * <!-- end-user-doc --> | 144 | * <!-- end-user-doc --> |
143 | * @generated | 145 | * @generated |
144 | */ | 146 | */ |
147 | @Override | ||
145 | public EReference getFileSystem_Live() { | 148 | public EReference getFileSystem_Live() { |
146 | return (EReference)fileSystemEClass.getEStructuralFeatures().get(1); | 149 | return (EReference)fileSystemEClass.getEStructuralFeatures().get(1); |
147 | } | 150 | } |
@@ -151,6 +154,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
151 | * <!-- end-user-doc --> | 154 | * <!-- end-user-doc --> |
152 | * @generated | 155 | * @generated |
153 | */ | 156 | */ |
157 | @Override | ||
154 | public EClass getFSObject() { | 158 | public EClass getFSObject() { |
155 | return fsObjectEClass; | 159 | return fsObjectEClass; |
156 | } | 160 | } |
@@ -160,6 +164,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
160 | * <!-- end-user-doc --> | 164 | * <!-- end-user-doc --> |
161 | * @generated | 165 | * @generated |
162 | */ | 166 | */ |
167 | @Override | ||
163 | public EReference getFSObject_Parent() { | 168 | public EReference getFSObject_Parent() { |
164 | return (EReference)fsObjectEClass.getEStructuralFeatures().get(0); | 169 | return (EReference)fsObjectEClass.getEStructuralFeatures().get(0); |
165 | } | 170 | } |
@@ -169,6 +174,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
169 | * <!-- end-user-doc --> | 174 | * <!-- end-user-doc --> |
170 | * @generated | 175 | * @generated |
171 | */ | 176 | */ |
177 | @Override | ||
172 | public EClass getDir() { | 178 | public EClass getDir() { |
173 | return dirEClass; | 179 | return dirEClass; |
174 | } | 180 | } |
@@ -178,6 +184,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
178 | * <!-- end-user-doc --> | 184 | * <!-- end-user-doc --> |
179 | * @generated | 185 | * @generated |
180 | */ | 186 | */ |
187 | @Override | ||
181 | public EReference getDir_Contents() { | 188 | public EReference getDir_Contents() { |
182 | return (EReference)dirEClass.getEStructuralFeatures().get(0); | 189 | return (EReference)dirEClass.getEStructuralFeatures().get(0); |
183 | } | 190 | } |
@@ -187,6 +194,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
187 | * <!-- end-user-doc --> | 194 | * <!-- end-user-doc --> |
188 | * @generated | 195 | * @generated |
189 | */ | 196 | */ |
197 | @Override | ||
190 | public EClass getFile() { | 198 | public EClass getFile() { |
191 | return fileEClass; | 199 | return fileEClass; |
192 | } | 200 | } |
@@ -196,6 +204,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
196 | * <!-- end-user-doc --> | 204 | * <!-- end-user-doc --> |
197 | * @generated | 205 | * @generated |
198 | */ | 206 | */ |
207 | @Override | ||
199 | public EClass getModel() { | 208 | public EClass getModel() { |
200 | return modelEClass; | 209 | return modelEClass; |
201 | } | 210 | } |
@@ -205,6 +214,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
205 | * <!-- end-user-doc --> | 214 | * <!-- end-user-doc --> |
206 | * @generated | 215 | * @generated |
207 | */ | 216 | */ |
217 | @Override | ||
208 | public EReference getModel_Filesystems() { | 218 | public EReference getModel_Filesystems() { |
209 | return (EReference)modelEClass.getEStructuralFeatures().get(0); | 219 | return (EReference)modelEClass.getEStructuralFeatures().get(0); |
210 | } | 220 | } |
@@ -214,6 +224,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
214 | * <!-- end-user-doc --> | 224 | * <!-- end-user-doc --> |
215 | * @generated | 225 | * @generated |
216 | */ | 226 | */ |
227 | @Override | ||
217 | public EReference getModel_OtherFSObjects() { | 228 | public EReference getModel_OtherFSObjects() { |
218 | return (EReference)modelEClass.getEStructuralFeatures().get(1); | 229 | return (EReference)modelEClass.getEStructuralFeatures().get(1); |
219 | } | 230 | } |
@@ -223,6 +234,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
223 | * <!-- end-user-doc --> | 234 | * <!-- end-user-doc --> |
224 | * @generated | 235 | * @generated |
225 | */ | 236 | */ |
237 | @Override | ||
226 | public FilesystemFactory getFilesystemFactory() { | 238 | public FilesystemFactory getFilesystemFactory() { |
227 | return (FilesystemFactory)getEFactoryInstance(); | 239 | return (FilesystemFactory)getEFactoryInstance(); |
228 | } | 240 | } |
@@ -296,7 +308,7 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
296 | 308 | ||
297 | // Initialize classes, features, and operations; add parameters | 309 | // Initialize classes, features, and operations; add parameters |
298 | initEClass(fileSystemEClass, FileSystem.class, "FileSystem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | 310 | initEClass(fileSystemEClass, FileSystem.class, "FileSystem", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
299 | initEReference(getFileSystem_Root(), this.getDir(), null, "root", null, 1, 1, FileSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | 311 | initEReference(getFileSystem_Root(), this.getFSObject(), null, "root", null, 1, 1, FileSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); |
300 | initEReference(getFileSystem_Live(), this.getFSObject(), null, "live", null, 0, -1, FileSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); | 312 | initEReference(getFileSystem_Live(), this.getFSObject(), null, "live", null, 0, -1, FileSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED); |
301 | 313 | ||
302 | initEClass(fsObjectEClass, FSObject.class, "FSObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | 314 | initEClass(fsObjectEClass, FSObject.class, "FSObject", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); |
@@ -328,12 +340,12 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
328 | * @generated | 340 | * @generated |
329 | */ | 341 | */ |
330 | protected void createEcoreAnnotations() { | 342 | protected void createEcoreAnnotations() { |
331 | String source = "http://www.eclipse.org/emf/2002/Ecore"; | 343 | String source = "http://www.eclipse.org/emf/2002/Ecore"; |
332 | addAnnotation | 344 | addAnnotation |
333 | (this, | 345 | (this, |
334 | source, | 346 | source, |
335 | new String[] { | 347 | new String[] { |
336 | "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" | 348 | "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" |
337 | }); | 349 | }); |
338 | } | 350 | } |
339 | 351 | ||
@@ -344,12 +356,12 @@ public class FilesystemPackageImpl extends EPackageImpl implements FilesystemPac | |||
344 | * @generated | 356 | * @generated |
345 | */ | 357 | */ |
346 | protected void createOrgAnnotations() { | 358 | protected void createOrgAnnotations() { |
347 | String source = "org.eclipse.viatra.query.querybasedfeature"; | 359 | String source = "org.eclipse.viatra.query.querybasedfeature"; |
348 | addAnnotation | 360 | addAnnotation |
349 | (getFileSystem_Live(), | 361 | (getFileSystem_Live(), |
350 | source, | 362 | source, |
351 | new String[] { | 363 | new String[] { |
352 | "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live" | 364 | "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.alloyexamples.live" |
353 | }); | 365 | }); |
354 | } | 366 | } |
355 | 367 | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java index 4c236e8e..093b9972 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.alloyexamples/src/hu/bme/mit/inf/dslreasoner/domains/alloyexamples/Filesystem/impl/ModelImpl.java | |||
@@ -82,6 +82,7 @@ public class ModelImpl extends MinimalEObjectImpl.Container implements Model { | |||
82 | * <!-- end-user-doc --> | 82 | * <!-- end-user-doc --> |
83 | * @generated | 83 | * @generated |
84 | */ | 84 | */ |
85 | @Override | ||
85 | public FileSystem getFilesystems() { | 86 | public FileSystem getFilesystems() { |
86 | return filesystems; | 87 | return filesystems; |
87 | } | 88 | } |
@@ -106,6 +107,7 @@ public class ModelImpl extends MinimalEObjectImpl.Container implements Model { | |||
106 | * <!-- end-user-doc --> | 107 | * <!-- end-user-doc --> |
107 | * @generated | 108 | * @generated |
108 | */ | 109 | */ |
110 | @Override | ||
109 | public void setFilesystems(FileSystem newFilesystems) { | 111 | public void setFilesystems(FileSystem newFilesystems) { |
110 | if (newFilesystems != filesystems) { | 112 | if (newFilesystems != filesystems) { |
111 | NotificationChain msgs = null; | 113 | NotificationChain msgs = null; |
@@ -125,6 +127,7 @@ public class ModelImpl extends MinimalEObjectImpl.Container implements Model { | |||
125 | * <!-- end-user-doc --> | 127 | * <!-- end-user-doc --> |
126 | * @generated | 128 | * @generated |
127 | */ | 129 | */ |
130 | @Override | ||
128 | public EList<FSObject> getOtherFSObjects() { | 131 | public EList<FSObject> getOtherFSObjects() { |
129 | if (otherFSObjects == null) { | 132 | if (otherFSObjects == null) { |
130 | otherFSObjects = new EObjectContainmentEList<FSObject>(FSObject.class, this, FilesystemPackage.MODEL__OTHER_FS_OBJECTS); | 133 | otherFSObjects = new EObjectContainmentEList<FSObject>(FSObject.class, this, FilesystemPackage.MODEL__OTHER_FS_OBJECTS); |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath new file mode 100644 index 00000000..faa51b1d --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.classpath | |||
@@ -0,0 +1,15 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <classpath> | ||
3 | <classpathentry kind="src" path="ecore-gen"/> | ||
4 | <classpathentry kind="src" path="xtend-gen"/> | ||
5 | <classpathentry kind="src" path="src"/> | ||
6 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
7 | <attributes> | ||
8 | <attribute name="module" value="true"/> | ||
9 | </attributes> | ||
10 | </classpathentry> | ||
11 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
12 | <classpathentry kind="src" path="src-gen"/> | ||
13 | <classpathentry kind="con" path="uk.ac.kcl.inf.mdeoptimiser.languages.ui.Mopt.MDEO_CONTAINER/dsl"/> | ||
14 | <classpathentry kind="output" path="bin"/> | ||
15 | </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..2affc42f --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.gitignore | |||
@@ -0,0 +1,7 @@ | |||
1 | /bin/ | ||
2 | /xtend-gen/ | ||
3 | /problem.lp | ||
4 | /solution.txt | ||
5 | /model/cps_fixup.henshin | ||
6 | /model/problem.xmi | ||
7 | /mdeo-results | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project new file mode 100644 index 00000000..41867b27 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project | |||
@@ -0,0 +1,40 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <projectDescription> | ||
3 | <name>hu.bme.mit.inf.dslreasoner.domains.cps</name> | ||
4 | <comment></comment> | ||
5 | <projects> | ||
6 | </projects> | ||
7 | <buildSpec> | ||
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> | ||
19 | <name>org.eclipse.jdt.core.javabuilder</name> | ||
20 | <arguments> | ||
21 | </arguments> | ||
22 | </buildCommand> | ||
23 | <buildCommand> | ||
24 | <name>org.eclipse.pde.ManifestBuilder</name> | ||
25 | <arguments> | ||
26 | </arguments> | ||
27 | </buildCommand> | ||
28 | <buildCommand> | ||
29 | <name>org.eclipse.pde.SchemaBuilder</name> | ||
30 | <arguments> | ||
31 | </arguments> | ||
32 | </buildCommand> | ||
33 | </buildSpec> | ||
34 | <natures> | ||
35 | <nature>org.eclipse.jdt.core.javanature</nature> | ||
36 | <nature>org.eclipse.pde.PluginNature</nature> | ||
37 | <nature>org.eclipse.viatra.query.projectnature</nature> | ||
38 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
39 | </natures> | ||
40 | </projectDescription> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.settings/org.eclipse.core.resources.prefs b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000..6d3062d3 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.settings/org.eclipse.core.resources.prefs | |||
@@ -0,0 +1,3 @@ | |||
1 | eclipse.preferences.version=1 | ||
2 | encoding//model/cps.henshin=UTF-8 | ||
3 | encoding//model/cps.henshin_diagram=UTF-8 | ||
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 new file mode 100644 index 00000000..e13a18cf --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF | |||
@@ -0,0 +1,43 @@ | |||
1 | Manifest-Version: 1.0 | ||
2 | Bundle-ManifestVersion: 2 | ||
3 | Bundle-Name: %pluginName | ||
4 | Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.domains.cps;singleton:=true | ||
5 | Bundle-Version: 0.1.0.qualifier | ||
6 | Bundle-ClassPath: . | ||
7 | Bundle-Vendor: %providerName | ||
8 | Bundle-Localization: plugin | ||
9 | Export-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 | ||
13 | Require-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, | ||
19 | org.eclipse.core.runtime, | ||
20 | org.eclipse.xtend.lib;bundle-version="2.16.0", | ||
21 | org.eclipse.xtend.lib.macro;bundle-version="2.16.0", | ||
22 | hu.bme.mit.inf.dslreasoner.application;bundle-version="1.0.0", | ||
23 | org.eclipse.viatra.dse, | ||
24 | org.eclipse.viatra.dse.genetic, | ||
25 | hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner;bundle-version="1.0.0", | ||
26 | org.eclipse.emf.ecore.xmi;bundle-version="2.15.0", | ||
27 | uk.ac.kcl.inf.mdeoptimiser.libraries.core;bundle-version="1.0.0", | ||
28 | uk.ac.kcl.inf.mdeoptimiser.interfaces.cli;bundle-version="1.0.0", | ||
29 | org.eclipse.emf.henshin.interpreter;bundle-version="1.5.0", | ||
30 | uk.ac.kcl.inf.mdeoptimiser.libraries.rulegen;bundle-version="1.0.0", | ||
31 | org.sidiff.common;bundle-version="1.0.0", | ||
32 | org.sidiff.common.emf;bundle-version="1.0.0", | ||
33 | org.sidiff.common.emf.extensions;bundle-version="1.0.0", | ||
34 | org.moeaframework;bundle-version="2.13.0", | ||
35 | org.apache.commons.math3;bundle-version="3.6.1", | ||
36 | org.apache.commons.lang3;bundle-version="3.8.1", | ||
37 | com.google.inject;bundle-version="3.0.0", | ||
38 | org.sidiff.common.henshin;bundle-version="1.0.0", | ||
39 | org.sidiff.serge;bundle-version="1.0.0" | ||
40 | Import-Package: org.apache.log4j | ||
41 | Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.domains.cps | ||
42 | Bundle-ActivationPolicy: lazy | ||
43 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/README.md b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/README.md new file mode 100644 index 00000000..986663fd --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/README.md | |||
@@ -0,0 +1,7 @@ | |||
1 | # Cyber Physical System case study for VIATRA Solver | ||
2 | |||
3 | ## Modifications to the metamodel | ||
4 | |||
5 | * Removed the `State` enumeration and the `ApplicationInstance.state` attribute, as we are only optimizing static configurations of applications instead of deployment strategies. | ||
6 | * Added `ApplicationInstance.requirement` as an opposite reference of `Requirement.instances` with multiplicity `[1..1]` to ensure that each `ApplicationInstance` satisfies exactly one `Requirement`. | ||
7 | * Marked `HostInstance.availableMemory`, `availableHdd`, `totalMemory`, `totalHdd` as derived. The values of `availableMemory` and `availableHdd` can be computed from `totalMemory`, `totalHdd` and the `ResourceRequirement`s associated with the `ApplicationInstances` allocated to the `HostInstance`, while `totalMemory` and `totalHdd` are always equal to `HostType.defaultMemory` and `defaultHdd`. \ No newline at end of file | ||
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 @@ | |||
1 | bin.includes = .,\ | ||
2 | model/,\ | ||
3 | META-INF/,\ | ||
4 | plugin.xml,\ | ||
5 | plugin.properties | ||
6 | jars.compile.order = . | ||
7 | source.. = ecore-gen/,\ | ||
8 | src-gen/ | ||
9 | output.. = 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import 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 | */ | ||
25 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import 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 | */ | ||
26 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import 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 | */ | ||
15 | public 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..b0c69786 --- /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,1084 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EAttribute; | ||
6 | import org.eclipse.emf.ecore.EClass; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | import 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 | * @generated | ||
25 | */ | ||
26 | public interface CpsPackage extends EPackage { | ||
27 | /** | ||
28 | * The package name. | ||
29 | * <!-- begin-user-doc --> | ||
30 | * <!-- end-user-doc --> | ||
31 | * @generated | ||
32 | */ | ||
33 | String eNAME = "cps"; | ||
34 | |||
35 | /** | ||
36 | * The package namespace URI. | ||
37 | * <!-- begin-user-doc --> | ||
38 | * <!-- end-user-doc --> | ||
39 | * @generated | ||
40 | */ | ||
41 | String eNS_URI = "http://www.example.org/cps"; | ||
42 | |||
43 | /** | ||
44 | * The package namespace name. | ||
45 | * <!-- begin-user-doc --> | ||
46 | * <!-- end-user-doc --> | ||
47 | * @generated | ||
48 | */ | ||
49 | String eNS_PREFIX = "cps"; | ||
50 | |||
51 | /** | ||
52 | * The singleton instance of the package. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | CpsPackage eINSTANCE = hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl.init(); | ||
58 | |||
59 | /** | ||
60 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl <em>Cyber Physical System</em>}' class. | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl | ||
64 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getCyberPhysicalSystem() | ||
65 | * @generated | ||
66 | */ | ||
67 | int CYBER_PHYSICAL_SYSTEM = 0; | ||
68 | |||
69 | /** | ||
70 | * The feature id for the '<em><b>Requests</b></em>' containment reference list. | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | * @ordered | ||
75 | */ | ||
76 | int CYBER_PHYSICAL_SYSTEM__REQUESTS = 0; | ||
77 | |||
78 | /** | ||
79 | * The feature id for the '<em><b>Application Types</b></em>' containment reference list. | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @generated | ||
83 | * @ordered | ||
84 | */ | ||
85 | int CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES = 1; | ||
86 | |||
87 | /** | ||
88 | * The feature id for the '<em><b>Host Types</b></em>' containment reference list. | ||
89 | * <!-- begin-user-doc --> | ||
90 | * <!-- end-user-doc --> | ||
91 | * @generated | ||
92 | * @ordered | ||
93 | */ | ||
94 | int CYBER_PHYSICAL_SYSTEM__HOST_TYPES = 2; | ||
95 | |||
96 | /** | ||
97 | * The number of structural features of the '<em>Cyber Physical System</em>' class. | ||
98 | * <!-- begin-user-doc --> | ||
99 | * <!-- end-user-doc --> | ||
100 | * @generated | ||
101 | * @ordered | ||
102 | */ | ||
103 | int CYBER_PHYSICAL_SYSTEM_FEATURE_COUNT = 3; | ||
104 | |||
105 | /** | ||
106 | * The number of operations of the '<em>Cyber Physical System</em>' class. | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @generated | ||
110 | * @ordered | ||
111 | */ | ||
112 | int CYBER_PHYSICAL_SYSTEM_OPERATION_COUNT = 0; | ||
113 | |||
114 | /** | ||
115 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl <em>Application Type</em>}' class. | ||
116 | * <!-- begin-user-doc --> | ||
117 | * <!-- end-user-doc --> | ||
118 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl | ||
119 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationType() | ||
120 | * @generated | ||
121 | */ | ||
122 | int APPLICATION_TYPE = 1; | ||
123 | |||
124 | /** | ||
125 | * The feature id for the '<em><b>Instances</b></em>' containment reference list. | ||
126 | * <!-- begin-user-doc --> | ||
127 | * <!-- end-user-doc --> | ||
128 | * @generated | ||
129 | * @ordered | ||
130 | */ | ||
131 | int APPLICATION_TYPE__INSTANCES = 0; | ||
132 | |||
133 | /** | ||
134 | * The feature id for the '<em><b>Requirements</b></em>' containment reference list. | ||
135 | * <!-- begin-user-doc --> | ||
136 | * <!-- end-user-doc --> | ||
137 | * @generated | ||
138 | * @ordered | ||
139 | */ | ||
140 | int APPLICATION_TYPE__REQUIREMENTS = 1; | ||
141 | |||
142 | /** | ||
143 | * The number of structural features of the '<em>Application Type</em>' class. | ||
144 | * <!-- begin-user-doc --> | ||
145 | * <!-- end-user-doc --> | ||
146 | * @generated | ||
147 | * @ordered | ||
148 | */ | ||
149 | int APPLICATION_TYPE_FEATURE_COUNT = 2; | ||
150 | |||
151 | /** | ||
152 | * The number of operations of the '<em>Application Type</em>' class. | ||
153 | * <!-- begin-user-doc --> | ||
154 | * <!-- end-user-doc --> | ||
155 | * @generated | ||
156 | * @ordered | ||
157 | */ | ||
158 | int APPLICATION_TYPE_OPERATION_COUNT = 0; | ||
159 | |||
160 | /** | ||
161 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl <em>Host Type</em>}' class. | ||
162 | * <!-- begin-user-doc --> | ||
163 | * <!-- end-user-doc --> | ||
164 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl | ||
165 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostType() | ||
166 | * @generated | ||
167 | */ | ||
168 | int HOST_TYPE = 2; | ||
169 | |||
170 | /** | ||
171 | * The feature id for the '<em><b>Default Memory</b></em>' attribute. | ||
172 | * <!-- begin-user-doc --> | ||
173 | * <!-- end-user-doc --> | ||
174 | * @generated | ||
175 | * @ordered | ||
176 | */ | ||
177 | int HOST_TYPE__DEFAULT_MEMORY = 0; | ||
178 | |||
179 | /** | ||
180 | * The feature id for the '<em><b>Default Hdd</b></em>' attribute. | ||
181 | * <!-- begin-user-doc --> | ||
182 | * <!-- end-user-doc --> | ||
183 | * @generated | ||
184 | * @ordered | ||
185 | */ | ||
186 | int HOST_TYPE__DEFAULT_HDD = 1; | ||
187 | |||
188 | /** | ||
189 | * The feature id for the '<em><b>Instances</b></em>' containment reference list. | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | * @ordered | ||
194 | */ | ||
195 | int HOST_TYPE__INSTANCES = 2; | ||
196 | |||
197 | /** | ||
198 | * The feature id for the '<em><b>Cost</b></em>' attribute. | ||
199 | * <!-- begin-user-doc --> | ||
200 | * <!-- end-user-doc --> | ||
201 | * @generated | ||
202 | * @ordered | ||
203 | */ | ||
204 | int HOST_TYPE__COST = 3; | ||
205 | |||
206 | /** | ||
207 | * The number of structural features of the '<em>Host Type</em>' class. | ||
208 | * <!-- begin-user-doc --> | ||
209 | * <!-- end-user-doc --> | ||
210 | * @generated | ||
211 | * @ordered | ||
212 | */ | ||
213 | int HOST_TYPE_FEATURE_COUNT = 4; | ||
214 | |||
215 | /** | ||
216 | * The number of operations of the '<em>Host Type</em>' class. | ||
217 | * <!-- begin-user-doc --> | ||
218 | * <!-- end-user-doc --> | ||
219 | * @generated | ||
220 | * @ordered | ||
221 | */ | ||
222 | int HOST_TYPE_OPERATION_COUNT = 0; | ||
223 | |||
224 | /** | ||
225 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl <em>Request</em>}' class. | ||
226 | * <!-- begin-user-doc --> | ||
227 | * <!-- end-user-doc --> | ||
228 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl | ||
229 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequest() | ||
230 | * @generated | ||
231 | */ | ||
232 | int REQUEST = 3; | ||
233 | |||
234 | /** | ||
235 | * The feature id for the '<em><b>Requirements</b></em>' containment reference list. | ||
236 | * <!-- begin-user-doc --> | ||
237 | * <!-- end-user-doc --> | ||
238 | * @generated | ||
239 | * @ordered | ||
240 | */ | ||
241 | int REQUEST__REQUIREMENTS = 0; | ||
242 | |||
243 | /** | ||
244 | * The number of structural features of the '<em>Request</em>' class. | ||
245 | * <!-- begin-user-doc --> | ||
246 | * <!-- end-user-doc --> | ||
247 | * @generated | ||
248 | * @ordered | ||
249 | */ | ||
250 | int REQUEST_FEATURE_COUNT = 1; | ||
251 | |||
252 | /** | ||
253 | * The number of operations of the '<em>Request</em>' class. | ||
254 | * <!-- begin-user-doc --> | ||
255 | * <!-- end-user-doc --> | ||
256 | * @generated | ||
257 | * @ordered | ||
258 | */ | ||
259 | int REQUEST_OPERATION_COUNT = 0; | ||
260 | |||
261 | /** | ||
262 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl <em>Requirement</em>}' class. | ||
263 | * <!-- begin-user-doc --> | ||
264 | * <!-- end-user-doc --> | ||
265 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl | ||
266 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequirement() | ||
267 | * @generated | ||
268 | */ | ||
269 | int REQUIREMENT = 4; | ||
270 | |||
271 | /** | ||
272 | * The feature id for the '<em><b>Request</b></em>' container reference. | ||
273 | * <!-- begin-user-doc --> | ||
274 | * <!-- end-user-doc --> | ||
275 | * @generated | ||
276 | * @ordered | ||
277 | */ | ||
278 | int REQUIREMENT__REQUEST = 0; | ||
279 | |||
280 | /** | ||
281 | * The feature id for the '<em><b>Count</b></em>' attribute. | ||
282 | * <!-- begin-user-doc --> | ||
283 | * <!-- end-user-doc --> | ||
284 | * @generated | ||
285 | * @ordered | ||
286 | */ | ||
287 | int REQUIREMENT__COUNT = 1; | ||
288 | |||
289 | /** | ||
290 | * The feature id for the '<em><b>Type</b></em>' reference. | ||
291 | * <!-- begin-user-doc --> | ||
292 | * <!-- end-user-doc --> | ||
293 | * @generated | ||
294 | * @ordered | ||
295 | */ | ||
296 | int REQUIREMENT__TYPE = 2; | ||
297 | |||
298 | /** | ||
299 | * The feature id for the '<em><b>Instances</b></em>' reference list. | ||
300 | * <!-- begin-user-doc --> | ||
301 | * <!-- end-user-doc --> | ||
302 | * @generated | ||
303 | * @ordered | ||
304 | */ | ||
305 | int REQUIREMENT__INSTANCES = 3; | ||
306 | |||
307 | /** | ||
308 | * The number of structural features of the '<em>Requirement</em>' class. | ||
309 | * <!-- begin-user-doc --> | ||
310 | * <!-- end-user-doc --> | ||
311 | * @generated | ||
312 | * @ordered | ||
313 | */ | ||
314 | int REQUIREMENT_FEATURE_COUNT = 4; | ||
315 | |||
316 | /** | ||
317 | * The number of operations of the '<em>Requirement</em>' class. | ||
318 | * <!-- begin-user-doc --> | ||
319 | * <!-- end-user-doc --> | ||
320 | * @generated | ||
321 | * @ordered | ||
322 | */ | ||
323 | int REQUIREMENT_OPERATION_COUNT = 0; | ||
324 | |||
325 | /** | ||
326 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl <em>Application Instance</em>}' class. | ||
327 | * <!-- begin-user-doc --> | ||
328 | * <!-- end-user-doc --> | ||
329 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl | ||
330 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationInstance() | ||
331 | * @generated | ||
332 | */ | ||
333 | int APPLICATION_INSTANCE = 5; | ||
334 | |||
335 | /** | ||
336 | * The feature id for the '<em><b>Requirement</b></em>' reference. | ||
337 | * <!-- begin-user-doc --> | ||
338 | * <!-- end-user-doc --> | ||
339 | * @generated | ||
340 | * @ordered | ||
341 | */ | ||
342 | int APPLICATION_INSTANCE__REQUIREMENT = 0; | ||
343 | |||
344 | /** | ||
345 | * The feature id for the '<em><b>Type</b></em>' container reference. | ||
346 | * <!-- begin-user-doc --> | ||
347 | * <!-- end-user-doc --> | ||
348 | * @generated | ||
349 | * @ordered | ||
350 | */ | ||
351 | int APPLICATION_INSTANCE__TYPE = 1; | ||
352 | |||
353 | /** | ||
354 | * The feature id for the '<em><b>Allocated To</b></em>' reference. | ||
355 | * <!-- begin-user-doc --> | ||
356 | * <!-- end-user-doc --> | ||
357 | * @generated | ||
358 | * @ordered | ||
359 | */ | ||
360 | int APPLICATION_INSTANCE__ALLOCATED_TO = 2; | ||
361 | |||
362 | /** | ||
363 | * The number of structural features of the '<em>Application Instance</em>' class. | ||
364 | * <!-- begin-user-doc --> | ||
365 | * <!-- end-user-doc --> | ||
366 | * @generated | ||
367 | * @ordered | ||
368 | */ | ||
369 | int APPLICATION_INSTANCE_FEATURE_COUNT = 3; | ||
370 | |||
371 | /** | ||
372 | * The number of operations of the '<em>Application Instance</em>' class. | ||
373 | * <!-- begin-user-doc --> | ||
374 | * <!-- end-user-doc --> | ||
375 | * @generated | ||
376 | * @ordered | ||
377 | */ | ||
378 | int APPLICATION_INSTANCE_OPERATION_COUNT = 0; | ||
379 | |||
380 | /** | ||
381 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl <em>Resource Requirement</em>}' class. | ||
382 | * <!-- begin-user-doc --> | ||
383 | * <!-- end-user-doc --> | ||
384 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl | ||
385 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getResourceRequirement() | ||
386 | * @generated | ||
387 | */ | ||
388 | int RESOURCE_REQUIREMENT = 6; | ||
389 | |||
390 | /** | ||
391 | * The feature id for the '<em><b>Required Memory</b></em>' attribute. | ||
392 | * <!-- begin-user-doc --> | ||
393 | * <!-- end-user-doc --> | ||
394 | * @generated | ||
395 | * @ordered | ||
396 | */ | ||
397 | int RESOURCE_REQUIREMENT__REQUIRED_MEMORY = 0; | ||
398 | |||
399 | /** | ||
400 | * The feature id for the '<em><b>Required Hdd</b></em>' attribute. | ||
401 | * <!-- begin-user-doc --> | ||
402 | * <!-- end-user-doc --> | ||
403 | * @generated | ||
404 | * @ordered | ||
405 | */ | ||
406 | int RESOURCE_REQUIREMENT__REQUIRED_HDD = 1; | ||
407 | |||
408 | /** | ||
409 | * The feature id for the '<em><b>Host Type</b></em>' reference. | ||
410 | * <!-- begin-user-doc --> | ||
411 | * <!-- end-user-doc --> | ||
412 | * @generated | ||
413 | * @ordered | ||
414 | */ | ||
415 | int RESOURCE_REQUIREMENT__HOST_TYPE = 2; | ||
416 | |||
417 | /** | ||
418 | * The number of structural features of the '<em>Resource Requirement</em>' class. | ||
419 | * <!-- begin-user-doc --> | ||
420 | * <!-- end-user-doc --> | ||
421 | * @generated | ||
422 | * @ordered | ||
423 | */ | ||
424 | int RESOURCE_REQUIREMENT_FEATURE_COUNT = 3; | ||
425 | |||
426 | /** | ||
427 | * The number of operations of the '<em>Resource Requirement</em>' class. | ||
428 | * <!-- begin-user-doc --> | ||
429 | * <!-- end-user-doc --> | ||
430 | * @generated | ||
431 | * @ordered | ||
432 | */ | ||
433 | int RESOURCE_REQUIREMENT_OPERATION_COUNT = 0; | ||
434 | |||
435 | /** | ||
436 | * The meta object id for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl <em>Host Instance</em>}' class. | ||
437 | * <!-- begin-user-doc --> | ||
438 | * <!-- end-user-doc --> | ||
439 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl | ||
440 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostInstance() | ||
441 | * @generated | ||
442 | */ | ||
443 | int HOST_INSTANCE = 7; | ||
444 | |||
445 | /** | ||
446 | * The feature id for the '<em><b>Type</b></em>' container reference. | ||
447 | * <!-- begin-user-doc --> | ||
448 | * <!-- end-user-doc --> | ||
449 | * @generated | ||
450 | * @ordered | ||
451 | */ | ||
452 | int HOST_INSTANCE__TYPE = 0; | ||
453 | |||
454 | /** | ||
455 | * The feature id for the '<em><b>Applications</b></em>' reference list. | ||
456 | * <!-- begin-user-doc --> | ||
457 | * <!-- end-user-doc --> | ||
458 | * @generated | ||
459 | * @ordered | ||
460 | */ | ||
461 | int HOST_INSTANCE__APPLICATIONS = 1; | ||
462 | |||
463 | /** | ||
464 | * The number of structural features of the '<em>Host Instance</em>' class. | ||
465 | * <!-- begin-user-doc --> | ||
466 | * <!-- end-user-doc --> | ||
467 | * @generated | ||
468 | * @ordered | ||
469 | */ | ||
470 | int HOST_INSTANCE_FEATURE_COUNT = 2; | ||
471 | |||
472 | /** | ||
473 | * The number of operations of the '<em>Host Instance</em>' class. | ||
474 | * <!-- begin-user-doc --> | ||
475 | * <!-- end-user-doc --> | ||
476 | * @generated | ||
477 | * @ordered | ||
478 | */ | ||
479 | int HOST_INSTANCE_OPERATION_COUNT = 0; | ||
480 | |||
481 | /** | ||
482 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem <em>Cyber Physical System</em>}'. | ||
483 | * <!-- begin-user-doc --> | ||
484 | * <!-- end-user-doc --> | ||
485 | * @return the meta object for class '<em>Cyber Physical System</em>'. | ||
486 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
487 | * @generated | ||
488 | */ | ||
489 | EClass getCyberPhysicalSystem(); | ||
490 | |||
491 | /** | ||
492 | * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getRequests <em>Requests</em>}'. | ||
493 | * <!-- begin-user-doc --> | ||
494 | * <!-- end-user-doc --> | ||
495 | * @return the meta object for the containment reference list '<em>Requests</em>'. | ||
496 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getRequests() | ||
497 | * @see #getCyberPhysicalSystem() | ||
498 | * @generated | ||
499 | */ | ||
500 | EReference getCyberPhysicalSystem_Requests(); | ||
501 | |||
502 | /** | ||
503 | * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplicationTypes <em>Application Types</em>}'. | ||
504 | * <!-- begin-user-doc --> | ||
505 | * <!-- end-user-doc --> | ||
506 | * @return the meta object for the containment reference list '<em>Application Types</em>'. | ||
507 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplicationTypes() | ||
508 | * @see #getCyberPhysicalSystem() | ||
509 | * @generated | ||
510 | */ | ||
511 | EReference getCyberPhysicalSystem_ApplicationTypes(); | ||
512 | |||
513 | /** | ||
514 | * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHostTypes <em>Host Types</em>}'. | ||
515 | * <!-- begin-user-doc --> | ||
516 | * <!-- end-user-doc --> | ||
517 | * @return the meta object for the containment reference list '<em>Host Types</em>'. | ||
518 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHostTypes() | ||
519 | * @see #getCyberPhysicalSystem() | ||
520 | * @generated | ||
521 | */ | ||
522 | EReference getCyberPhysicalSystem_HostTypes(); | ||
523 | |||
524 | /** | ||
525 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType <em>Application Type</em>}'. | ||
526 | * <!-- begin-user-doc --> | ||
527 | * <!-- end-user-doc --> | ||
528 | * @return the meta object for class '<em>Application Type</em>'. | ||
529 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType | ||
530 | * @generated | ||
531 | */ | ||
532 | EClass getApplicationType(); | ||
533 | |||
534 | /** | ||
535 | * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getInstances <em>Instances</em>}'. | ||
536 | * <!-- begin-user-doc --> | ||
537 | * <!-- end-user-doc --> | ||
538 | * @return the meta object for the containment reference list '<em>Instances</em>'. | ||
539 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getInstances() | ||
540 | * @see #getApplicationType() | ||
541 | * @generated | ||
542 | */ | ||
543 | EReference getApplicationType_Instances(); | ||
544 | |||
545 | /** | ||
546 | * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getRequirements <em>Requirements</em>}'. | ||
547 | * <!-- begin-user-doc --> | ||
548 | * <!-- end-user-doc --> | ||
549 | * @return the meta object for the containment reference list '<em>Requirements</em>'. | ||
550 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType#getRequirements() | ||
551 | * @see #getApplicationType() | ||
552 | * @generated | ||
553 | */ | ||
554 | EReference getApplicationType_Requirements(); | ||
555 | |||
556 | /** | ||
557 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType <em>Host Type</em>}'. | ||
558 | * <!-- begin-user-doc --> | ||
559 | * <!-- end-user-doc --> | ||
560 | * @return the meta object for class '<em>Host Type</em>'. | ||
561 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType | ||
562 | * @generated | ||
563 | */ | ||
564 | EClass getHostType(); | ||
565 | |||
566 | /** | ||
567 | * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultMemory <em>Default Memory</em>}'. | ||
568 | * <!-- begin-user-doc --> | ||
569 | * <!-- end-user-doc --> | ||
570 | * @return the meta object for the attribute '<em>Default Memory</em>'. | ||
571 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultMemory() | ||
572 | * @see #getHostType() | ||
573 | * @generated | ||
574 | */ | ||
575 | EAttribute getHostType_DefaultMemory(); | ||
576 | |||
577 | /** | ||
578 | * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultHdd <em>Default Hdd</em>}'. | ||
579 | * <!-- begin-user-doc --> | ||
580 | * <!-- end-user-doc --> | ||
581 | * @return the meta object for the attribute '<em>Default Hdd</em>'. | ||
582 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getDefaultHdd() | ||
583 | * @see #getHostType() | ||
584 | * @generated | ||
585 | */ | ||
586 | EAttribute getHostType_DefaultHdd(); | ||
587 | |||
588 | /** | ||
589 | * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances <em>Instances</em>}'. | ||
590 | * <!-- begin-user-doc --> | ||
591 | * <!-- end-user-doc --> | ||
592 | * @return the meta object for the containment reference list '<em>Instances</em>'. | ||
593 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances() | ||
594 | * @see #getHostType() | ||
595 | * @generated | ||
596 | */ | ||
597 | EReference getHostType_Instances(); | ||
598 | |||
599 | /** | ||
600 | * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getCost <em>Cost</em>}'. | ||
601 | * <!-- begin-user-doc --> | ||
602 | * <!-- end-user-doc --> | ||
603 | * @return the meta object for the attribute '<em>Cost</em>'. | ||
604 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getCost() | ||
605 | * @see #getHostType() | ||
606 | * @generated | ||
607 | */ | ||
608 | EAttribute getHostType_Cost(); | ||
609 | |||
610 | /** | ||
611 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Request <em>Request</em>}'. | ||
612 | * <!-- begin-user-doc --> | ||
613 | * <!-- end-user-doc --> | ||
614 | * @return the meta object for class '<em>Request</em>'. | ||
615 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.Request | ||
616 | * @generated | ||
617 | */ | ||
618 | EClass getRequest(); | ||
619 | |||
620 | /** | ||
621 | * Returns the meta object for the containment reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Request#getRequirements <em>Requirements</em>}'. | ||
622 | * <!-- begin-user-doc --> | ||
623 | * <!-- end-user-doc --> | ||
624 | * @return the meta object for the containment reference list '<em>Requirements</em>'. | ||
625 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.Request#getRequirements() | ||
626 | * @see #getRequest() | ||
627 | * @generated | ||
628 | */ | ||
629 | EReference getRequest_Requirements(); | ||
630 | |||
631 | /** | ||
632 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement <em>Requirement</em>}'. | ||
633 | * <!-- begin-user-doc --> | ||
634 | * <!-- end-user-doc --> | ||
635 | * @return the meta object for class '<em>Requirement</em>'. | ||
636 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement | ||
637 | * @generated | ||
638 | */ | ||
639 | EClass getRequirement(); | ||
640 | |||
641 | /** | ||
642 | * Returns the meta object for the container reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest <em>Request</em>}'. | ||
643 | * <!-- begin-user-doc --> | ||
644 | * <!-- end-user-doc --> | ||
645 | * @return the meta object for the container reference '<em>Request</em>'. | ||
646 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getRequest() | ||
647 | * @see #getRequirement() | ||
648 | * @generated | ||
649 | */ | ||
650 | EReference getRequirement_Request(); | ||
651 | |||
652 | /** | ||
653 | * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getCount <em>Count</em>}'. | ||
654 | * <!-- begin-user-doc --> | ||
655 | * <!-- end-user-doc --> | ||
656 | * @return the meta object for the attribute '<em>Count</em>'. | ||
657 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getCount() | ||
658 | * @see #getRequirement() | ||
659 | * @generated | ||
660 | */ | ||
661 | EAttribute getRequirement_Count(); | ||
662 | |||
663 | /** | ||
664 | * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getType <em>Type</em>}'. | ||
665 | * <!-- begin-user-doc --> | ||
666 | * <!-- end-user-doc --> | ||
667 | * @return the meta object for the reference '<em>Type</em>'. | ||
668 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getType() | ||
669 | * @see #getRequirement() | ||
670 | * @generated | ||
671 | */ | ||
672 | EReference getRequirement_Type(); | ||
673 | |||
674 | /** | ||
675 | * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getInstances <em>Instances</em>}'. | ||
676 | * <!-- begin-user-doc --> | ||
677 | * <!-- end-user-doc --> | ||
678 | * @return the meta object for the reference list '<em>Instances</em>'. | ||
679 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.Requirement#getInstances() | ||
680 | * @see #getRequirement() | ||
681 | * @generated | ||
682 | */ | ||
683 | EReference getRequirement_Instances(); | ||
684 | |||
685 | /** | ||
686 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance <em>Application Instance</em>}'. | ||
687 | * <!-- begin-user-doc --> | ||
688 | * <!-- end-user-doc --> | ||
689 | * @return the meta object for class '<em>Application Instance</em>'. | ||
690 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance | ||
691 | * @generated | ||
692 | */ | ||
693 | EClass getApplicationInstance(); | ||
694 | |||
695 | /** | ||
696 | * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement <em>Requirement</em>}'. | ||
697 | * <!-- begin-user-doc --> | ||
698 | * <!-- end-user-doc --> | ||
699 | * @return the meta object for the reference '<em>Requirement</em>'. | ||
700 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getRequirement() | ||
701 | * @see #getApplicationInstance() | ||
702 | * @generated | ||
703 | */ | ||
704 | EReference getApplicationInstance_Requirement(); | ||
705 | |||
706 | /** | ||
707 | * Returns the meta object for the container reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType <em>Type</em>}'. | ||
708 | * <!-- begin-user-doc --> | ||
709 | * <!-- end-user-doc --> | ||
710 | * @return the meta object for the container reference '<em>Type</em>'. | ||
711 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getType() | ||
712 | * @see #getApplicationInstance() | ||
713 | * @generated | ||
714 | */ | ||
715 | EReference getApplicationInstance_Type(); | ||
716 | |||
717 | /** | ||
718 | * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}'. | ||
719 | * <!-- begin-user-doc --> | ||
720 | * <!-- end-user-doc --> | ||
721 | * @return the meta object for the reference '<em>Allocated To</em>'. | ||
722 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo() | ||
723 | * @see #getApplicationInstance() | ||
724 | * @generated | ||
725 | */ | ||
726 | EReference getApplicationInstance_AllocatedTo(); | ||
727 | |||
728 | /** | ||
729 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement <em>Resource Requirement</em>}'. | ||
730 | * <!-- begin-user-doc --> | ||
731 | * <!-- end-user-doc --> | ||
732 | * @return the meta object for class '<em>Resource Requirement</em>'. | ||
733 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement | ||
734 | * @generated | ||
735 | */ | ||
736 | EClass getResourceRequirement(); | ||
737 | |||
738 | /** | ||
739 | * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredMemory <em>Required Memory</em>}'. | ||
740 | * <!-- begin-user-doc --> | ||
741 | * <!-- end-user-doc --> | ||
742 | * @return the meta object for the attribute '<em>Required Memory</em>'. | ||
743 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredMemory() | ||
744 | * @see #getResourceRequirement() | ||
745 | * @generated | ||
746 | */ | ||
747 | EAttribute getResourceRequirement_RequiredMemory(); | ||
748 | |||
749 | /** | ||
750 | * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredHdd <em>Required Hdd</em>}'. | ||
751 | * <!-- begin-user-doc --> | ||
752 | * <!-- end-user-doc --> | ||
753 | * @return the meta object for the attribute '<em>Required Hdd</em>'. | ||
754 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getRequiredHdd() | ||
755 | * @see #getResourceRequirement() | ||
756 | * @generated | ||
757 | */ | ||
758 | EAttribute getResourceRequirement_RequiredHdd(); | ||
759 | |||
760 | /** | ||
761 | * Returns the meta object for the reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getHostType <em>Host Type</em>}'. | ||
762 | * <!-- begin-user-doc --> | ||
763 | * <!-- end-user-doc --> | ||
764 | * @return the meta object for the reference '<em>Host Type</em>'. | ||
765 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement#getHostType() | ||
766 | * @see #getResourceRequirement() | ||
767 | * @generated | ||
768 | */ | ||
769 | EReference getResourceRequirement_HostType(); | ||
770 | |||
771 | /** | ||
772 | * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance <em>Host Instance</em>}'. | ||
773 | * <!-- begin-user-doc --> | ||
774 | * <!-- end-user-doc --> | ||
775 | * @return the meta object for class '<em>Host Instance</em>'. | ||
776 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance | ||
777 | * @generated | ||
778 | */ | ||
779 | EClass getHostInstance(); | ||
780 | |||
781 | /** | ||
782 | * Returns the meta object for the container reference '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}'. | ||
783 | * <!-- begin-user-doc --> | ||
784 | * <!-- end-user-doc --> | ||
785 | * @return the meta object for the container reference '<em>Type</em>'. | ||
786 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType() | ||
787 | * @see #getHostInstance() | ||
788 | * @generated | ||
789 | */ | ||
790 | EReference getHostInstance_Type(); | ||
791 | |||
792 | /** | ||
793 | * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}'. | ||
794 | * <!-- begin-user-doc --> | ||
795 | * <!-- end-user-doc --> | ||
796 | * @return the meta object for the reference list '<em>Applications</em>'. | ||
797 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications() | ||
798 | * @see #getHostInstance() | ||
799 | * @generated | ||
800 | */ | ||
801 | EReference getHostInstance_Applications(); | ||
802 | |||
803 | /** | ||
804 | * Returns the factory that creates the instances of the model. | ||
805 | * <!-- begin-user-doc --> | ||
806 | * <!-- end-user-doc --> | ||
807 | * @return the factory that creates the instances of the model. | ||
808 | * @generated | ||
809 | */ | ||
810 | CpsFactory getCpsFactory(); | ||
811 | |||
812 | /** | ||
813 | * <!-- begin-user-doc --> | ||
814 | * Defines literals for the meta objects that represent | ||
815 | * <ul> | ||
816 | * <li>each class,</li> | ||
817 | * <li>each feature of each class,</li> | ||
818 | * <li>each operation of each class,</li> | ||
819 | * <li>each enum,</li> | ||
820 | * <li>and each data type</li> | ||
821 | * </ul> | ||
822 | * <!-- end-user-doc --> | ||
823 | * @generated | ||
824 | */ | ||
825 | interface Literals { | ||
826 | /** | ||
827 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl <em>Cyber Physical System</em>}' class. | ||
828 | * <!-- begin-user-doc --> | ||
829 | * <!-- end-user-doc --> | ||
830 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl | ||
831 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getCyberPhysicalSystem() | ||
832 | * @generated | ||
833 | */ | ||
834 | EClass CYBER_PHYSICAL_SYSTEM = eINSTANCE.getCyberPhysicalSystem(); | ||
835 | |||
836 | /** | ||
837 | * The meta object literal for the '<em><b>Requests</b></em>' containment reference list feature. | ||
838 | * <!-- begin-user-doc --> | ||
839 | * <!-- end-user-doc --> | ||
840 | * @generated | ||
841 | */ | ||
842 | EReference CYBER_PHYSICAL_SYSTEM__REQUESTS = eINSTANCE.getCyberPhysicalSystem_Requests(); | ||
843 | |||
844 | /** | ||
845 | * The meta object literal for the '<em><b>Application Types</b></em>' containment reference list feature. | ||
846 | * <!-- begin-user-doc --> | ||
847 | * <!-- end-user-doc --> | ||
848 | * @generated | ||
849 | */ | ||
850 | EReference CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES = eINSTANCE.getCyberPhysicalSystem_ApplicationTypes(); | ||
851 | |||
852 | /** | ||
853 | * The meta object literal for the '<em><b>Host Types</b></em>' containment reference list feature. | ||
854 | * <!-- begin-user-doc --> | ||
855 | * <!-- end-user-doc --> | ||
856 | * @generated | ||
857 | */ | ||
858 | EReference CYBER_PHYSICAL_SYSTEM__HOST_TYPES = eINSTANCE.getCyberPhysicalSystem_HostTypes(); | ||
859 | |||
860 | /** | ||
861 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl <em>Application Type</em>}' class. | ||
862 | * <!-- begin-user-doc --> | ||
863 | * <!-- end-user-doc --> | ||
864 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl | ||
865 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationType() | ||
866 | * @generated | ||
867 | */ | ||
868 | EClass APPLICATION_TYPE = eINSTANCE.getApplicationType(); | ||
869 | |||
870 | /** | ||
871 | * The meta object literal for the '<em><b>Instances</b></em>' containment reference list feature. | ||
872 | * <!-- begin-user-doc --> | ||
873 | * <!-- end-user-doc --> | ||
874 | * @generated | ||
875 | */ | ||
876 | EReference APPLICATION_TYPE__INSTANCES = eINSTANCE.getApplicationType_Instances(); | ||
877 | |||
878 | /** | ||
879 | * The meta object literal for the '<em><b>Requirements</b></em>' containment reference list feature. | ||
880 | * <!-- begin-user-doc --> | ||
881 | * <!-- end-user-doc --> | ||
882 | * @generated | ||
883 | */ | ||
884 | EReference APPLICATION_TYPE__REQUIREMENTS = eINSTANCE.getApplicationType_Requirements(); | ||
885 | |||
886 | /** | ||
887 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl <em>Host Type</em>}' class. | ||
888 | * <!-- begin-user-doc --> | ||
889 | * <!-- end-user-doc --> | ||
890 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostTypeImpl | ||
891 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostType() | ||
892 | * @generated | ||
893 | */ | ||
894 | EClass HOST_TYPE = eINSTANCE.getHostType(); | ||
895 | |||
896 | /** | ||
897 | * The meta object literal for the '<em><b>Default Memory</b></em>' attribute feature. | ||
898 | * <!-- begin-user-doc --> | ||
899 | * <!-- end-user-doc --> | ||
900 | * @generated | ||
901 | */ | ||
902 | EAttribute HOST_TYPE__DEFAULT_MEMORY = eINSTANCE.getHostType_DefaultMemory(); | ||
903 | |||
904 | /** | ||
905 | * The meta object literal for the '<em><b>Default Hdd</b></em>' attribute feature. | ||
906 | * <!-- begin-user-doc --> | ||
907 | * <!-- end-user-doc --> | ||
908 | * @generated | ||
909 | */ | ||
910 | EAttribute HOST_TYPE__DEFAULT_HDD = eINSTANCE.getHostType_DefaultHdd(); | ||
911 | |||
912 | /** | ||
913 | * The meta object literal for the '<em><b>Instances</b></em>' containment reference list feature. | ||
914 | * <!-- begin-user-doc --> | ||
915 | * <!-- end-user-doc --> | ||
916 | * @generated | ||
917 | */ | ||
918 | EReference HOST_TYPE__INSTANCES = eINSTANCE.getHostType_Instances(); | ||
919 | |||
920 | /** | ||
921 | * The meta object literal for the '<em><b>Cost</b></em>' attribute feature. | ||
922 | * <!-- begin-user-doc --> | ||
923 | * <!-- end-user-doc --> | ||
924 | * @generated | ||
925 | */ | ||
926 | EAttribute HOST_TYPE__COST = eINSTANCE.getHostType_Cost(); | ||
927 | |||
928 | /** | ||
929 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl <em>Request</em>}' class. | ||
930 | * <!-- begin-user-doc --> | ||
931 | * <!-- end-user-doc --> | ||
932 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequestImpl | ||
933 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequest() | ||
934 | * @generated | ||
935 | */ | ||
936 | EClass REQUEST = eINSTANCE.getRequest(); | ||
937 | |||
938 | /** | ||
939 | * The meta object literal for the '<em><b>Requirements</b></em>' containment reference list feature. | ||
940 | * <!-- begin-user-doc --> | ||
941 | * <!-- end-user-doc --> | ||
942 | * @generated | ||
943 | */ | ||
944 | EReference REQUEST__REQUIREMENTS = eINSTANCE.getRequest_Requirements(); | ||
945 | |||
946 | /** | ||
947 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl <em>Requirement</em>}' class. | ||
948 | * <!-- begin-user-doc --> | ||
949 | * <!-- end-user-doc --> | ||
950 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.RequirementImpl | ||
951 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getRequirement() | ||
952 | * @generated | ||
953 | */ | ||
954 | EClass REQUIREMENT = eINSTANCE.getRequirement(); | ||
955 | |||
956 | /** | ||
957 | * The meta object literal for the '<em><b>Request</b></em>' container reference feature. | ||
958 | * <!-- begin-user-doc --> | ||
959 | * <!-- end-user-doc --> | ||
960 | * @generated | ||
961 | */ | ||
962 | EReference REQUIREMENT__REQUEST = eINSTANCE.getRequirement_Request(); | ||
963 | |||
964 | /** | ||
965 | * The meta object literal for the '<em><b>Count</b></em>' attribute feature. | ||
966 | * <!-- begin-user-doc --> | ||
967 | * <!-- end-user-doc --> | ||
968 | * @generated | ||
969 | */ | ||
970 | EAttribute REQUIREMENT__COUNT = eINSTANCE.getRequirement_Count(); | ||
971 | |||
972 | /** | ||
973 | * The meta object literal for the '<em><b>Type</b></em>' reference feature. | ||
974 | * <!-- begin-user-doc --> | ||
975 | * <!-- end-user-doc --> | ||
976 | * @generated | ||
977 | */ | ||
978 | EReference REQUIREMENT__TYPE = eINSTANCE.getRequirement_Type(); | ||
979 | |||
980 | /** | ||
981 | * The meta object literal for the '<em><b>Instances</b></em>' reference list feature. | ||
982 | * <!-- begin-user-doc --> | ||
983 | * <!-- end-user-doc --> | ||
984 | * @generated | ||
985 | */ | ||
986 | EReference REQUIREMENT__INSTANCES = eINSTANCE.getRequirement_Instances(); | ||
987 | |||
988 | /** | ||
989 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl <em>Application Instance</em>}' class. | ||
990 | * <!-- begin-user-doc --> | ||
991 | * <!-- end-user-doc --> | ||
992 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationInstanceImpl | ||
993 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getApplicationInstance() | ||
994 | * @generated | ||
995 | */ | ||
996 | EClass APPLICATION_INSTANCE = eINSTANCE.getApplicationInstance(); | ||
997 | |||
998 | /** | ||
999 | * The meta object literal for the '<em><b>Requirement</b></em>' reference feature. | ||
1000 | * <!-- begin-user-doc --> | ||
1001 | * <!-- end-user-doc --> | ||
1002 | * @generated | ||
1003 | */ | ||
1004 | EReference APPLICATION_INSTANCE__REQUIREMENT = eINSTANCE.getApplicationInstance_Requirement(); | ||
1005 | |||
1006 | /** | ||
1007 | * The meta object literal for the '<em><b>Type</b></em>' container reference feature. | ||
1008 | * <!-- begin-user-doc --> | ||
1009 | * <!-- end-user-doc --> | ||
1010 | * @generated | ||
1011 | */ | ||
1012 | EReference APPLICATION_INSTANCE__TYPE = eINSTANCE.getApplicationInstance_Type(); | ||
1013 | |||
1014 | /** | ||
1015 | * The meta object literal for the '<em><b>Allocated To</b></em>' reference feature. | ||
1016 | * <!-- begin-user-doc --> | ||
1017 | * <!-- end-user-doc --> | ||
1018 | * @generated | ||
1019 | */ | ||
1020 | EReference APPLICATION_INSTANCE__ALLOCATED_TO = eINSTANCE.getApplicationInstance_AllocatedTo(); | ||
1021 | |||
1022 | /** | ||
1023 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl <em>Resource Requirement</em>}' class. | ||
1024 | * <!-- begin-user-doc --> | ||
1025 | * <!-- end-user-doc --> | ||
1026 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.ResourceRequirementImpl | ||
1027 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getResourceRequirement() | ||
1028 | * @generated | ||
1029 | */ | ||
1030 | EClass RESOURCE_REQUIREMENT = eINSTANCE.getResourceRequirement(); | ||
1031 | |||
1032 | /** | ||
1033 | * The meta object literal for the '<em><b>Required Memory</b></em>' attribute feature. | ||
1034 | * <!-- begin-user-doc --> | ||
1035 | * <!-- end-user-doc --> | ||
1036 | * @generated | ||
1037 | */ | ||
1038 | EAttribute RESOURCE_REQUIREMENT__REQUIRED_MEMORY = eINSTANCE.getResourceRequirement_RequiredMemory(); | ||
1039 | |||
1040 | /** | ||
1041 | * The meta object literal for the '<em><b>Required Hdd</b></em>' attribute feature. | ||
1042 | * <!-- begin-user-doc --> | ||
1043 | * <!-- end-user-doc --> | ||
1044 | * @generated | ||
1045 | */ | ||
1046 | EAttribute RESOURCE_REQUIREMENT__REQUIRED_HDD = eINSTANCE.getResourceRequirement_RequiredHdd(); | ||
1047 | |||
1048 | /** | ||
1049 | * The meta object literal for the '<em><b>Host Type</b></em>' reference feature. | ||
1050 | * <!-- begin-user-doc --> | ||
1051 | * <!-- end-user-doc --> | ||
1052 | * @generated | ||
1053 | */ | ||
1054 | EReference RESOURCE_REQUIREMENT__HOST_TYPE = eINSTANCE.getResourceRequirement_HostType(); | ||
1055 | |||
1056 | /** | ||
1057 | * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl <em>Host Instance</em>}' class. | ||
1058 | * <!-- begin-user-doc --> | ||
1059 | * <!-- end-user-doc --> | ||
1060 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl | ||
1061 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.impl.CpsPackageImpl#getHostInstance() | ||
1062 | * @generated | ||
1063 | */ | ||
1064 | EClass HOST_INSTANCE = eINSTANCE.getHostInstance(); | ||
1065 | |||
1066 | /** | ||
1067 | * The meta object literal for the '<em><b>Type</b></em>' container reference feature. | ||
1068 | * <!-- begin-user-doc --> | ||
1069 | * <!-- end-user-doc --> | ||
1070 | * @generated | ||
1071 | */ | ||
1072 | EReference HOST_INSTANCE__TYPE = eINSTANCE.getHostInstance_Type(); | ||
1073 | |||
1074 | /** | ||
1075 | * The meta object literal for the '<em><b>Applications</b></em>' reference list feature. | ||
1076 | * <!-- begin-user-doc --> | ||
1077 | * <!-- end-user-doc --> | ||
1078 | * @generated | ||
1079 | */ | ||
1080 | EReference HOST_INSTANCE__APPLICATIONS = eINSTANCE.getHostInstance_Applications(); | ||
1081 | |||
1082 | } | ||
1083 | |||
1084 | } //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..fbf4ce0d --- /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,76 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import 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 | * </ul> | ||
22 | * | ||
23 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem() | ||
24 | * @model | ||
25 | * @generated | ||
26 | */ | ||
27 | public interface CyberPhysicalSystem extends EObject { | ||
28 | /** | ||
29 | * Returns the value of the '<em><b>Requests</b></em>' containment reference list. | ||
30 | * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.Request}. | ||
31 | * <!-- begin-user-doc --> | ||
32 | * <p> | ||
33 | * If the meaning of the '<em>Requests</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>Requests</em>' containment reference list. | ||
38 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_Requests() | ||
39 | * @model containment="true" | ||
40 | * @generated | ||
41 | */ | ||
42 | EList<Request> getRequests(); | ||
43 | |||
44 | /** | ||
45 | * Returns the value of the '<em><b>Application Types</b></em>' containment reference list. | ||
46 | * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType}. | ||
47 | * <!-- begin-user-doc --> | ||
48 | * <p> | ||
49 | * If the meaning of the '<em>Application Types</em>' containment reference list isn't clear, | ||
50 | * there really should be more of a description here... | ||
51 | * </p> | ||
52 | * <!-- end-user-doc --> | ||
53 | * @return the value of the '<em>Application Types</em>' containment reference list. | ||
54 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_ApplicationTypes() | ||
55 | * @model containment="true" | ||
56 | * @generated | ||
57 | */ | ||
58 | EList<ApplicationType> getApplicationTypes(); | ||
59 | |||
60 | /** | ||
61 | * Returns the value of the '<em><b>Host Types</b></em>' containment reference list. | ||
62 | * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType}. | ||
63 | * <!-- begin-user-doc --> | ||
64 | * <p> | ||
65 | * If the meaning of the '<em>Host Types</em>' containment reference list isn't clear, | ||
66 | * there really should be more of a description here... | ||
67 | * </p> | ||
68 | * <!-- end-user-doc --> | ||
69 | * @return the value of the '<em>Host Types</em>' containment reference list. | ||
70 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_HostTypes() | ||
71 | * @model containment="true" | ||
72 | * @generated | ||
73 | */ | ||
74 | EList<HostType> getHostTypes(); | ||
75 | |||
76 | } // 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..b4721842 --- /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,73 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import 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#getApplications <em>Applications</em>}</li> | ||
20 | * </ul> | ||
21 | * | ||
22 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance() | ||
23 | * @model | ||
24 | * @generated | ||
25 | */ | ||
26 | public interface HostInstance extends EObject { | ||
27 | /** | ||
28 | * Returns the value of the '<em><b>Type</b></em>' container reference. | ||
29 | * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances <em>Instances</em>}'. | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <p> | ||
32 | * If the meaning of the '<em>Type</em>' container reference 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>Type</em>' container reference. | ||
37 | * @see #setType(HostType) | ||
38 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_Type() | ||
39 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostType#getInstances | ||
40 | * @model opposite="instances" required="true" transient="false" | ||
41 | * @generated | ||
42 | */ | ||
43 | HostType getType(); | ||
44 | |||
45 | /** | ||
46 | * Sets the value of the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}' container reference. | ||
47 | * <!-- begin-user-doc --> | ||
48 | * <!-- end-user-doc --> | ||
49 | * @param value the new value of the '<em>Type</em>' container reference. | ||
50 | * @see #getType() | ||
51 | * @generated | ||
52 | */ | ||
53 | void setType(HostType value); | ||
54 | |||
55 | /** | ||
56 | * Returns the value of the '<em><b>Applications</b></em>' reference list. | ||
57 | * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}. | ||
58 | * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}'. | ||
59 | * <!-- begin-user-doc --> | ||
60 | * <p> | ||
61 | * If the meaning of the '<em>Applications</em>' reference list 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>Applications</em>' reference list. | ||
66 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_Applications() | ||
67 | * @see hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo | ||
68 | * @model opposite="allocatedTo" | ||
69 | * @generated | ||
70 | */ | ||
71 | EList<ApplicationInstance> getApplications(); | ||
72 | |||
73 | } // 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import 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 | */ | ||
28 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import 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 | */ | ||
25 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import 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 | */ | ||
28 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps; | ||
4 | |||
5 | import 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 | */ | ||
25 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.Notification; | ||
12 | import org.eclipse.emf.common.notify.NotificationChain; | ||
13 | |||
14 | import org.eclipse.emf.ecore.EClass; | ||
15 | import org.eclipse.emf.ecore.InternalEObject; | ||
16 | |||
17 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
18 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
19 | |||
20 | import 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 | */ | ||
37 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; | ||
9 | |||
10 | import java.util.Collection; | ||
11 | |||
12 | import org.eclipse.emf.common.notify.NotificationChain; | ||
13 | |||
14 | import org.eclipse.emf.common.util.EList; | ||
15 | |||
16 | import org.eclipse.emf.ecore.EClass; | ||
17 | import org.eclipse.emf.ecore.InternalEObject; | ||
18 | |||
19 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
20 | |||
21 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
22 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
23 | import 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 | */ | ||
39 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.*; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EClass; | ||
8 | import org.eclipse.emf.ecore.EObject; | ||
9 | import org.eclipse.emf.ecore.EPackage; | ||
10 | |||
11 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
12 | |||
13 | import 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 | */ | ||
21 | public 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..e29ccccd --- /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,643 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
12 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
13 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
14 | import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; | ||
15 | |||
16 | import org.eclipse.emf.ecore.EAttribute; | ||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.EPackage; | ||
19 | import org.eclipse.emf.ecore.EReference; | ||
20 | |||
21 | import 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 | */ | ||
29 | public 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 EClass getApplicationType() { | ||
197 | return applicationTypeEClass; | ||
198 | } | ||
199 | |||
200 | /** | ||
201 | * <!-- begin-user-doc --> | ||
202 | * <!-- end-user-doc --> | ||
203 | * @generated | ||
204 | */ | ||
205 | @Override | ||
206 | public EReference getApplicationType_Instances() { | ||
207 | return (EReference) applicationTypeEClass.getEStructuralFeatures().get(0); | ||
208 | } | ||
209 | |||
210 | /** | ||
211 | * <!-- begin-user-doc --> | ||
212 | * <!-- end-user-doc --> | ||
213 | * @generated | ||
214 | */ | ||
215 | @Override | ||
216 | public EReference getApplicationType_Requirements() { | ||
217 | return (EReference) applicationTypeEClass.getEStructuralFeatures().get(1); | ||
218 | } | ||
219 | |||
220 | /** | ||
221 | * <!-- begin-user-doc --> | ||
222 | * <!-- end-user-doc --> | ||
223 | * @generated | ||
224 | */ | ||
225 | @Override | ||
226 | public EClass getHostType() { | ||
227 | return hostTypeEClass; | ||
228 | } | ||
229 | |||
230 | /** | ||
231 | * <!-- begin-user-doc --> | ||
232 | * <!-- end-user-doc --> | ||
233 | * @generated | ||
234 | */ | ||
235 | @Override | ||
236 | public EAttribute getHostType_DefaultMemory() { | ||
237 | return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(0); | ||
238 | } | ||
239 | |||
240 | /** | ||
241 | * <!-- begin-user-doc --> | ||
242 | * <!-- end-user-doc --> | ||
243 | * @generated | ||
244 | */ | ||
245 | @Override | ||
246 | public EAttribute getHostType_DefaultHdd() { | ||
247 | return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(1); | ||
248 | } | ||
249 | |||
250 | /** | ||
251 | * <!-- begin-user-doc --> | ||
252 | * <!-- end-user-doc --> | ||
253 | * @generated | ||
254 | */ | ||
255 | @Override | ||
256 | public EReference getHostType_Instances() { | ||
257 | return (EReference) hostTypeEClass.getEStructuralFeatures().get(2); | ||
258 | } | ||
259 | |||
260 | /** | ||
261 | * <!-- begin-user-doc --> | ||
262 | * <!-- end-user-doc --> | ||
263 | * @generated | ||
264 | */ | ||
265 | @Override | ||
266 | public EAttribute getHostType_Cost() { | ||
267 | return (EAttribute) hostTypeEClass.getEStructuralFeatures().get(3); | ||
268 | } | ||
269 | |||
270 | /** | ||
271 | * <!-- begin-user-doc --> | ||
272 | * <!-- end-user-doc --> | ||
273 | * @generated | ||
274 | */ | ||
275 | @Override | ||
276 | public EClass getRequest() { | ||
277 | return requestEClass; | ||
278 | } | ||
279 | |||
280 | /** | ||
281 | * <!-- begin-user-doc --> | ||
282 | * <!-- end-user-doc --> | ||
283 | * @generated | ||
284 | */ | ||
285 | @Override | ||
286 | public EReference getRequest_Requirements() { | ||
287 | return (EReference) requestEClass.getEStructuralFeatures().get(0); | ||
288 | } | ||
289 | |||
290 | /** | ||
291 | * <!-- begin-user-doc --> | ||
292 | * <!-- end-user-doc --> | ||
293 | * @generated | ||
294 | */ | ||
295 | @Override | ||
296 | public EClass getRequirement() { | ||
297 | return requirementEClass; | ||
298 | } | ||
299 | |||
300 | /** | ||
301 | * <!-- begin-user-doc --> | ||
302 | * <!-- end-user-doc --> | ||
303 | * @generated | ||
304 | */ | ||
305 | @Override | ||
306 | public EReference getRequirement_Request() { | ||
307 | return (EReference) requirementEClass.getEStructuralFeatures().get(0); | ||
308 | } | ||
309 | |||
310 | /** | ||
311 | * <!-- begin-user-doc --> | ||
312 | * <!-- end-user-doc --> | ||
313 | * @generated | ||
314 | */ | ||
315 | @Override | ||
316 | public EAttribute getRequirement_Count() { | ||
317 | return (EAttribute) requirementEClass.getEStructuralFeatures().get(1); | ||
318 | } | ||
319 | |||
320 | /** | ||
321 | * <!-- begin-user-doc --> | ||
322 | * <!-- end-user-doc --> | ||
323 | * @generated | ||
324 | */ | ||
325 | @Override | ||
326 | public EReference getRequirement_Type() { | ||
327 | return (EReference) requirementEClass.getEStructuralFeatures().get(2); | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * <!-- begin-user-doc --> | ||
332 | * <!-- end-user-doc --> | ||
333 | * @generated | ||
334 | */ | ||
335 | @Override | ||
336 | public EReference getRequirement_Instances() { | ||
337 | return (EReference) requirementEClass.getEStructuralFeatures().get(3); | ||
338 | } | ||
339 | |||
340 | /** | ||
341 | * <!-- begin-user-doc --> | ||
342 | * <!-- end-user-doc --> | ||
343 | * @generated | ||
344 | */ | ||
345 | @Override | ||
346 | public EClass getApplicationInstance() { | ||
347 | return applicationInstanceEClass; | ||
348 | } | ||
349 | |||
350 | /** | ||
351 | * <!-- begin-user-doc --> | ||
352 | * <!-- end-user-doc --> | ||
353 | * @generated | ||
354 | */ | ||
355 | @Override | ||
356 | public EReference getApplicationInstance_Requirement() { | ||
357 | return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(0); | ||
358 | } | ||
359 | |||
360 | /** | ||
361 | * <!-- begin-user-doc --> | ||
362 | * <!-- end-user-doc --> | ||
363 | * @generated | ||
364 | */ | ||
365 | @Override | ||
366 | public EReference getApplicationInstance_Type() { | ||
367 | return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(1); | ||
368 | } | ||
369 | |||
370 | /** | ||
371 | * <!-- begin-user-doc --> | ||
372 | * <!-- end-user-doc --> | ||
373 | * @generated | ||
374 | */ | ||
375 | @Override | ||
376 | public EReference getApplicationInstance_AllocatedTo() { | ||
377 | return (EReference) applicationInstanceEClass.getEStructuralFeatures().get(2); | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * <!-- begin-user-doc --> | ||
382 | * <!-- end-user-doc --> | ||
383 | * @generated | ||
384 | */ | ||
385 | @Override | ||
386 | public EClass getResourceRequirement() { | ||
387 | return resourceRequirementEClass; | ||
388 | } | ||
389 | |||
390 | /** | ||
391 | * <!-- begin-user-doc --> | ||
392 | * <!-- end-user-doc --> | ||
393 | * @generated | ||
394 | */ | ||
395 | @Override | ||
396 | public EAttribute getResourceRequirement_RequiredMemory() { | ||
397 | return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(0); | ||
398 | } | ||
399 | |||
400 | /** | ||
401 | * <!-- begin-user-doc --> | ||
402 | * <!-- end-user-doc --> | ||
403 | * @generated | ||
404 | */ | ||
405 | @Override | ||
406 | public EAttribute getResourceRequirement_RequiredHdd() { | ||
407 | return (EAttribute) resourceRequirementEClass.getEStructuralFeatures().get(1); | ||
408 | } | ||
409 | |||
410 | /** | ||
411 | * <!-- begin-user-doc --> | ||
412 | * <!-- end-user-doc --> | ||
413 | * @generated | ||
414 | */ | ||
415 | @Override | ||
416 | public EReference getResourceRequirement_HostType() { | ||
417 | return (EReference) resourceRequirementEClass.getEStructuralFeatures().get(2); | ||
418 | } | ||
419 | |||
420 | /** | ||
421 | * <!-- begin-user-doc --> | ||
422 | * <!-- end-user-doc --> | ||
423 | * @generated | ||
424 | */ | ||
425 | @Override | ||
426 | public EClass getHostInstance() { | ||
427 | return hostInstanceEClass; | ||
428 | } | ||
429 | |||
430 | /** | ||
431 | * <!-- begin-user-doc --> | ||
432 | * <!-- end-user-doc --> | ||
433 | * @generated | ||
434 | */ | ||
435 | @Override | ||
436 | public EReference getHostInstance_Type() { | ||
437 | return (EReference) hostInstanceEClass.getEStructuralFeatures().get(0); | ||
438 | } | ||
439 | |||
440 | /** | ||
441 | * <!-- begin-user-doc --> | ||
442 | * <!-- end-user-doc --> | ||
443 | * @generated | ||
444 | */ | ||
445 | @Override | ||
446 | public EReference getHostInstance_Applications() { | ||
447 | return (EReference) hostInstanceEClass.getEStructuralFeatures().get(1); | ||
448 | } | ||
449 | |||
450 | /** | ||
451 | * <!-- begin-user-doc --> | ||
452 | * <!-- end-user-doc --> | ||
453 | * @generated | ||
454 | */ | ||
455 | @Override | ||
456 | public CpsFactory getCpsFactory() { | ||
457 | return (CpsFactory) getEFactoryInstance(); | ||
458 | } | ||
459 | |||
460 | /** | ||
461 | * <!-- begin-user-doc --> | ||
462 | * <!-- end-user-doc --> | ||
463 | * @generated | ||
464 | */ | ||
465 | private boolean isCreated = false; | ||
466 | |||
467 | /** | ||
468 | * Creates the meta-model objects for the package. This method is | ||
469 | * guarded to have no affect on any invocation but its first. | ||
470 | * <!-- begin-user-doc --> | ||
471 | * <!-- end-user-doc --> | ||
472 | * @generated | ||
473 | */ | ||
474 | public void createPackageContents() { | ||
475 | if (isCreated) | ||
476 | return; | ||
477 | isCreated = true; | ||
478 | |||
479 | // Create classes and their features | ||
480 | cyberPhysicalSystemEClass = createEClass(CYBER_PHYSICAL_SYSTEM); | ||
481 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__REQUESTS); | ||
482 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES); | ||
483 | createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOST_TYPES); | ||
484 | |||
485 | applicationTypeEClass = createEClass(APPLICATION_TYPE); | ||
486 | createEReference(applicationTypeEClass, APPLICATION_TYPE__INSTANCES); | ||
487 | createEReference(applicationTypeEClass, APPLICATION_TYPE__REQUIREMENTS); | ||
488 | |||
489 | hostTypeEClass = createEClass(HOST_TYPE); | ||
490 | createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_MEMORY); | ||
491 | createEAttribute(hostTypeEClass, HOST_TYPE__DEFAULT_HDD); | ||
492 | createEReference(hostTypeEClass, HOST_TYPE__INSTANCES); | ||
493 | createEAttribute(hostTypeEClass, HOST_TYPE__COST); | ||
494 | |||
495 | requestEClass = createEClass(REQUEST); | ||
496 | createEReference(requestEClass, REQUEST__REQUIREMENTS); | ||
497 | |||
498 | requirementEClass = createEClass(REQUIREMENT); | ||
499 | createEReference(requirementEClass, REQUIREMENT__REQUEST); | ||
500 | createEAttribute(requirementEClass, REQUIREMENT__COUNT); | ||
501 | createEReference(requirementEClass, REQUIREMENT__TYPE); | ||
502 | createEReference(requirementEClass, REQUIREMENT__INSTANCES); | ||
503 | |||
504 | applicationInstanceEClass = createEClass(APPLICATION_INSTANCE); | ||
505 | createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__REQUIREMENT); | ||
506 | createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__TYPE); | ||
507 | createEReference(applicationInstanceEClass, APPLICATION_INSTANCE__ALLOCATED_TO); | ||
508 | |||
509 | resourceRequirementEClass = createEClass(RESOURCE_REQUIREMENT); | ||
510 | createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_MEMORY); | ||
511 | createEAttribute(resourceRequirementEClass, RESOURCE_REQUIREMENT__REQUIRED_HDD); | ||
512 | createEReference(resourceRequirementEClass, RESOURCE_REQUIREMENT__HOST_TYPE); | ||
513 | |||
514 | hostInstanceEClass = createEClass(HOST_INSTANCE); | ||
515 | createEReference(hostInstanceEClass, HOST_INSTANCE__TYPE); | ||
516 | createEReference(hostInstanceEClass, HOST_INSTANCE__APPLICATIONS); | ||
517 | } | ||
518 | |||
519 | /** | ||
520 | * <!-- begin-user-doc --> | ||
521 | * <!-- end-user-doc --> | ||
522 | * @generated | ||
523 | */ | ||
524 | private boolean isInitialized = false; | ||
525 | |||
526 | /** | ||
527 | * Complete the initialization of the package and its meta-model. This | ||
528 | * method is guarded to have no affect on any invocation but its first. | ||
529 | * <!-- begin-user-doc --> | ||
530 | * <!-- end-user-doc --> | ||
531 | * @generated | ||
532 | */ | ||
533 | public void initializePackageContents() { | ||
534 | if (isInitialized) | ||
535 | return; | ||
536 | isInitialized = true; | ||
537 | |||
538 | // Initialize package | ||
539 | setName(eNAME); | ||
540 | setNsPrefix(eNS_PREFIX); | ||
541 | setNsURI(eNS_URI); | ||
542 | |||
543 | // Create type parameters | ||
544 | |||
545 | // Set bounds for type parameters | ||
546 | |||
547 | // Add supertypes to classes | ||
548 | |||
549 | // Initialize classes, features, and operations; add parameters | ||
550 | initEClass(cyberPhysicalSystemEClass, CyberPhysicalSystem.class, "CyberPhysicalSystem", !IS_ABSTRACT, | ||
551 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
552 | initEReference(getCyberPhysicalSystem_Requests(), this.getRequest(), null, "requests", null, 0, -1, | ||
553 | CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
554 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
555 | initEReference(getCyberPhysicalSystem_ApplicationTypes(), this.getApplicationType(), null, "applicationTypes", | ||
556 | null, 0, -1, CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
557 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
558 | initEReference(getCyberPhysicalSystem_HostTypes(), this.getHostType(), null, "hostTypes", null, 0, -1, | ||
559 | CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
560 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
561 | |||
562 | initEClass(applicationTypeEClass, ApplicationType.class, "ApplicationType", !IS_ABSTRACT, !IS_INTERFACE, | ||
563 | IS_GENERATED_INSTANCE_CLASS); | ||
564 | initEReference(getApplicationType_Instances(), this.getApplicationInstance(), | ||
565 | this.getApplicationInstance_Type(), "instances", null, 0, -1, ApplicationType.class, !IS_TRANSIENT, | ||
566 | !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, | ||
567 | IS_ORDERED); | ||
568 | initEReference(getApplicationType_Requirements(), this.getResourceRequirement(), null, "requirements", null, 0, | ||
569 | -1, ApplicationType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
570 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
571 | |||
572 | initEClass(hostTypeEClass, HostType.class, "HostType", !IS_ABSTRACT, !IS_INTERFACE, | ||
573 | IS_GENERATED_INSTANCE_CLASS); | ||
574 | initEAttribute(getHostType_DefaultMemory(), ecorePackage.getEInt(), "defaultMemory", null, 1, 1, HostType.class, | ||
575 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
576 | initEAttribute(getHostType_DefaultHdd(), ecorePackage.getEInt(), "defaultHdd", null, 1, 1, HostType.class, | ||
577 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
578 | initEReference(getHostType_Instances(), this.getHostInstance(), this.getHostInstance_Type(), "instances", null, | ||
579 | 0, -1, HostType.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, | ||
580 | !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
581 | initEAttribute(getHostType_Cost(), ecorePackage.getEInt(), "cost", null, 1, 1, HostType.class, !IS_TRANSIENT, | ||
582 | !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
583 | |||
584 | initEClass(requestEClass, Request.class, "Request", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
585 | initEReference(getRequest_Requirements(), this.getRequirement(), this.getRequirement_Request(), "requirements", | ||
586 | null, 0, -1, Request.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
587 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
588 | |||
589 | initEClass(requirementEClass, Requirement.class, "Requirement", !IS_ABSTRACT, !IS_INTERFACE, | ||
590 | IS_GENERATED_INSTANCE_CLASS); | ||
591 | initEReference(getRequirement_Request(), this.getRequest(), this.getRequest_Requirements(), "request", null, 1, | ||
592 | 1, Requirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, | ||
593 | !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
594 | initEAttribute(getRequirement_Count(), ecorePackage.getEInt(), "count", null, 1, 1, Requirement.class, | ||
595 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
596 | initEReference(getRequirement_Type(), this.getApplicationType(), null, "type", null, 0, 1, Requirement.class, | ||
597 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
598 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
599 | initEReference(getRequirement_Instances(), this.getApplicationInstance(), | ||
600 | this.getApplicationInstance_Requirement(), "instances", null, 0, -1, Requirement.class, !IS_TRANSIENT, | ||
601 | !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, | ||
602 | IS_ORDERED); | ||
603 | |||
604 | initEClass(applicationInstanceEClass, ApplicationInstance.class, "ApplicationInstance", !IS_ABSTRACT, | ||
605 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
606 | initEReference(getApplicationInstance_Requirement(), this.getRequirement(), this.getRequirement_Instances(), | ||
607 | "requirement", null, 0, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, | ||
608 | !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
609 | initEReference(getApplicationInstance_Type(), this.getApplicationType(), this.getApplicationType_Instances(), | ||
610 | "type", null, 1, 1, ApplicationInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, | ||
611 | !IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
612 | initEReference(getApplicationInstance_AllocatedTo(), this.getHostInstance(), | ||
613 | this.getHostInstance_Applications(), "allocatedTo", null, 1, 1, ApplicationInstance.class, | ||
614 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
615 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
616 | |||
617 | initEClass(resourceRequirementEClass, ResourceRequirement.class, "ResourceRequirement", !IS_ABSTRACT, | ||
618 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
619 | initEAttribute(getResourceRequirement_RequiredMemory(), ecorePackage.getEInt(), "requiredMemory", null, 1, 1, | ||
620 | ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, | ||
621 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
622 | initEAttribute(getResourceRequirement_RequiredHdd(), ecorePackage.getEInt(), "requiredHdd", null, 1, 1, | ||
623 | ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, | ||
624 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
625 | initEReference(getResourceRequirement_HostType(), this.getHostType(), null, "hostType", null, 1, 1, | ||
626 | ResourceRequirement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, | ||
627 | IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
628 | |||
629 | initEClass(hostInstanceEClass, HostInstance.class, "HostInstance", !IS_ABSTRACT, !IS_INTERFACE, | ||
630 | IS_GENERATED_INSTANCE_CLASS); | ||
631 | initEReference(getHostInstance_Type(), this.getHostType(), this.getHostType_Instances(), "type", null, 1, 1, | ||
632 | HostInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, | ||
633 | !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
634 | initEReference(getHostInstance_Applications(), this.getApplicationInstance(), | ||
635 | this.getApplicationInstance_AllocatedTo(), "applications", null, 0, -1, HostInstance.class, | ||
636 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
637 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
638 | |||
639 | // Create resource | ||
640 | createResource(eNS_URI); | ||
641 | } | ||
642 | |||
643 | } //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..3ba111af --- /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,232 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
10 | |||
11 | import java.util.Collection; | ||
12 | |||
13 | import org.eclipse.emf.common.notify.NotificationChain; | ||
14 | |||
15 | import org.eclipse.emf.common.util.EList; | ||
16 | |||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.InternalEObject; | ||
19 | |||
20 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
21 | |||
22 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
23 | import org.eclipse.emf.ecore.util.InternalEList; | ||
24 | |||
25 | /** | ||
26 | * <!-- begin-user-doc --> | ||
27 | * An implementation of the model object '<em><b>Cyber Physical System</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.CyberPhysicalSystemImpl#getRequests <em>Requests</em>}</li> | ||
34 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplicationTypes <em>Application Types</em>}</li> | ||
35 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHostTypes <em>Host Types</em>}</li> | ||
36 | * </ul> | ||
37 | * | ||
38 | * @generated | ||
39 | */ | ||
40 | public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implements CyberPhysicalSystem { | ||
41 | /** | ||
42 | * The cached value of the '{@link #getRequests() <em>Requests</em>}' containment reference list. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getRequests() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected EList<Request> requests; | ||
50 | |||
51 | /** | ||
52 | * The cached value of the '{@link #getApplicationTypes() <em>Application Types</em>}' containment reference list. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #getApplicationTypes() | ||
56 | * @generated | ||
57 | * @ordered | ||
58 | */ | ||
59 | protected EList<ApplicationType> applicationTypes; | ||
60 | |||
61 | /** | ||
62 | * The cached value of the '{@link #getHostTypes() <em>Host Types</em>}' containment reference list. | ||
63 | * <!-- begin-user-doc --> | ||
64 | * <!-- end-user-doc --> | ||
65 | * @see #getHostTypes() | ||
66 | * @generated | ||
67 | * @ordered | ||
68 | */ | ||
69 | protected EList<HostType> hostTypes; | ||
70 | |||
71 | /** | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @generated | ||
75 | */ | ||
76 | protected CyberPhysicalSystemImpl() { | ||
77 | super(); | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | @Override | ||
86 | protected EClass eStaticClass() { | ||
87 | return CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM; | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * <!-- begin-user-doc --> | ||
92 | * <!-- end-user-doc --> | ||
93 | * @generated | ||
94 | */ | ||
95 | @Override | ||
96 | public EList<Request> getRequests() { | ||
97 | if (requests == null) { | ||
98 | requests = new EObjectContainmentEList<Request>(Request.class, this, | ||
99 | CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS); | ||
100 | } | ||
101 | return requests; | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * <!-- begin-user-doc --> | ||
106 | * <!-- end-user-doc --> | ||
107 | * @generated | ||
108 | */ | ||
109 | @Override | ||
110 | public EList<ApplicationType> getApplicationTypes() { | ||
111 | if (applicationTypes == null) { | ||
112 | applicationTypes = new EObjectContainmentEList<ApplicationType>(ApplicationType.class, this, | ||
113 | CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES); | ||
114 | } | ||
115 | return applicationTypes; | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * <!-- begin-user-doc --> | ||
120 | * <!-- end-user-doc --> | ||
121 | * @generated | ||
122 | */ | ||
123 | @Override | ||
124 | public EList<HostType> getHostTypes() { | ||
125 | if (hostTypes == null) { | ||
126 | hostTypes = new EObjectContainmentEList<HostType>(HostType.class, this, | ||
127 | CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES); | ||
128 | } | ||
129 | return hostTypes; | ||
130 | } | ||
131 | |||
132 | /** | ||
133 | * <!-- begin-user-doc --> | ||
134 | * <!-- end-user-doc --> | ||
135 | * @generated | ||
136 | */ | ||
137 | @Override | ||
138 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
139 | switch (featureID) { | ||
140 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
141 | return ((InternalEList<?>) getRequests()).basicRemove(otherEnd, msgs); | ||
142 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
143 | return ((InternalEList<?>) getApplicationTypes()).basicRemove(otherEnd, msgs); | ||
144 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
145 | return ((InternalEList<?>) getHostTypes()).basicRemove(otherEnd, msgs); | ||
146 | } | ||
147 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * <!-- begin-user-doc --> | ||
152 | * <!-- end-user-doc --> | ||
153 | * @generated | ||
154 | */ | ||
155 | @Override | ||
156 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
157 | switch (featureID) { | ||
158 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
159 | return getRequests(); | ||
160 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
161 | return getApplicationTypes(); | ||
162 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
163 | return getHostTypes(); | ||
164 | } | ||
165 | return super.eGet(featureID, resolve, coreType); | ||
166 | } | ||
167 | |||
168 | /** | ||
169 | * <!-- begin-user-doc --> | ||
170 | * <!-- end-user-doc --> | ||
171 | * @generated | ||
172 | */ | ||
173 | @SuppressWarnings("unchecked") | ||
174 | @Override | ||
175 | public void eSet(int featureID, Object newValue) { | ||
176 | switch (featureID) { | ||
177 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
178 | getRequests().clear(); | ||
179 | getRequests().addAll((Collection<? extends Request>) newValue); | ||
180 | return; | ||
181 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
182 | getApplicationTypes().clear(); | ||
183 | getApplicationTypes().addAll((Collection<? extends ApplicationType>) newValue); | ||
184 | return; | ||
185 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
186 | getHostTypes().clear(); | ||
187 | getHostTypes().addAll((Collection<? extends HostType>) newValue); | ||
188 | return; | ||
189 | } | ||
190 | super.eSet(featureID, newValue); | ||
191 | } | ||
192 | |||
193 | /** | ||
194 | * <!-- begin-user-doc --> | ||
195 | * <!-- end-user-doc --> | ||
196 | * @generated | ||
197 | */ | ||
198 | @Override | ||
199 | public void eUnset(int featureID) { | ||
200 | switch (featureID) { | ||
201 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
202 | getRequests().clear(); | ||
203 | return; | ||
204 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
205 | getApplicationTypes().clear(); | ||
206 | return; | ||
207 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
208 | getHostTypes().clear(); | ||
209 | return; | ||
210 | } | ||
211 | super.eUnset(featureID); | ||
212 | } | ||
213 | |||
214 | /** | ||
215 | * <!-- begin-user-doc --> | ||
216 | * <!-- end-user-doc --> | ||
217 | * @generated | ||
218 | */ | ||
219 | @Override | ||
220 | public boolean eIsSet(int featureID) { | ||
221 | switch (featureID) { | ||
222 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__REQUESTS: | ||
223 | return requests != null && !requests.isEmpty(); | ||
224 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES: | ||
225 | return applicationTypes != null && !applicationTypes.isEmpty(); | ||
226 | case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: | ||
227 | return hostTypes != null && !hostTypes.isEmpty(); | ||
228 | } | ||
229 | return super.eIsSet(featureID); | ||
230 | } | ||
231 | |||
232 | } //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..551f2ed6 --- /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,250 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
9 | |||
10 | import java.util.Collection; | ||
11 | |||
12 | import org.eclipse.emf.common.notify.Notification; | ||
13 | import org.eclipse.emf.common.notify.NotificationChain; | ||
14 | |||
15 | import org.eclipse.emf.common.util.EList; | ||
16 | |||
17 | import org.eclipse.emf.ecore.EClass; | ||
18 | import org.eclipse.emf.ecore.InternalEObject; | ||
19 | |||
20 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
21 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
22 | |||
23 | import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; | ||
24 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
25 | import org.eclipse.emf.ecore.util.InternalEList; | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * An implementation of the model object '<em><b>Host Instance</b></em>'. | ||
30 | * <!-- end-user-doc --> | ||
31 | * <p> | ||
32 | * The following features are implemented: | ||
33 | * </p> | ||
34 | * <ul> | ||
35 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getType <em>Type</em>}</li> | ||
36 | * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getApplications <em>Applications</em>}</li> | ||
37 | * </ul> | ||
38 | * | ||
39 | * @generated | ||
40 | */ | ||
41 | public class HostInstanceImpl extends MinimalEObjectImpl.Container implements HostInstance { | ||
42 | /** | ||
43 | * The cached value of the '{@link #getApplications() <em>Applications</em>}' reference list. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @see #getApplications() | ||
47 | * @generated | ||
48 | * @ordered | ||
49 | */ | ||
50 | protected EList<ApplicationInstance> applications; | ||
51 | |||
52 | /** | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @generated | ||
56 | */ | ||
57 | protected HostInstanceImpl() { | ||
58 | super(); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | @Override | ||
67 | protected EClass eStaticClass() { | ||
68 | return CpsPackage.Literals.HOST_INSTANCE; | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * <!-- begin-user-doc --> | ||
73 | * <!-- end-user-doc --> | ||
74 | * @generated | ||
75 | */ | ||
76 | @Override | ||
77 | public HostType getType() { | ||
78 | if (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE) | ||
79 | return null; | ||
80 | return (HostType) eInternalContainer(); | ||
81 | } | ||
82 | |||
83 | /** | ||
84 | * <!-- begin-user-doc --> | ||
85 | * <!-- end-user-doc --> | ||
86 | * @generated | ||
87 | */ | ||
88 | public NotificationChain basicSetType(HostType newType, NotificationChain msgs) { | ||
89 | msgs = eBasicSetContainer((InternalEObject) newType, CpsPackage.HOST_INSTANCE__TYPE, msgs); | ||
90 | return msgs; | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | @Override | ||
99 | public void setType(HostType newType) { | ||
100 | if (newType != eInternalContainer() | ||
101 | || (eContainerFeatureID() != CpsPackage.HOST_INSTANCE__TYPE && newType != null)) { | ||
102 | if (EcoreUtil.isAncestor(this, newType)) | ||
103 | throw new IllegalArgumentException("Recursive containment not allowed for " + toString()); | ||
104 | NotificationChain msgs = null; | ||
105 | if (eInternalContainer() != null) | ||
106 | msgs = eBasicRemoveFromContainer(msgs); | ||
107 | if (newType != null) | ||
108 | msgs = ((InternalEObject) newType).eInverseAdd(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, | ||
109 | msgs); | ||
110 | msgs = basicSetType(newType, msgs); | ||
111 | if (msgs != null) | ||
112 | msgs.dispatch(); | ||
113 | } else if (eNotificationRequired()) | ||
114 | eNotify(new ENotificationImpl(this, Notification.SET, CpsPackage.HOST_INSTANCE__TYPE, newType, newType)); | ||
115 | } | ||
116 | |||
117 | /** | ||
118 | * <!-- begin-user-doc --> | ||
119 | * <!-- end-user-doc --> | ||
120 | * @generated | ||
121 | */ | ||
122 | @Override | ||
123 | public EList<ApplicationInstance> getApplications() { | ||
124 | if (applications == null) { | ||
125 | applications = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this, | ||
126 | CpsPackage.HOST_INSTANCE__APPLICATIONS, CpsPackage.APPLICATION_INSTANCE__ALLOCATED_TO); | ||
127 | } | ||
128 | return applications; | ||
129 | } | ||
130 | |||
131 | /** | ||
132 | * <!-- begin-user-doc --> | ||
133 | * <!-- end-user-doc --> | ||
134 | * @generated | ||
135 | */ | ||
136 | @SuppressWarnings("unchecked") | ||
137 | @Override | ||
138 | public NotificationChain eInverseAdd(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
139 | switch (featureID) { | ||
140 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
141 | if (eInternalContainer() != null) | ||
142 | msgs = eBasicRemoveFromContainer(msgs); | ||
143 | return basicSetType((HostType) otherEnd, msgs); | ||
144 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
145 | return ((InternalEList<InternalEObject>) (InternalEList<?>) getApplications()).basicAdd(otherEnd, msgs); | ||
146 | } | ||
147 | return super.eInverseAdd(otherEnd, featureID, msgs); | ||
148 | } | ||
149 | |||
150 | /** | ||
151 | * <!-- begin-user-doc --> | ||
152 | * <!-- end-user-doc --> | ||
153 | * @generated | ||
154 | */ | ||
155 | @Override | ||
156 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
157 | switch (featureID) { | ||
158 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
159 | return basicSetType(null, msgs); | ||
160 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
161 | return ((InternalEList<?>) getApplications()).basicRemove(otherEnd, msgs); | ||
162 | } | ||
163 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * <!-- begin-user-doc --> | ||
168 | * <!-- end-user-doc --> | ||
169 | * @generated | ||
170 | */ | ||
171 | @Override | ||
172 | public NotificationChain eBasicRemoveFromContainerFeature(NotificationChain msgs) { | ||
173 | switch (eContainerFeatureID()) { | ||
174 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
175 | return eInternalContainer().eInverseRemove(this, CpsPackage.HOST_TYPE__INSTANCES, HostType.class, msgs); | ||
176 | } | ||
177 | return super.eBasicRemoveFromContainerFeature(msgs); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * <!-- begin-user-doc --> | ||
182 | * <!-- end-user-doc --> | ||
183 | * @generated | ||
184 | */ | ||
185 | @Override | ||
186 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
187 | switch (featureID) { | ||
188 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
189 | return getType(); | ||
190 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
191 | return getApplications(); | ||
192 | } | ||
193 | return super.eGet(featureID, resolve, coreType); | ||
194 | } | ||
195 | |||
196 | /** | ||
197 | * <!-- begin-user-doc --> | ||
198 | * <!-- end-user-doc --> | ||
199 | * @generated | ||
200 | */ | ||
201 | @SuppressWarnings("unchecked") | ||
202 | @Override | ||
203 | public void eSet(int featureID, Object newValue) { | ||
204 | switch (featureID) { | ||
205 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
206 | setType((HostType) newValue); | ||
207 | return; | ||
208 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
209 | getApplications().clear(); | ||
210 | getApplications().addAll((Collection<? extends ApplicationInstance>) newValue); | ||
211 | return; | ||
212 | } | ||
213 | super.eSet(featureID, newValue); | ||
214 | } | ||
215 | |||
216 | /** | ||
217 | * <!-- begin-user-doc --> | ||
218 | * <!-- end-user-doc --> | ||
219 | * @generated | ||
220 | */ | ||
221 | @Override | ||
222 | public void eUnset(int featureID) { | ||
223 | switch (featureID) { | ||
224 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
225 | setType((HostType) null); | ||
226 | return; | ||
227 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
228 | getApplications().clear(); | ||
229 | return; | ||
230 | } | ||
231 | super.eUnset(featureID); | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * <!-- begin-user-doc --> | ||
236 | * <!-- end-user-doc --> | ||
237 | * @generated | ||
238 | */ | ||
239 | @Override | ||
240 | public boolean eIsSet(int featureID) { | ||
241 | switch (featureID) { | ||
242 | case CpsPackage.HOST_INSTANCE__TYPE: | ||
243 | return getType() != null; | ||
244 | case CpsPackage.HOST_INSTANCE__APPLICATIONS: | ||
245 | return applications != null && !applications.isEmpty(); | ||
246 | } | ||
247 | return super.eIsSet(featureID); | ||
248 | } | ||
249 | |||
250 | } //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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
8 | |||
9 | import java.util.Collection; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.Notification; | ||
12 | import org.eclipse.emf.common.notify.NotificationChain; | ||
13 | |||
14 | import org.eclipse.emf.common.util.EList; | ||
15 | |||
16 | import org.eclipse.emf.ecore.EClass; | ||
17 | import org.eclipse.emf.ecore.InternalEObject; | ||
18 | |||
19 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
20 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
21 | |||
22 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
23 | import 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 | */ | ||
41 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
8 | |||
9 | import java.util.Collection; | ||
10 | |||
11 | import org.eclipse.emf.common.notify.NotificationChain; | ||
12 | |||
13 | import org.eclipse.emf.common.util.EList; | ||
14 | |||
15 | import org.eclipse.emf.ecore.EClass; | ||
16 | import org.eclipse.emf.ecore.InternalEObject; | ||
17 | |||
18 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
19 | |||
20 | import org.eclipse.emf.ecore.util.EObjectContainmentWithInverseEList; | ||
21 | import 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 | */ | ||
36 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
10 | |||
11 | import java.util.Collection; | ||
12 | |||
13 | import org.eclipse.emf.common.notify.Notification; | ||
14 | import org.eclipse.emf.common.notify.NotificationChain; | ||
15 | |||
16 | import org.eclipse.emf.common.util.EList; | ||
17 | |||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.emf.ecore.InternalEObject; | ||
20 | |||
21 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
22 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
23 | |||
24 | import org.eclipse.emf.ecore.util.EObjectWithInverseResolvingEList; | ||
25 | import org.eclipse.emf.ecore.util.EcoreUtil; | ||
26 | import 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 | */ | ||
44 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.impl; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement; | ||
8 | |||
9 | import org.eclipse.emf.common.notify.Notification; | ||
10 | |||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.InternalEObject; | ||
13 | |||
14 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
15 | import 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 | */ | ||
32 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.util; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.*; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Adapter; | ||
8 | import org.eclipse.emf.common.notify.Notifier; | ||
9 | |||
10 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; | ||
11 | |||
12 | import 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 | */ | ||
22 | public 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 | */ | ||
3 | package hu.bme.mit.inf.dslreasoner.domains.cps.util; | ||
4 | |||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.*; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | import org.eclipse.emf.ecore.EPackage; | ||
9 | |||
10 | import 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 | */ | ||
25 | public 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.ecore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore new file mode 100644 index 00000000..0f52d8ee --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore | |||
@@ -0,0 +1,61 @@ | |||
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" | ||
3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="cps" nsURI="http://www.example.org/cps" nsPrefix="cps"> | ||
4 | <eClassifiers xsi:type="ecore:EClass" name="CyberPhysicalSystem"> | ||
5 | <eStructuralFeatures xsi:type="ecore:EReference" name="requests" upperBound="-1" | ||
6 | eType="#//Request" containment="true"/> | ||
7 | <eStructuralFeatures xsi:type="ecore:EReference" name="applicationTypes" upperBound="-1" | ||
8 | eType="#//ApplicationType" containment="true"/> | ||
9 | <eStructuralFeatures xsi:type="ecore:EReference" name="hostTypes" upperBound="-1" | ||
10 | eType="#//HostType" containment="true"/> | ||
11 | </eClassifiers> | ||
12 | <eClassifiers xsi:type="ecore:EClass" name="ApplicationType"> | ||
13 | <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1" | ||
14 | eType="#//ApplicationInstance" containment="true" eOpposite="#//ApplicationInstance/type"/> | ||
15 | <eStructuralFeatures xsi:type="ecore:EReference" name="requirements" upperBound="-1" | ||
16 | eType="#//ResourceRequirement" containment="true"/> | ||
17 | </eClassifiers> | ||
18 | <eClassifiers xsi:type="ecore:EClass" name="HostType"> | ||
19 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultMemory" lowerBound="1" | ||
20 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
21 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="defaultHdd" lowerBound="1" | ||
22 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
23 | <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1" | ||
24 | eType="#//HostInstance" containment="true" eOpposite="#//HostInstance/type"/> | ||
25 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="cost" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
26 | </eClassifiers> | ||
27 | <eClassifiers xsi:type="ecore:EClass" name="Request"> | ||
28 | <eStructuralFeatures xsi:type="ecore:EReference" name="requirements" upperBound="-1" | ||
29 | eType="#//Requirement" containment="true" eOpposite="#//Requirement/request"/> | ||
30 | </eClassifiers> | ||
31 | <eClassifiers xsi:type="ecore:EClass" name="Requirement"> | ||
32 | <eStructuralFeatures xsi:type="ecore:EReference" name="request" lowerBound="1" | ||
33 | eType="#//Request" eOpposite="#//Request/requirements"/> | ||
34 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="count" lowerBound="1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
35 | <eStructuralFeatures xsi:type="ecore:EReference" name="type" eType="#//ApplicationType"/> | ||
36 | <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1" | ||
37 | eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/requirement"/> | ||
38 | </eClassifiers> | ||
39 | <eClassifiers xsi:type="ecore:EClass" name="ApplicationInstance"> | ||
40 | <eStructuralFeatures xsi:type="ecore:EReference" name="requirement" eType="#//Requirement" | ||
41 | eOpposite="#//Requirement/instances"/> | ||
42 | <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//ApplicationType" | ||
43 | eOpposite="#//ApplicationType/instances"/> | ||
44 | <eStructuralFeatures xsi:type="ecore:EReference" name="allocatedTo" lowerBound="1" | ||
45 | eType="#//HostInstance" eOpposite="#//HostInstance/applications"/> | ||
46 | </eClassifiers> | ||
47 | <eClassifiers xsi:type="ecore:EClass" name="ResourceRequirement"> | ||
48 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="requiredMemory" lowerBound="1" | ||
49 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
50 | <eStructuralFeatures xsi:type="ecore:EAttribute" name="requiredHdd" lowerBound="1" | ||
51 | eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"/> | ||
52 | <eStructuralFeatures xsi:type="ecore:EReference" name="hostType" lowerBound="1" | ||
53 | eType="#//HostType"/> | ||
54 | </eClassifiers> | ||
55 | <eClassifiers xsi:type="ecore:EClass" name="HostInstance"> | ||
56 | <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//HostType" | ||
57 | eOpposite="#//HostType/instances"/> | ||
58 | <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1" | ||
59 | eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/allocatedTo"/> | ||
60 | </eClassifiers> | ||
61 | </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 new file mode 100644 index 00000000..09ed2e0c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel | |||
@@ -0,0 +1,53 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <genmodel:GenModel 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" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" | ||
4 | modelDirectory="/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen" | ||
5 | creationIcons="false" editDirectory="/hu.bme.mit.inf.dslreasoner.domains.cps.edit/src-gen" | ||
6 | editorDirectory="/hu.bme.mit.inf.dslreasoner.domains.cps.editor/src-gen" modelPluginID="hu.bme.mit.inf.dslreasoner.domains.cps" | ||
7 | modelName="Cps" rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" | ||
8 | codeFormatting="true" importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" | ||
9 | copyrightFields="false" operationReflection="true" importOrganizing="true"> | ||
10 | <foreignModel>cps.ecore</foreignModel> | ||
11 | <testsDirectory xsi:nil="true"/> | ||
12 | <genPackages prefix="Cps" basePackage="hu.bme.mit.inf.dslreasoner.domains" disposableProviderFactory="true" | ||
13 | ecorePackage="cps.ecore#/"> | ||
14 | <genClasses ecoreClass="cps.ecore#//CyberPhysicalSystem"> | ||
15 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//CyberPhysicalSystem/requests"/> | ||
16 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//CyberPhysicalSystem/applicationTypes"/> | ||
17 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//CyberPhysicalSystem/hostTypes"/> | ||
18 | </genClasses> | ||
19 | <genClasses ecoreClass="cps.ecore#//ApplicationType"> | ||
20 | <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/instances"/> | ||
21 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/requirements"/> | ||
22 | </genClasses> | ||
23 | <genClasses ecoreClass="cps.ecore#//HostType"> | ||
24 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/defaultMemory"/> | ||
25 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/defaultHdd"/> | ||
26 | <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostType/instances"/> | ||
27 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostType/cost"/> | ||
28 | </genClasses> | ||
29 | <genClasses ecoreClass="cps.ecore#//Request"> | ||
30 | <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//Request/requirements"/> | ||
31 | </genClasses> | ||
32 | <genClasses ecoreClass="cps.ecore#//Requirement"> | ||
33 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//Requirement/request"/> | ||
34 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//Requirement/count"/> | ||
35 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//Requirement/type"/> | ||
36 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//Requirement/instances"/> | ||
37 | </genClasses> | ||
38 | <genClasses ecoreClass="cps.ecore#//ApplicationInstance"> | ||
39 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/requirement"/> | ||
40 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/type"/> | ||
41 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
42 | </genClasses> | ||
43 | <genClasses ecoreClass="cps.ecore#//ResourceRequirement"> | ||
44 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//ResourceRequirement/requiredMemory"/> | ||
45 | <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//ResourceRequirement/requiredHdd"/> | ||
46 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ResourceRequirement/hostType"/> | ||
47 | </genClasses> | ||
48 | <genClasses ecoreClass="cps.ecore#//HostInstance"> | ||
49 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/type"/> | ||
50 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/applications"/> | ||
51 | </genClasses> | ||
52 | </genPackages> | ||
53 | </genmodel:GenModel> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.henshin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.henshin new file mode 100644 index 00000000..a4f4f576 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.henshin | |||
@@ -0,0 +1,498 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <henshin:Module xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmi:id="_rUcIgHyxEemI79hpD-o6pA"> | ||
3 | <imports href="cps.ecore#/"/> | ||
4 | <units xsi:type="henshin:Rule" xmi:id="_ttviMHyxEemI79hpD-o6pA" name="createAppInstance"> | ||
5 | <lhs xmi:id="_tuVYEHyxEemI79hpD-o6pA" name="Lhs"> | ||
6 | <nodes xmi:id="_8OoYwHyxEemI79hpD-o6pA" name="req" outgoing="_APd7gHyzEemI79hpD-o6pA"> | ||
7 | <type href="cps.ecore#//Requirement"/> | ||
8 | </nodes> | ||
9 | <nodes xmi:id="__cBFUHyyEemI79hpD-o6pA" incoming="_APd7gHyzEemI79hpD-o6pA"> | ||
10 | <type href="cps.ecore#//ApplicationType"/> | ||
11 | </nodes> | ||
12 | <edges xmi:id="_APd7gHyzEemI79hpD-o6pA" source="_8OoYwHyxEemI79hpD-o6pA" target="__cBFUHyyEemI79hpD-o6pA"> | ||
13 | <type href="cps.ecore#//Requirement/type"/> | ||
14 | </edges> | ||
15 | </lhs> | ||
16 | <rhs xmi:id="_txSlcHyxEemI79hpD-o6pA" name="Rhs"> | ||
17 | <nodes xmi:id="_8OufYHyxEemI79hpD-o6pA" name="req" outgoing="_6YaokHyyEemI79hpD-o6pA _APd7gXyzEemI79hpD-o6pA"> | ||
18 | <type href="cps.ecore#//Requirement"/> | ||
19 | </nodes> | ||
20 | <nodes xmi:id="_KIXvwHyyEemI79hpD-o6pA" incoming="_6YaokHyyEemI79hpD-o6pA _AoFP0HyzEemI79hpD-o6pA"> | ||
21 | <type href="cps.ecore#//ApplicationInstance"/> | ||
22 | </nodes> | ||
23 | <nodes xmi:id="__cBFUXyyEemI79hpD-o6pA" incoming="_APd7gXyzEemI79hpD-o6pA" outgoing="_AoFP0HyzEemI79hpD-o6pA"> | ||
24 | <type href="cps.ecore#//ApplicationType"/> | ||
25 | </nodes> | ||
26 | <edges xmi:id="_6YaokHyyEemI79hpD-o6pA" source="_8OufYHyxEemI79hpD-o6pA" target="_KIXvwHyyEemI79hpD-o6pA"> | ||
27 | <type href="cps.ecore#//Requirement/instances"/> | ||
28 | </edges> | ||
29 | <edges xmi:id="_APd7gXyzEemI79hpD-o6pA" source="_8OufYHyxEemI79hpD-o6pA" target="__cBFUXyyEemI79hpD-o6pA"> | ||
30 | <type href="cps.ecore#//Requirement/type"/> | ||
31 | </edges> | ||
32 | <edges xmi:id="_AoFP0HyzEemI79hpD-o6pA" source="__cBFUXyyEemI79hpD-o6pA" target="_KIXvwHyyEemI79hpD-o6pA"> | ||
33 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
34 | </edges> | ||
35 | </rhs> | ||
36 | <mappings xmi:id="_8OufYXyxEemI79hpD-o6pA" origin="_8OoYwHyxEemI79hpD-o6pA" image="_8OufYHyxEemI79hpD-o6pA"/> | ||
37 | <mappings xmi:id="__cBsYHyyEemI79hpD-o6pA" origin="__cBFUHyyEemI79hpD-o6pA" image="__cBFUXyyEemI79hpD-o6pA"/> | ||
38 | </units> | ||
39 | <units xsi:type="henshin:Rule" xmi:id="_M36NQHy0EemI79hpD-o6pA" name="createHostInstance"> | ||
40 | <lhs xmi:id="_M4D-QHy0EemI79hpD-o6pA" name="Lhs"> | ||
41 | <nodes xmi:id="_ZpwIEHy0EemI79hpD-o6pA"> | ||
42 | <type href="cps.ecore#//HostType"/> | ||
43 | </nodes> | ||
44 | </lhs> | ||
45 | <rhs xmi:id="_M4HBkHy0EemI79hpD-o6pA" name="Rhs"> | ||
46 | <nodes xmi:id="_Zp2OsHy0EemI79hpD-o6pA" outgoing="_faZ4EHy0EemI79hpD-o6pA"> | ||
47 | <type href="cps.ecore#//HostType"/> | ||
48 | </nodes> | ||
49 | <nodes xmi:id="_bFDBYHy0EemI79hpD-o6pA" incoming="_faZ4EHy0EemI79hpD-o6pA"> | ||
50 | <type href="cps.ecore#//HostInstance"/> | ||
51 | </nodes> | ||
52 | <edges xmi:id="_faZ4EHy0EemI79hpD-o6pA" source="_Zp2OsHy0EemI79hpD-o6pA" target="_bFDBYHy0EemI79hpD-o6pA"> | ||
53 | <type href="cps.ecore#//HostType/instances"/> | ||
54 | </edges> | ||
55 | </rhs> | ||
56 | <mappings xmi:id="_Zp2OsXy0EemI79hpD-o6pA" origin="_ZpwIEHy0EemI79hpD-o6pA" image="_Zp2OsHy0EemI79hpD-o6pA"/> | ||
57 | </units> | ||
58 | <units xsi:type="henshin:Rule" xmi:id="_2yQIQHy0EemI79hpD-o6pA" name="deleteHostInstance"> | ||
59 | <lhs xmi:id="_2yTLkHy0EemI79hpD-o6pA" name="Lhs"> | ||
60 | <nodes xmi:id="_5jfg0Hy0EemI79hpD-o6pA" outgoing="_7KrhEHy0EemI79hpD-o6pA"> | ||
61 | <type href="cps.ecore#//HostType"/> | ||
62 | </nodes> | ||
63 | <nodes xmi:id="_6FqZwHy0EemI79hpD-o6pA" incoming="_7KrhEHy0EemI79hpD-o6pA"> | ||
64 | <type href="cps.ecore#//HostInstance"/> | ||
65 | </nodes> | ||
66 | <edges xmi:id="_7KrhEHy0EemI79hpD-o6pA" source="_5jfg0Hy0EemI79hpD-o6pA" target="_6FqZwHy0EemI79hpD-o6pA"> | ||
67 | <type href="cps.ecore#//HostType/instances"/> | ||
68 | </edges> | ||
69 | <formula xsi:type="henshin:Not" xmi:id="__tHxgHy0EemI79hpD-o6pA"> | ||
70 | <child xsi:type="henshin:NestedCondition" xmi:id="__tIYkHy0EemI79hpD-o6pA"> | ||
71 | <conclusion xmi:id="__tIYkXy0EemI79hpD-o6pA"> | ||
72 | <nodes xmi:id="_8lTsAHy0EemI79hpD-o6pA" outgoing="__HvMgHy0EemI79hpD-o6pA"> | ||
73 | <type href="cps.ecore#//ApplicationInstance"/> | ||
74 | </nodes> | ||
75 | <nodes xmi:id="__tI_oHy0EemI79hpD-o6pA" incoming="__HvMgHy0EemI79hpD-o6pA _AuDqEHy1EemI79hpD-o6pA"> | ||
76 | <type href="cps.ecore#//HostInstance"/> | ||
77 | </nodes> | ||
78 | <nodes xmi:id="_AuDDAHy1EemI79hpD-o6pA" outgoing="_AuDqEHy1EemI79hpD-o6pA"> | ||
79 | <type href="cps.ecore#//HostType"/> | ||
80 | </nodes> | ||
81 | <edges xmi:id="__HvMgHy0EemI79hpD-o6pA" source="_8lTsAHy0EemI79hpD-o6pA" target="__tI_oHy0EemI79hpD-o6pA"> | ||
82 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
83 | </edges> | ||
84 | <edges xmi:id="_AuDqEHy1EemI79hpD-o6pA" source="_AuDDAHy1EemI79hpD-o6pA" target="__tI_oHy0EemI79hpD-o6pA"> | ||
85 | <type href="cps.ecore#//HostType/instances"/> | ||
86 | </edges> | ||
87 | </conclusion> | ||
88 | <mappings xmi:id="__tI_oXy0EemI79hpD-o6pA" origin="_6FqZwHy0EemI79hpD-o6pA" image="__tI_oHy0EemI79hpD-o6pA"/> | ||
89 | <mappings xmi:id="_AuDDAXy1EemI79hpD-o6pA" origin="_5jfg0Hy0EemI79hpD-o6pA" image="_AuDDAHy1EemI79hpD-o6pA"/> | ||
90 | </child> | ||
91 | </formula> | ||
92 | </lhs> | ||
93 | <rhs xmi:id="_2yUZsHy0EemI79hpD-o6pA" name="Rhs"> | ||
94 | <nodes xmi:id="_5jfg0Xy0EemI79hpD-o6pA"> | ||
95 | <type href="cps.ecore#//HostType"/> | ||
96 | </nodes> | ||
97 | </rhs> | ||
98 | <mappings xmi:id="_5jfg0ny0EemI79hpD-o6pA" origin="_5jfg0Hy0EemI79hpD-o6pA" image="_5jfg0Xy0EemI79hpD-o6pA"/> | ||
99 | </units> | ||
100 | <units xsi:type="henshin:Rule" xmi:id="_W9WPYHy4EemI79hpD-o6pA" name="allocate"> | ||
101 | <lhs xmi:id="_W9ag0Hy4EemI79hpD-o6pA" name="Lhs"> | ||
102 | <nodes xmi:id="_QzQ2QHy5EemI79hpD-o6pA" outgoing="_hW5nsHy5EemI79hpD-o6pA"> | ||
103 | <type href="cps.ecore#//Requirement"/> | ||
104 | </nodes> | ||
105 | <nodes xmi:id="_U88ocHy5EemI79hpD-o6pA" outgoing="_epK2IHy5EemI79hpD-o6pA _f_l2gHy5EemI79hpD-o6pA"> | ||
106 | <type href="cps.ecore#//ApplicationType"/> | ||
107 | </nodes> | ||
108 | <nodes xmi:id="_WEdqIHy5EemI79hpD-o6pA" incoming="_f_l2gHy5EemI79hpD-o6pA _hW5nsHy5EemI79hpD-o6pA"> | ||
109 | <type href="cps.ecore#//ApplicationInstance"/> | ||
110 | </nodes> | ||
111 | <nodes xmi:id="_XGRscHy5EemI79hpD-o6pA" incoming="_fGY9oHy5EemI79hpD-o6pA" outgoing="_fggGwHy5EemI79hpD-o6pA"> | ||
112 | <type href="cps.ecore#//HostType"/> | ||
113 | </nodes> | ||
114 | <nodes xmi:id="_XfSpYHy5EemI79hpD-o6pA" incoming="_fggGwHy5EemI79hpD-o6pA"> | ||
115 | <type href="cps.ecore#//HostInstance"/> | ||
116 | </nodes> | ||
117 | <nodes xmi:id="_YuZg0Hy5EemI79hpD-o6pA" incoming="_epK2IHy5EemI79hpD-o6pA" outgoing="_fGY9oHy5EemI79hpD-o6pA"> | ||
118 | <type href="cps.ecore#//ResourceRequirement"/> | ||
119 | </nodes> | ||
120 | <edges xmi:id="_epK2IHy5EemI79hpD-o6pA" source="_U88ocHy5EemI79hpD-o6pA" target="_YuZg0Hy5EemI79hpD-o6pA"> | ||
121 | <type href="cps.ecore#//ApplicationType/requirements"/> | ||
122 | </edges> | ||
123 | <edges xmi:id="_fGY9oHy5EemI79hpD-o6pA" source="_YuZg0Hy5EemI79hpD-o6pA" target="_XGRscHy5EemI79hpD-o6pA"> | ||
124 | <type href="cps.ecore#//ResourceRequirement/hostType"/> | ||
125 | </edges> | ||
126 | <edges xmi:id="_fggGwHy5EemI79hpD-o6pA" source="_XGRscHy5EemI79hpD-o6pA" target="_XfSpYHy5EemI79hpD-o6pA"> | ||
127 | <type href="cps.ecore#//HostType/instances"/> | ||
128 | </edges> | ||
129 | <edges xmi:id="_f_l2gHy5EemI79hpD-o6pA" source="_U88ocHy5EemI79hpD-o6pA" target="_WEdqIHy5EemI79hpD-o6pA"> | ||
130 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
131 | </edges> | ||
132 | <edges xmi:id="_hW5nsHy5EemI79hpD-o6pA" source="_QzQ2QHy5EemI79hpD-o6pA" target="_WEdqIHy5EemI79hpD-o6pA"> | ||
133 | <type href="cps.ecore#//Requirement/instances"/> | ||
134 | </edges> | ||
135 | <formula xsi:type="henshin:And" xmi:id="_JNyfMH8VEemiUoPdWqOlQg"> | ||
136 | <left xsi:type="henshin:Not" xmi:id="_GpwcMX8VEemiUoPdWqOlQg"> | ||
137 | <child xsi:type="henshin:NestedCondition" xmi:id="_GpwcMn8VEemiUoPdWqOlQg"> | ||
138 | <conclusion xmi:id="_GpwcM38VEemiUoPdWqOlQg" name="2"> | ||
139 | <nodes xmi:id="_GpwcNH8VEemiUoPdWqOlQg" outgoing="_GpxDQn8VEemiUoPdWqOlQg"> | ||
140 | <type href="cps.ecore#//Requirement"/> | ||
141 | </nodes> | ||
142 | <nodes xmi:id="_GpxDQH8VEemiUoPdWqOlQg" incoming="_GpxDQn8VEemiUoPdWqOlQg _GpxDSH8VEemiUoPdWqOlQg" outgoing="_LOADcH8VEemiUoPdWqOlQg"> | ||
143 | <type href="cps.ecore#//ApplicationInstance"/> | ||
144 | </nodes> | ||
145 | <nodes xmi:id="_GpxDQ38VEemiUoPdWqOlQg" outgoing="_GpxDR38VEemiUoPdWqOlQg _GpxDSH8VEemiUoPdWqOlQg"> | ||
146 | <type href="cps.ecore#//ApplicationType"/> | ||
147 | </nodes> | ||
148 | <nodes xmi:id="_GpxDRX8VEemiUoPdWqOlQg" incoming="_GpxDR38VEemiUoPdWqOlQg" outgoing="_GpxqUH8VEemiUoPdWqOlQg"> | ||
149 | <type href="cps.ecore#//ResourceRequirement"/> | ||
150 | </nodes> | ||
151 | <nodes xmi:id="_GpxDSX8VEemiUoPdWqOlQg" incoming="_GpxqUH8VEemiUoPdWqOlQg" outgoing="_GpxqU38VEemiUoPdWqOlQg"> | ||
152 | <type href="cps.ecore#//HostType"/> | ||
153 | </nodes> | ||
154 | <nodes xmi:id="_GpxqUX8VEemiUoPdWqOlQg" incoming="_GpxqU38VEemiUoPdWqOlQg"> | ||
155 | <type href="cps.ecore#//HostInstance"/> | ||
156 | </nodes> | ||
157 | <nodes xmi:id="_DK7k4H8VEemiUoPdWqOlQg" description="" incoming="_LOADcH8VEemiUoPdWqOlQg"> | ||
158 | <type href="cps.ecore#//HostInstance"/> | ||
159 | </nodes> | ||
160 | <edges xmi:id="_GpxDQn8VEemiUoPdWqOlQg" source="_GpwcNH8VEemiUoPdWqOlQg" target="_GpxDQH8VEemiUoPdWqOlQg"> | ||
161 | <type href="cps.ecore#//Requirement/instances"/> | ||
162 | </edges> | ||
163 | <edges xmi:id="_GpxDR38VEemiUoPdWqOlQg" source="_GpxDQ38VEemiUoPdWqOlQg" target="_GpxDRX8VEemiUoPdWqOlQg"> | ||
164 | <type href="cps.ecore#//ApplicationType/requirements"/> | ||
165 | </edges> | ||
166 | <edges xmi:id="_GpxDSH8VEemiUoPdWqOlQg" source="_GpxDQ38VEemiUoPdWqOlQg" target="_GpxDQH8VEemiUoPdWqOlQg"> | ||
167 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
168 | </edges> | ||
169 | <edges xmi:id="_GpxqUH8VEemiUoPdWqOlQg" source="_GpxDRX8VEemiUoPdWqOlQg" target="_GpxDSX8VEemiUoPdWqOlQg"> | ||
170 | <type href="cps.ecore#//ResourceRequirement/hostType"/> | ||
171 | </edges> | ||
172 | <edges xmi:id="_GpxqU38VEemiUoPdWqOlQg" source="_GpxDSX8VEemiUoPdWqOlQg" target="_GpxqUX8VEemiUoPdWqOlQg"> | ||
173 | <type href="cps.ecore#//HostType/instances"/> | ||
174 | </edges> | ||
175 | <edges xmi:id="_LOADcH8VEemiUoPdWqOlQg" source="_GpxDQH8VEemiUoPdWqOlQg" target="_DK7k4H8VEemiUoPdWqOlQg"> | ||
176 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
177 | </edges> | ||
178 | </conclusion> | ||
179 | <mappings xmi:id="_GpwcNX8VEemiUoPdWqOlQg" origin="_QzQ2QHy5EemI79hpD-o6pA" image="_GpwcNH8VEemiUoPdWqOlQg"/> | ||
180 | <mappings xmi:id="_GpxDQX8VEemiUoPdWqOlQg" origin="_WEdqIHy5EemI79hpD-o6pA" image="_GpxDQH8VEemiUoPdWqOlQg"/> | ||
181 | <mappings xmi:id="_GpxDRH8VEemiUoPdWqOlQg" origin="_U88ocHy5EemI79hpD-o6pA" image="_GpxDQ38VEemiUoPdWqOlQg"/> | ||
182 | <mappings xmi:id="_GpxDRn8VEemiUoPdWqOlQg" origin="_YuZg0Hy5EemI79hpD-o6pA" image="_GpxDRX8VEemiUoPdWqOlQg"/> | ||
183 | <mappings xmi:id="_GpxDSn8VEemiUoPdWqOlQg" origin="_XGRscHy5EemI79hpD-o6pA" image="_GpxDSX8VEemiUoPdWqOlQg"/> | ||
184 | <mappings xmi:id="_GpxqUn8VEemiUoPdWqOlQg" origin="_XfSpYHy5EemI79hpD-o6pA" image="_GpxqUX8VEemiUoPdWqOlQg"/> | ||
185 | </child> | ||
186 | </left> | ||
187 | <right xsi:type="henshin:Not" xmi:id="_JNyfMX8VEemiUoPdWqOlQg"> | ||
188 | <child xsi:type="henshin:NestedCondition" xmi:id="_JNzGQH8VEemiUoPdWqOlQg"> | ||
189 | <conclusion xmi:id="_JNzGQX8VEemiUoPdWqOlQg" name="1"> | ||
190 | <nodes xmi:id="_JNzGQn8VEemiUoPdWqOlQg" outgoing="_JNztUH8VEemiUoPdWqOlQg _mLtagHy5EemI79hpD-o6pA"> | ||
191 | <type href="cps.ecore#//Requirement"/> | ||
192 | </nodes> | ||
193 | <nodes xmi:id="_JNzGRH8VEemiUoPdWqOlQg" incoming="_JNztUH8VEemiUoPdWqOlQg _JN0UY38VEemiUoPdWqOlQg"> | ||
194 | <type href="cps.ecore#//ApplicationInstance"/> | ||
195 | </nodes> | ||
196 | <nodes xmi:id="_iu3gMHy5EemI79hpD-o6pA" incoming="_mLtagHy5EemI79hpD-o6pA" outgoing="_l0ud4Hy5EemI79hpD-o6pA"> | ||
197 | <type href="cps.ecore#//ApplicationInstance"/> | ||
198 | </nodes> | ||
199 | <nodes xmi:id="_JNztVH8VEemiUoPdWqOlQg" outgoing="_JN0UYn8VEemiUoPdWqOlQg _JN0UY38VEemiUoPdWqOlQg"> | ||
200 | <type href="cps.ecore#//ApplicationType"/> | ||
201 | </nodes> | ||
202 | <nodes xmi:id="_JN0UYH8VEemiUoPdWqOlQg" incoming="_JN0UYn8VEemiUoPdWqOlQg" outgoing="_JN07cn8VEemiUoPdWqOlQg"> | ||
203 | <type href="cps.ecore#//ResourceRequirement"/> | ||
204 | </nodes> | ||
205 | <nodes xmi:id="_JN07cH8VEemiUoPdWqOlQg" incoming="_JN07cn8VEemiUoPdWqOlQg" outgoing="_JN1igX8VEemiUoPdWqOlQg"> | ||
206 | <type href="cps.ecore#//HostType"/> | ||
207 | </nodes> | ||
208 | <nodes xmi:id="_JN07c38VEemiUoPdWqOlQg" incoming="_JN1igX8VEemiUoPdWqOlQg _l0ud4Hy5EemI79hpD-o6pA"> | ||
209 | <type href="cps.ecore#//HostInstance"/> | ||
210 | </nodes> | ||
211 | <edges xmi:id="_JNztUH8VEemiUoPdWqOlQg" source="_JNzGQn8VEemiUoPdWqOlQg" target="_JNzGRH8VEemiUoPdWqOlQg"> | ||
212 | <type href="cps.ecore#//Requirement/instances"/> | ||
213 | </edges> | ||
214 | <edges xmi:id="_JN0UYn8VEemiUoPdWqOlQg" source="_JNztVH8VEemiUoPdWqOlQg" target="_JN0UYH8VEemiUoPdWqOlQg"> | ||
215 | <type href="cps.ecore#//ApplicationType/requirements"/> | ||
216 | </edges> | ||
217 | <edges xmi:id="_JN0UY38VEemiUoPdWqOlQg" source="_JNztVH8VEemiUoPdWqOlQg" target="_JNzGRH8VEemiUoPdWqOlQg"> | ||
218 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
219 | </edges> | ||
220 | <edges xmi:id="_JN07cn8VEemiUoPdWqOlQg" source="_JN0UYH8VEemiUoPdWqOlQg" target="_JN07cH8VEemiUoPdWqOlQg"> | ||
221 | <type href="cps.ecore#//ResourceRequirement/hostType"/> | ||
222 | </edges> | ||
223 | <edges xmi:id="_JN1igX8VEemiUoPdWqOlQg" source="_JN07cH8VEemiUoPdWqOlQg" target="_JN07c38VEemiUoPdWqOlQg"> | ||
224 | <type href="cps.ecore#//HostType/instances"/> | ||
225 | </edges> | ||
226 | <edges xmi:id="_mLtagHy5EemI79hpD-o6pA" source="_JNzGQn8VEemiUoPdWqOlQg" target="_iu3gMHy5EemI79hpD-o6pA"> | ||
227 | <type href="cps.ecore#//Requirement/instances"/> | ||
228 | </edges> | ||
229 | <edges xmi:id="_l0ud4Hy5EemI79hpD-o6pA" source="_iu3gMHy5EemI79hpD-o6pA" target="_JN07c38VEemiUoPdWqOlQg"> | ||
230 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
231 | </edges> | ||
232 | </conclusion> | ||
233 | <mappings xmi:id="_JNzGQ38VEemiUoPdWqOlQg" origin="_QzQ2QHy5EemI79hpD-o6pA" image="_JNzGQn8VEemiUoPdWqOlQg"/> | ||
234 | <mappings xmi:id="_JNzGRX8VEemiUoPdWqOlQg" origin="_WEdqIHy5EemI79hpD-o6pA" image="_JNzGRH8VEemiUoPdWqOlQg"/> | ||
235 | <mappings xmi:id="_JNztVX8VEemiUoPdWqOlQg" origin="_U88ocHy5EemI79hpD-o6pA" image="_JNztVH8VEemiUoPdWqOlQg"/> | ||
236 | <mappings xmi:id="_JN0UYX8VEemiUoPdWqOlQg" origin="_YuZg0Hy5EemI79hpD-o6pA" image="_JN0UYH8VEemiUoPdWqOlQg"/> | ||
237 | <mappings xmi:id="_JN07cX8VEemiUoPdWqOlQg" origin="_XGRscHy5EemI79hpD-o6pA" image="_JN07cH8VEemiUoPdWqOlQg"/> | ||
238 | <mappings xmi:id="_JN1igH8VEemiUoPdWqOlQg" origin="_XfSpYHy5EemI79hpD-o6pA" image="_JN07c38VEemiUoPdWqOlQg"/> | ||
239 | </child> | ||
240 | </right> | ||
241 | </formula> | ||
242 | </lhs> | ||
243 | <rhs xmi:id="_W9bH4Hy4EemI79hpD-o6pA" name="Rhs"> | ||
244 | <nodes xmi:id="_QzT5kHy5EemI79hpD-o6pA" outgoing="_hW5nsXy5EemI79hpD-o6pA"> | ||
245 | <type href="cps.ecore#//Requirement"/> | ||
246 | </nodes> | ||
247 | <nodes xmi:id="_U89PgHy5EemI79hpD-o6pA" outgoing="_epK2IXy5EemI79hpD-o6pA _f_l2gXy5EemI79hpD-o6pA"> | ||
248 | <type href="cps.ecore#//ApplicationType"/> | ||
249 | </nodes> | ||
250 | <nodes xmi:id="_WEdqIXy5EemI79hpD-o6pA" incoming="_f_l2gXy5EemI79hpD-o6pA _hW5nsXy5EemI79hpD-o6pA" outgoing="_gh0Z0Hy5EemI79hpD-o6pA"> | ||
251 | <type href="cps.ecore#//ApplicationInstance"/> | ||
252 | </nodes> | ||
253 | <nodes xmi:id="_XGRscXy5EemI79hpD-o6pA" incoming="_fGY9oXy5EemI79hpD-o6pA" outgoing="_fggGwXy5EemI79hpD-o6pA"> | ||
254 | <type href="cps.ecore#//HostType"/> | ||
255 | </nodes> | ||
256 | <nodes xmi:id="_XfSpYXy5EemI79hpD-o6pA" incoming="_fggGwXy5EemI79hpD-o6pA _gh0Z0Hy5EemI79hpD-o6pA"> | ||
257 | <type href="cps.ecore#//HostInstance"/> | ||
258 | </nodes> | ||
259 | <nodes xmi:id="_YuZg0Xy5EemI79hpD-o6pA" incoming="_epK2IXy5EemI79hpD-o6pA" outgoing="_fGY9oXy5EemI79hpD-o6pA"> | ||
260 | <type href="cps.ecore#//ResourceRequirement"/> | ||
261 | </nodes> | ||
262 | <edges xmi:id="_epK2IXy5EemI79hpD-o6pA" source="_U89PgHy5EemI79hpD-o6pA" target="_YuZg0Xy5EemI79hpD-o6pA"> | ||
263 | <type href="cps.ecore#//ApplicationType/requirements"/> | ||
264 | </edges> | ||
265 | <edges xmi:id="_fGY9oXy5EemI79hpD-o6pA" source="_YuZg0Xy5EemI79hpD-o6pA" target="_XGRscXy5EemI79hpD-o6pA"> | ||
266 | <type href="cps.ecore#//ResourceRequirement/hostType"/> | ||
267 | </edges> | ||
268 | <edges xmi:id="_fggGwXy5EemI79hpD-o6pA" source="_XGRscXy5EemI79hpD-o6pA" target="_XfSpYXy5EemI79hpD-o6pA"> | ||
269 | <type href="cps.ecore#//HostType/instances"/> | ||
270 | </edges> | ||
271 | <edges xmi:id="_f_l2gXy5EemI79hpD-o6pA" source="_U89PgHy5EemI79hpD-o6pA" target="_WEdqIXy5EemI79hpD-o6pA"> | ||
272 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
273 | </edges> | ||
274 | <edges xmi:id="_gh0Z0Hy5EemI79hpD-o6pA" source="_WEdqIXy5EemI79hpD-o6pA" target="_XfSpYXy5EemI79hpD-o6pA"> | ||
275 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
276 | </edges> | ||
277 | <edges xmi:id="_hW5nsXy5EemI79hpD-o6pA" source="_QzT5kHy5EemI79hpD-o6pA" target="_WEdqIXy5EemI79hpD-o6pA"> | ||
278 | <type href="cps.ecore#//Requirement/instances"/> | ||
279 | </edges> | ||
280 | </rhs> | ||
281 | <mappings xmi:id="_QzUgoHy5EemI79hpD-o6pA" origin="_QzQ2QHy5EemI79hpD-o6pA" image="_QzT5kHy5EemI79hpD-o6pA"/> | ||
282 | <mappings xmi:id="_U89PgXy5EemI79hpD-o6pA" origin="_U88ocHy5EemI79hpD-o6pA" image="_U89PgHy5EemI79hpD-o6pA"/> | ||
283 | <mappings xmi:id="_WEdqIny5EemI79hpD-o6pA" origin="_WEdqIHy5EemI79hpD-o6pA" image="_WEdqIXy5EemI79hpD-o6pA"/> | ||
284 | <mappings xmi:id="_XGRscny5EemI79hpD-o6pA" origin="_XGRscHy5EemI79hpD-o6pA" image="_XGRscXy5EemI79hpD-o6pA"/> | ||
285 | <mappings xmi:id="_XfSpYny5EemI79hpD-o6pA" origin="_XfSpYHy5EemI79hpD-o6pA" image="_XfSpYXy5EemI79hpD-o6pA"/> | ||
286 | <mappings xmi:id="_YuZg0ny5EemI79hpD-o6pA" origin="_YuZg0Hy5EemI79hpD-o6pA" image="_YuZg0Xy5EemI79hpD-o6pA"/> | ||
287 | </units> | ||
288 | <units xsi:type="henshin:Rule" xmi:id="_1VgrMHy5EemI79hpD-o6pA" name="unallocate"> | ||
289 | <lhs xmi:id="_1Vk8oHy5EemI79hpD-o6pA" name="Lhs"> | ||
290 | <nodes xmi:id="_OdtesHy6EemI79hpD-o6pA" outgoing="_UpBxcHy6EemI79hpD-o6pA"> | ||
291 | <type href="cps.ecore#//ApplicationInstance"/> | ||
292 | </nodes> | ||
293 | <nodes xmi:id="_PGadcHy6EemI79hpD-o6pA" incoming="_UpBxcHy6EemI79hpD-o6pA"> | ||
294 | <type href="cps.ecore#//HostInstance"/> | ||
295 | </nodes> | ||
296 | <edges xmi:id="_UpBxcHy6EemI79hpD-o6pA" source="_OdtesHy6EemI79hpD-o6pA" target="_PGadcHy6EemI79hpD-o6pA"> | ||
297 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
298 | </edges> | ||
299 | </lhs> | ||
300 | <rhs xmi:id="_1VmKwHy5EemI79hpD-o6pA" name="Rhs"> | ||
301 | <nodes xmi:id="_OdwiAHy6EemI79hpD-o6pA"> | ||
302 | <type href="cps.ecore#//ApplicationInstance"/> | ||
303 | </nodes> | ||
304 | <nodes xmi:id="_PGadcXy6EemI79hpD-o6pA"> | ||
305 | <type href="cps.ecore#//HostInstance"/> | ||
306 | </nodes> | ||
307 | </rhs> | ||
308 | <mappings xmi:id="_OdwiAXy6EemI79hpD-o6pA" origin="_OdtesHy6EemI79hpD-o6pA" image="_OdwiAHy6EemI79hpD-o6pA"/> | ||
309 | <mappings xmi:id="_PGadcny6EemI79hpD-o6pA" origin="_PGadcHy6EemI79hpD-o6pA" image="_PGadcXy6EemI79hpD-o6pA"/> | ||
310 | </units> | ||
311 | <units xsi:type="henshin:Rule" xmi:id="_4lbl0H8UEemiUoPdWqOlQg" name="reallocate"> | ||
312 | <lhs xmi:id="_4lkvwH8UEemiUoPdWqOlQg" name="Lhs"> | ||
313 | <nodes xmi:id="_VfKxQH8VEemiUoPdWqOlQg" outgoing="_uW8jIH8VEemiUoPdWqOlQg"> | ||
314 | <type href="cps.ecore#//Requirement"/> | ||
315 | </nodes> | ||
316 | <nodes xmi:id="_WJkZIH8VEemiUoPdWqOlQg" outgoing="_4SqlYH8VEemiUoPdWqOlQg _44kHwH8VEemiUoPdWqOlQg"> | ||
317 | <type href="cps.ecore#//ApplicationType"/> | ||
318 | </nodes> | ||
319 | <nodes xmi:id="_Yz9i0H8VEemiUoPdWqOlQg" incoming="_5r5CIH8VEemiUoPdWqOlQg"> | ||
320 | <type href="cps.ecore#//HostInstance"/> | ||
321 | </nodes> | ||
322 | <nodes xmi:id="_cTchcH8VEemiUoPdWqOlQg" incoming="_uW8jIH8VEemiUoPdWqOlQg _4SqlYH8VEemiUoPdWqOlQg" outgoing="_3NH5oH8VEemiUoPdWqOlQg"> | ||
323 | <type href="cps.ecore#//ApplicationInstance"/> | ||
324 | </nodes> | ||
325 | <nodes xmi:id="_fYauUH8VEemiUoPdWqOlQg" incoming="_44kHwH8VEemiUoPdWqOlQg" outgoing="_5Rch0H8VEemiUoPdWqOlQg"> | ||
326 | <type href="cps.ecore#//ResourceRequirement"/> | ||
327 | </nodes> | ||
328 | <nodes xmi:id="_kl-_YH8VEemiUoPdWqOlQg" incoming="_5Rch0H8VEemiUoPdWqOlQg" outgoing="_5r5CIH8VEemiUoPdWqOlQg"> | ||
329 | <type href="cps.ecore#//HostType"/> | ||
330 | </nodes> | ||
331 | <nodes xmi:id="_wZrP4H8VEemiUoPdWqOlQg" incoming="_3NH5oH8VEemiUoPdWqOlQg"> | ||
332 | <type href="cps.ecore#//HostInstance"/> | ||
333 | </nodes> | ||
334 | <edges xmi:id="_uW8jIH8VEemiUoPdWqOlQg" source="_VfKxQH8VEemiUoPdWqOlQg" target="_cTchcH8VEemiUoPdWqOlQg"> | ||
335 | <type href="cps.ecore#//Requirement/instances"/> | ||
336 | </edges> | ||
337 | <edges xmi:id="_4SqlYH8VEemiUoPdWqOlQg" source="_WJkZIH8VEemiUoPdWqOlQg" target="_cTchcH8VEemiUoPdWqOlQg"> | ||
338 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
339 | </edges> | ||
340 | <edges xmi:id="_44kHwH8VEemiUoPdWqOlQg" source="_WJkZIH8VEemiUoPdWqOlQg" target="_fYauUH8VEemiUoPdWqOlQg"> | ||
341 | <type href="cps.ecore#//ApplicationType/requirements"/> | ||
342 | </edges> | ||
343 | <edges xmi:id="_5Rch0H8VEemiUoPdWqOlQg" source="_fYauUH8VEemiUoPdWqOlQg" target="_kl-_YH8VEemiUoPdWqOlQg"> | ||
344 | <type href="cps.ecore#//ResourceRequirement/hostType"/> | ||
345 | </edges> | ||
346 | <edges xmi:id="_5r5CIH8VEemiUoPdWqOlQg" source="_kl-_YH8VEemiUoPdWqOlQg" target="_Yz9i0H8VEemiUoPdWqOlQg"> | ||
347 | <type href="cps.ecore#//HostType/instances"/> | ||
348 | </edges> | ||
349 | <edges xmi:id="_3NH5oH8VEemiUoPdWqOlQg" source="_cTchcH8VEemiUoPdWqOlQg" target="_wZrP4H8VEemiUoPdWqOlQg"> | ||
350 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
351 | </edges> | ||
352 | <formula xsi:type="henshin:Not" xmi:id="_9Q-5gH8VEemiUoPdWqOlQg"> | ||
353 | <child xsi:type="henshin:NestedCondition" xmi:id="_9Q-5gX8VEemiUoPdWqOlQg"> | ||
354 | <conclusion xmi:id="_9Q-5gn8VEemiUoPdWqOlQg"> | ||
355 | <nodes xmi:id="_9Q-5g38VEemiUoPdWqOlQg" outgoing="_9Q-5h38VEemiUoPdWqOlQg _ulPd0H8VEemiUoPdWqOlQg"> | ||
356 | <type href="cps.ecore#//Requirement"/> | ||
357 | </nodes> | ||
358 | <nodes xmi:id="_9Q-5hX8VEemiUoPdWqOlQg" incoming="_9Q-5h38VEemiUoPdWqOlQg _9Q-5jX8VEemiUoPdWqOlQg" outgoing="_9Q-5mH8VEemiUoPdWqOlQg"> | ||
359 | <type href="cps.ecore#//ApplicationInstance"/> | ||
360 | </nodes> | ||
361 | <nodes xmi:id="_Xr-AAH8VEemiUoPdWqOlQg" incoming="_ulPd0H8VEemiUoPdWqOlQg" outgoing="_-vrFEH8VEemiUoPdWqOlQg"> | ||
362 | <type href="cps.ecore#//ApplicationInstance"/> | ||
363 | </nodes> | ||
364 | <nodes xmi:id="_9Q-5i38VEemiUoPdWqOlQg" outgoing="_9Q-5jX8VEemiUoPdWqOlQg _9Q-5kH8VEemiUoPdWqOlQg"> | ||
365 | <type href="cps.ecore#//ApplicationType"/> | ||
366 | </nodes> | ||
367 | <nodes xmi:id="_9Q-5jn8VEemiUoPdWqOlQg" incoming="_9Q-5kH8VEemiUoPdWqOlQg" outgoing="_9Q-5mX8VEemiUoPdWqOlQg"> | ||
368 | <type href="cps.ecore#//ResourceRequirement"/> | ||
369 | </nodes> | ||
370 | <nodes xmi:id="_9Q-5kX8VEemiUoPdWqOlQg" incoming="_9Q-5lX8VEemiUoPdWqOlQg _-vrFEH8VEemiUoPdWqOlQg"> | ||
371 | <type href="cps.ecore#//HostInstance"/> | ||
372 | </nodes> | ||
373 | <nodes xmi:id="_9Q-5k38VEemiUoPdWqOlQg" incoming="_9Q-5mX8VEemiUoPdWqOlQg" outgoing="_9Q-5lX8VEemiUoPdWqOlQg"> | ||
374 | <type href="cps.ecore#//HostType"/> | ||
375 | </nodes> | ||
376 | <nodes xmi:id="_9Q-5ln8VEemiUoPdWqOlQg" incoming="_9Q-5mH8VEemiUoPdWqOlQg"> | ||
377 | <type href="cps.ecore#//HostInstance"/> | ||
378 | </nodes> | ||
379 | <edges xmi:id="_9Q-5h38VEemiUoPdWqOlQg" source="_9Q-5g38VEemiUoPdWqOlQg" target="_9Q-5hX8VEemiUoPdWqOlQg"> | ||
380 | <type href="cps.ecore#//Requirement/instances"/> | ||
381 | </edges> | ||
382 | <edges xmi:id="_9Q-5jX8VEemiUoPdWqOlQg" source="_9Q-5i38VEemiUoPdWqOlQg" target="_9Q-5hX8VEemiUoPdWqOlQg"> | ||
383 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
384 | </edges> | ||
385 | <edges xmi:id="_9Q-5kH8VEemiUoPdWqOlQg" source="_9Q-5i38VEemiUoPdWqOlQg" target="_9Q-5jn8VEemiUoPdWqOlQg"> | ||
386 | <type href="cps.ecore#//ApplicationType/requirements"/> | ||
387 | </edges> | ||
388 | <edges xmi:id="_9Q-5lX8VEemiUoPdWqOlQg" source="_9Q-5k38VEemiUoPdWqOlQg" target="_9Q-5kX8VEemiUoPdWqOlQg"> | ||
389 | <type href="cps.ecore#//HostType/instances"/> | ||
390 | </edges> | ||
391 | <edges xmi:id="_9Q-5mH8VEemiUoPdWqOlQg" source="_9Q-5hX8VEemiUoPdWqOlQg" target="_9Q-5ln8VEemiUoPdWqOlQg"> | ||
392 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
393 | </edges> | ||
394 | <edges xmi:id="_9Q-5mX8VEemiUoPdWqOlQg" source="_9Q-5jn8VEemiUoPdWqOlQg" target="_9Q-5k38VEemiUoPdWqOlQg"> | ||
395 | <type href="cps.ecore#//ResourceRequirement/hostType"/> | ||
396 | </edges> | ||
397 | <edges xmi:id="_ulPd0H8VEemiUoPdWqOlQg" source="_9Q-5g38VEemiUoPdWqOlQg" target="_Xr-AAH8VEemiUoPdWqOlQg"> | ||
398 | <type href="cps.ecore#//Requirement/instances"/> | ||
399 | </edges> | ||
400 | <edges xmi:id="_-vrFEH8VEemiUoPdWqOlQg" source="_Xr-AAH8VEemiUoPdWqOlQg" target="_9Q-5kX8VEemiUoPdWqOlQg"> | ||
401 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
402 | </edges> | ||
403 | </conclusion> | ||
404 | <mappings xmi:id="_9Q-5hH8VEemiUoPdWqOlQg" origin="_VfKxQH8VEemiUoPdWqOlQg" image="_9Q-5g38VEemiUoPdWqOlQg"/> | ||
405 | <mappings xmi:id="_9Q-5hn8VEemiUoPdWqOlQg" origin="_cTchcH8VEemiUoPdWqOlQg" image="_9Q-5hX8VEemiUoPdWqOlQg"/> | ||
406 | <mappings xmi:id="_9Q-5jH8VEemiUoPdWqOlQg" origin="_WJkZIH8VEemiUoPdWqOlQg" image="_9Q-5i38VEemiUoPdWqOlQg"/> | ||
407 | <mappings xmi:id="_9Q-5j38VEemiUoPdWqOlQg" origin="_fYauUH8VEemiUoPdWqOlQg" image="_9Q-5jn8VEemiUoPdWqOlQg"/> | ||
408 | <mappings xmi:id="_9Q-5kn8VEemiUoPdWqOlQg" origin="_Yz9i0H8VEemiUoPdWqOlQg" image="_9Q-5kX8VEemiUoPdWqOlQg"/> | ||
409 | <mappings xmi:id="_9Q-5lH8VEemiUoPdWqOlQg" origin="_kl-_YH8VEemiUoPdWqOlQg" image="_9Q-5k38VEemiUoPdWqOlQg"/> | ||
410 | <mappings xmi:id="_9Q-5l38VEemiUoPdWqOlQg" origin="_wZrP4H8VEemiUoPdWqOlQg" image="_9Q-5ln8VEemiUoPdWqOlQg"/> | ||
411 | </child> | ||
412 | </formula> | ||
413 | </lhs> | ||
414 | <rhs xmi:id="_4lnMAH8UEemiUoPdWqOlQg" name="Rhs"> | ||
415 | <nodes xmi:id="_VfNNgH8VEemiUoPdWqOlQg" outgoing="_uW9KMH8VEemiUoPdWqOlQg"> | ||
416 | <type href="cps.ecore#//Requirement"/> | ||
417 | </nodes> | ||
418 | <nodes xmi:id="_WJkZIX8VEemiUoPdWqOlQg" outgoing="_4SqlYX8VEemiUoPdWqOlQg _44kHwX8VEemiUoPdWqOlQg"> | ||
419 | <type href="cps.ecore#//ApplicationType"/> | ||
420 | </nodes> | ||
421 | <nodes xmi:id="_Y0DCYH8VEemiUoPdWqOlQg" incoming="_5r5CIX8VEemiUoPdWqOlQg __Te8wH8VEemiUoPdWqOlQg"> | ||
422 | <type href="cps.ecore#//HostInstance"/> | ||
423 | </nodes> | ||
424 | <nodes xmi:id="_cTchcX8VEemiUoPdWqOlQg" incoming="_uW9KMH8VEemiUoPdWqOlQg _4SqlYX8VEemiUoPdWqOlQg" outgoing="__Te8wH8VEemiUoPdWqOlQg"> | ||
425 | <type href="cps.ecore#//ApplicationInstance"/> | ||
426 | </nodes> | ||
427 | <nodes xmi:id="_fYbVYH8VEemiUoPdWqOlQg" incoming="_44kHwX8VEemiUoPdWqOlQg" outgoing="_5Rch0X8VEemiUoPdWqOlQg"> | ||
428 | <type href="cps.ecore#//ResourceRequirement"/> | ||
429 | </nodes> | ||
430 | <nodes xmi:id="_kl-_YX8VEemiUoPdWqOlQg" incoming="_5Rch0X8VEemiUoPdWqOlQg" outgoing="_5r5CIX8VEemiUoPdWqOlQg"> | ||
431 | <type href="cps.ecore#//HostType"/> | ||
432 | </nodes> | ||
433 | <nodes xmi:id="_6wB_sH8VEemiUoPdWqOlQg"> | ||
434 | <type href="cps.ecore#//HostInstance"/> | ||
435 | </nodes> | ||
436 | <edges xmi:id="_uW9KMH8VEemiUoPdWqOlQg" source="_VfNNgH8VEemiUoPdWqOlQg" target="_cTchcX8VEemiUoPdWqOlQg"> | ||
437 | <type href="cps.ecore#//Requirement/instances"/> | ||
438 | </edges> | ||
439 | <edges xmi:id="_4SqlYX8VEemiUoPdWqOlQg" source="_WJkZIX8VEemiUoPdWqOlQg" target="_cTchcX8VEemiUoPdWqOlQg"> | ||
440 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
441 | </edges> | ||
442 | <edges xmi:id="_44kHwX8VEemiUoPdWqOlQg" source="_WJkZIX8VEemiUoPdWqOlQg" target="_fYbVYH8VEemiUoPdWqOlQg"> | ||
443 | <type href="cps.ecore#//ApplicationType/requirements"/> | ||
444 | </edges> | ||
445 | <edges xmi:id="_5Rch0X8VEemiUoPdWqOlQg" source="_fYbVYH8VEemiUoPdWqOlQg" target="_kl-_YX8VEemiUoPdWqOlQg"> | ||
446 | <type href="cps.ecore#//ResourceRequirement/hostType"/> | ||
447 | </edges> | ||
448 | <edges xmi:id="_5r5CIX8VEemiUoPdWqOlQg" source="_kl-_YX8VEemiUoPdWqOlQg" target="_Y0DCYH8VEemiUoPdWqOlQg"> | ||
449 | <type href="cps.ecore#//HostType/instances"/> | ||
450 | </edges> | ||
451 | <edges xmi:id="__Te8wH8VEemiUoPdWqOlQg" source="_cTchcX8VEemiUoPdWqOlQg" target="_Y0DCYH8VEemiUoPdWqOlQg"> | ||
452 | <type href="cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
453 | </edges> | ||
454 | </rhs> | ||
455 | <mappings xmi:id="_VfNNgX8VEemiUoPdWqOlQg" origin="_VfKxQH8VEemiUoPdWqOlQg" image="_VfNNgH8VEemiUoPdWqOlQg"/> | ||
456 | <mappings xmi:id="_WJkZIn8VEemiUoPdWqOlQg" origin="_WJkZIH8VEemiUoPdWqOlQg" image="_WJkZIX8VEemiUoPdWqOlQg"/> | ||
457 | <mappings xmi:id="_Y0DCYX8VEemiUoPdWqOlQg" origin="_Yz9i0H8VEemiUoPdWqOlQg" image="_Y0DCYH8VEemiUoPdWqOlQg"/> | ||
458 | <mappings xmi:id="_cTchcn8VEemiUoPdWqOlQg" origin="_cTchcH8VEemiUoPdWqOlQg" image="_cTchcX8VEemiUoPdWqOlQg"/> | ||
459 | <mappings xmi:id="_fYbVYX8VEemiUoPdWqOlQg" origin="_fYauUH8VEemiUoPdWqOlQg" image="_fYbVYH8VEemiUoPdWqOlQg"/> | ||
460 | <mappings xmi:id="_kl_mcH8VEemiUoPdWqOlQg" origin="_kl-_YH8VEemiUoPdWqOlQg" image="_kl-_YX8VEemiUoPdWqOlQg"/> | ||
461 | <mappings xmi:id="_6wB_sX8VEemiUoPdWqOlQg" origin="_wZrP4H8VEemiUoPdWqOlQg" image="_6wB_sH8VEemiUoPdWqOlQg"/> | ||
462 | </units> | ||
463 | <units xsi:type="henshin:Rule" xmi:id="_7SLYkH8XEemiUoPdWqOlQg" name="deleteAppInstance"> | ||
464 | <lhs xmi:id="_7SQREH8XEemiUoPdWqOlQg" name="Lhs"> | ||
465 | <nodes xmi:id="_AUFMMH8YEemiUoPdWqOlQg" outgoing="_IR7MgH8YEemiUoPdWqOlQg _InEWEH8YEemiUoPdWqOlQg"> | ||
466 | <type href="cps.ecore#//Requirement"/> | ||
467 | </nodes> | ||
468 | <nodes xmi:id="_A8eo8H8YEemiUoPdWqOlQg" incoming="_InEWEH8YEemiUoPdWqOlQg" outgoing="_H6p8AH8YEemiUoPdWqOlQg"> | ||
469 | <type href="cps.ecore#//ApplicationType"/> | ||
470 | </nodes> | ||
471 | <nodes xmi:id="_Dova4H8YEemiUoPdWqOlQg" incoming="_H6p8AH8YEemiUoPdWqOlQg _IR7MgH8YEemiUoPdWqOlQg"> | ||
472 | <type href="cps.ecore#//ApplicationInstance"/> | ||
473 | </nodes> | ||
474 | <edges xmi:id="_H6p8AH8YEemiUoPdWqOlQg" source="_A8eo8H8YEemiUoPdWqOlQg" target="_Dova4H8YEemiUoPdWqOlQg"> | ||
475 | <type href="cps.ecore#//ApplicationType/instances"/> | ||
476 | </edges> | ||
477 | <edges xmi:id="_IR7MgH8YEemiUoPdWqOlQg" source="_AUFMMH8YEemiUoPdWqOlQg" target="_Dova4H8YEemiUoPdWqOlQg"> | ||
478 | <type href="cps.ecore#//Requirement/instances"/> | ||
479 | </edges> | ||
480 | <edges xmi:id="_InEWEH8YEemiUoPdWqOlQg" source="_AUFMMH8YEemiUoPdWqOlQg" target="_A8eo8H8YEemiUoPdWqOlQg"> | ||
481 | <type href="cps.ecore#//Requirement/type"/> | ||
482 | </edges> | ||
483 | </lhs> | ||
484 | <rhs xmi:id="_7SQ4IH8XEemiUoPdWqOlQg" name="Rhs"> | ||
485 | <nodes xmi:id="_AUFMMX8YEemiUoPdWqOlQg" outgoing="_InEWEX8YEemiUoPdWqOlQg"> | ||
486 | <type href="cps.ecore#//Requirement"/> | ||
487 | </nodes> | ||
488 | <nodes xmi:id="_A8eo8X8YEemiUoPdWqOlQg" incoming="_InEWEX8YEemiUoPdWqOlQg"> | ||
489 | <type href="cps.ecore#//ApplicationType"/> | ||
490 | </nodes> | ||
491 | <edges xmi:id="_InEWEX8YEemiUoPdWqOlQg" source="_AUFMMX8YEemiUoPdWqOlQg" target="_A8eo8X8YEemiUoPdWqOlQg"> | ||
492 | <type href="cps.ecore#//Requirement/type"/> | ||
493 | </edges> | ||
494 | </rhs> | ||
495 | <mappings xmi:id="_AUFMMn8YEemiUoPdWqOlQg" origin="_AUFMMH8YEemiUoPdWqOlQg" image="_AUFMMX8YEemiUoPdWqOlQg"/> | ||
496 | <mappings xmi:id="_A8eo8n8YEemiUoPdWqOlQg" origin="_A8eo8H8YEemiUoPdWqOlQg" image="_A8eo8X8YEemiUoPdWqOlQg"/> | ||
497 | </units> | ||
498 | </henshin:Module> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.henshin_diagram b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.henshin_diagram new file mode 100644 index 00000000..985ff350 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.henshin_diagram | |||
@@ -0,0 +1,699 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:henshin="http://www.eclipse.org/emf/2011/Henshin" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmi:id="_rVAwQHyxEemI79hpD-o6pA" type="Henshin" name="cps.henshin_diagram" measurementUnit="Pixel"> | ||
3 | <children xmi:type="notation:Shape" xmi:id="_0PszUHyxEemI79hpD-o6pA" type="2001" fontName="Noto Sans" italic="true" lineColor="0"> | ||
4 | <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_5CPVQHyxEemI79hpD-o6pA" source="defaultAction"> | ||
5 | <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_5CP8UHyxEemI79hpD-o6pA" key="value" value="preserve"/> | ||
6 | </eAnnotations> | ||
7 | <children xmi:type="notation:DecorationNode" xmi:id="_0PszUnyxEemI79hpD-o6pA" type="5001"/> | ||
8 | <children xmi:type="notation:DecorationNode" xmi:id="_0PtaYHyxEemI79hpD-o6pA" type="7001"> | ||
9 | <children xmi:type="notation:Shape" xmi:id="_8Ow7oHyxEemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
10 | <children xmi:type="notation:DecorationNode" xmi:id="_8OxisXyxEemI79hpD-o6pA" type="5002"/> | ||
11 | <children xmi:type="notation:DecorationNode" xmi:id="_8OxisnyxEemI79hpD-o6pA" type="5003"/> | ||
12 | <children xmi:type="notation:DecorationNode" xmi:id="_8OyJwHyxEemI79hpD-o6pA" type="7002"> | ||
13 | <styles xmi:type="notation:SortingStyle" xmi:id="_8OyJwXyxEemI79hpD-o6pA"/> | ||
14 | <styles xmi:type="notation:FilteringStyle" xmi:id="_8OyJwnyxEemI79hpD-o6pA"/> | ||
15 | </children> | ||
16 | <element xmi:type="henshin:Node" href="cps.henshin#_8OoYwHyxEemI79hpD-o6pA"/> | ||
17 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8OxisHyxEemI79hpD-o6pA" x="28" y="27"/> | ||
18 | </children> | ||
19 | <children xmi:type="notation:Shape" xmi:id="_KIaMAHyyEemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
20 | <children xmi:type="notation:DecorationNode" xmi:id="_KIaMAnyyEemI79hpD-o6pA" type="5002"/> | ||
21 | <children xmi:type="notation:DecorationNode" xmi:id="_KIaMA3yyEemI79hpD-o6pA" type="5003"/> | ||
22 | <children xmi:type="notation:DecorationNode" xmi:id="_KIaMBHyyEemI79hpD-o6pA" type="7002"> | ||
23 | <styles xmi:type="notation:SortingStyle" xmi:id="_KIaMBXyyEemI79hpD-o6pA"/> | ||
24 | <styles xmi:type="notation:FilteringStyle" xmi:id="_KIaMBnyyEemI79hpD-o6pA"/> | ||
25 | </children> | ||
26 | <element xmi:type="henshin:Node" href="cps.henshin#_KIXvwHyyEemI79hpD-o6pA"/> | ||
27 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_KIaMAXyyEemI79hpD-o6pA" x="248" y="169"/> | ||
28 | </children> | ||
29 | <children xmi:type="notation:Shape" xmi:id="__cDhkHyyEemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
30 | <children xmi:type="notation:DecorationNode" xmi:id="__cEIoXyyEemI79hpD-o6pA" type="5002"/> | ||
31 | <children xmi:type="notation:DecorationNode" xmi:id="__cEIonyyEemI79hpD-o6pA" type="5003"/> | ||
32 | <children xmi:type="notation:DecorationNode" xmi:id="__cEIo3yyEemI79hpD-o6pA" type="7002"> | ||
33 | <styles xmi:type="notation:SortingStyle" xmi:id="__cEIpHyyEemI79hpD-o6pA"/> | ||
34 | <styles xmi:type="notation:FilteringStyle" xmi:id="__cEIpXyyEemI79hpD-o6pA"/> | ||
35 | </children> | ||
36 | <element xmi:type="henshin:Node" href="cps.henshin#__cBFUHyyEemI79hpD-o6pA"/> | ||
37 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="__cEIoHyyEemI79hpD-o6pA" x="259" y="17"/> | ||
38 | </children> | ||
39 | </children> | ||
40 | <element xmi:type="henshin:Rule" href="cps.henshin#_ttviMHyxEemI79hpD-o6pA"/> | ||
41 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_0PszUXyxEemI79hpD-o6pA" x="22" y="22" width="407" height="284"/> | ||
42 | </children> | ||
43 | <children xmi:type="notation:Shape" xmi:id="_M4A68Hy0EemI79hpD-o6pA" type="2001" fontName="Noto Sans" italic="true" lineColor="0"> | ||
44 | <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Zp21wHy0EemI79hpD-o6pA" source="defaultAction"> | ||
45 | <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Zp21wXy0EemI79hpD-o6pA" key="value" value="preserve"/> | ||
46 | </eAnnotations> | ||
47 | <children xmi:type="notation:DecorationNode" xmi:id="_M4BiAHy0EemI79hpD-o6pA" type="5001"/> | ||
48 | <children xmi:type="notation:DecorationNode" xmi:id="_M4CJEHy0EemI79hpD-o6pA" type="7001"> | ||
49 | <children xmi:type="notation:Shape" xmi:id="_Zp4q8Hy0EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
50 | <children xmi:type="notation:DecorationNode" xmi:id="_Zp4q8ny0EemI79hpD-o6pA" type="5002"/> | ||
51 | <children xmi:type="notation:DecorationNode" xmi:id="_Zp4q83y0EemI79hpD-o6pA" type="5003"/> | ||
52 | <children xmi:type="notation:DecorationNode" xmi:id="_Zp4q9Hy0EemI79hpD-o6pA" type="7002"> | ||
53 | <styles xmi:type="notation:SortingStyle" xmi:id="_Zp4q9Xy0EemI79hpD-o6pA"/> | ||
54 | <styles xmi:type="notation:FilteringStyle" xmi:id="_Zp4q9ny0EemI79hpD-o6pA"/> | ||
55 | </children> | ||
56 | <element xmi:type="henshin:Node" href="cps.henshin#_ZpwIEHy0EemI79hpD-o6pA"/> | ||
57 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Zp4q8Xy0EemI79hpD-o6pA" x="55" y="8"/> | ||
58 | </children> | ||
59 | <children xmi:type="notation:Shape" xmi:id="_bFEPgHy0EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
60 | <children xmi:type="notation:DecorationNode" xmi:id="_bFEPgny0EemI79hpD-o6pA" type="5002"/> | ||
61 | <children xmi:type="notation:DecorationNode" xmi:id="_bFEPg3y0EemI79hpD-o6pA" type="5003"/> | ||
62 | <children xmi:type="notation:DecorationNode" xmi:id="_bFEPhHy0EemI79hpD-o6pA" type="7002"> | ||
63 | <styles xmi:type="notation:SortingStyle" xmi:id="_bFEPhXy0EemI79hpD-o6pA"/> | ||
64 | <styles xmi:type="notation:FilteringStyle" xmi:id="_bFEPhny0EemI79hpD-o6pA"/> | ||
65 | </children> | ||
66 | <element xmi:type="henshin:Node" href="cps.henshin#_bFDBYHy0EemI79hpD-o6pA"/> | ||
67 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_bFEPgXy0EemI79hpD-o6pA" x="47" y="102"/> | ||
68 | </children> | ||
69 | </children> | ||
70 | <element xmi:type="henshin:Rule" href="cps.henshin#_M36NQHy0EemI79hpD-o6pA"/> | ||
71 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_M4A68Xy0EemI79hpD-o6pA" x="22" y="327" width="191" height="199"/> | ||
72 | </children> | ||
73 | <children xmi:type="notation:Shape" xmi:id="_2ySkgHy0EemI79hpD-o6pA" type="2001" fontName="Noto Sans" italic="true" lineColor="0"> | ||
74 | <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_5jgH4Hy0EemI79hpD-o6pA" source="defaultAction"> | ||
75 | <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_5jgH4Xy0EemI79hpD-o6pA" key="value" value="preserve"/> | ||
76 | </eAnnotations> | ||
77 | <children xmi:type="notation:DecorationNode" xmi:id="_2ySkgny0EemI79hpD-o6pA" type="5001"/> | ||
78 | <children xmi:type="notation:DecorationNode" xmi:id="_2ySkg3y0EemI79hpD-o6pA" type="7001"> | ||
79 | <children xmi:type="notation:Shape" xmi:id="_5jh9EHy0EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
80 | <children xmi:type="notation:DecorationNode" xmi:id="_5jikIHy0EemI79hpD-o6pA" type="5002"/> | ||
81 | <children xmi:type="notation:DecorationNode" xmi:id="_5jikIXy0EemI79hpD-o6pA" type="5003"/> | ||
82 | <children xmi:type="notation:DecorationNode" xmi:id="_5jikIny0EemI79hpD-o6pA" type="7002"> | ||
83 | <styles xmi:type="notation:SortingStyle" xmi:id="_5jikI3y0EemI79hpD-o6pA"/> | ||
84 | <styles xmi:type="notation:FilteringStyle" xmi:id="_5jikJHy0EemI79hpD-o6pA"/> | ||
85 | </children> | ||
86 | <element xmi:type="henshin:Node" href="cps.henshin#_5jfg0Hy0EemI79hpD-o6pA"/> | ||
87 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_5jh9EXy0EemI79hpD-o6pA" x="46" y="17"/> | ||
88 | </children> | ||
89 | <children xmi:type="notation:Shape" xmi:id="_6FsO8Hy0EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
90 | <children xmi:type="notation:DecorationNode" xmi:id="_6Fs2AHy0EemI79hpD-o6pA" type="5002"/> | ||
91 | <children xmi:type="notation:DecorationNode" xmi:id="_6Fs2AXy0EemI79hpD-o6pA" type="5003"/> | ||
92 | <children xmi:type="notation:DecorationNode" xmi:id="_6Fs2Any0EemI79hpD-o6pA" type="7002"> | ||
93 | <styles xmi:type="notation:SortingStyle" xmi:id="_6Fs2A3y0EemI79hpD-o6pA"/> | ||
94 | <styles xmi:type="notation:FilteringStyle" xmi:id="_6Fs2BHy0EemI79hpD-o6pA"/> | ||
95 | </children> | ||
96 | <element xmi:type="henshin:Node" href="cps.henshin#_6FqZwHy0EemI79hpD-o6pA"/> | ||
97 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_6FsO8Xy0EemI79hpD-o6pA" x="47" y="102"/> | ||
98 | </children> | ||
99 | <children xmi:type="notation:Shape" xmi:id="_8lWIQHy0EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
100 | <children xmi:type="notation:DecorationNode" xmi:id="_8lWIQny0EemI79hpD-o6pA" type="5002"/> | ||
101 | <children xmi:type="notation:DecorationNode" xmi:id="_8lWIQ3y0EemI79hpD-o6pA" type="5003"/> | ||
102 | <children xmi:type="notation:DecorationNode" xmi:id="_8lWvUHy0EemI79hpD-o6pA" type="7002"> | ||
103 | <styles xmi:type="notation:SortingStyle" xmi:id="_8lWvUXy0EemI79hpD-o6pA"/> | ||
104 | <styles xmi:type="notation:FilteringStyle" xmi:id="_8lWvUny0EemI79hpD-o6pA"/> | ||
105 | </children> | ||
106 | <element xmi:type="henshin:Node" href="cps.henshin#_8lTsAHy0EemI79hpD-o6pA"/> | ||
107 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8lWIQXy0EemI79hpD-o6pA" x="202" y="102"/> | ||
108 | </children> | ||
109 | </children> | ||
110 | <element xmi:type="henshin:Rule" href="cps.henshin#_2yQIQHy0EemI79hpD-o6pA"/> | ||
111 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_2ySkgXy0EemI79hpD-o6pA" x="236" y="327" width="345" height="199"/> | ||
112 | </children> | ||
113 | <children xmi:type="notation:Shape" xmi:id="_W9ZSsHy4EemI79hpD-o6pA" type="2001" fontName="Noto Sans" italic="true" lineColor="0"> | ||
114 | <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_QzUgoXy5EemI79hpD-o6pA" source="defaultAction"> | ||
115 | <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_QzUgony5EemI79hpD-o6pA" key="value" value="preserve"/> | ||
116 | </eAnnotations> | ||
117 | <children xmi:type="notation:DecorationNode" xmi:id="_W9ZSsny4EemI79hpD-o6pA" type="5001"/> | ||
118 | <children xmi:type="notation:DecorationNode" xmi:id="_W9ZSs3y4EemI79hpD-o6pA" type="7001"> | ||
119 | <children xmi:type="notation:Shape" xmi:id="_QzVuwHy5EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
120 | <children xmi:type="notation:DecorationNode" xmi:id="_QzVuwny5EemI79hpD-o6pA" type="5002"/> | ||
121 | <children xmi:type="notation:DecorationNode" xmi:id="_QzVuw3y5EemI79hpD-o6pA" type="5003"/> | ||
122 | <children xmi:type="notation:DecorationNode" xmi:id="_QzVuxHy5EemI79hpD-o6pA" type="7002"> | ||
123 | <styles xmi:type="notation:SortingStyle" xmi:id="_QzVuxXy5EemI79hpD-o6pA"/> | ||
124 | <styles xmi:type="notation:FilteringStyle" xmi:id="_QzVuxny5EemI79hpD-o6pA"/> | ||
125 | </children> | ||
126 | <element xmi:type="henshin:Node" href="cps.henshin#_QzQ2QHy5EemI79hpD-o6pA"/> | ||
127 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_QzVuwXy5EemI79hpD-o6pA" x="16" y="162"/> | ||
128 | </children> | ||
129 | <children xmi:type="notation:Shape" xmi:id="_U8_rwHy5EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
130 | <children xmi:type="notation:DecorationNode" xmi:id="_U9AS0Hy5EemI79hpD-o6pA" type="5002"/> | ||
131 | <children xmi:type="notation:DecorationNode" xmi:id="_U9AS0Xy5EemI79hpD-o6pA" type="5003"/> | ||
132 | <children xmi:type="notation:DecorationNode" xmi:id="_U9AS0ny5EemI79hpD-o6pA" type="7002"> | ||
133 | <styles xmi:type="notation:SortingStyle" xmi:id="_U9AS03y5EemI79hpD-o6pA"/> | ||
134 | <styles xmi:type="notation:FilteringStyle" xmi:id="_U9AS1Hy5EemI79hpD-o6pA"/> | ||
135 | </children> | ||
136 | <element xmi:type="henshin:Node" href="cps.henshin#_U88ocHy5EemI79hpD-o6pA"/> | ||
137 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_U8_rwXy5EemI79hpD-o6pA" x="177" y="11"/> | ||
138 | </children> | ||
139 | <children xmi:type="notation:Shape" xmi:id="_WEe4QHy5EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
140 | <children xmi:type="notation:DecorationNode" xmi:id="_WEe4Qny5EemI79hpD-o6pA" type="5002"/> | ||
141 | <children xmi:type="notation:DecorationNode" xmi:id="_WEe4Q3y5EemI79hpD-o6pA" type="5003"/> | ||
142 | <children xmi:type="notation:DecorationNode" xmi:id="_WEe4RHy5EemI79hpD-o6pA" type="7002"> | ||
143 | <styles xmi:type="notation:SortingStyle" xmi:id="_WEe4RXy5EemI79hpD-o6pA"/> | ||
144 | <styles xmi:type="notation:FilteringStyle" xmi:id="_WEe4Rny5EemI79hpD-o6pA"/> | ||
145 | </children> | ||
146 | <element xmi:type="henshin:Node" href="cps.henshin#_WEdqIHy5EemI79hpD-o6pA"/> | ||
147 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WEe4QXy5EemI79hpD-o6pA" x="166" y="117"/> | ||
148 | </children> | ||
149 | <children xmi:type="notation:Shape" xmi:id="_XGUIsHy5EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
150 | <children xmi:type="notation:DecorationNode" xmi:id="_XGUIsny5EemI79hpD-o6pA" type="5002"/> | ||
151 | <children xmi:type="notation:DecorationNode" xmi:id="_XGUvwHy5EemI79hpD-o6pA" type="5003"/> | ||
152 | <children xmi:type="notation:DecorationNode" xmi:id="_XGUvwXy5EemI79hpD-o6pA" type="7002"> | ||
153 | <styles xmi:type="notation:SortingStyle" xmi:id="_XGUvwny5EemI79hpD-o6pA"/> | ||
154 | <styles xmi:type="notation:FilteringStyle" xmi:id="_XGUvw3y5EemI79hpD-o6pA"/> | ||
155 | </children> | ||
156 | <element xmi:type="henshin:Node" href="cps.henshin#_XGRscHy5EemI79hpD-o6pA"/> | ||
157 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XGUIsXy5EemI79hpD-o6pA" x="527" y="11"/> | ||
158 | </children> | ||
159 | <children xmi:type="notation:Shape" xmi:id="_XfT3gHy5EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
160 | <children xmi:type="notation:DecorationNode" xmi:id="_XfT3gny5EemI79hpD-o6pA" type="5002"/> | ||
161 | <children xmi:type="notation:DecorationNode" xmi:id="_XfT3g3y5EemI79hpD-o6pA" type="5003"/> | ||
162 | <children xmi:type="notation:DecorationNode" xmi:id="_XfT3hHy5EemI79hpD-o6pA" type="7002"> | ||
163 | <styles xmi:type="notation:SortingStyle" xmi:id="_XfT3hXy5EemI79hpD-o6pA"/> | ||
164 | <styles xmi:type="notation:FilteringStyle" xmi:id="_XfT3hny5EemI79hpD-o6pA"/> | ||
165 | </children> | ||
166 | <element xmi:type="henshin:Node" href="cps.henshin#_XfSpYHy5EemI79hpD-o6pA"/> | ||
167 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XfT3gXy5EemI79hpD-o6pA" x="527" y="162"/> | ||
168 | </children> | ||
169 | <children xmi:type="notation:Shape" xmi:id="_YuaH4Hy5EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
170 | <children xmi:type="notation:DecorationNode" xmi:id="_YuaH4ny5EemI79hpD-o6pA" type="5002"/> | ||
171 | <children xmi:type="notation:DecorationNode" xmi:id="_YuaH43y5EemI79hpD-o6pA" type="5003"/> | ||
172 | <children xmi:type="notation:DecorationNode" xmi:id="_YuaH5Hy5EemI79hpD-o6pA" type="7002"> | ||
173 | <styles xmi:type="notation:SortingStyle" xmi:id="_YuaH5Xy5EemI79hpD-o6pA"/> | ||
174 | <styles xmi:type="notation:FilteringStyle" xmi:id="_YuaH5ny5EemI79hpD-o6pA"/> | ||
175 | </children> | ||
176 | <element xmi:type="henshin:Node" href="cps.henshin#_YuZg0Hy5EemI79hpD-o6pA"/> | ||
177 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_YuaH4Xy5EemI79hpD-o6pA" x="337" y="11"/> | ||
178 | </children> | ||
179 | <children xmi:type="notation:Shape" xmi:id="_iu5VYHy5EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
180 | <children xmi:type="notation:DecorationNode" xmi:id="_iu5VYny5EemI79hpD-o6pA" type="5002"/> | ||
181 | <children xmi:type="notation:DecorationNode" xmi:id="_iu5VY3y5EemI79hpD-o6pA" type="5003"/> | ||
182 | <children xmi:type="notation:DecorationNode" xmi:id="_iu5VZHy5EemI79hpD-o6pA" type="7002"> | ||
183 | <styles xmi:type="notation:SortingStyle" xmi:id="_iu5VZXy5EemI79hpD-o6pA"/> | ||
184 | <styles xmi:type="notation:FilteringStyle" xmi:id="_iu5VZny5EemI79hpD-o6pA"/> | ||
185 | </children> | ||
186 | <element xmi:type="henshin:Node" href="cps.henshin#_iu3gMHy5EemI79hpD-o6pA"/> | ||
187 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iu5VYXy5EemI79hpD-o6pA" x="166" y="214"/> | ||
188 | </children> | ||
189 | <children xmi:type="notation:Shape" xmi:id="_DK8L8H8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
190 | <children xmi:type="notation:DecorationNode" xmi:id="_DK8zAH8VEemiUoPdWqOlQg" type="5002"/> | ||
191 | <children xmi:type="notation:DecorationNode" xmi:id="_DK8zAX8VEemiUoPdWqOlQg" type="5003"/> | ||
192 | <children xmi:type="notation:DecorationNode" xmi:id="_DK8zAn8VEemiUoPdWqOlQg" type="7002"> | ||
193 | <styles xmi:type="notation:SortingStyle" xmi:id="_DK8zA38VEemiUoPdWqOlQg"/> | ||
194 | <styles xmi:type="notation:FilteringStyle" xmi:id="_DK8zBH8VEemiUoPdWqOlQg"/> | ||
195 | </children> | ||
196 | <element xmi:type="henshin:Node" href="cps.henshin#_DK7k4H8VEemiUoPdWqOlQg"/> | ||
197 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DK8L8X8VEemiUoPdWqOlQg" x="15" y="11"/> | ||
198 | </children> | ||
199 | </children> | ||
200 | <element xmi:type="henshin:Rule" href="cps.henshin#_W9WPYHy4EemI79hpD-o6pA"/> | ||
201 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_W9ZSsXy4EemI79hpD-o6pA" x="22" y="549" width="637" height="322"/> | ||
202 | </children> | ||
203 | <children xmi:type="notation:Shape" xmi:id="_1VkVkHy5EemI79hpD-o6pA" type="2001" fontName="Noto Sans" italic="true" lineColor="0"> | ||
204 | <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_OdwiAny6EemI79hpD-o6pA" source="defaultAction"> | ||
205 | <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_OdwiA3y6EemI79hpD-o6pA" key="value" value="preserve"/> | ||
206 | </eAnnotations> | ||
207 | <children xmi:type="notation:DecorationNode" xmi:id="_1VkVkny5EemI79hpD-o6pA" type="5001"/> | ||
208 | <children xmi:type="notation:DecorationNode" xmi:id="_1VkVk3y5EemI79hpD-o6pA" type="7001"> | ||
209 | <children xmi:type="notation:Shape" xmi:id="_OdxwIHy6EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
210 | <children xmi:type="notation:DecorationNode" xmi:id="_OdxwIny6EemI79hpD-o6pA" type="5002"/> | ||
211 | <children xmi:type="notation:DecorationNode" xmi:id="_OdxwI3y6EemI79hpD-o6pA" type="5003"/> | ||
212 | <children xmi:type="notation:DecorationNode" xmi:id="_OdxwJHy6EemI79hpD-o6pA" type="7002"> | ||
213 | <styles xmi:type="notation:SortingStyle" xmi:id="_OdxwJXy6EemI79hpD-o6pA"/> | ||
214 | <styles xmi:type="notation:FilteringStyle" xmi:id="_OdxwJny6EemI79hpD-o6pA"/> | ||
215 | </children> | ||
216 | <element xmi:type="henshin:Node" href="cps.henshin#_OdtesHy6EemI79hpD-o6pA"/> | ||
217 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OdxwIXy6EemI79hpD-o6pA" x="21" y="12"/> | ||
218 | </children> | ||
219 | <children xmi:type="notation:Shape" xmi:id="_PGbrkHy6EemI79hpD-o6pA" type="3001" fontName="Noto Sans"> | ||
220 | <children xmi:type="notation:DecorationNode" xmi:id="_PGcSoHy6EemI79hpD-o6pA" type="5002"/> | ||
221 | <children xmi:type="notation:DecorationNode" xmi:id="_PGcSoXy6EemI79hpD-o6pA" type="5003"/> | ||
222 | <children xmi:type="notation:DecorationNode" xmi:id="_PGcSony6EemI79hpD-o6pA" type="7002"> | ||
223 | <styles xmi:type="notation:SortingStyle" xmi:id="_PGcSo3y6EemI79hpD-o6pA"/> | ||
224 | <styles xmi:type="notation:FilteringStyle" xmi:id="_PGcSpHy6EemI79hpD-o6pA"/> | ||
225 | </children> | ||
226 | <element xmi:type="henshin:Node" href="cps.henshin#_PGadcHy6EemI79hpD-o6pA"/> | ||
227 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PGbrkXy6EemI79hpD-o6pA" x="39" y="163"/> | ||
228 | </children> | ||
229 | </children> | ||
230 | <element xmi:type="henshin:Rule" href="cps.henshin#_1VgrMHy5EemI79hpD-o6pA"/> | ||
231 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1VkVkXy5EemI79hpD-o6pA" x="684" y="549" width="177" height="259"/> | ||
232 | </children> | ||
233 | <children xmi:type="notation:Shape" xmi:id="_4li6kH8UEemiUoPdWqOlQg" type="2001" fontName="Noto Sans" italic="true" lineColor="0"> | ||
234 | <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_VfNNgn8VEemiUoPdWqOlQg" source="defaultAction"> | ||
235 | <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_VfNNg38VEemiUoPdWqOlQg" key="value" value="preserve"/> | ||
236 | </eAnnotations> | ||
237 | <children xmi:type="notation:DecorationNode" xmi:id="_4ljhoH8UEemiUoPdWqOlQg" type="5001"/> | ||
238 | <children xmi:type="notation:DecorationNode" xmi:id="_4ljhoX8UEemiUoPdWqOlQg" type="7001"> | ||
239 | <children xmi:type="notation:Shape" xmi:id="_VfOboH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
240 | <children xmi:type="notation:DecorationNode" xmi:id="_VfPCsH8VEemiUoPdWqOlQg" type="5002"/> | ||
241 | <children xmi:type="notation:DecorationNode" xmi:id="_VfPCsX8VEemiUoPdWqOlQg" type="5003"/> | ||
242 | <children xmi:type="notation:DecorationNode" xmi:id="_VfPCsn8VEemiUoPdWqOlQg" type="7002"> | ||
243 | <styles xmi:type="notation:SortingStyle" xmi:id="_VfPCs38VEemiUoPdWqOlQg"/> | ||
244 | <styles xmi:type="notation:FilteringStyle" xmi:id="_VfPCtH8VEemiUoPdWqOlQg"/> | ||
245 | </children> | ||
246 | <element xmi:type="henshin:Node" href="cps.henshin#_VfKxQH8VEemiUoPdWqOlQg"/> | ||
247 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_VfOboX8VEemiUoPdWqOlQg" x="19" y="196"/> | ||
248 | </children> | ||
249 | <children xmi:type="notation:Shape" xmi:id="_WJm1YH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
250 | <children xmi:type="notation:DecorationNode" xmi:id="_WJnccH8VEemiUoPdWqOlQg" type="5002"/> | ||
251 | <children xmi:type="notation:DecorationNode" xmi:id="_WJnccX8VEemiUoPdWqOlQg" type="5003"/> | ||
252 | <children xmi:type="notation:DecorationNode" xmi:id="_WJnccn8VEemiUoPdWqOlQg" type="7002"> | ||
253 | <styles xmi:type="notation:SortingStyle" xmi:id="_WJncc38VEemiUoPdWqOlQg"/> | ||
254 | <styles xmi:type="notation:FilteringStyle" xmi:id="_WJncdH8VEemiUoPdWqOlQg"/> | ||
255 | </children> | ||
256 | <element xmi:type="henshin:Node" href="cps.henshin#_WJkZIH8VEemiUoPdWqOlQg"/> | ||
257 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_WJm1YX8VEemiUoPdWqOlQg" x="172" y="16"/> | ||
258 | </children> | ||
259 | <children xmi:type="notation:Shape" xmi:id="_Xr_OIH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
260 | <children xmi:type="notation:DecorationNode" xmi:id="_Xr_OIn8VEemiUoPdWqOlQg" type="5002"/> | ||
261 | <children xmi:type="notation:DecorationNode" xmi:id="_Xr_OI38VEemiUoPdWqOlQg" type="5003"/> | ||
262 | <children xmi:type="notation:DecorationNode" xmi:id="_Xr_OJH8VEemiUoPdWqOlQg" type="7002"> | ||
263 | <styles xmi:type="notation:SortingStyle" xmi:id="_Xr_OJX8VEemiUoPdWqOlQg"/> | ||
264 | <styles xmi:type="notation:FilteringStyle" xmi:id="_Xr_OJn8VEemiUoPdWqOlQg"/> | ||
265 | </children> | ||
266 | <element xmi:type="henshin:Node" href="cps.henshin#_Xr-AAH8VEemiUoPdWqOlQg"/> | ||
267 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Xr_OIX8VEemiUoPdWqOlQg" x="161" y="263"/> | ||
268 | </children> | ||
269 | <children xmi:type="notation:Shape" xmi:id="_Y0FeoH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
270 | <children xmi:type="notation:DecorationNode" xmi:id="_Y0GFsX8VEemiUoPdWqOlQg" type="5002"/> | ||
271 | <children xmi:type="notation:DecorationNode" xmi:id="_Y0GFsn8VEemiUoPdWqOlQg" type="5003"/> | ||
272 | <children xmi:type="notation:DecorationNode" xmi:id="_Y0GFs38VEemiUoPdWqOlQg" type="7002"> | ||
273 | <styles xmi:type="notation:SortingStyle" xmi:id="_Y0GFtH8VEemiUoPdWqOlQg"/> | ||
274 | <styles xmi:type="notation:FilteringStyle" xmi:id="_Y0GFtX8VEemiUoPdWqOlQg"/> | ||
275 | </children> | ||
276 | <element xmi:type="henshin:Node" href="cps.henshin#_Yz9i0H8VEemiUoPdWqOlQg"/> | ||
277 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Y0GFsH8VEemiUoPdWqOlQg" x="533" y="196"/> | ||
278 | </children> | ||
279 | <children xmi:type="notation:Shape" xmi:id="_cTdIgH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
280 | <children xmi:type="notation:DecorationNode" xmi:id="_cTdIgn8VEemiUoPdWqOlQg" type="5002"/> | ||
281 | <children xmi:type="notation:DecorationNode" xmi:id="_cTdIg38VEemiUoPdWqOlQg" type="5003"/> | ||
282 | <children xmi:type="notation:DecorationNode" xmi:id="_cTdIhH8VEemiUoPdWqOlQg" type="7002"> | ||
283 | <styles xmi:type="notation:SortingStyle" xmi:id="_cTdIhX8VEemiUoPdWqOlQg"/> | ||
284 | <styles xmi:type="notation:FilteringStyle" xmi:id="_cTdIhn8VEemiUoPdWqOlQg"/> | ||
285 | </children> | ||
286 | <element xmi:type="henshin:Node" href="cps.henshin#_cTchcH8VEemiUoPdWqOlQg"/> | ||
287 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cTdIgX8VEemiUoPdWqOlQg" x="161" y="133"/> | ||
288 | </children> | ||
289 | <children xmi:type="notation:Shape" xmi:id="_fYb8cH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
290 | <children xmi:type="notation:DecorationNode" xmi:id="_fYb8cn8VEemiUoPdWqOlQg" type="5002"/> | ||
291 | <children xmi:type="notation:DecorationNode" xmi:id="_fYb8c38VEemiUoPdWqOlQg" type="5003"/> | ||
292 | <children xmi:type="notation:DecorationNode" xmi:id="_fYb8dH8VEemiUoPdWqOlQg" type="7002"> | ||
293 | <styles xmi:type="notation:SortingStyle" xmi:id="_fYb8dX8VEemiUoPdWqOlQg"/> | ||
294 | <styles xmi:type="notation:FilteringStyle" xmi:id="_fYb8dn8VEemiUoPdWqOlQg"/> | ||
295 | </children> | ||
296 | <element xmi:type="henshin:Node" href="cps.henshin#_fYauUH8VEemiUoPdWqOlQg"/> | ||
297 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fYb8cX8VEemiUoPdWqOlQg" x="347" y="16"/> | ||
298 | </children> | ||
299 | <children xmi:type="notation:Shape" xmi:id="_kmA0kH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
300 | <children xmi:type="notation:DecorationNode" xmi:id="_kmA0kn8VEemiUoPdWqOlQg" type="5002"/> | ||
301 | <children xmi:type="notation:DecorationNode" xmi:id="_kmA0k38VEemiUoPdWqOlQg" type="5003"/> | ||
302 | <children xmi:type="notation:DecorationNode" xmi:id="_kmA0lH8VEemiUoPdWqOlQg" type="7002"> | ||
303 | <styles xmi:type="notation:SortingStyle" xmi:id="_kmA0lX8VEemiUoPdWqOlQg"/> | ||
304 | <styles xmi:type="notation:FilteringStyle" xmi:id="_kmA0ln8VEemiUoPdWqOlQg"/> | ||
305 | </children> | ||
306 | <element xmi:type="henshin:Node" href="cps.henshin#_kl-_YH8VEemiUoPdWqOlQg"/> | ||
307 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kmA0kX8VEemiUoPdWqOlQg" x="540" y="16"/> | ||
308 | </children> | ||
309 | <children xmi:type="notation:Shape" xmi:id="_wZseAH8VEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
310 | <children xmi:type="notation:DecorationNode" xmi:id="_wZseAn8VEemiUoPdWqOlQg" type="5002"/> | ||
311 | <children xmi:type="notation:DecorationNode" xmi:id="_wZseA38VEemiUoPdWqOlQg" type="5003"/> | ||
312 | <children xmi:type="notation:DecorationNode" xmi:id="_wZseBH8VEemiUoPdWqOlQg" type="7002"> | ||
313 | <styles xmi:type="notation:SortingStyle" xmi:id="_wZseBX8VEemiUoPdWqOlQg"/> | ||
314 | <styles xmi:type="notation:FilteringStyle" xmi:id="_wZseBn8VEemiUoPdWqOlQg"/> | ||
315 | </children> | ||
316 | <element xmi:type="henshin:Node" href="cps.henshin#_wZrP4H8VEemiUoPdWqOlQg"/> | ||
317 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_wZseAX8VEemiUoPdWqOlQg" x="18" y="16"/> | ||
318 | </children> | ||
319 | </children> | ||
320 | <element xmi:type="henshin:Rule" href="cps.henshin#_4lbl0H8UEemiUoPdWqOlQg"/> | ||
321 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_4li6kX8UEemiUoPdWqOlQg" x="22" y="894" width="637" height="360"/> | ||
322 | </children> | ||
323 | <children xmi:type="notation:Shape" xmi:id="_7SPC8H8XEemiUoPdWqOlQg" type="2001" fontName="Noto Sans" italic="true" lineColor="0"> | ||
324 | <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_AUFzQH8YEemiUoPdWqOlQg" source="defaultAction"> | ||
325 | <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_AUFzQX8YEemiUoPdWqOlQg" key="value" value="preserve"/> | ||
326 | </eAnnotations> | ||
327 | <children xmi:type="notation:DecorationNode" xmi:id="_7SPqAH8XEemiUoPdWqOlQg" type="5001"/> | ||
328 | <children xmi:type="notation:DecorationNode" xmi:id="_7SPqAX8XEemiUoPdWqOlQg" type="7001"> | ||
329 | <children xmi:type="notation:Shape" xmi:id="_AUGaUH8YEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
330 | <children xmi:type="notation:DecorationNode" xmi:id="_AUGaUn8YEemiUoPdWqOlQg" type="5002"/> | ||
331 | <children xmi:type="notation:DecorationNode" xmi:id="_AUGaU38YEemiUoPdWqOlQg" type="5003"/> | ||
332 | <children xmi:type="notation:DecorationNode" xmi:id="_AUGaVH8YEemiUoPdWqOlQg" type="7002"> | ||
333 | <styles xmi:type="notation:SortingStyle" xmi:id="_AUGaVX8YEemiUoPdWqOlQg"/> | ||
334 | <styles xmi:type="notation:FilteringStyle" xmi:id="_AUGaVn8YEemiUoPdWqOlQg"/> | ||
335 | </children> | ||
336 | <element xmi:type="henshin:Node" href="cps.henshin#_AUFMMH8YEemiUoPdWqOlQg"/> | ||
337 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_AUGaUX8YEemiUoPdWqOlQg" x="28" y="19"/> | ||
338 | </children> | ||
339 | <children xmi:type="notation:Shape" xmi:id="_A8fQAH8YEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
340 | <children xmi:type="notation:DecorationNode" xmi:id="_A8fQAn8YEemiUoPdWqOlQg" type="5002"/> | ||
341 | <children xmi:type="notation:DecorationNode" xmi:id="_A8fQA38YEemiUoPdWqOlQg" type="5003"/> | ||
342 | <children xmi:type="notation:DecorationNode" xmi:id="_A8fQBH8YEemiUoPdWqOlQg" type="7002"> | ||
343 | <styles xmi:type="notation:SortingStyle" xmi:id="_A8fQBX8YEemiUoPdWqOlQg"/> | ||
344 | <styles xmi:type="notation:FilteringStyle" xmi:id="_A8fQBn8YEemiUoPdWqOlQg"/> | ||
345 | </children> | ||
346 | <element xmi:type="henshin:Node" href="cps.henshin#_A8eo8H8YEemiUoPdWqOlQg"/> | ||
347 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_A8fQAX8YEemiUoPdWqOlQg" x="238" y="19"/> | ||
348 | </children> | ||
349 | <children xmi:type="notation:Shape" xmi:id="_DowB8H8YEemiUoPdWqOlQg" type="3001" fontName="Noto Sans"> | ||
350 | <children xmi:type="notation:DecorationNode" xmi:id="_DowB8n8YEemiUoPdWqOlQg" type="5002"/> | ||
351 | <children xmi:type="notation:DecorationNode" xmi:id="_DowB838YEemiUoPdWqOlQg" type="5003"/> | ||
352 | <children xmi:type="notation:DecorationNode" xmi:id="_DowB9H8YEemiUoPdWqOlQg" type="7002"> | ||
353 | <styles xmi:type="notation:SortingStyle" xmi:id="_DowB9X8YEemiUoPdWqOlQg"/> | ||
354 | <styles xmi:type="notation:FilteringStyle" xmi:id="_DowB9n8YEemiUoPdWqOlQg"/> | ||
355 | </children> | ||
356 | <element xmi:type="henshin:Node" href="cps.henshin#_Dova4H8YEemiUoPdWqOlQg"/> | ||
357 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DowB8X8YEemiUoPdWqOlQg" x="227" y="171"/> | ||
358 | </children> | ||
359 | </children> | ||
360 | <element xmi:type="henshin:Rule" href="cps.henshin#_7SLYkH8XEemiUoPdWqOlQg"/> | ||
361 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_7SPC8X8XEemiUoPdWqOlQg" x="453" y="22" width="376" height="284"/> | ||
362 | </children> | ||
363 | <styles xmi:type="notation:DiagramStyle" xmi:id="_rVAwQXyxEemI79hpD-o6pA"/> | ||
364 | <element xmi:type="henshin:Module" href="cps.henshin#_rUcIgHyxEemI79hpD-o6pA"/> | ||
365 | <edges xmi:type="notation:Connector" xmi:id="_6Yb2sHyyEemI79hpD-o6pA" type="4001" source="_8Ow7oHyxEemI79hpD-o6pA" target="_KIaMAHyyEemI79hpD-o6pA"> | ||
366 | <children xmi:type="notation:DecorationNode" xmi:id="_6Yb2s3yyEemI79hpD-o6pA" type="6001"> | ||
367 | <layoutConstraint xmi:type="notation:Location" xmi:id="_6Yb2tHyyEemI79hpD-o6pA" y="40"/> | ||
368 | </children> | ||
369 | <children xmi:type="notation:DecorationNode" xmi:id="_6Yb2tXyyEemI79hpD-o6pA" type="6002"> | ||
370 | <layoutConstraint xmi:type="notation:Location" xmi:id="_6Yb2tnyyEemI79hpD-o6pA" y="60"/> | ||
371 | </children> | ||
372 | <styles xmi:type="notation:FontStyle" xmi:id="_6Yb2sXyyEemI79hpD-o6pA" fontName="Noto Sans"/> | ||
373 | <element xmi:type="henshin:Edge" href="cps.henshin#_6YaokHyyEemI79hpD-o6pA"/> | ||
374 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6Yb2snyyEemI79hpD-o6pA" points="[49, -7, -165, 20]$[190, -30, -24, -3]"/> | ||
375 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6YdE0HyyEemI79hpD-o6pA" id="(0.20512820512820512,0.41304347826086957)"/> | ||
376 | </edges> | ||
377 | <edges xmi:type="notation:Connector" xmi:id="_APeikHyzEemI79hpD-o6pA" type="4001" source="_8Ow7oHyxEemI79hpD-o6pA" target="__cDhkHyyEemI79hpD-o6pA"> | ||
378 | <children xmi:type="notation:DecorationNode" xmi:id="_APeik3yzEemI79hpD-o6pA" type="6001"> | ||
379 | <layoutConstraint xmi:type="notation:Location" xmi:id="_APeilHyzEemI79hpD-o6pA" y="40"/> | ||
380 | </children> | ||
381 | <children xmi:type="notation:DecorationNode" xmi:id="_APeilXyzEemI79hpD-o6pA" type="6002"> | ||
382 | <layoutConstraint xmi:type="notation:Location" xmi:id="_APeilnyzEemI79hpD-o6pA" y="60"/> | ||
383 | </children> | ||
384 | <styles xmi:type="notation:FontStyle" xmi:id="_APeikXyzEemI79hpD-o6pA" fontName="Noto Sans"/> | ||
385 | <element xmi:type="henshin:Edge" href="cps.henshin#_APd7gHyzEemI79hpD-o6pA"/> | ||
386 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_APeiknyzEemI79hpD-o6pA" points="[14, -1, -203, 1]$[215, -25, -2, -23]"/> | ||
387 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_APfwsHyzEemI79hpD-o6pA" id="(0.8571428571428571,0.17391304347826086)"/> | ||
388 | </edges> | ||
389 | <edges xmi:type="notation:Connector" xmi:id="_AoHFAHyzEemI79hpD-o6pA" type="4001" source="__cDhkHyyEemI79hpD-o6pA" target="_KIaMAHyyEemI79hpD-o6pA"> | ||
390 | <children xmi:type="notation:DecorationNode" xmi:id="_AoHsEHyzEemI79hpD-o6pA" type="6001"> | ||
391 | <layoutConstraint xmi:type="notation:Location" xmi:id="_AoHsEXyzEemI79hpD-o6pA" x="20" y="37"/> | ||
392 | </children> | ||
393 | <children xmi:type="notation:DecorationNode" xmi:id="_AoHsEnyzEemI79hpD-o6pA" type="6002"> | ||
394 | <layoutConstraint xmi:type="notation:Location" xmi:id="_AoHsE3yzEemI79hpD-o6pA" y="60"/> | ||
395 | </children> | ||
396 | <styles xmi:type="notation:FontStyle" xmi:id="_AoHFAXyzEemI79hpD-o6pA" fontName="Noto Sans"/> | ||
397 | <element xmi:type="henshin:Edge" href="cps.henshin#_AoFP0HyzEemI79hpD-o6pA"/> | ||
398 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_AoHFAnyzEemI79hpD-o6pA" points="[-2, 23, 10, -119]$[-9, 136, 3, -6]"/> | ||
399 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_AoMkkHyzEemI79hpD-o6pA" id="(0.5897435897435898,0.13043478260869565)"/> | ||
400 | </edges> | ||
401 | <edges xmi:type="notation:Connector" xmi:id="_fabGMHy0EemI79hpD-o6pA" type="4001" source="_Zp4q8Hy0EemI79hpD-o6pA" target="_bFEPgHy0EemI79hpD-o6pA"> | ||
402 | <children xmi:type="notation:DecorationNode" xmi:id="_fabtQHy0EemI79hpD-o6pA" type="6001"> | ||
403 | <layoutConstraint xmi:type="notation:Location" xmi:id="_fabtQXy0EemI79hpD-o6pA" y="40"/> | ||
404 | </children> | ||
405 | <children xmi:type="notation:DecorationNode" xmi:id="_fabtQny0EemI79hpD-o6pA" type="6002"> | ||
406 | <layoutConstraint xmi:type="notation:Location" xmi:id="_facUUHy0EemI79hpD-o6pA" y="60"/> | ||
407 | </children> | ||
408 | <styles xmi:type="notation:FontStyle" xmi:id="_fabGMXy0EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
409 | <element xmi:type="henshin:Edge" href="cps.henshin#_faZ4EHy0EemI79hpD-o6pA"/> | ||
410 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_fabGMny0EemI79hpD-o6pA" points="[-1, 23, 0, -56]$[-2, 71, -1, -8]"/> | ||
411 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_faglwHy0EemI79hpD-o6pA" id="(0.49382716049382713,0.17391304347826086)"/> | ||
412 | </edges> | ||
413 | <edges xmi:type="notation:Connector" xmi:id="_7KsvMHy0EemI79hpD-o6pA" type="4001" source="_5jh9EHy0EemI79hpD-o6pA" target="_6FsO8Hy0EemI79hpD-o6pA"> | ||
414 | <children xmi:type="notation:DecorationNode" xmi:id="_7KtWQHy0EemI79hpD-o6pA" type="6001"> | ||
415 | <layoutConstraint xmi:type="notation:Location" xmi:id="_7KtWQXy0EemI79hpD-o6pA" y="40"/> | ||
416 | </children> | ||
417 | <children xmi:type="notation:DecorationNode" xmi:id="_7KtWQny0EemI79hpD-o6pA" type="6002"> | ||
418 | <layoutConstraint xmi:type="notation:Location" xmi:id="_7KtWQ3y0EemI79hpD-o6pA" y="60"/> | ||
419 | </children> | ||
420 | <styles xmi:type="notation:FontStyle" xmi:id="_7KsvMXy0EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
421 | <element xmi:type="henshin:Edge" href="cps.henshin#_7KrhEHy0EemI79hpD-o6pA"/> | ||
422 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_7KsvMny0EemI79hpD-o6pA" points="[3, 23, -5, -62]$[11, 62, 3, -23]"/> | ||
423 | </edges> | ||
424 | <edges xmi:type="notation:Connector" xmi:id="__HxBsHy0EemI79hpD-o6pA" type="4001" source="_8lWIQHy0EemI79hpD-o6pA" target="_6FsO8Hy0EemI79hpD-o6pA"> | ||
425 | <children xmi:type="notation:DecorationNode" xmi:id="__HxBs3y0EemI79hpD-o6pA" type="6001"> | ||
426 | <layoutConstraint xmi:type="notation:Location" xmi:id="__HxBtHy0EemI79hpD-o6pA" y="40"/> | ||
427 | </children> | ||
428 | <children xmi:type="notation:DecorationNode" xmi:id="__HxowHy0EemI79hpD-o6pA" type="6002"> | ||
429 | <layoutConstraint xmi:type="notation:Location" xmi:id="__HxowXy0EemI79hpD-o6pA" y="60"/> | ||
430 | </children> | ||
431 | <styles xmi:type="notation:FontStyle" xmi:id="__HxBsXy0EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
432 | <element xmi:type="henshin:Edge" href="cps.henshin#__HvMgHy0EemI79hpD-o6pA"/> | ||
433 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="__HxBsny0EemI79hpD-o6pA" points="[-24, -5, 115, -1]$[-98, -5, 41, -1]"/> | ||
434 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="__H0sEHy0EemI79hpD-o6pA" id="(0.20512820512820512,0.5869565217391305)"/> | ||
435 | </edges> | ||
436 | <edges xmi:type="notation:Connector" xmi:id="_epK2Iny5EemI79hpD-o6pA" type="4001" source="_U8_rwHy5EemI79hpD-o6pA" target="_YuaH4Hy5EemI79hpD-o6pA"> | ||
437 | <children xmi:type="notation:DecorationNode" xmi:id="_epK2JXy5EemI79hpD-o6pA" type="6001"> | ||
438 | <layoutConstraint xmi:type="notation:Location" xmi:id="_epK2Jny5EemI79hpD-o6pA" y="40"/> | ||
439 | </children> | ||
440 | <children xmi:type="notation:DecorationNode" xmi:id="_epK2J3y5EemI79hpD-o6pA" type="6002"> | ||
441 | <layoutConstraint xmi:type="notation:Location" xmi:id="_epK2KHy5EemI79hpD-o6pA" y="60"/> | ||
442 | </children> | ||
443 | <styles xmi:type="notation:FontStyle" xmi:id="_epK2I3y5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
444 | <element xmi:type="henshin:Edge" href="cps.henshin#_epK2IHy5EemI79hpD-o6pA"/> | ||
445 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_epK2JHy5EemI79hpD-o6pA" points="[15, -1, -82, 0]$[79, -3, -18, -2]"/> | ||
446 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_epMEQHy5EemI79hpD-o6pA" id="(0.84375,0.43478260869565216)"/> | ||
447 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_epMEQXy5EemI79hpD-o6pA" id="(0.13740458015267176,0.41304347826086957)"/> | ||
448 | </edges> | ||
449 | <edges xmi:type="notation:Connector" xmi:id="_fGay0Hy5EemI79hpD-o6pA" type="4001" source="_YuaH4Hy5EemI79hpD-o6pA" target="_XGUIsHy5EemI79hpD-o6pA"> | ||
450 | <children xmi:type="notation:DecorationNode" xmi:id="_fGay03y5EemI79hpD-o6pA" type="6001"> | ||
451 | <layoutConstraint xmi:type="notation:Location" xmi:id="_fGay1Hy5EemI79hpD-o6pA" y="40"/> | ||
452 | </children> | ||
453 | <children xmi:type="notation:DecorationNode" xmi:id="_fGbZ4Hy5EemI79hpD-o6pA" type="6002"> | ||
454 | <layoutConstraint xmi:type="notation:Location" xmi:id="_fGbZ4Xy5EemI79hpD-o6pA" y="60"/> | ||
455 | </children> | ||
456 | <styles xmi:type="notation:FontStyle" xmi:id="_fGay0Xy5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
457 | <element xmi:type="henshin:Edge" href="cps.henshin#_fGY9oHy5EemI79hpD-o6pA"/> | ||
458 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_fGay0ny5EemI79hpD-o6pA" points="[13, 1, -92, -3]$[106, -19, 1, -23]"/> | ||
459 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_fGfEQHy5EemI79hpD-o6pA" id="(0.9007633587786259,0.41304347826086957)"/> | ||
460 | </edges> | ||
461 | <edges xmi:type="notation:Connector" xmi:id="_fghU4Hy5EemI79hpD-o6pA" type="4001" source="_XGUIsHy5EemI79hpD-o6pA" target="_XfT3gHy5EemI79hpD-o6pA"> | ||
462 | <children xmi:type="notation:DecorationNode" xmi:id="_fgh78Hy5EemI79hpD-o6pA" type="6001"> | ||
463 | <layoutConstraint xmi:type="notation:Location" xmi:id="_fgh78Xy5EemI79hpD-o6pA" y="40"/> | ||
464 | </children> | ||
465 | <children xmi:type="notation:DecorationNode" xmi:id="_fgh78ny5EemI79hpD-o6pA" type="6002"> | ||
466 | <layoutConstraint xmi:type="notation:Location" xmi:id="_fgh783y5EemI79hpD-o6pA" y="60"/> | ||
467 | </children> | ||
468 | <styles xmi:type="notation:FontStyle" xmi:id="_fghU4Xy5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
469 | <element xmi:type="henshin:Edge" href="cps.henshin#_fggGwHy5EemI79hpD-o6pA"/> | ||
470 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_fghU4ny5EemI79hpD-o6pA" points="[8, 23, 1, -116]$[8, 116, 1, -23]"/> | ||
471 | </edges> | ||
472 | <edges xmi:type="notation:Connector" xmi:id="_f_l2gny5EemI79hpD-o6pA" type="4001" source="_U8_rwHy5EemI79hpD-o6pA" target="_WEe4QHy5EemI79hpD-o6pA"> | ||
473 | <children xmi:type="notation:DecorationNode" xmi:id="_f_mdkHy5EemI79hpD-o6pA" type="6001"> | ||
474 | <layoutConstraint xmi:type="notation:Location" xmi:id="_f_mdkXy5EemI79hpD-o6pA" y="40"/> | ||
475 | </children> | ||
476 | <children xmi:type="notation:DecorationNode" xmi:id="_f_mdkny5EemI79hpD-o6pA" type="6002"> | ||
477 | <layoutConstraint xmi:type="notation:Location" xmi:id="_f_mdk3y5EemI79hpD-o6pA" y="60"/> | ||
478 | </children> | ||
479 | <styles xmi:type="notation:FontStyle" xmi:id="_f_l2g3y5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
480 | <element xmi:type="henshin:Edge" href="cps.henshin#_f_l2gHy5EemI79hpD-o6pA"/> | ||
481 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_f_l2hHy5EemI79hpD-o6pA" points="[2, 23, 0, -69]$[3, 83, 1, -9]"/> | ||
482 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_f_nrsHy5EemI79hpD-o6pA" id="(0.5213675213675214,0.1956521739130435)"/> | ||
483 | </edges> | ||
484 | <edges xmi:type="notation:Connector" xmi:id="_gh1n8Hy5EemI79hpD-o6pA" type="4001" source="_WEe4QHy5EemI79hpD-o6pA" target="_XfT3gHy5EemI79hpD-o6pA"> | ||
485 | <children xmi:type="notation:DecorationNode" xmi:id="_gh2PAny5EemI79hpD-o6pA" type="6001"> | ||
486 | <layoutConstraint xmi:type="notation:Location" xmi:id="_gh2PA3y5EemI79hpD-o6pA" y="40"/> | ||
487 | </children> | ||
488 | <children xmi:type="notation:DecorationNode" xmi:id="_gh2PBHy5EemI79hpD-o6pA" type="6002"> | ||
489 | <layoutConstraint xmi:type="notation:Location" xmi:id="_gh2PBXy5EemI79hpD-o6pA" y="60"/> | ||
490 | </children> | ||
491 | <styles xmi:type="notation:FontStyle" xmi:id="_gh2PAHy5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
492 | <element xmi:type="henshin:Edge" href="cps.henshin#_gh0Z0Hy5EemI79hpD-o6pA"/> | ||
493 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_gh2PAXy5EemI79hpD-o6pA" points="[15, 2, -284, -45]$[299, 70, 0, 23]"/> | ||
494 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_gh55YHy5EemI79hpD-o6pA" id="(0.8717948717948718,0.1956521739130435)"/> | ||
495 | </edges> | ||
496 | <edges xmi:type="notation:Connector" xmi:id="_hW6OwHy5EemI79hpD-o6pA" type="4001" source="_QzVuwHy5EemI79hpD-o6pA" target="_WEe4QHy5EemI79hpD-o6pA"> | ||
497 | <children xmi:type="notation:DecorationNode" xmi:id="_hW6Ow3y5EemI79hpD-o6pA" type="6001"> | ||
498 | <layoutConstraint xmi:type="notation:Location" xmi:id="_hW6OxHy5EemI79hpD-o6pA" y="40"/> | ||
499 | </children> | ||
500 | <children xmi:type="notation:DecorationNode" xmi:id="_hW6OxXy5EemI79hpD-o6pA" type="6002"> | ||
501 | <layoutConstraint xmi:type="notation:Location" xmi:id="_hW6Oxny5EemI79hpD-o6pA" y="60"/> | ||
502 | </children> | ||
503 | <styles xmi:type="notation:FontStyle" xmi:id="_hW6OwXy5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
504 | <element xmi:type="henshin:Edge" href="cps.henshin#_hW5nsHy5EemI79hpD-o6pA"/> | ||
505 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_hW6Owny5EemI79hpD-o6pA" points="[1, -5, -81, 0]$[71, -6, -11, -1]"/> | ||
506 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hW7c4Hy5EemI79hpD-o6pA" id="(0.9873417721518988,0.6739130434782609)"/> | ||
507 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_hW7c4Xy5EemI79hpD-o6pA" id="(0.09401709401709402,0.41304347826086957)"/> | ||
508 | </edges> | ||
509 | <edges xmi:type="notation:Connector" xmi:id="_l0vE8Hy5EemI79hpD-o6pA" type="4001" source="_iu5VYHy5EemI79hpD-o6pA" target="_XfT3gHy5EemI79hpD-o6pA"> | ||
510 | <children xmi:type="notation:DecorationNode" xmi:id="_l0vE83y5EemI79hpD-o6pA" type="6001"> | ||
511 | <layoutConstraint xmi:type="notation:Location" xmi:id="_l0vE9Hy5EemI79hpD-o6pA" y="40"/> | ||
512 | </children> | ||
513 | <children xmi:type="notation:DecorationNode" xmi:id="_l0vE9Xy5EemI79hpD-o6pA" type="6002"> | ||
514 | <layoutConstraint xmi:type="notation:Location" xmi:id="_l0vE9ny5EemI79hpD-o6pA" y="60"/> | ||
515 | </children> | ||
516 | <styles xmi:type="notation:FontStyle" xmi:id="_l0vE8Xy5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
517 | <element xmi:type="henshin:Edge" href="cps.henshin#_l0ud4Hy5EemI79hpD-o6pA"/> | ||
518 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_l0vE8ny5EemI79hpD-o6pA" points="[28, -5, -282, 43]$[309, -44, -1, 4]"/> | ||
519 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_l0w6IHy5EemI79hpD-o6pA" id="(0.7606837606837606,0.5652173913043478)"/> | ||
520 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_l0w6IXy5EemI79hpD-o6pA" id="(0.4691358024691358,0.9130434782608695)"/> | ||
521 | </edges> | ||
522 | <edges xmi:type="notation:Connector" xmi:id="_mLuBkHy5EemI79hpD-o6pA" type="4001" source="_QzVuwHy5EemI79hpD-o6pA" target="_iu5VYHy5EemI79hpD-o6pA"> | ||
523 | <children xmi:type="notation:DecorationNode" xmi:id="_mLuBk3y5EemI79hpD-o6pA" type="6001"> | ||
524 | <layoutConstraint xmi:type="notation:Location" xmi:id="_mLuBlHy5EemI79hpD-o6pA" y="40"/> | ||
525 | </children> | ||
526 | <children xmi:type="notation:DecorationNode" xmi:id="_mLuBlXy5EemI79hpD-o6pA" type="6002"> | ||
527 | <layoutConstraint xmi:type="notation:Location" xmi:id="_mLuBlny5EemI79hpD-o6pA" y="60"/> | ||
528 | </children> | ||
529 | <styles xmi:type="notation:FontStyle" xmi:id="_mLuBkXy5EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
530 | <element xmi:type="henshin:Edge" href="cps.henshin#_mLtagHy5EemI79hpD-o6pA"/> | ||
531 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_mLuBkny5EemI79hpD-o6pA" points="[28, 23, -111, -91]$[110, 123, -29, 9]"/> | ||
532 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_mLuooHy5EemI79hpD-o6pA" id="(0.24786324786324787,0.717391304347826)"/> | ||
533 | </edges> | ||
534 | <edges xmi:type="notation:Connector" xmi:id="_UpCYgHy6EemI79hpD-o6pA" type="4001" source="_OdxwIHy6EemI79hpD-o6pA" target="_PGbrkHy6EemI79hpD-o6pA"> | ||
535 | <children xmi:type="notation:DecorationNode" xmi:id="_UpCYg3y6EemI79hpD-o6pA" type="6001"> | ||
536 | <layoutConstraint xmi:type="notation:Location" xmi:id="_UpCYhHy6EemI79hpD-o6pA" y="40"/> | ||
537 | </children> | ||
538 | <children xmi:type="notation:DecorationNode" xmi:id="_UpCYhXy6EemI79hpD-o6pA" type="6002"> | ||
539 | <layoutConstraint xmi:type="notation:Location" xmi:id="_UpCYhny6EemI79hpD-o6pA" y="60"/> | ||
540 | </children> | ||
541 | <styles xmi:type="notation:FontStyle" xmi:id="_UpCYgXy6EemI79hpD-o6pA" fontName="Noto Sans"/> | ||
542 | <element xmi:type="henshin:Edge" href="cps.henshin#_UpBxcHy6EemI79hpD-o6pA"/> | ||
543 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_UpCYgny6EemI79hpD-o6pA" points="[4, 23, 0, -114]$[6, 128, 2, -9]"/> | ||
544 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_UpDmoHy6EemI79hpD-o6pA" id="(0.5432098765432098,0.1956521739130435)"/> | ||
545 | </edges> | ||
546 | <edges xmi:type="notation:Connector" xmi:id="_LOAqgH8VEemiUoPdWqOlQg" type="4001" source="_WEe4QHy5EemI79hpD-o6pA" target="_DK8L8H8VEemiUoPdWqOlQg"> | ||
547 | <children xmi:type="notation:DecorationNode" xmi:id="_LOAqg38VEemiUoPdWqOlQg" type="6001"> | ||
548 | <layoutConstraint xmi:type="notation:Location" xmi:id="_LOAqhH8VEemiUoPdWqOlQg" y="40"/> | ||
549 | </children> | ||
550 | <children xmi:type="notation:DecorationNode" xmi:id="_LOAqhX8VEemiUoPdWqOlQg" type="6002"> | ||
551 | <layoutConstraint xmi:type="notation:Location" xmi:id="_LOAqhn8VEemiUoPdWqOlQg" y="60"/> | ||
552 | </children> | ||
553 | <styles xmi:type="notation:FontStyle" xmi:id="_LOAqgX8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
554 | <element xmi:type="henshin:Edge" href="cps.henshin#_LOADcH8VEemiUoPdWqOlQg"/> | ||
555 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_LOAqgn8VEemiUoPdWqOlQg" points="[27, -7, -120, 30]$[134, -46, -13, -9]"/> | ||
556 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_LOCfsH8VEemiUoPdWqOlQg" id="(0.6666666666666666,0.15217391304347827)"/> | ||
557 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_LOCfsX8VEemiUoPdWqOlQg" id="(0.25925925925925924,0.1956521739130435)"/> | ||
558 | </edges> | ||
559 | <edges xmi:type="notation:Connector" xmi:id="_uW-YUH8VEemiUoPdWqOlQg" type="4001" source="_VfOboH8VEemiUoPdWqOlQg" target="_cTdIgH8VEemiUoPdWqOlQg"> | ||
560 | <children xmi:type="notation:DecorationNode" xmi:id="_uW-_YH8VEemiUoPdWqOlQg" type="6001"> | ||
561 | <layoutConstraint xmi:type="notation:Location" xmi:id="_uW-_YX8VEemiUoPdWqOlQg" y="40"/> | ||
562 | </children> | ||
563 | <children xmi:type="notation:DecorationNode" xmi:id="_uW-_Yn8VEemiUoPdWqOlQg" type="6002"> | ||
564 | <layoutConstraint xmi:type="notation:Location" xmi:id="_uW-_Y38VEemiUoPdWqOlQg" y="60"/> | ||
565 | </children> | ||
566 | <styles xmi:type="notation:FontStyle" xmi:id="_uW-YUX8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
567 | <element xmi:type="henshin:Edge" href="cps.henshin#_uW8jIH8VEemiUoPdWqOlQg"/> | ||
568 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_uW-YUn8VEemiUoPdWqOlQg" points="[36, -23, -86, 55]$[108, -86, -14, -8]"/> | ||
569 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_uXCCsH8VEemiUoPdWqOlQg" id="(0.28205128205128205,0.17391304347826086)"/> | ||
570 | </edges> | ||
571 | <edges xmi:type="notation:Connector" xmi:id="_ulQE4H8VEemiUoPdWqOlQg" type="4001" source="_VfOboH8VEemiUoPdWqOlQg" target="_Xr_OIH8VEemiUoPdWqOlQg"> | ||
572 | <children xmi:type="notation:DecorationNode" xmi:id="_ulQr8H8VEemiUoPdWqOlQg" type="6001"> | ||
573 | <layoutConstraint xmi:type="notation:Location" xmi:id="_ulQr8X8VEemiUoPdWqOlQg" y="40"/> | ||
574 | </children> | ||
575 | <children xmi:type="notation:DecorationNode" xmi:id="_ulQr8n8VEemiUoPdWqOlQg" type="6002"> | ||
576 | <layoutConstraint xmi:type="notation:Location" xmi:id="_ulQr838VEemiUoPdWqOlQg" y="60"/> | ||
577 | </children> | ||
578 | <styles xmi:type="notation:FontStyle" xmi:id="_ulQE4X8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
579 | <element xmi:type="henshin:Edge" href="cps.henshin#_ulPd0H8VEemiUoPdWqOlQg"/> | ||
580 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_ulQE4n8VEemiUoPdWqOlQg" points="[40, 19, -76, -39]$[89, 50, -27, -8]"/> | ||
581 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ulTvQH8VEemiUoPdWqOlQg" id="(0.23076923076923078,0.30434782608695654)"/> | ||
582 | </edges> | ||
583 | <edges xmi:type="notation:Connector" xmi:id="_3NJHwH8VEemiUoPdWqOlQg" type="4001" source="_cTdIgH8VEemiUoPdWqOlQg" target="_wZseAH8VEemiUoPdWqOlQg"> | ||
584 | <children xmi:type="notation:DecorationNode" xmi:id="_3NJHw38VEemiUoPdWqOlQg" type="6001"> | ||
585 | <layoutConstraint xmi:type="notation:Location" xmi:id="_3NJHxH8VEemiUoPdWqOlQg" y="40"/> | ||
586 | </children> | ||
587 | <children xmi:type="notation:DecorationNode" xmi:id="_3NJHxX8VEemiUoPdWqOlQg" type="6002"> | ||
588 | <layoutConstraint xmi:type="notation:Location" xmi:id="_3NJHxn8VEemiUoPdWqOlQg" y="60"/> | ||
589 | </children> | ||
590 | <styles xmi:type="notation:FontStyle" xmi:id="_3NJHwX8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
591 | <element xmi:type="henshin:Edge" href="cps.henshin#_3NH5oH8VEemiUoPdWqOlQg"/> | ||
592 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_3NJHwn8VEemiUoPdWqOlQg" points="[-6, -4, 131, 94]$[-141, -121, -4, -23]"/> | ||
593 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_3NK88H8VEemiUoPdWqOlQg" id="(0.2905982905982906,0.08695652173913043)"/> | ||
594 | </edges> | ||
595 | <edges xmi:type="notation:Connector" xmi:id="_4SrMcH8VEemiUoPdWqOlQg" type="4001" source="_WJm1YH8VEemiUoPdWqOlQg" target="_cTdIgH8VEemiUoPdWqOlQg"> | ||
596 | <children xmi:type="notation:DecorationNode" xmi:id="_4SrMc38VEemiUoPdWqOlQg" type="6001"> | ||
597 | <layoutConstraint xmi:type="notation:Location" xmi:id="_4SrMdH8VEemiUoPdWqOlQg" y="40"/> | ||
598 | </children> | ||
599 | <children xmi:type="notation:DecorationNode" xmi:id="_4SrMdX8VEemiUoPdWqOlQg" type="6002"> | ||
600 | <layoutConstraint xmi:type="notation:Location" xmi:id="_4SrMdn8VEemiUoPdWqOlQg" y="60"/> | ||
601 | </children> | ||
602 | <styles xmi:type="notation:FontStyle" xmi:id="_4SrMcX8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
603 | <element xmi:type="henshin:Edge" href="cps.henshin#_4SqlYH8VEemiUoPdWqOlQg"/> | ||
604 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_4SrMcn8VEemiUoPdWqOlQg" points="[5, 23, 6, -94]$[5, 94, 6, -23]"/> | ||
605 | </edges> | ||
606 | <edges xmi:type="notation:Connector" xmi:id="_44ku0H8VEemiUoPdWqOlQg" type="4001" source="_WJm1YH8VEemiUoPdWqOlQg" target="_fYb8cH8VEemiUoPdWqOlQg"> | ||
607 | <children xmi:type="notation:DecorationNode" xmi:id="_44ku038VEemiUoPdWqOlQg" type="6001"> | ||
608 | <layoutConstraint xmi:type="notation:Location" xmi:id="_44ku1H8VEemiUoPdWqOlQg" y="40"/> | ||
609 | </children> | ||
610 | <children xmi:type="notation:DecorationNode" xmi:id="_44ku1X8VEemiUoPdWqOlQg" type="6002"> | ||
611 | <layoutConstraint xmi:type="notation:Location" xmi:id="_44ku1n8VEemiUoPdWqOlQg" y="60"/> | ||
612 | </children> | ||
613 | <styles xmi:type="notation:FontStyle" xmi:id="_44ku0X8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
614 | <element xmi:type="henshin:Edge" href="cps.henshin#_44kHwH8VEemiUoPdWqOlQg"/> | ||
615 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_44ku0n8VEemiUoPdWqOlQg" points="[11, -1, -144, 2]$[90, -1, -65, 2]"/> | ||
616 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_44l88H8VEemiUoPdWqOlQg" id="(0.8854166666666666,0.5652173913043478)"/> | ||
617 | </edges> | ||
618 | <edges xmi:type="notation:Connector" xmi:id="_5ReXAH8VEemiUoPdWqOlQg" type="4001" source="_fYb8cH8VEemiUoPdWqOlQg" target="_kmA0kH8VEemiUoPdWqOlQg"> | ||
619 | <children xmi:type="notation:DecorationNode" xmi:id="_5ReXA38VEemiUoPdWqOlQg" type="6001"> | ||
620 | <layoutConstraint xmi:type="notation:Location" xmi:id="_5ReXBH8VEemiUoPdWqOlQg" y="40"/> | ||
621 | </children> | ||
622 | <children xmi:type="notation:DecorationNode" xmi:id="_5ReXBX8VEemiUoPdWqOlQg" type="6002"> | ||
623 | <layoutConstraint xmi:type="notation:Location" xmi:id="_5ReXBn8VEemiUoPdWqOlQg" y="60"/> | ||
624 | </children> | ||
625 | <styles xmi:type="notation:FontStyle" xmi:id="_5ReXAX8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
626 | <element xmi:type="henshin:Edge" href="cps.henshin#_5Rch0H8VEemiUoPdWqOlQg"/> | ||
627 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_5ReXAn8VEemiUoPdWqOlQg" points="[17, -2, -95, 1]$[79, -11, -33, -8]"/> | ||
628 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_5RgMMH8VEemiUoPdWqOlQg" id="(0.8702290076335878,0.5652173913043478)"/> | ||
629 | </edges> | ||
630 | <edges xmi:type="notation:Connector" xmi:id="_5r5pMH8VEemiUoPdWqOlQg" type="4001" source="_kmA0kH8VEemiUoPdWqOlQg" target="_Y0FeoH8VEemiUoPdWqOlQg"> | ||
631 | <children xmi:type="notation:DecorationNode" xmi:id="_5r5pM38VEemiUoPdWqOlQg" type="6001"> | ||
632 | <layoutConstraint xmi:type="notation:Location" xmi:id="_5r5pNH8VEemiUoPdWqOlQg" y="40"/> | ||
633 | </children> | ||
634 | <children xmi:type="notation:DecorationNode" xmi:id="_5r5pNX8VEemiUoPdWqOlQg" type="6002"> | ||
635 | <layoutConstraint xmi:type="notation:Location" xmi:id="_5r5pNn8VEemiUoPdWqOlQg" y="60"/> | ||
636 | </children> | ||
637 | <styles xmi:type="notation:FontStyle" xmi:id="_5r5pMX8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
638 | <element xmi:type="henshin:Edge" href="cps.henshin#_5r5CIH8VEemiUoPdWqOlQg"/> | ||
639 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_5r5pMn8VEemiUoPdWqOlQg" points="[-3, 23, -3, -157]$[-3, 157, -3, -23]"/> | ||
640 | </edges> | ||
641 | <edges xmi:type="notation:Connector" xmi:id="_-vsTMH8VEemiUoPdWqOlQg" type="4001" source="_Xr_OIH8VEemiUoPdWqOlQg" target="_Y0FeoH8VEemiUoPdWqOlQg"> | ||
642 | <children xmi:type="notation:DecorationNode" xmi:id="_-vsTM38VEemiUoPdWqOlQg" type="6001"> | ||
643 | <layoutConstraint xmi:type="notation:Location" xmi:id="_-vsTNH8VEemiUoPdWqOlQg" y="40"/> | ||
644 | </children> | ||
645 | <children xmi:type="notation:DecorationNode" xmi:id="_-vsTNX8VEemiUoPdWqOlQg" type="6002"> | ||
646 | <layoutConstraint xmi:type="notation:Location" xmi:id="_-vsTNn8VEemiUoPdWqOlQg" y="60"/> | ||
647 | </children> | ||
648 | <styles xmi:type="notation:FontStyle" xmi:id="_-vsTMX8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
649 | <element xmi:type="henshin:Edge" href="cps.henshin#_-vrFEH8VEemiUoPdWqOlQg"/> | ||
650 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_-vsTMn8VEemiUoPdWqOlQg" points="[59, -14, -295, 53]$[346, -90, -8, -23]"/> | ||
651 | </edges> | ||
652 | <edges xmi:type="notation:Connector" xmi:id="__Tfj0H8VEemiUoPdWqOlQg" type="4001" source="_cTdIgH8VEemiUoPdWqOlQg" target="_Y0FeoH8VEemiUoPdWqOlQg"> | ||
653 | <children xmi:type="notation:DecorationNode" xmi:id="__Tfj038VEemiUoPdWqOlQg" type="6001"> | ||
654 | <layoutConstraint xmi:type="notation:Location" xmi:id="__Tfj1H8VEemiUoPdWqOlQg" y="40"/> | ||
655 | </children> | ||
656 | <children xmi:type="notation:DecorationNode" xmi:id="__Tfj1X8VEemiUoPdWqOlQg" type="6002"> | ||
657 | <layoutConstraint xmi:type="notation:Location" xmi:id="__Tfj1n8VEemiUoPdWqOlQg" y="60"/> | ||
658 | </children> | ||
659 | <styles xmi:type="notation:FontStyle" xmi:id="__Tfj0X8VEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
660 | <element xmi:type="henshin:Edge" href="cps.henshin#__Te8wH8VEemiUoPdWqOlQg"/> | ||
661 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="__Tfj0n8VEemiUoPdWqOlQg" points="[11, 2, -295, -62]$[266, 56, -40, -8]"/> | ||
662 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="__TiAEH8VEemiUoPdWqOlQg" id="(0.905982905982906,0.4782608695652174)"/> | ||
663 | </edges> | ||
664 | <edges xmi:type="notation:Connector" xmi:id="_H6qjEH8YEemiUoPdWqOlQg" type="4001" source="_A8fQAH8YEemiUoPdWqOlQg" target="_DowB8H8YEemiUoPdWqOlQg"> | ||
665 | <children xmi:type="notation:DecorationNode" xmi:id="_H6qjE38YEemiUoPdWqOlQg" type="6001"> | ||
666 | <layoutConstraint xmi:type="notation:Location" xmi:id="_H6qjFH8YEemiUoPdWqOlQg" y="40"/> | ||
667 | </children> | ||
668 | <children xmi:type="notation:DecorationNode" xmi:id="_H6qjFX8YEemiUoPdWqOlQg" type="6002"> | ||
669 | <layoutConstraint xmi:type="notation:Location" xmi:id="_H6qjFn8YEemiUoPdWqOlQg" y="60"/> | ||
670 | </children> | ||
671 | <styles xmi:type="notation:FontStyle" xmi:id="_H6qjEX8YEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
672 | <element xmi:type="henshin:Edge" href="cps.henshin#_H6p8AH8YEemiUoPdWqOlQg"/> | ||
673 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_H6qjEn8YEemiUoPdWqOlQg" points="[-3, 23, -2, -129]$[-3, 175, -2, 23]"/> | ||
674 | </edges> | ||
675 | <edges xmi:type="notation:Connector" xmi:id="_IR7MgX8YEemiUoPdWqOlQg" type="4001" source="_AUGaUH8YEemiUoPdWqOlQg" target="_DowB8H8YEemiUoPdWqOlQg"> | ||
676 | <children xmi:type="notation:DecorationNode" xmi:id="_IR7zkH8YEemiUoPdWqOlQg" type="6001"> | ||
677 | <layoutConstraint xmi:type="notation:Location" xmi:id="_IR7zkX8YEemiUoPdWqOlQg" y="40"/> | ||
678 | </children> | ||
679 | <children xmi:type="notation:DecorationNode" xmi:id="_IR7zkn8YEemiUoPdWqOlQg" type="6002"> | ||
680 | <layoutConstraint xmi:type="notation:Location" xmi:id="_IR7zk38YEemiUoPdWqOlQg" y="60"/> | ||
681 | </children> | ||
682 | <styles xmi:type="notation:FontStyle" xmi:id="_IR7Mgn8YEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
683 | <element xmi:type="henshin:Edge" href="cps.henshin#_IR7MgH8YEemiUoPdWqOlQg"/> | ||
684 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_IR7Mg38YEemiUoPdWqOlQg" points="[29, 23, -155, -122]$[160, 140, -24, -5]"/> | ||
685 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_IR8aoH8YEemiUoPdWqOlQg" id="(0.20512820512820512,0.34782608695652173)"/> | ||
686 | </edges> | ||
687 | <edges xmi:type="notation:Connector" xmi:id="_InE9IH8YEemiUoPdWqOlQg" type="4001" source="_AUGaUH8YEemiUoPdWqOlQg" target="_A8fQAH8YEemiUoPdWqOlQg"> | ||
688 | <children xmi:type="notation:DecorationNode" xmi:id="_InE9I38YEemiUoPdWqOlQg" type="6001"> | ||
689 | <layoutConstraint xmi:type="notation:Location" xmi:id="_InE9JH8YEemiUoPdWqOlQg" y="40"/> | ||
690 | </children> | ||
691 | <children xmi:type="notation:DecorationNode" xmi:id="_InE9JX8YEemiUoPdWqOlQg" type="6002"> | ||
692 | <layoutConstraint xmi:type="notation:Location" xmi:id="_InE9Jn8YEemiUoPdWqOlQg" y="60"/> | ||
693 | </children> | ||
694 | <styles xmi:type="notation:FontStyle" xmi:id="_InE9IX8YEemiUoPdWqOlQg" fontName="Noto Sans"/> | ||
695 | <element xmi:type="henshin:Edge" href="cps.henshin#_InEWEH8YEemiUoPdWqOlQg"/> | ||
696 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_InE9In8YEemiUoPdWqOlQg" points="[16, 8, -179, 9]$[188, 22, -7, 23]"/> | ||
697 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_InGLQH8YEemiUoPdWqOlQg" id="(0.7974683544303798,0.5217391304347826)"/> | ||
698 | </edges> | ||
699 | </notation:Diagram> | ||
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 | |||
3 | pluginName = hu.bme.mit.inf.dslreasoner.domains.cps | ||
4 | providerName = 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..5a0fee8d --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml | |||
@@ -0,0 +1,27 @@ | |||
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="hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries" point="org.eclipse.viatra.query.runtime.queryspecification"> | ||
8 | <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"> | ||
9 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement"/> | ||
10 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement"/> | ||
11 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory"/> | ||
12 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd"/> | ||
13 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.instanceDoesNotSatisfyRequirement"/> | ||
14 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.requirementNotSatisfied"/> | ||
15 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.redundantInstancesOnSameHost"/> | ||
16 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric"/> | ||
17 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric"/> | ||
18 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric"/> | ||
19 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsCost"/> | ||
20 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocate"/> | ||
21 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.unallocateAppInstance"/> | ||
22 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.createHostInstance"/> | ||
23 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance"/> | ||
24 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.guidanceObjective"/> | ||
25 | </group> | ||
26 | </extension> | ||
27 | </plugin> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/representations.aird b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/representations.aird new file mode 100644 index 00000000..dbaf9f8c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/representations.aird | |||
@@ -0,0 +1,600 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:description="http://www.eclipse.org/sirius/description/1.1.0" xmlns:description_1="http://www.eclipse.org/sirius/diagram/description/1.1.0" xmlns:diagram="http://www.eclipse.org/sirius/diagram/1.1.0" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/sirius/diagram/description/style/1.1.0" xmlns:viewpoint="http://www.eclipse.org/sirius/1.1.0" xsi:schemaLocation="http://www.eclipse.org/sirius/description/1.1.0 http://www.eclipse.org/sirius/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description http://www.eclipse.org/sirius/diagram/description/style/1.1.0 http://www.eclipse.org/sirius/diagram/1.1.0#//description/style"> | ||
3 | <viewpoint:DAnalysis uid="_hQ-pEHpMEem6LP4EDiey6Q" selectedViews="_jsELcHpMEem6LP4EDiey6Q" version="14.1.0.201810161215"> | ||
4 | <semanticResources>model/cps.ecore</semanticResources> | ||
5 | <semanticResources>http://www.eclipse.org/emf/2002/Ecore</semanticResources> | ||
6 | <semanticResources>model/cps.genmodel</semanticResources> | ||
7 | <semanticResources>src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.xtend</semanticResources> | ||
8 | <semanticResources>src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.xtend</semanticResources> | ||
9 | <semanticResources>src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend</semanticResources> | ||
10 | <semanticResources>src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql</semanticResources> | ||
11 | <semanticResources>src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.xtend</semanticResources> | ||
12 | <ownedViews xmi:type="viewpoint:DView" uid="_jsELcHpMEem6LP4EDiey6Q"> | ||
13 | <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/> | ||
14 | <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_kBjTQHpMEem6LP4EDiey6Q" name="cps class diagram" repPath="#_kAPrsHpMEem6LP4EDiey6Q"> | ||
15 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> | ||
16 | <target xmi:type="ecore:EPackage" href="model/cps.ecore#/"/> | ||
17 | </ownedRepresentationDescriptors> | ||
18 | </ownedViews> | ||
19 | </viewpoint:DAnalysis> | ||
20 | <diagram:DSemanticDiagram uid="_kAPrsHpMEem6LP4EDiey6Q" name="cps class diagram"> | ||
21 | <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_kBb-gHpMEem6LP4EDiey6Q" source="DANNOTATION_CUSTOMIZATION_KEY"> | ||
22 | <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_kBclkHpMEem6LP4EDiey6Q"> | ||
23 | <computedStyleDescriptions xmi:type="style:BundledImageDescription" xmi:id="_kku40HpMEem6LP4EDiey6Q" labelExpression="service:render" labelAlignment="LEFT" tooltipExpression="service:renderTooltip" sizeComputationExpression="1"> | ||
24 | <borderColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
25 | <labelFormat>bold</labelFormat> | ||
26 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
27 | <color xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
28 | </computedStyleDescriptions> | ||
29 | <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_kk538HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan"> | ||
30 | <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
31 | <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_kk538XpMEem6LP4EDiey6Q" showIcon="false" labelExpression="service:render"> | ||
32 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
33 | </centerLabelStyleDescription> | ||
34 | <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_kk538npMEem6LP4EDiey6Q" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel"> | ||
35 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> | ||
36 | </endLabelStyleDescription> | ||
37 | </computedStyleDescriptions> | ||
38 | <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_kk_-kHpMEem6LP4EDiey6Q" routingStyle="manhattan"> | ||
39 | <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
40 | <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_kk_-kXpMEem6LP4EDiey6Q" showIcon="false" labelExpression="service:render"> | ||
41 | <labelFormat>bold</labelFormat> | ||
42 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
43 | </centerLabelStyleDescription> | ||
44 | <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_kk_-knpMEem6LP4EDiey6Q" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel"> | ||
45 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/> | ||
46 | </endLabelStyleDescription> | ||
47 | </computedStyleDescriptions> | ||
48 | <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_klBzwHpMEem6LP4EDiey6Q" sourceArrow="InputArrow" routingStyle="manhattan"> | ||
49 | <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
50 | <beginLabelStyleDescription xmi:type="style:BeginLabelStyleDescription" xmi:id="_klBzwXpMEem6LP4EDiey6Q" showIcon="false" labelExpression="service:renderEOpposite"> | ||
51 | <labelFormat>bold</labelFormat> | ||
52 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
53 | </beginLabelStyleDescription> | ||
54 | <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_klBzwnpMEem6LP4EDiey6Q" showIcon="false" labelExpression="service:render"> | ||
55 | <labelFormat>bold</labelFormat> | ||
56 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
57 | </endLabelStyleDescription> | ||
58 | </computedStyleDescriptions> | ||
59 | <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_klDo8HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan"> | ||
60 | <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
61 | <beginLabelStyleDescription xmi:type="style:BeginLabelStyleDescription" xmi:id="_klDo8XpMEem6LP4EDiey6Q" showIcon="false" labelExpression="service:renderEOpposite"> | ||
62 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
63 | </beginLabelStyleDescription> | ||
64 | <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_klDo8npMEem6LP4EDiey6Q" showIcon="false" labelExpression="service:render"> | ||
65 | <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/> | ||
66 | </endLabelStyleDescription> | ||
67 | </computedStyleDescriptions> | ||
68 | </data> | ||
69 | </ownedAnnotationEntries> | ||
70 | <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_kCIiEHpMEem6LP4EDiey6Q" source="GMF_DIAGRAMS"> | ||
71 | <data xmi:type="notation:Diagram" xmi:id="_kCIiEXpMEem6LP4EDiey6Q" type="Sirius" element="_kAPrsHpMEem6LP4EDiey6Q" measurementUnit="Pixel"> | ||
72 | <children xmi:type="notation:Node" xmi:id="_klH6YHpMEem6LP4EDiey6Q" type="2003" element="_kkaIsHpMEem6LP4EDiey6Q"> | ||
73 | <children xmi:type="notation:Node" xmi:id="_klIhcHpMEem6LP4EDiey6Q" type="5007"/> | ||
74 | <children xmi:type="notation:Node" xmi:id="_klKWoHpMEem6LP4EDiey6Q" type="7004"> | ||
75 | <styles xmi:type="notation:SortingStyle" xmi:id="_klKWoXpMEem6LP4EDiey6Q"/> | ||
76 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klKWonpMEem6LP4EDiey6Q"/> | ||
77 | </children> | ||
78 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klH6YXpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
79 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klH6YnpMEem6LP4EDiey6Q" x="200" y="960"/> | ||
80 | </children> | ||
81 | <children xmi:type="notation:Node" xmi:id="_klK9sHpMEem6LP4EDiey6Q" type="2003" element="_kkeaIHpMEem6LP4EDiey6Q"> | ||
82 | <children xmi:type="notation:Node" xmi:id="_klK9s3pMEem6LP4EDiey6Q" type="5007"/> | ||
83 | <children xmi:type="notation:Node" xmi:id="_klK9tHpMEem6LP4EDiey6Q" type="7004"> | ||
84 | <styles xmi:type="notation:SortingStyle" xmi:id="_klK9tXpMEem6LP4EDiey6Q"/> | ||
85 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klK9tnpMEem6LP4EDiey6Q"/> | ||
86 | </children> | ||
87 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klK9sXpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
88 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klK9snpMEem6LP4EDiey6Q" x="200" y="480"/> | ||
89 | </children> | ||
90 | <children xmi:type="notation:Node" xmi:id="_klK9t3pMEem6LP4EDiey6Q" type="2003" element="_kkfoQXpMEem6LP4EDiey6Q"> | ||
91 | <children xmi:type="notation:Node" xmi:id="_klLkwHpMEem6LP4EDiey6Q" type="5007"/> | ||
92 | <children xmi:type="notation:Node" xmi:id="_klLkwXpMEem6LP4EDiey6Q" type="7004"> | ||
93 | <children xmi:type="notation:Node" xmi:id="_klOoEHpMEem6LP4EDiey6Q" type="3010" element="_kktqsHpMEem6LP4EDiey6Q"> | ||
94 | <styles xmi:type="notation:FontStyle" xmi:id="_klOoEXpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8" bold="true"/> | ||
95 | <layoutConstraint xmi:type="notation:Location" xmi:id="_klOoEnpMEem6LP4EDiey6Q"/> | ||
96 | </children> | ||
97 | <children xmi:type="notation:Node" xmi:id="_klPPIHpMEem6LP4EDiey6Q" type="3010" element="_kkxVEHpMEem6LP4EDiey6Q"> | ||
98 | <styles xmi:type="notation:FontStyle" xmi:id="_klPPIXpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8" bold="true"/> | ||
99 | <layoutConstraint xmi:type="notation:Location" xmi:id="_klPPInpMEem6LP4EDiey6Q"/> | ||
100 | </children> | ||
101 | <children xmi:type="notation:Node" xmi:id="_klPPI3pMEem6LP4EDiey6Q" type="3010" element="_kkxVEnpMEem6LP4EDiey6Q"> | ||
102 | <styles xmi:type="notation:FontStyle" xmi:id="_klPPJHpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8" bold="true"/> | ||
103 | <layoutConstraint xmi:type="notation:Location" xmi:id="_klPPJXpMEem6LP4EDiey6Q"/> | ||
104 | </children> | ||
105 | <styles xmi:type="notation:SortingStyle" xmi:id="_klLkwnpMEem6LP4EDiey6Q"/> | ||
106 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klLkw3pMEem6LP4EDiey6Q"/> | ||
107 | </children> | ||
108 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klK9uHpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
109 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klK9uXpMEem6LP4EDiey6Q" x="140" y="160"/> | ||
110 | </children> | ||
111 | <children xmi:type="notation:Node" xmi:id="_klLkxHpMEem6LP4EDiey6Q" type="2003" element="_kkhdcHpMEem6LP4EDiey6Q"> | ||
112 | <children xmi:type="notation:Node" xmi:id="_klML0HpMEem6LP4EDiey6Q" type="5007"/> | ||
113 | <children xmi:type="notation:Node" xmi:id="_klML0XpMEem6LP4EDiey6Q" type="7004"> | ||
114 | <styles xmi:type="notation:SortingStyle" xmi:id="_klML0npMEem6LP4EDiey6Q"/> | ||
115 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klML03pMEem6LP4EDiey6Q"/> | ||
116 | </children> | ||
117 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klLkxXpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
118 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klLkxnpMEem6LP4EDiey6Q" x="380" y="800"/> | ||
119 | </children> | ||
120 | <children xmi:type="notation:Node" xmi:id="_klML1HpMEem6LP4EDiey6Q" type="2003" element="_kkirkHpMEem6LP4EDiey6Q"> | ||
121 | <children xmi:type="notation:Node" xmi:id="_klML13pMEem6LP4EDiey6Q" type="5007"/> | ||
122 | <children xmi:type="notation:Node" xmi:id="_klML2HpMEem6LP4EDiey6Q" type="7004"> | ||
123 | <children xmi:type="notation:Node" xmi:id="_klP2MHpMEem6LP4EDiey6Q" type="3010" element="_kkyjMHpMEem6LP4EDiey6Q"> | ||
124 | <styles xmi:type="notation:FontStyle" xmi:id="_klP2MXpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8" bold="true"/> | ||
125 | <layoutConstraint xmi:type="notation:Location" xmi:id="_klP2MnpMEem6LP4EDiey6Q"/> | ||
126 | </children> | ||
127 | <styles xmi:type="notation:SortingStyle" xmi:id="_klML2XpMEem6LP4EDiey6Q"/> | ||
128 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klML2npMEem6LP4EDiey6Q"/> | ||
129 | </children> | ||
130 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klML1XpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
131 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klML1npMEem6LP4EDiey6Q" x="380" y="640"/> | ||
132 | </children> | ||
133 | <children xmi:type="notation:Node" xmi:id="_klML23pMEem6LP4EDiey6Q" type="2003" element="_kkjSoXpMEem6LP4EDiey6Q"> | ||
134 | <children xmi:type="notation:Node" xmi:id="_klMy4HpMEem6LP4EDiey6Q" type="5007"/> | ||
135 | <children xmi:type="notation:Node" xmi:id="_klMy4XpMEem6LP4EDiey6Q" type="7004"> | ||
136 | <styles xmi:type="notation:SortingStyle" xmi:id="_klMy4npMEem6LP4EDiey6Q"/> | ||
137 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klMy43pMEem6LP4EDiey6Q"/> | ||
138 | </children> | ||
139 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klML3HpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
140 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klML3XpMEem6LP4EDiey6Q" x="400" y="320"/> | ||
141 | </children> | ||
142 | <children xmi:type="notation:Node" xmi:id="_klMy5HpMEem6LP4EDiey6Q" type="2003" element="_kkkgwHpMEem6LP4EDiey6Q"> | ||
143 | <children xmi:type="notation:Node" xmi:id="_klNZ8HpMEem6LP4EDiey6Q" type="5007"/> | ||
144 | <children xmi:type="notation:Node" xmi:id="_klNZ8XpMEem6LP4EDiey6Q" type="7004"> | ||
145 | <children xmi:type="notation:Node" xmi:id="_klP2M3pMEem6LP4EDiey6Q" type="3010" element="_kkzKQHpMEem6LP4EDiey6Q"> | ||
146 | <styles xmi:type="notation:FontStyle" xmi:id="_klP2NHpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8" bold="true"/> | ||
147 | <layoutConstraint xmi:type="notation:Location" xmi:id="_klP2NXpMEem6LP4EDiey6Q"/> | ||
148 | </children> | ||
149 | <children xmi:type="notation:Node" xmi:id="_klP2NnpMEem6LP4EDiey6Q" type="3010" element="_kkzxUXpMEem6LP4EDiey6Q"> | ||
150 | <styles xmi:type="notation:FontStyle" xmi:id="_klP2N3pMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8" bold="true"/> | ||
151 | <layoutConstraint xmi:type="notation:Location" xmi:id="_klP2OHpMEem6LP4EDiey6Q"/> | ||
152 | </children> | ||
153 | <styles xmi:type="notation:SortingStyle" xmi:id="_klNZ8npMEem6LP4EDiey6Q"/> | ||
154 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klNZ83pMEem6LP4EDiey6Q"/> | ||
155 | </children> | ||
156 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klMy5XpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
157 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klMy5npMEem6LP4EDiey6Q" x="180" y="320"/> | ||
158 | </children> | ||
159 | <children xmi:type="notation:Node" xmi:id="_klOBAHpMEem6LP4EDiey6Q" type="2003" element="_kklH0HpMEem6LP4EDiey6Q"> | ||
160 | <children xmi:type="notation:Node" xmi:id="_klOBA3pMEem6LP4EDiey6Q" type="5007"/> | ||
161 | <children xmi:type="notation:Node" xmi:id="_klOBBHpMEem6LP4EDiey6Q" type="7004"> | ||
162 | <styles xmi:type="notation:SortingStyle" xmi:id="_klOBBXpMEem6LP4EDiey6Q"/> | ||
163 | <styles xmi:type="notation:FilteringStyle" xmi:id="_klOBBnpMEem6LP4EDiey6Q"/> | ||
164 | </children> | ||
165 | <styles xmi:type="notation:ShapeStyle" xmi:id="_klOBAXpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
166 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klOBAnpMEem6LP4EDiey6Q" x="400"/> | ||
167 | </children> | ||
168 | <styles xmi:type="notation:DiagramStyle" xmi:id="_kCIiEnpMEem6LP4EDiey6Q"/> | ||
169 | <edges xmi:type="notation:Edge" xmi:id="_klTgkHpMEem6LP4EDiey6Q" type="4001" element="_kk4p0HpMEem6LP4EDiey6Q" source="_klH6YHpMEem6LP4EDiey6Q" target="_klLkxHpMEem6LP4EDiey6Q"> | ||
170 | <children xmi:type="notation:Node" xmi:id="_klUusHpMEem6LP4EDiey6Q" type="6001"> | ||
171 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klUusXpMEem6LP4EDiey6Q" y="-10"/> | ||
172 | </children> | ||
173 | <children xmi:type="notation:Node" xmi:id="_klVVwHpMEem6LP4EDiey6Q" type="6002"> | ||
174 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klVVwXpMEem6LP4EDiey6Q" y="10"/> | ||
175 | </children> | ||
176 | <children xmi:type="notation:Node" xmi:id="_klVVwnpMEem6LP4EDiey6Q" type="6003"> | ||
177 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klVVw3pMEem6LP4EDiey6Q" y="10"/> | ||
178 | </children> | ||
179 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_klTgkXpMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
180 | <styles xmi:type="notation:FontStyle" xmi:id="_klTgknpMEem6LP4EDiey6Q" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
181 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_klTgk3pMEem6LP4EDiey6Q" points="[0, -50, -181, 110]$[181, -110, 0, 50]"/> | ||
182 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klcqgHpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
183 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klcqgXpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
184 | </edges> | ||
185 | <edges xmi:type="notation:Edge" xmi:id="_kldRkHpMEem6LP4EDiey6Q" type="4001" element="_kk8UMHpMEem6LP4EDiey6Q" source="_klH6YHpMEem6LP4EDiey6Q" target="_klK9sHpMEem6LP4EDiey6Q"> | ||
186 | <children xmi:type="notation:Node" xmi:id="_kldRlHpMEem6LP4EDiey6Q" type="6001"> | ||
187 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kldRlXpMEem6LP4EDiey6Q" y="-10"/> | ||
188 | </children> | ||
189 | <children xmi:type="notation:Node" xmi:id="_kldRlnpMEem6LP4EDiey6Q" type="6002"> | ||
190 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kldRl3pMEem6LP4EDiey6Q" y="10"/> | ||
191 | </children> | ||
192 | <children xmi:type="notation:Node" xmi:id="_kldRmHpMEem6LP4EDiey6Q" type="6003"> | ||
193 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kldRmXpMEem6LP4EDiey6Q" y="10"/> | ||
194 | </children> | ||
195 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_kldRkXpMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
196 | <styles xmi:type="notation:FontStyle" xmi:id="_kldRknpMEem6LP4EDiey6Q" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
197 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_kldRk3pMEem6LP4EDiey6Q" points="[0, -50, 0, 430]$[0, -430, 0, 50]"/> | ||
198 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_kld4oHpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
199 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_kld4oXpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
200 | </edges> | ||
201 | <edges xmi:type="notation:Edge" xmi:id="_kld4onpMEem6LP4EDiey6Q" type="4001" element="_kk87RnpMEem6LP4EDiey6Q" source="_klH6YHpMEem6LP4EDiey6Q" target="_klK9t3pMEem6LP4EDiey6Q"> | ||
202 | <children xmi:type="notation:Node" xmi:id="_kld4pnpMEem6LP4EDiey6Q" type="6001"> | ||
203 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kld4p3pMEem6LP4EDiey6Q" y="-10"/> | ||
204 | </children> | ||
205 | <children xmi:type="notation:Node" xmi:id="_kld4qHpMEem6LP4EDiey6Q" type="6002"> | ||
206 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kld4qXpMEem6LP4EDiey6Q" y="10"/> | ||
207 | </children> | ||
208 | <children xmi:type="notation:Node" xmi:id="_klefsHpMEem6LP4EDiey6Q" type="6003"> | ||
209 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klefsXpMEem6LP4EDiey6Q" y="10"/> | ||
210 | </children> | ||
211 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_kld4o3pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
212 | <styles xmi:type="notation:FontStyle" xmi:id="_kld4pHpMEem6LP4EDiey6Q" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
213 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_kld4pXpMEem6LP4EDiey6Q" points="[0, -50, 49, 750]$[-180, -111, -131, 689]$[-196, -591, -147, 209]$[-196, -690, -147, 110]$[-49, -750, 0, 50]"/> | ||
214 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klefsnpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
215 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klefs3pMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
216 | </edges> | ||
217 | <edges xmi:type="notation:Edge" xmi:id="_kleftHpMEem6LP4EDiey6Q" type="4001" element="_kk9iVnpMEem6LP4EDiey6Q" source="_klK9sHpMEem6LP4EDiey6Q" target="_klMy5HpMEem6LP4EDiey6Q"> | ||
218 | <children xmi:type="notation:Node" xmi:id="_klefuHpMEem6LP4EDiey6Q" type="6001"> | ||
219 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klefuXpMEem6LP4EDiey6Q" y="-10"/> | ||
220 | </children> | ||
221 | <children xmi:type="notation:Node" xmi:id="_klefunpMEem6LP4EDiey6Q" type="6002"> | ||
222 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klefu3pMEem6LP4EDiey6Q" y="10"/> | ||
223 | </children> | ||
224 | <children xmi:type="notation:Node" xmi:id="_klefvHpMEem6LP4EDiey6Q" type="6003"> | ||
225 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klefvXpMEem6LP4EDiey6Q" y="10"/> | ||
226 | </children> | ||
227 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_kleftXpMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
228 | <styles xmi:type="notation:FontStyle" xmi:id="_kleftnpMEem6LP4EDiey6Q" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
229 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_kleft3pMEem6LP4EDiey6Q" points="[0, -50, 0, 110]$[0, -110, 0, 50]"/> | ||
230 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klfGwHpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
231 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klfGwXpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
232 | </edges> | ||
233 | <edges xmi:type="notation:Edge" xmi:id="_klfGwnpMEem6LP4EDiey6Q" type="4001" element="_kk-wcHpMEem6LP4EDiey6Q" source="_klML1HpMEem6LP4EDiey6Q" target="_klK9sHpMEem6LP4EDiey6Q"> | ||
234 | <children xmi:type="notation:Node" xmi:id="_klfGxnpMEem6LP4EDiey6Q" type="6001"> | ||
235 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klfGx3pMEem6LP4EDiey6Q" y="-10"/> | ||
236 | </children> | ||
237 | <children xmi:type="notation:Node" xmi:id="_klfGyHpMEem6LP4EDiey6Q" type="6002"> | ||
238 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klfGyXpMEem6LP4EDiey6Q" y="10"/> | ||
239 | </children> | ||
240 | <children xmi:type="notation:Node" xmi:id="_klfGynpMEem6LP4EDiey6Q" type="6003"> | ||
241 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klfGy3pMEem6LP4EDiey6Q" y="10"/> | ||
242 | </children> | ||
243 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_klfGw3pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
244 | <styles xmi:type="notation:FontStyle" xmi:id="_klfGxHpMEem6LP4EDiey6Q" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
245 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_klfGxXpMEem6LP4EDiey6Q" points="[0, 0, 181, 60]$[-181, -60, 0, 0]"/> | ||
246 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klft0HpMEem6LP4EDiey6Q" id="(0.5,0.0)"/> | ||
247 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klft0XpMEem6LP4EDiey6Q" id="(0.5,1.0)"/> | ||
248 | </edges> | ||
249 | <edges xmi:type="notation:Edge" xmi:id="_klft0npMEem6LP4EDiey6Q" type="4001" element="_kk_Xg3pMEem6LP4EDiey6Q" source="_klMy5HpMEem6LP4EDiey6Q" target="_klK9t3pMEem6LP4EDiey6Q"> | ||
250 | <children xmi:type="notation:Node" xmi:id="_klft1npMEem6LP4EDiey6Q" type="6001"> | ||
251 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klft13pMEem6LP4EDiey6Q" y="-10"/> | ||
252 | </children> | ||
253 | <children xmi:type="notation:Node" xmi:id="_klft2HpMEem6LP4EDiey6Q" type="6002"> | ||
254 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klft2XpMEem6LP4EDiey6Q" y="10"/> | ||
255 | </children> | ||
256 | <children xmi:type="notation:Node" xmi:id="_klft2npMEem6LP4EDiey6Q" type="6003"> | ||
257 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klft23pMEem6LP4EDiey6Q" y="10"/> | ||
258 | </children> | ||
259 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_klft03pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
260 | <styles xmi:type="notation:FontStyle" xmi:id="_klft1HpMEem6LP4EDiey6Q" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/> | ||
261 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_klft1XpMEem6LP4EDiey6Q" points="[0, -50, 49, 110]$[-49, -110, 0, 50]"/> | ||
262 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klgU4HpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
263 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klgU4XpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
264 | </edges> | ||
265 | <edges xmi:type="notation:Edge" xmi:id="_klgU4npMEem6LP4EDiey6Q" type="4001" element="_klBMsHpMEem6LP4EDiey6Q" source="_klML23pMEem6LP4EDiey6Q" target="_klOBAHpMEem6LP4EDiey6Q"> | ||
266 | <children xmi:type="notation:Node" xmi:id="_klgU5npMEem6LP4EDiey6Q" type="6001"> | ||
267 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klgU53pMEem6LP4EDiey6Q" y="-10"/> | ||
268 | </children> | ||
269 | <children xmi:type="notation:Node" xmi:id="_klgU6HpMEem6LP4EDiey6Q" type="6002"> | ||
270 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klgU6XpMEem6LP4EDiey6Q" y="10"/> | ||
271 | </children> | ||
272 | <children xmi:type="notation:Node" xmi:id="_klgU6npMEem6LP4EDiey6Q" type="6003"> | ||
273 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klgU63pMEem6LP4EDiey6Q" y="10"/> | ||
274 | </children> | ||
275 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_klgU43pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
276 | <styles xmi:type="notation:FontStyle" xmi:id="_klgU5HpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8" bold="true"/> | ||
277 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_klgU5XpMEem6LP4EDiey6Q" points="[0, -50, 0, 270]$[0, -270, 0, 50]"/> | ||
278 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klg78HpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
279 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klg78XpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
280 | </edges> | ||
281 | <edges xmi:type="notation:Edge" xmi:id="_klg78npMEem6LP4EDiey6Q" type="4001" element="_klDB4HpMEem6LP4EDiey6Q" source="_klK9t3pMEem6LP4EDiey6Q" target="_klOBAHpMEem6LP4EDiey6Q"> | ||
282 | <children xmi:type="notation:Node" xmi:id="_klg79npMEem6LP4EDiey6Q" type="6001"> | ||
283 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klg793pMEem6LP4EDiey6Q" y="-10"/> | ||
284 | </children> | ||
285 | <children xmi:type="notation:Node" xmi:id="_klg7-HpMEem6LP4EDiey6Q" type="6002"> | ||
286 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klg7-XpMEem6LP4EDiey6Q" y="10"/> | ||
287 | </children> | ||
288 | <children xmi:type="notation:Node" xmi:id="_klg7-npMEem6LP4EDiey6Q" type="6003"> | ||
289 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klg7-3pMEem6LP4EDiey6Q" y="10"/> | ||
290 | </children> | ||
291 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_klg783pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
292 | <styles xmi:type="notation:FontStyle" xmi:id="_klg79HpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
293 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_klg79XpMEem6LP4EDiey6Q" points="[0, -50, -247, 110]$[247, -110, 0, 50]"/> | ||
294 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klhjAHpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
295 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klhjAXpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
296 | </edges> | ||
297 | <edges xmi:type="notation:Edge" xmi:id="_klhjAnpMEem6LP4EDiey6Q" type="4001" element="_klDo-XpMEem6LP4EDiey6Q" source="_klLkxHpMEem6LP4EDiey6Q" target="_klML1HpMEem6LP4EDiey6Q"> | ||
298 | <children xmi:type="notation:Node" xmi:id="_klhjBnpMEem6LP4EDiey6Q" type="6001"> | ||
299 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klhjB3pMEem6LP4EDiey6Q" y="-10"/> | ||
300 | </children> | ||
301 | <children xmi:type="notation:Node" xmi:id="_klhjCHpMEem6LP4EDiey6Q" type="6002"> | ||
302 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klhjCXpMEem6LP4EDiey6Q" y="10"/> | ||
303 | </children> | ||
304 | <children xmi:type="notation:Node" xmi:id="_klhjCnpMEem6LP4EDiey6Q" type="6003"> | ||
305 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klhjC3pMEem6LP4EDiey6Q" y="10"/> | ||
306 | </children> | ||
307 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_klhjA3pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
308 | <styles xmi:type="notation:FontStyle" xmi:id="_klhjBHpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
309 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_klhjBXpMEem6LP4EDiey6Q" points="[0, 0, 0, 60]$[0, -60, 0, 0]"/> | ||
310 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_kliKEHpMEem6LP4EDiey6Q" id="(0.5,0.0)"/> | ||
311 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_kliKEXpMEem6LP4EDiey6Q" id="(0.5,1.0)"/> | ||
312 | </edges> | ||
313 | <edges xmi:type="notation:Edge" xmi:id="_kliKEnpMEem6LP4EDiey6Q" type="4001" element="_klEQBnpMEem6LP4EDiey6Q" source="_klK9sHpMEem6LP4EDiey6Q" target="_klML23pMEem6LP4EDiey6Q"> | ||
314 | <children xmi:type="notation:Node" xmi:id="_kliKFnpMEem6LP4EDiey6Q" type="6001"> | ||
315 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kliKF3pMEem6LP4EDiey6Q" x="-5" y="-73"/> | ||
316 | </children> | ||
317 | <children xmi:type="notation:Node" xmi:id="_kliKGHpMEem6LP4EDiey6Q" type="6002"> | ||
318 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kliKGXpMEem6LP4EDiey6Q" x="18" y="18"/> | ||
319 | </children> | ||
320 | <children xmi:type="notation:Node" xmi:id="_kliKGnpMEem6LP4EDiey6Q" type="6003"> | ||
321 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_kliKG3pMEem6LP4EDiey6Q" x="-1" y="-45"/> | ||
322 | </children> | ||
323 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_kliKE3pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
324 | <styles xmi:type="notation:FontStyle" xmi:id="_kliKFHpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
325 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_kliKFXpMEem6LP4EDiey6Q" points="[59, 1, -143, 161]$[141, 1, -61, 161]$[141, -111, -61, 49]"/> | ||
326 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klixIHpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
327 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klixIXpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
328 | </edges> | ||
329 | <edges xmi:type="notation:Edge" xmi:id="_klixInpMEem6LP4EDiey6Q" type="4001" element="_klFeIHpMEem6LP4EDiey6Q" source="_klML1HpMEem6LP4EDiey6Q" target="_klML23pMEem6LP4EDiey6Q"> | ||
330 | <children xmi:type="notation:Node" xmi:id="_klixJnpMEem6LP4EDiey6Q" type="6001"> | ||
331 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klixJ3pMEem6LP4EDiey6Q" y="-10"/> | ||
332 | </children> | ||
333 | <children xmi:type="notation:Node" xmi:id="_klixKHpMEem6LP4EDiey6Q" type="6002"> | ||
334 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klixKXpMEem6LP4EDiey6Q" y="10"/> | ||
335 | </children> | ||
336 | <children xmi:type="notation:Node" xmi:id="_klixKnpMEem6LP4EDiey6Q" type="6003"> | ||
337 | <layoutConstraint xmi:type="notation:Bounds" xmi:id="_klixK3pMEem6LP4EDiey6Q" y="10"/> | ||
338 | </children> | ||
339 | <styles xmi:type="notation:ConnectorStyle" xmi:id="_klixI3pMEem6LP4EDiey6Q" routing="Rectilinear"/> | ||
340 | <styles xmi:type="notation:FontStyle" xmi:id="_klixJHpMEem6LP4EDiey6Q" fontName="Noto Sans" fontHeight="8"/> | ||
341 | <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_klixJXpMEem6LP4EDiey6Q" points="[0, -50, -17, 270]$[17, -270, 0, 50]"/> | ||
342 | <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_klixLHpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
343 | <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_kljYMHpMEem6LP4EDiey6Q" id="(0.5,0.5)"/> | ||
344 | </edges> | ||
345 | </data> | ||
346 | </ownedAnnotationEntries> | ||
347 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kkaIsHpMEem6LP4EDiey6Q" name="CyberPhysicalSystem" tooltipText="" outgoingEdges="_kk4p0HpMEem6LP4EDiey6Q _kk8UMHpMEem6LP4EDiey6Q _kk87RnpMEem6LP4EDiey6Q" width="12" height="10"> | ||
348 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//CyberPhysicalSystem"/> | ||
349 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//CyberPhysicalSystem"/> | ||
350 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kkdMAHpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
351 | <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"/> | ||
352 | </ownedStyle> | ||
353 | <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']"/> | ||
354 | </ownedDiagramElements> | ||
355 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kkeaIHpMEem6LP4EDiey6Q" name="ApplicationType" tooltipText="" outgoingEdges="_kk9iVnpMEem6LP4EDiey6Q _klEQBnpMEem6LP4EDiey6Q" incomingEdges="_kk8UMHpMEem6LP4EDiey6Q _kk-wcHpMEem6LP4EDiey6Q" width="12" height="10"> | ||
356 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//ApplicationType"/> | ||
357 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//ApplicationType"/> | ||
358 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kkfBMHpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
359 | <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"/> | ||
360 | </ownedStyle> | ||
361 | <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']"/> | ||
362 | </ownedDiagramElements> | ||
363 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kkfoQXpMEem6LP4EDiey6Q" name="HostType" tooltipText="" outgoingEdges="_klDB4HpMEem6LP4EDiey6Q" incomingEdges="_kk87RnpMEem6LP4EDiey6Q _kk_Xg3pMEem6LP4EDiey6Q" width="12" height="10"> | ||
364 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//HostType"/> | ||
365 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//HostType"/> | ||
366 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kkgPUHpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
367 | <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"/> | ||
368 | </ownedStyle> | ||
369 | <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']"/> | ||
370 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_kktqsHpMEem6LP4EDiey6Q" name="defaultMemory : EInt" tooltipText=""> | ||
371 | <target xmi:type="ecore:EAttribute" href="model/cps.ecore#//HostType/defaultMemory"/> | ||
372 | <semanticElements xmi:type="ecore:EAttribute" href="model/cps.ecore#//HostType/defaultMemory"/> | ||
373 | <ownedStyle xmi:type="diagram:BundledImage" uid="_kkwG8HpMEem6LP4EDiey6Q" labelAlignment="LEFT" description="_kku40HpMEem6LP4EDiey6Q"> | ||
374 | <labelFormat>bold</labelFormat> | ||
375 | </ownedStyle> | ||
376 | <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']"/> | ||
377 | </ownedElements> | ||
378 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_kkxVEHpMEem6LP4EDiey6Q" name="defaultHdd : EInt" tooltipText=""> | ||
379 | <target xmi:type="ecore:EAttribute" href="model/cps.ecore#//HostType/defaultHdd"/> | ||
380 | <semanticElements xmi:type="ecore:EAttribute" href="model/cps.ecore#//HostType/defaultHdd"/> | ||
381 | <ownedStyle xmi:type="diagram:BundledImage" uid="_kkxVEXpMEem6LP4EDiey6Q" labelAlignment="LEFT" description="_kku40HpMEem6LP4EDiey6Q"> | ||
382 | <labelFormat>bold</labelFormat> | ||
383 | </ownedStyle> | ||
384 | <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']"/> | ||
385 | </ownedElements> | ||
386 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_kkxVEnpMEem6LP4EDiey6Q" name="cost : EInt" tooltipText=""> | ||
387 | <target xmi:type="ecore:EAttribute" href="model/cps.ecore#//HostType/cost"/> | ||
388 | <semanticElements xmi:type="ecore:EAttribute" href="model/cps.ecore#//HostType/cost"/> | ||
389 | <ownedStyle xmi:type="diagram:BundledImage" uid="_kkx8IHpMEem6LP4EDiey6Q" labelAlignment="LEFT" description="_kku40HpMEem6LP4EDiey6Q"> | ||
390 | <labelFormat>bold</labelFormat> | ||
391 | </ownedStyle> | ||
392 | <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']"/> | ||
393 | </ownedElements> | ||
394 | </ownedDiagramElements> | ||
395 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kkhdcHpMEem6LP4EDiey6Q" name="Request" tooltipText="" outgoingEdges="_klDo-XpMEem6LP4EDiey6Q" incomingEdges="_kk4p0HpMEem6LP4EDiey6Q" width="12" height="10"> | ||
396 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//Request"/> | ||
397 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//Request"/> | ||
398 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kkhdcXpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
399 | <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"/> | ||
400 | </ownedStyle> | ||
401 | <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']"/> | ||
402 | </ownedDiagramElements> | ||
403 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kkirkHpMEem6LP4EDiey6Q" name="Requirement" tooltipText="" outgoingEdges="_kk-wcHpMEem6LP4EDiey6Q _klFeIHpMEem6LP4EDiey6Q" incomingEdges="_klDo-XpMEem6LP4EDiey6Q" width="12" height="10"> | ||
404 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//Requirement"/> | ||
405 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//Requirement"/> | ||
406 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kkirkXpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
407 | <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"/> | ||
408 | </ownedStyle> | ||
409 | <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']"/> | ||
410 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_kkyjMHpMEem6LP4EDiey6Q" name="count : EInt" tooltipText=""> | ||
411 | <target xmi:type="ecore:EAttribute" href="model/cps.ecore#//Requirement/count"/> | ||
412 | <semanticElements xmi:type="ecore:EAttribute" href="model/cps.ecore#//Requirement/count"/> | ||
413 | <ownedStyle xmi:type="diagram:BundledImage" uid="_kkyjMXpMEem6LP4EDiey6Q" labelAlignment="LEFT" description="_kku40HpMEem6LP4EDiey6Q"> | ||
414 | <labelFormat>bold</labelFormat> | ||
415 | </ownedStyle> | ||
416 | <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']"/> | ||
417 | </ownedElements> | ||
418 | </ownedDiagramElements> | ||
419 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kkjSoXpMEem6LP4EDiey6Q" name="ApplicationInstance" tooltipText="" outgoingEdges="_klBMsHpMEem6LP4EDiey6Q" incomingEdges="_klEQBnpMEem6LP4EDiey6Q _klFeIHpMEem6LP4EDiey6Q" width="12" height="10"> | ||
420 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//ApplicationInstance"/> | ||
421 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//ApplicationInstance"/> | ||
422 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kkj5sHpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
423 | <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"/> | ||
424 | </ownedStyle> | ||
425 | <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']"/> | ||
426 | </ownedDiagramElements> | ||
427 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kkkgwHpMEem6LP4EDiey6Q" name="ResourceRequirement" tooltipText="" outgoingEdges="_kk_Xg3pMEem6LP4EDiey6Q" incomingEdges="_kk9iVnpMEem6LP4EDiey6Q" width="12" height="10"> | ||
428 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//ResourceRequirement"/> | ||
429 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//ResourceRequirement"/> | ||
430 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kkkgwXpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
431 | <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"/> | ||
432 | </ownedStyle> | ||
433 | <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']"/> | ||
434 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_kkzKQHpMEem6LP4EDiey6Q" name="requiredMemory : EInt" tooltipText=""> | ||
435 | <target xmi:type="ecore:EAttribute" href="model/cps.ecore#//ResourceRequirement/requiredMemory"/> | ||
436 | <semanticElements xmi:type="ecore:EAttribute" href="model/cps.ecore#//ResourceRequirement/requiredMemory"/> | ||
437 | <ownedStyle xmi:type="diagram:BundledImage" uid="_kkzxUHpMEem6LP4EDiey6Q" labelAlignment="LEFT" description="_kku40HpMEem6LP4EDiey6Q"> | ||
438 | <labelFormat>bold</labelFormat> | ||
439 | </ownedStyle> | ||
440 | <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']"/> | ||
441 | </ownedElements> | ||
442 | <ownedElements xmi:type="diagram:DNodeListElement" uid="_kkzxUXpMEem6LP4EDiey6Q" name="requiredHdd : EInt" tooltipText=""> | ||
443 | <target xmi:type="ecore:EAttribute" href="model/cps.ecore#//ResourceRequirement/requiredHdd"/> | ||
444 | <semanticElements xmi:type="ecore:EAttribute" href="model/cps.ecore#//ResourceRequirement/requiredHdd"/> | ||
445 | <ownedStyle xmi:type="diagram:BundledImage" uid="_kk0YYHpMEem6LP4EDiey6Q" labelAlignment="LEFT" description="_kku40HpMEem6LP4EDiey6Q"> | ||
446 | <labelFormat>bold</labelFormat> | ||
447 | </ownedStyle> | ||
448 | <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']"/> | ||
449 | </ownedElements> | ||
450 | </ownedDiagramElements> | ||
451 | <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_kklH0HpMEem6LP4EDiey6Q" name="HostInstance" tooltipText="" incomingEdges="_klBMsHpMEem6LP4EDiey6Q _klDB4HpMEem6LP4EDiey6Q" width="12" height="10"> | ||
452 | <target xmi:type="ecore:EClass" href="model/cps.ecore#//HostInstance"/> | ||
453 | <semanticElements xmi:type="ecore:EClass" href="model/cps.ecore#//HostInstance"/> | ||
454 | <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_kklH0XpMEem6LP4EDiey6Q" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216"> | ||
455 | <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"/> | ||
456 | </ownedStyle> | ||
457 | <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']"/> | ||
458 | </ownedDiagramElements> | ||
459 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_kk4p0HpMEem6LP4EDiey6Q" name="[0..*] requests" sourceNode="_kkaIsHpMEem6LP4EDiey6Q" targetNode="_kkhdcHpMEem6LP4EDiey6Q"> | ||
460 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//CyberPhysicalSystem/requests"/> | ||
461 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//CyberPhysicalSystem/requests"/> | ||
462 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_kk7GEHpMEem6LP4EDiey6Q" description="_kk538HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
463 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_kk7tIXpMEem6LP4EDiey6Q" showIcon="false"> | ||
464 | <customFeatures>labelSize</customFeatures> | ||
465 | </centerLabelStyle> | ||
466 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_kk7tIHpMEem6LP4EDiey6Q" showIcon="false" labelColor="39,76,114"> | ||
467 | <customFeatures>labelSize</customFeatures> | ||
468 | </endLabelStyle> | ||
469 | </ownedStyle> | ||
470 | <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']"/> | ||
471 | </ownedDiagramElements> | ||
472 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_kk8UMHpMEem6LP4EDiey6Q" name="[0..*] applicationTypes" sourceNode="_kkaIsHpMEem6LP4EDiey6Q" targetNode="_kkeaIHpMEem6LP4EDiey6Q"> | ||
473 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//CyberPhysicalSystem/applicationTypes"/> | ||
474 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//CyberPhysicalSystem/applicationTypes"/> | ||
475 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_kk87QHpMEem6LP4EDiey6Q" description="_kk538HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
476 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_kk87QnpMEem6LP4EDiey6Q" showIcon="false"> | ||
477 | <customFeatures>labelSize</customFeatures> | ||
478 | </centerLabelStyle> | ||
479 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_kk87QXpMEem6LP4EDiey6Q" showIcon="false" labelColor="39,76,114"> | ||
480 | <customFeatures>labelSize</customFeatures> | ||
481 | </endLabelStyle> | ||
482 | </ownedStyle> | ||
483 | <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']"/> | ||
484 | </ownedDiagramElements> | ||
485 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_kk87RnpMEem6LP4EDiey6Q" name="[0..*] hostTypes" sourceNode="_kkaIsHpMEem6LP4EDiey6Q" targetNode="_kkfoQXpMEem6LP4EDiey6Q"> | ||
486 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//CyberPhysicalSystem/hostTypes"/> | ||
487 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//CyberPhysicalSystem/hostTypes"/> | ||
488 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_kk9iUHpMEem6LP4EDiey6Q" description="_kk538HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
489 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_kk9iUnpMEem6LP4EDiey6Q" showIcon="false"> | ||
490 | <customFeatures>labelSize</customFeatures> | ||
491 | </centerLabelStyle> | ||
492 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_kk9iUXpMEem6LP4EDiey6Q" showIcon="false" labelColor="39,76,114"> | ||
493 | <customFeatures>labelSize</customFeatures> | ||
494 | </endLabelStyle> | ||
495 | </ownedStyle> | ||
496 | <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']"/> | ||
497 | </ownedDiagramElements> | ||
498 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_kk9iVnpMEem6LP4EDiey6Q" name="[0..*] requirements" sourceNode="_kkeaIHpMEem6LP4EDiey6Q" targetNode="_kkkgwHpMEem6LP4EDiey6Q"> | ||
499 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationType/requirements"/> | ||
500 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationType/requirements"/> | ||
501 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_kk-JYHpMEem6LP4EDiey6Q" description="_kk538HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
502 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_kk-JYnpMEem6LP4EDiey6Q" showIcon="false"> | ||
503 | <customFeatures>labelSize</customFeatures> | ||
504 | </centerLabelStyle> | ||
505 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_kk-JYXpMEem6LP4EDiey6Q" showIcon="false" labelColor="39,76,114"> | ||
506 | <customFeatures>labelSize</customFeatures> | ||
507 | </endLabelStyle> | ||
508 | </ownedStyle> | ||
509 | <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']"/> | ||
510 | </ownedDiagramElements> | ||
511 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_kk-wcHpMEem6LP4EDiey6Q" name="[0..1] type" sourceNode="_kkirkHpMEem6LP4EDiey6Q" targetNode="_kkeaIHpMEem6LP4EDiey6Q"> | ||
512 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//Requirement/type"/> | ||
513 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//Requirement/type"/> | ||
514 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_kk-wcXpMEem6LP4EDiey6Q" routingStyle="manhattan" strokeColor="0,0,0"> | ||
515 | <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"/> | ||
516 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_kk-wc3pMEem6LP4EDiey6Q" showIcon="false"> | ||
517 | <customFeatures>labelSize</customFeatures> | ||
518 | </centerLabelStyle> | ||
519 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_kk-wcnpMEem6LP4EDiey6Q" showIcon="false" labelColor="39,76,114"> | ||
520 | <customFeatures>labelSize</customFeatures> | ||
521 | </endLabelStyle> | ||
522 | </ownedStyle> | ||
523 | <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']"/> | ||
524 | </ownedDiagramElements> | ||
525 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_kk_Xg3pMEem6LP4EDiey6Q" name="[1..1] hostType" sourceNode="_kkkgwHpMEem6LP4EDiey6Q" targetNode="_kkfoQXpMEem6LP4EDiey6Q"> | ||
526 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//ResourceRequirement/hostType"/> | ||
527 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//ResourceRequirement/hostType"/> | ||
528 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_kk_-k3pMEem6LP4EDiey6Q" description="_kk_-kHpMEem6LP4EDiey6Q" routingStyle="manhattan" strokeColor="0,0,0"> | ||
529 | <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_kk_-lXpMEem6LP4EDiey6Q" showIcon="false"> | ||
530 | <customFeatures>labelSize</customFeatures> | ||
531 | </centerLabelStyle> | ||
532 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_kk_-lHpMEem6LP4EDiey6Q" showIcon="false" labelColor="39,76,114"> | ||
533 | <customFeatures>labelSize</customFeatures> | ||
534 | </endLabelStyle> | ||
535 | </ownedStyle> | ||
536 | <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']"/> | ||
537 | </ownedDiagramElements> | ||
538 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_klBMsHpMEem6LP4EDiey6Q" sourceNode="_kkjSoXpMEem6LP4EDiey6Q" targetNode="_kklH0HpMEem6LP4EDiey6Q" beginLabel="[0..*] applications" endLabel="[1..1] allocatedTo"> | ||
539 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
540 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationInstance/allocatedTo"/> | ||
541 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//HostInstance/applications"/> | ||
542 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_klBzw3pMEem6LP4EDiey6Q" description="_klBzwHpMEem6LP4EDiey6Q" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0"> | ||
543 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_klCa0HpMEem6LP4EDiey6Q" showIcon="false"> | ||
544 | <labelFormat>bold</labelFormat> | ||
545 | </beginLabelStyle> | ||
546 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_klCa0XpMEem6LP4EDiey6Q" showIcon="false"> | ||
547 | <labelFormat>bold</labelFormat> | ||
548 | </endLabelStyle> | ||
549 | </ownedStyle> | ||
550 | <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']"/> | ||
551 | </ownedDiagramElements> | ||
552 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_klDB4HpMEem6LP4EDiey6Q" sourceNode="_kkfoQXpMEem6LP4EDiey6Q" targetNode="_kklH0HpMEem6LP4EDiey6Q" beginLabel="[1..1] type" endLabel="[0..*] instances"> | ||
553 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//HostType/instances"/> | ||
554 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//HostType/instances"/> | ||
555 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//HostInstance/type"/> | ||
556 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_klDo83pMEem6LP4EDiey6Q" description="_klDo8HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
557 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_klDo9HpMEem6LP4EDiey6Q" showIcon="false"/> | ||
558 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_klDo9XpMEem6LP4EDiey6Q" showIcon="false"/> | ||
559 | </ownedStyle> | ||
560 | <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']"/> | ||
561 | </ownedDiagramElements> | ||
562 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_klDo-XpMEem6LP4EDiey6Q" sourceNode="_kkhdcHpMEem6LP4EDiey6Q" targetNode="_kkirkHpMEem6LP4EDiey6Q" beginLabel="[1..1] request" endLabel="[0..*] requirements"> | ||
563 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//Request/requirements"/> | ||
564 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//Requirement/request"/> | ||
565 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//Request/requirements"/> | ||
566 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_klEQAHpMEem6LP4EDiey6Q" description="_klDo8HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
567 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_klEQAXpMEem6LP4EDiey6Q" showIcon="false"/> | ||
568 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_klEQAnpMEem6LP4EDiey6Q" showIcon="false"/> | ||
569 | </ownedStyle> | ||
570 | <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']"/> | ||
571 | </ownedDiagramElements> | ||
572 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_klEQBnpMEem6LP4EDiey6Q" sourceNode="_kkeaIHpMEem6LP4EDiey6Q" targetNode="_kkjSoXpMEem6LP4EDiey6Q" beginLabel="[1..1] type" endLabel="[0..*] instances"> | ||
573 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationType/instances"/> | ||
574 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationType/instances"/> | ||
575 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationInstance/type"/> | ||
576 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_klE3EHpMEem6LP4EDiey6Q" description="_klDo8HpMEem6LP4EDiey6Q" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0"> | ||
577 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_klE3EXpMEem6LP4EDiey6Q" showIcon="false"/> | ||
578 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_klE3EnpMEem6LP4EDiey6Q" showIcon="false"/> | ||
579 | </ownedStyle> | ||
580 | <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']"/> | ||
581 | </ownedDiagramElements> | ||
582 | <ownedDiagramElements xmi:type="diagram:DEdge" uid="_klFeIHpMEem6LP4EDiey6Q" sourceNode="_kkirkHpMEem6LP4EDiey6Q" targetNode="_kkjSoXpMEem6LP4EDiey6Q" beginLabel="[0..1] requirement" endLabel="[0..*] instances"> | ||
583 | <target xmi:type="ecore:EReference" href="model/cps.ecore#//Requirement/instances"/> | ||
584 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//Requirement/instances"/> | ||
585 | <semanticElements xmi:type="ecore:EReference" href="model/cps.ecore#//ApplicationInstance/requirement"/> | ||
586 | <ownedStyle xmi:type="diagram:EdgeStyle" uid="_klFeIXpMEem6LP4EDiey6Q" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0"> | ||
587 | <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"/> | ||
588 | <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_klFeInpMEem6LP4EDiey6Q" showIcon="false"/> | ||
589 | <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_klFeI3pMEem6LP4EDiey6Q" showIcon="false"/> | ||
590 | </ownedStyle> | ||
591 | <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']"/> | ||
592 | </ownedDiagramElements> | ||
593 | <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/> | ||
594 | <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_kAqicHpMEem6LP4EDiey6Q"/> | ||
595 | <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/> | ||
596 | <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Package']"/> | ||
597 | <activatedLayers xmi:type="description_1:AdditionalLayer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@additionalLayers[name='Validation']"/> | ||
598 | <target xmi:type="ecore:EPackage" href="model/cps.ecore#/"/> | ||
599 | </diagram:DSemanticDiagram> | ||
600 | </xmi:XMI> | ||
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..d3114d9d --- /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,44 @@ | |||
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 | ||
17 | /.RedundantInstancesOnSameHost.java._trace | ||
18 | /.Allocate.java._trace | ||
19 | /.CpsTransformationRules.java._trace | ||
20 | /.ResourceRequirement.java._trace | ||
21 | /.CreateInstance.java._trace | ||
22 | /.CreateHostInstance.java._trace | ||
23 | /.UnallocatedAppInstance.java._trace | ||
24 | /.RequiredAppInstances.java._trace | ||
25 | /.GuidanceObjective.java._trace | ||
26 | /.RemoveHostInstance.java._trace | ||
27 | /.UnallocateAppInstance.java._trace | ||
28 | /Allocate.java | ||
29 | /AllocationWithoutResourceRequirement.java | ||
30 | /AverageFreeHddMetric.java | ||
31 | /AverageFreeMemoryMetric.java | ||
32 | /CostMetric.java | ||
33 | /CpsCost.java | ||
34 | /CpsQueries.java | ||
35 | /CreateHostInstance.java | ||
36 | /GuidanceObjective.java | ||
37 | /InstanceDoesNotSatisfyRequirement.java | ||
38 | /NotEnoughAvailableHdd.java | ||
39 | /NotEnoughAvailableMemory.java | ||
40 | /RedundantInstancesOnSameHost.java | ||
41 | /RemoveHostInstance.java | ||
42 | /RequirementNotSatisfied.java | ||
43 | /ResourceRequirement.java | ||
44 | /UnallocateAppInstance.java | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/Allocate.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/Allocate.java new file mode 100644 index 00000000..830dc8a0 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/Allocate.java | |||
@@ -0,0 +1,862 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance; | ||
11 | import java.util.Arrays; | ||
12 | import java.util.Collection; | ||
13 | import java.util.Collections; | ||
14 | import java.util.LinkedHashSet; | ||
15 | import java.util.List; | ||
16 | import java.util.Objects; | ||
17 | import java.util.Optional; | ||
18 | import java.util.Set; | ||
19 | import java.util.function.Consumer; | ||
20 | import java.util.stream.Collectors; | ||
21 | import java.util.stream.Stream; | ||
22 | import org.apache.log4j.Logger; | ||
23 | import org.eclipse.emf.ecore.EClass; | ||
24 | import org.eclipse.emf.ecore.EDataType; | ||
25 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
27 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
28 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
29 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
30 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
31 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
32 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
33 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
34 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
44 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
45 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
46 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
47 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
48 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
49 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
50 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
51 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
52 | |||
53 | /** | ||
54 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
55 | * | ||
56 | * <p>Original source: | ||
57 | * <code><pre> | ||
58 | * // | ||
59 | * // Transformation rule preconditions for rule-based DSE | ||
60 | * // | ||
61 | * | ||
62 | * pattern allocate(App : ApplicationInstance, Host : HostInstance) { | ||
63 | * ApplicationInstance.type.requirements(App, Req); | ||
64 | * ResourceRequirement.hostType.instances(Req, Host); | ||
65 | * find unallocatedAppInstance(App); | ||
66 | * find availableMemory(Host, AvailableMem); | ||
67 | * find availableHdd(Host, AvailableHdd); | ||
68 | * ResourceRequirement.requiredMemory(Req, RequiredMem); | ||
69 | * ResourceRequirement.requiredHdd(Req, RequiredHdd); | ||
70 | * check(AvailableMem {@literal >}= RequiredMem); | ||
71 | * check(AvailableHdd {@literal >}= RequiredHdd); | ||
72 | * neg ApplicationInstance.requirement.instances.allocatedTo(App, Host); | ||
73 | * } | ||
74 | * </pre></code> | ||
75 | * | ||
76 | * @see Matcher | ||
77 | * @see Match | ||
78 | * | ||
79 | */ | ||
80 | @SuppressWarnings("all") | ||
81 | public final class Allocate extends BaseGeneratedEMFQuerySpecification<Allocate.Matcher> { | ||
82 | /** | ||
83 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocate pattern, | ||
84 | * to be used in conjunction with {@link Matcher}. | ||
85 | * | ||
86 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
87 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
88 | * usable to represent a match of the pattern in the result of a query, | ||
89 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
90 | * | ||
91 | * @see Matcher | ||
92 | * | ||
93 | */ | ||
94 | public static abstract class Match extends BasePatternMatch { | ||
95 | private ApplicationInstance fApp; | ||
96 | |||
97 | private HostInstance fHost; | ||
98 | |||
99 | private static List<String> parameterNames = makeImmutableList("App", "Host"); | ||
100 | |||
101 | private Match(final ApplicationInstance pApp, final HostInstance pHost) { | ||
102 | this.fApp = pApp; | ||
103 | this.fHost = pHost; | ||
104 | } | ||
105 | |||
106 | @Override | ||
107 | public Object get(final String parameterName) { | ||
108 | if ("App".equals(parameterName)) return this.fApp; | ||
109 | if ("Host".equals(parameterName)) return this.fHost; | ||
110 | return null; | ||
111 | } | ||
112 | |||
113 | public ApplicationInstance getApp() { | ||
114 | return this.fApp; | ||
115 | } | ||
116 | |||
117 | public HostInstance getHost() { | ||
118 | return this.fHost; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public boolean set(final String parameterName, final Object newValue) { | ||
123 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
124 | if ("App".equals(parameterName) ) { | ||
125 | this.fApp = (ApplicationInstance) newValue; | ||
126 | return true; | ||
127 | } | ||
128 | if ("Host".equals(parameterName) ) { | ||
129 | this.fHost = (HostInstance) newValue; | ||
130 | return true; | ||
131 | } | ||
132 | return false; | ||
133 | } | ||
134 | |||
135 | public void setApp(final ApplicationInstance pApp) { | ||
136 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
137 | this.fApp = pApp; | ||
138 | } | ||
139 | |||
140 | public void setHost(final HostInstance pHost) { | ||
141 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
142 | this.fHost = pHost; | ||
143 | } | ||
144 | |||
145 | @Override | ||
146 | public String patternName() { | ||
147 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocate"; | ||
148 | } | ||
149 | |||
150 | @Override | ||
151 | public List<String> parameterNames() { | ||
152 | return Allocate.Match.parameterNames; | ||
153 | } | ||
154 | |||
155 | @Override | ||
156 | public Object[] toArray() { | ||
157 | return new Object[]{fApp, fHost}; | ||
158 | } | ||
159 | |||
160 | @Override | ||
161 | public Allocate.Match toImmutable() { | ||
162 | return isMutable() ? newMatch(fApp, fHost) : this; | ||
163 | } | ||
164 | |||
165 | @Override | ||
166 | public String prettyPrint() { | ||
167 | StringBuilder result = new StringBuilder(); | ||
168 | result.append("\"App\"=" + prettyPrintValue(fApp) + ", "); | ||
169 | result.append("\"Host\"=" + prettyPrintValue(fHost)); | ||
170 | return result.toString(); | ||
171 | } | ||
172 | |||
173 | @Override | ||
174 | public int hashCode() { | ||
175 | return Objects.hash(fApp, fHost); | ||
176 | } | ||
177 | |||
178 | @Override | ||
179 | public boolean equals(final Object obj) { | ||
180 | if (this == obj) | ||
181 | return true; | ||
182 | if (obj == null) { | ||
183 | return false; | ||
184 | } | ||
185 | if ((obj instanceof Allocate.Match)) { | ||
186 | Allocate.Match other = (Allocate.Match) obj; | ||
187 | return Objects.equals(fApp, other.fApp) && Objects.equals(fHost, other.fHost); | ||
188 | } else { | ||
189 | // this should be infrequent | ||
190 | if (!(obj instanceof IPatternMatch)) { | ||
191 | return false; | ||
192 | } | ||
193 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
194 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
195 | } | ||
196 | } | ||
197 | |||
198 | @Override | ||
199 | public Allocate specification() { | ||
200 | return Allocate.instance(); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * Returns an empty, mutable match. | ||
205 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
206 | * | ||
207 | * @return the empty match. | ||
208 | * | ||
209 | */ | ||
210 | public static Allocate.Match newEmptyMatch() { | ||
211 | return new Mutable(null, null); | ||
212 | } | ||
213 | |||
214 | /** | ||
215 | * Returns a mutable (partial) match. | ||
216 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
217 | * | ||
218 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
219 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
220 | * @return the new, mutable (partial) match object. | ||
221 | * | ||
222 | */ | ||
223 | public static Allocate.Match newMutableMatch(final ApplicationInstance pApp, final HostInstance pHost) { | ||
224 | return new Mutable(pApp, pHost); | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * Returns a new (partial) match. | ||
229 | * This can be used e.g. to call the matcher with a partial match. | ||
230 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
231 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
232 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
233 | * @return the (partial) match object. | ||
234 | * | ||
235 | */ | ||
236 | public static Allocate.Match newMatch(final ApplicationInstance pApp, final HostInstance pHost) { | ||
237 | return new Immutable(pApp, pHost); | ||
238 | } | ||
239 | |||
240 | private static final class Mutable extends Allocate.Match { | ||
241 | Mutable(final ApplicationInstance pApp, final HostInstance pHost) { | ||
242 | super(pApp, pHost); | ||
243 | } | ||
244 | |||
245 | @Override | ||
246 | public boolean isMutable() { | ||
247 | return true; | ||
248 | } | ||
249 | } | ||
250 | |||
251 | private static final class Immutable extends Allocate.Match { | ||
252 | Immutable(final ApplicationInstance pApp, final HostInstance pHost) { | ||
253 | super(pApp, pHost); | ||
254 | } | ||
255 | |||
256 | @Override | ||
257 | public boolean isMutable() { | ||
258 | return false; | ||
259 | } | ||
260 | } | ||
261 | } | ||
262 | |||
263 | /** | ||
264 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocate pattern, | ||
265 | * providing pattern-specific query methods. | ||
266 | * | ||
267 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
268 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
269 | * | ||
270 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
271 | * | ||
272 | * <p>Original source: | ||
273 | * <code><pre> | ||
274 | * // | ||
275 | * // Transformation rule preconditions for rule-based DSE | ||
276 | * // | ||
277 | * | ||
278 | * pattern allocate(App : ApplicationInstance, Host : HostInstance) { | ||
279 | * ApplicationInstance.type.requirements(App, Req); | ||
280 | * ResourceRequirement.hostType.instances(Req, Host); | ||
281 | * find unallocatedAppInstance(App); | ||
282 | * find availableMemory(Host, AvailableMem); | ||
283 | * find availableHdd(Host, AvailableHdd); | ||
284 | * ResourceRequirement.requiredMemory(Req, RequiredMem); | ||
285 | * ResourceRequirement.requiredHdd(Req, RequiredHdd); | ||
286 | * check(AvailableMem {@literal >}= RequiredMem); | ||
287 | * check(AvailableHdd {@literal >}= RequiredHdd); | ||
288 | * neg ApplicationInstance.requirement.instances.allocatedTo(App, Host); | ||
289 | * } | ||
290 | * </pre></code> | ||
291 | * | ||
292 | * @see Match | ||
293 | * @see Allocate | ||
294 | * | ||
295 | */ | ||
296 | public static class Matcher extends BaseMatcher<Allocate.Match> { | ||
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 | public static Allocate.Matcher on(final ViatraQueryEngine engine) { | ||
306 | // check if matcher already exists | ||
307 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
308 | if (matcher == null) { | ||
309 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
310 | } | ||
311 | return matcher; | ||
312 | } | ||
313 | |||
314 | /** | ||
315 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
316 | * @return an initialized matcher | ||
317 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
318 | * | ||
319 | */ | ||
320 | public static Allocate.Matcher create() { | ||
321 | return new Matcher(); | ||
322 | } | ||
323 | |||
324 | private static final int POSITION_APP = 0; | ||
325 | |||
326 | private static final int POSITION_HOST = 1; | ||
327 | |||
328 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(Allocate.Matcher.class); | ||
329 | |||
330 | /** | ||
331 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
332 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
333 | * | ||
334 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
335 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
336 | * | ||
337 | */ | ||
338 | private Matcher() { | ||
339 | super(querySpecification()); | ||
340 | } | ||
341 | |||
342 | /** | ||
343 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
344 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
345 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
346 | * @return matches represented as a Match object. | ||
347 | * | ||
348 | */ | ||
349 | public Collection<Allocate.Match> getAllMatches(final ApplicationInstance pApp, final HostInstance pHost) { | ||
350 | return rawStreamAllMatches(new Object[]{pApp, pHost}).collect(Collectors.toSet()); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
355 | * </p> | ||
356 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
357 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
358 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
359 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
360 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
361 | * @return a stream of matches represented as a Match object. | ||
362 | * | ||
363 | */ | ||
364 | public Stream<Allocate.Match> streamAllMatches(final ApplicationInstance pApp, final HostInstance pHost) { | ||
365 | return rawStreamAllMatches(new Object[]{pApp, pHost}); | ||
366 | } | ||
367 | |||
368 | /** | ||
369 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
370 | * Neither determinism nor randomness of selection is guaranteed. | ||
371 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
372 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
373 | * @return a match represented as a Match object, or null if no match is found. | ||
374 | * | ||
375 | */ | ||
376 | public Optional<Allocate.Match> getOneArbitraryMatch(final ApplicationInstance pApp, final HostInstance pHost) { | ||
377 | return rawGetOneArbitraryMatch(new Object[]{pApp, pHost}); | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
382 | * under any possible substitution of the unspecified parameters (if any). | ||
383 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
384 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
385 | * @return true if the input is a valid (partial) match of the pattern. | ||
386 | * | ||
387 | */ | ||
388 | public boolean hasMatch(final ApplicationInstance pApp, final HostInstance pHost) { | ||
389 | return rawHasMatch(new Object[]{pApp, pHost}); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
394 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
395 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
396 | * @return the number of pattern matches found. | ||
397 | * | ||
398 | */ | ||
399 | public int countMatches(final ApplicationInstance pApp, final HostInstance pHost) { | ||
400 | return rawCountMatches(new Object[]{pApp, pHost}); | ||
401 | } | ||
402 | |||
403 | /** | ||
404 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
405 | * Neither determinism nor randomness of selection is guaranteed. | ||
406 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
407 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
408 | * @param processor the action that will process the selected match. | ||
409 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
410 | * | ||
411 | */ | ||
412 | public boolean forOneArbitraryMatch(final ApplicationInstance pApp, final HostInstance pHost, final Consumer<? super Allocate.Match> processor) { | ||
413 | return rawForOneArbitraryMatch(new Object[]{pApp, pHost}, processor); | ||
414 | } | ||
415 | |||
416 | /** | ||
417 | * Returns a new (partial) match. | ||
418 | * This can be used e.g. to call the matcher with a partial match. | ||
419 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
420 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
421 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
422 | * @return the (partial) match object. | ||
423 | * | ||
424 | */ | ||
425 | public Allocate.Match newMatch(final ApplicationInstance pApp, final HostInstance pHost) { | ||
426 | return Allocate.Match.newMatch(pApp, pHost); | ||
427 | } | ||
428 | |||
429 | /** | ||
430 | * Retrieve the set of values that occur in matches for App. | ||
431 | * @return the Set of all values or empty set if there are no matches | ||
432 | * | ||
433 | */ | ||
434 | protected Stream<ApplicationInstance> rawStreamAllValuesOfApp(final Object[] parameters) { | ||
435 | return rawStreamAllValues(POSITION_APP, parameters).map(ApplicationInstance.class::cast); | ||
436 | } | ||
437 | |||
438 | /** | ||
439 | * Retrieve the set of values that occur in matches for App. | ||
440 | * @return the Set of all values or empty set if there are no matches | ||
441 | * | ||
442 | */ | ||
443 | public Set<ApplicationInstance> getAllValuesOfApp() { | ||
444 | return rawStreamAllValuesOfApp(emptyArray()).collect(Collectors.toSet()); | ||
445 | } | ||
446 | |||
447 | /** | ||
448 | * Retrieve the set of values that occur in matches for App. | ||
449 | * @return the Set of all values or empty set if there are no matches | ||
450 | * | ||
451 | */ | ||
452 | public Stream<ApplicationInstance> streamAllValuesOfApp() { | ||
453 | return rawStreamAllValuesOfApp(emptyArray()); | ||
454 | } | ||
455 | |||
456 | /** | ||
457 | * Retrieve the set of values that occur in matches for App. | ||
458 | * </p> | ||
459 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
460 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
461 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
462 | * | ||
463 | * @return the Stream of all values or empty set if there are no matches | ||
464 | * | ||
465 | */ | ||
466 | public Stream<ApplicationInstance> streamAllValuesOfApp(final Allocate.Match partialMatch) { | ||
467 | return rawStreamAllValuesOfApp(partialMatch.toArray()); | ||
468 | } | ||
469 | |||
470 | /** | ||
471 | * Retrieve the set of values that occur in matches for App. | ||
472 | * </p> | ||
473 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
474 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
475 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
476 | * | ||
477 | * @return the Stream of all values or empty set if there are no matches | ||
478 | * | ||
479 | */ | ||
480 | public Stream<ApplicationInstance> streamAllValuesOfApp(final HostInstance pHost) { | ||
481 | return rawStreamAllValuesOfApp(new Object[]{null, pHost}); | ||
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(final Allocate.Match partialMatch) { | ||
490 | return rawStreamAllValuesOfApp(partialMatch.toArray()).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 Set<ApplicationInstance> getAllValuesOfApp(final HostInstance pHost) { | ||
499 | return rawStreamAllValuesOfApp(new Object[]{null, pHost}).collect(Collectors.toSet()); | ||
500 | } | ||
501 | |||
502 | /** | ||
503 | * Retrieve the set of values that occur in matches for Host. | ||
504 | * @return the Set of all values or empty set if there are no matches | ||
505 | * | ||
506 | */ | ||
507 | protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) { | ||
508 | return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast); | ||
509 | } | ||
510 | |||
511 | /** | ||
512 | * Retrieve the set of values that occur in matches for Host. | ||
513 | * @return the Set of all values or empty set if there are no matches | ||
514 | * | ||
515 | */ | ||
516 | public Set<HostInstance> getAllValuesOfHost() { | ||
517 | return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet()); | ||
518 | } | ||
519 | |||
520 | /** | ||
521 | * Retrieve the set of values that occur in matches for Host. | ||
522 | * @return the Set of all values or empty set if there are no matches | ||
523 | * | ||
524 | */ | ||
525 | public Stream<HostInstance> streamAllValuesOfHost() { | ||
526 | return rawStreamAllValuesOfHost(emptyArray()); | ||
527 | } | ||
528 | |||
529 | /** | ||
530 | * Retrieve the set of values that occur in matches for Host. | ||
531 | * </p> | ||
532 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
533 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
534 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
535 | * | ||
536 | * @return the Stream of all values or empty set if there are no matches | ||
537 | * | ||
538 | */ | ||
539 | public Stream<HostInstance> streamAllValuesOfHost(final Allocate.Match partialMatch) { | ||
540 | return rawStreamAllValuesOfHost(partialMatch.toArray()); | ||
541 | } | ||
542 | |||
543 | /** | ||
544 | * Retrieve the set of values that occur in matches for Host. | ||
545 | * </p> | ||
546 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
547 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
548 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
549 | * | ||
550 | * @return the Stream of all values or empty set if there are no matches | ||
551 | * | ||
552 | */ | ||
553 | public Stream<HostInstance> streamAllValuesOfHost(final ApplicationInstance pApp) { | ||
554 | return rawStreamAllValuesOfHost(new Object[]{pApp, null}); | ||
555 | } | ||
556 | |||
557 | /** | ||
558 | * Retrieve the set of values that occur in matches for Host. | ||
559 | * @return the Set of all values or empty set if there are no matches | ||
560 | * | ||
561 | */ | ||
562 | public Set<HostInstance> getAllValuesOfHost(final Allocate.Match partialMatch) { | ||
563 | return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet()); | ||
564 | } | ||
565 | |||
566 | /** | ||
567 | * Retrieve the set of values that occur in matches for Host. | ||
568 | * @return the Set of all values or empty set if there are no matches | ||
569 | * | ||
570 | */ | ||
571 | public Set<HostInstance> getAllValuesOfHost(final ApplicationInstance pApp) { | ||
572 | return rawStreamAllValuesOfHost(new Object[]{pApp, null}).collect(Collectors.toSet()); | ||
573 | } | ||
574 | |||
575 | @Override | ||
576 | protected Allocate.Match tupleToMatch(final Tuple t) { | ||
577 | try { | ||
578 | return Allocate.Match.newMatch((ApplicationInstance) t.get(POSITION_APP), (HostInstance) t.get(POSITION_HOST)); | ||
579 | } catch(ClassCastException e) { | ||
580 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
581 | return null; | ||
582 | } | ||
583 | } | ||
584 | |||
585 | @Override | ||
586 | protected Allocate.Match arrayToMatch(final Object[] match) { | ||
587 | try { | ||
588 | return Allocate.Match.newMatch((ApplicationInstance) match[POSITION_APP], (HostInstance) match[POSITION_HOST]); | ||
589 | } catch(ClassCastException e) { | ||
590 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
591 | return null; | ||
592 | } | ||
593 | } | ||
594 | |||
595 | @Override | ||
596 | protected Allocate.Match arrayToMatchMutable(final Object[] match) { | ||
597 | try { | ||
598 | return Allocate.Match.newMutableMatch((ApplicationInstance) match[POSITION_APP], (HostInstance) match[POSITION_HOST]); | ||
599 | } catch(ClassCastException e) { | ||
600 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
601 | return null; | ||
602 | } | ||
603 | } | ||
604 | |||
605 | /** | ||
606 | * @return the singleton instance of the query specification of this pattern | ||
607 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
608 | * | ||
609 | */ | ||
610 | public static IQuerySpecification<Allocate.Matcher> querySpecification() { | ||
611 | return Allocate.instance(); | ||
612 | } | ||
613 | } | ||
614 | |||
615 | private Allocate() { | ||
616 | super(GeneratedPQuery.INSTANCE); | ||
617 | } | ||
618 | |||
619 | /** | ||
620 | * @return the singleton instance of the query specification | ||
621 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
622 | * | ||
623 | */ | ||
624 | public static Allocate instance() { | ||
625 | try{ | ||
626 | return LazyHolder.INSTANCE; | ||
627 | } catch (ExceptionInInitializerError err) { | ||
628 | throw processInitializerError(err); | ||
629 | } | ||
630 | } | ||
631 | |||
632 | @Override | ||
633 | protected Allocate.Matcher instantiate(final ViatraQueryEngine engine) { | ||
634 | return Allocate.Matcher.on(engine); | ||
635 | } | ||
636 | |||
637 | @Override | ||
638 | public Allocate.Matcher instantiate() { | ||
639 | return Allocate.Matcher.create(); | ||
640 | } | ||
641 | |||
642 | @Override | ||
643 | public Allocate.Match newEmptyMatch() { | ||
644 | return Allocate.Match.newEmptyMatch(); | ||
645 | } | ||
646 | |||
647 | @Override | ||
648 | public Allocate.Match newMatch(final Object... parameters) { | ||
649 | return Allocate.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[1]); | ||
650 | } | ||
651 | |||
652 | /** | ||
653 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate (visibility: PUBLIC, simpleName: Allocate, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate, 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 | ||
654 | * <b>not</b> at the class load time of the outer class, | ||
655 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate (visibility: PUBLIC, simpleName: Allocate, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
656 | * | ||
657 | * <p> This workaround is required e.g. to support recursion. | ||
658 | * | ||
659 | */ | ||
660 | private static class LazyHolder { | ||
661 | private static final Allocate INSTANCE = new Allocate(); | ||
662 | |||
663 | /** | ||
664 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
665 | * This initialization order is required to support indirect recursion. | ||
666 | * | ||
667 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
668 | * | ||
669 | */ | ||
670 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
671 | |||
672 | public static Object ensureInitialized() { | ||
673 | INSTANCE.ensureInitializedInternal(); | ||
674 | return null; | ||
675 | } | ||
676 | } | ||
677 | |||
678 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
679 | private static final Allocate.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
680 | |||
681 | 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); | ||
682 | |||
683 | 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); | ||
684 | |||
685 | private final List<PParameter> parameters = Arrays.asList(parameter_App, parameter_Host); | ||
686 | |||
687 | private class Embedded_1_ApplicationInstance_requirement_instances_allocatedTo extends BaseGeneratedEMFPQuery { | ||
688 | private final PParameter parameter_p0 = new PParameter("p0", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT); | ||
689 | |||
690 | private final PParameter parameter_p1 = new PParameter("p1", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT); | ||
691 | |||
692 | private final List<PParameter> embeddedParameters = Arrays.asList(parameter_p0, parameter_p1); | ||
693 | |||
694 | public Embedded_1_ApplicationInstance_requirement_instances_allocatedTo() { | ||
695 | super(PVisibility.EMBEDDED); | ||
696 | } | ||
697 | |||
698 | @Override | ||
699 | public String getFullyQualifiedName() { | ||
700 | return GeneratedPQuery.this.getFullyQualifiedName() + "$Embedded_1_ApplicationInstance_requirement_instances_allocatedTo"; | ||
701 | } | ||
702 | |||
703 | @Override | ||
704 | public List<PParameter> getParameters() { | ||
705 | return embeddedParameters; | ||
706 | } | ||
707 | |||
708 | @Override | ||
709 | public Set<PBody> doGetContainedBodies() { | ||
710 | PBody body = new PBody(this); | ||
711 | PVariable var_p0 = body.getOrCreateVariableByName("p0"); | ||
712 | PVariable var_p1 = body.getOrCreateVariableByName("p1"); | ||
713 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
714 | new ExportedParameter(body, var_p0, parameter_p0), | ||
715 | new ExportedParameter(body, var_p1, parameter_p1) | ||
716 | )); | ||
717 | // ApplicationInstance.requirement.instances.allocatedTo(App, Host) | ||
718 | new TypeConstraint(body, Tuples.flatTupleOf(var_p0), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
719 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
720 | new TypeConstraint(body, Tuples.flatTupleOf(var_p0, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "requirement"))); | ||
721 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement"))); | ||
722 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
723 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "instances"))); | ||
724 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
725 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
726 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo"))); | ||
727 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
728 | new Equality(body, var__virtual_2_, var_p1); | ||
729 | return Collections.singleton(body); | ||
730 | } | ||
731 | } | ||
732 | |||
733 | private GeneratedPQuery() { | ||
734 | super(PVisibility.PUBLIC); | ||
735 | } | ||
736 | |||
737 | @Override | ||
738 | public String getFullyQualifiedName() { | ||
739 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocate"; | ||
740 | } | ||
741 | |||
742 | @Override | ||
743 | public List<String> getParameterNames() { | ||
744 | return Arrays.asList("App","Host"); | ||
745 | } | ||
746 | |||
747 | @Override | ||
748 | public List<PParameter> getParameters() { | ||
749 | return parameters; | ||
750 | } | ||
751 | |||
752 | @Override | ||
753 | public Set<PBody> doGetContainedBodies() { | ||
754 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
755 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
756 | { | ||
757 | PBody body = new PBody(this); | ||
758 | PVariable var_App = body.getOrCreateVariableByName("App"); | ||
759 | PVariable var_Host = body.getOrCreateVariableByName("Host"); | ||
760 | PVariable var_Req = body.getOrCreateVariableByName("Req"); | ||
761 | PVariable var_AvailableMem = body.getOrCreateVariableByName("AvailableMem"); | ||
762 | PVariable var_AvailableHdd = body.getOrCreateVariableByName("AvailableHdd"); | ||
763 | PVariable var_RequiredMem = body.getOrCreateVariableByName("RequiredMem"); | ||
764 | PVariable var_RequiredHdd = body.getOrCreateVariableByName("RequiredHdd"); | ||
765 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
766 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
767 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
768 | new ExportedParameter(body, var_App, parameter_App), | ||
769 | new ExportedParameter(body, var_Host, parameter_Host) | ||
770 | )); | ||
771 | // ApplicationInstance.type.requirements(App, Req) | ||
772 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
773 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
774 | new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "type"))); | ||
775 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType"))); | ||
776 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
777 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "requirements"))); | ||
778 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
779 | new Equality(body, var__virtual_1_, var_Req); | ||
780 | // ResourceRequirement.hostType.instances(Req, Host) | ||
781 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
782 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
783 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "hostType"))); | ||
784 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
785 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
786 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "instances"))); | ||
787 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
788 | new Equality(body, var__virtual_3_, var_Host); | ||
789 | // find unallocatedAppInstance(App) | ||
790 | new PositivePatternCall(body, Tuples.flatTupleOf(var_App), UnallocatedAppInstance.instance().getInternalQueryRepresentation()); | ||
791 | // find availableMemory(Host, AvailableMem) | ||
792 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_AvailableMem), AvailableMemory.instance().getInternalQueryRepresentation()); | ||
793 | // find availableHdd(Host, AvailableHdd) | ||
794 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_AvailableHdd), AvailableHdd.instance().getInternalQueryRepresentation()); | ||
795 | // ResourceRequirement.requiredMemory(Req, RequiredMem) | ||
796 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
797 | PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}"); | ||
798 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "requiredMemory"))); | ||
799 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
800 | new Equality(body, var__virtual_4_, var_RequiredMem); | ||
801 | // ResourceRequirement.requiredHdd(Req, RequiredHdd) | ||
802 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
803 | PVariable var__virtual_5_ = body.getOrCreateVariableByName(".virtual{5}"); | ||
804 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_5_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "requiredHdd"))); | ||
805 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_5_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
806 | new Equality(body, var__virtual_5_, var_RequiredHdd); | ||
807 | // check(AvailableMem >= RequiredMem) | ||
808 | new ExpressionEvaluation(body, new IExpressionEvaluator() { | ||
809 | |||
810 | @Override | ||
811 | public String getShortDescription() { | ||
812 | return "Expression evaluation from pattern allocate"; | ||
813 | } | ||
814 | |||
815 | @Override | ||
816 | public Iterable<String> getInputParameterNames() { | ||
817 | return Arrays.asList("AvailableMem", "RequiredMem");} | ||
818 | |||
819 | @Override | ||
820 | public Object evaluateExpression(IValueProvider provider) throws Exception { | ||
821 | Integer AvailableMem = (Integer) provider.getValue("AvailableMem"); | ||
822 | Integer RequiredMem = (Integer) provider.getValue("RequiredMem"); | ||
823 | return evaluateExpression_1_1(AvailableMem, RequiredMem); | ||
824 | } | ||
825 | }, null); | ||
826 | // check(AvailableHdd >= RequiredHdd) | ||
827 | new ExpressionEvaluation(body, new IExpressionEvaluator() { | ||
828 | |||
829 | @Override | ||
830 | public String getShortDescription() { | ||
831 | return "Expression evaluation from pattern allocate"; | ||
832 | } | ||
833 | |||
834 | @Override | ||
835 | public Iterable<String> getInputParameterNames() { | ||
836 | return Arrays.asList("AvailableHdd", "RequiredHdd");} | ||
837 | |||
838 | @Override | ||
839 | public Object evaluateExpression(IValueProvider provider) throws Exception { | ||
840 | Integer AvailableHdd = (Integer) provider.getValue("AvailableHdd"); | ||
841 | Integer RequiredHdd = (Integer) provider.getValue("RequiredHdd"); | ||
842 | return evaluateExpression_1_2(AvailableHdd, RequiredHdd); | ||
843 | } | ||
844 | }, null); | ||
845 | // neg ApplicationInstance.requirement.instances.allocatedTo(App, Host) | ||
846 | new NegativePatternCall(body, Tuples.flatTupleOf(var_App, var_Host), new Allocate.GeneratedPQuery.Embedded_1_ApplicationInstance_requirement_instances_allocatedTo()); | ||
847 | bodies.add(body); | ||
848 | } | ||
849 | return bodies; | ||
850 | } | ||
851 | } | ||
852 | |||
853 | private static boolean evaluateExpression_1_1(final Integer AvailableMem, final Integer RequiredMem) { | ||
854 | boolean _greaterEqualsThan = (AvailableMem.compareTo(RequiredMem) >= 0); | ||
855 | return _greaterEqualsThan; | ||
856 | } | ||
857 | |||
858 | private static boolean evaluateExpression_1_2(final Integer AvailableHdd, final Integer RequiredHdd) { | ||
859 | boolean _greaterEqualsThan = (AvailableHdd.compareTo(RequiredHdd) >= 0); | ||
860 | return _greaterEqualsThan; | ||
861 | } | ||
862 | } | ||
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..6da5f76d --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement; | ||
9 | import java.util.Arrays; | ||
10 | import java.util.Collection; | ||
11 | import java.util.LinkedHashSet; | ||
12 | import java.util.List; | ||
13 | import java.util.Objects; | ||
14 | import java.util.Optional; | ||
15 | import java.util.Set; | ||
16 | import java.util.function.Consumer; | ||
17 | import java.util.stream.Collectors; | ||
18 | import java.util.stream.Stream; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
44 | import 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") | ||
64 | public 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/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..bc38b60b --- /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,544 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
19 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
20 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.aggregators.avg; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
39 | import 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 | * // Free HDD | ||
47 | * | ||
48 | * pattern averageFreeHddMetric(Average : java Double) { | ||
49 | * Average == avg find freeHddPercentage(_, #_); | ||
50 | * } | ||
51 | * </pre></code> | ||
52 | * | ||
53 | * @see Matcher | ||
54 | * @see Match | ||
55 | * | ||
56 | */ | ||
57 | @SuppressWarnings("all") | ||
58 | public final class AverageFreeHddMetric extends BaseGeneratedEMFQuerySpecification<AverageFreeHddMetric.Matcher> { | ||
59 | /** | ||
60 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric 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 fAverage; | ||
73 | |||
74 | private static List<String> parameterNames = makeImmutableList("Average"); | ||
75 | |||
76 | private Match(final Double pAverage) { | ||
77 | this.fAverage = pAverage; | ||
78 | } | ||
79 | |||
80 | @Override | ||
81 | public Object get(final String parameterName) { | ||
82 | if ("Average".equals(parameterName)) return this.fAverage; | ||
83 | return null; | ||
84 | } | ||
85 | |||
86 | public Double getAverage() { | ||
87 | return this.fAverage; | ||
88 | } | ||
89 | |||
90 | @Override | ||
91 | public boolean set(final String parameterName, final Object newValue) { | ||
92 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
93 | if ("Average".equals(parameterName) ) { | ||
94 | this.fAverage = (Double) newValue; | ||
95 | return true; | ||
96 | } | ||
97 | return false; | ||
98 | } | ||
99 | |||
100 | public void setAverage(final Double pAverage) { | ||
101 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
102 | this.fAverage = pAverage; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public String patternName() { | ||
107 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric"; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public List<String> parameterNames() { | ||
112 | return AverageFreeHddMetric.Match.parameterNames; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Object[] toArray() { | ||
117 | return new Object[]{fAverage}; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public AverageFreeHddMetric.Match toImmutable() { | ||
122 | return isMutable() ? newMatch(fAverage) : this; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public String prettyPrint() { | ||
127 | StringBuilder result = new StringBuilder(); | ||
128 | result.append("\"Average\"=" + prettyPrintValue(fAverage)); | ||
129 | return result.toString(); | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public int hashCode() { | ||
134 | return Objects.hash(fAverage); | ||
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 AverageFreeHddMetric.Match)) { | ||
145 | AverageFreeHddMetric.Match other = (AverageFreeHddMetric.Match) obj; | ||
146 | return Objects.equals(fAverage, other.fAverage); | ||
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 AverageFreeHddMetric specification() { | ||
159 | return AverageFreeHddMetric.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 AverageFreeHddMetric.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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
178 | * @return the new, mutable (partial) match object. | ||
179 | * | ||
180 | */ | ||
181 | public static AverageFreeHddMetric.Match newMutableMatch(final Double pAverage) { | ||
182 | return new Mutable(pAverage); | ||
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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
190 | * @return the (partial) match object. | ||
191 | * | ||
192 | */ | ||
193 | public static AverageFreeHddMetric.Match newMatch(final Double pAverage) { | ||
194 | return new Immutable(pAverage); | ||
195 | } | ||
196 | |||
197 | private static final class Mutable extends AverageFreeHddMetric.Match { | ||
198 | Mutable(final Double pAverage) { | ||
199 | super(pAverage); | ||
200 | } | ||
201 | |||
202 | @Override | ||
203 | public boolean isMutable() { | ||
204 | return true; | ||
205 | } | ||
206 | } | ||
207 | |||
208 | private static final class Immutable extends AverageFreeHddMetric.Match { | ||
209 | Immutable(final Double pAverage) { | ||
210 | super(pAverage); | ||
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.cps.queries.averageFreeHddMetric 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 | * // Free HDD | ||
232 | * | ||
233 | * pattern averageFreeHddMetric(Average : java Double) { | ||
234 | * Average == avg find freeHddPercentage(_, #_); | ||
235 | * } | ||
236 | * </pre></code> | ||
237 | * | ||
238 | * @see Match | ||
239 | * @see AverageFreeHddMetric | ||
240 | * | ||
241 | */ | ||
242 | public static class Matcher extends BaseMatcher<AverageFreeHddMetric.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 AverageFreeHddMetric.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 AverageFreeHddMetric.Matcher create() { | ||
267 | return new Matcher(); | ||
268 | } | ||
269 | |||
270 | private static final int POSITION_AVERAGE = 0; | ||
271 | |||
272 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AverageFreeHddMetric.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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
289 | * @return matches represented as a Match object. | ||
290 | * | ||
291 | */ | ||
292 | public Collection<AverageFreeHddMetric.Match> getAllMatches(final Double pAverage) { | ||
293 | return rawStreamAllMatches(new Object[]{pAverage}).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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
303 | * @return a stream of matches represented as a Match object. | ||
304 | * | ||
305 | */ | ||
306 | public Stream<AverageFreeHddMetric.Match> streamAllMatches(final Double pAverage) { | ||
307 | return rawStreamAllMatches(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, 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<AverageFreeHddMetric.Match> getOneArbitraryMatch(final Double pAverage) { | ||
318 | return rawGetOneArbitraryMatch(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, 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 pAverage) { | ||
329 | return rawHasMatch(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
335 | * @return the number of pattern matches found. | ||
336 | * | ||
337 | */ | ||
338 | public int countMatches(final Double pAverage) { | ||
339 | return rawCountMatches(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, 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 pAverage, final Consumer<? super AverageFreeHddMetric.Match> processor) { | ||
351 | return rawForOneArbitraryMatch(new Object[]{pAverage}, 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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
359 | * @return the (partial) match object. | ||
360 | * | ||
361 | */ | ||
362 | public AverageFreeHddMetric.Match newMatch(final Double pAverage) { | ||
363 | return AverageFreeHddMetric.Match.newMatch(pAverage); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * Retrieve the set of values that occur in matches for Average. | ||
368 | * @return the Set of all values or empty set if there are no matches | ||
369 | * | ||
370 | */ | ||
371 | protected Stream<Double> rawStreamAllValuesOfAverage(final Object[] parameters) { | ||
372 | return rawStreamAllValues(POSITION_AVERAGE, parameters).map(Double.class::cast); | ||
373 | } | ||
374 | |||
375 | /** | ||
376 | * Retrieve the set of values that occur in matches for Average. | ||
377 | * @return the Set of all values or empty set if there are no matches | ||
378 | * | ||
379 | */ | ||
380 | public Set<Double> getAllValuesOfAverage() { | ||
381 | return rawStreamAllValuesOfAverage(emptyArray()).collect(Collectors.toSet()); | ||
382 | } | ||
383 | |||
384 | /** | ||
385 | * Retrieve the set of values that occur in matches for Average. | ||
386 | * @return the Set of all values or empty set if there are no matches | ||
387 | * | ||
388 | */ | ||
389 | public Stream<Double> streamAllValuesOfAverage() { | ||
390 | return rawStreamAllValuesOfAverage(emptyArray()); | ||
391 | } | ||
392 | |||
393 | @Override | ||
394 | protected AverageFreeHddMetric.Match tupleToMatch(final Tuple t) { | ||
395 | try { | ||
396 | return AverageFreeHddMetric.Match.newMatch((Double) t.get(POSITION_AVERAGE)); | ||
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 AverageFreeHddMetric.Match arrayToMatch(final Object[] match) { | ||
405 | try { | ||
406 | return AverageFreeHddMetric.Match.newMatch((Double) match[POSITION_AVERAGE]); | ||
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 AverageFreeHddMetric.Match arrayToMatchMutable(final Object[] match) { | ||
415 | try { | ||
416 | return AverageFreeHddMetric.Match.newMutableMatch((Double) match[POSITION_AVERAGE]); | ||
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<AverageFreeHddMetric.Matcher> querySpecification() { | ||
429 | return AverageFreeHddMetric.instance(); | ||
430 | } | ||
431 | } | ||
432 | |||
433 | private AverageFreeHddMetric() { | ||
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 AverageFreeHddMetric instance() { | ||
443 | try{ | ||
444 | return LazyHolder.INSTANCE; | ||
445 | } catch (ExceptionInInitializerError err) { | ||
446 | throw processInitializerError(err); | ||
447 | } | ||
448 | } | ||
449 | |||
450 | @Override | ||
451 | protected AverageFreeHddMetric.Matcher instantiate(final ViatraQueryEngine engine) { | ||
452 | return AverageFreeHddMetric.Matcher.on(engine); | ||
453 | } | ||
454 | |||
455 | @Override | ||
456 | public AverageFreeHddMetric.Matcher instantiate() { | ||
457 | return AverageFreeHddMetric.Matcher.create(); | ||
458 | } | ||
459 | |||
460 | @Override | ||
461 | public AverageFreeHddMetric.Match newEmptyMatch() { | ||
462 | return AverageFreeHddMetric.Match.newEmptyMatch(); | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | public AverageFreeHddMetric.Match newMatch(final Object... parameters) { | ||
467 | return AverageFreeHddMetric.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.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 | ||
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.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()}. | ||
474 | * | ||
475 | * <p> This workaround is required e.g. to support recursion. | ||
476 | * | ||
477 | */ | ||
478 | private static class LazyHolder { | ||
479 | private static final AverageFreeHddMetric INSTANCE = new AverageFreeHddMetric(); | ||
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 AverageFreeHddMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
498 | |||
499 | private final PParameter parameter_Average = new PParameter("Average", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT); | ||
500 | |||
501 | private final List<PParameter> parameters = Arrays.asList(parameter_Average); | ||
502 | |||
503 | private GeneratedPQuery() { | ||
504 | super(PVisibility.PUBLIC); | ||
505 | } | ||
506 | |||
507 | @Override | ||
508 | public String getFullyQualifiedName() { | ||
509 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric"; | ||
510 | } | ||
511 | |||
512 | @Override | ||
513 | public List<String> getParameterNames() { | ||
514 | return Arrays.asList("Average"); | ||
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_Average = body.getOrCreateVariableByName("Average"); | ||
529 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
530 | PVariable var___1_ = body.getOrCreateVariableByName("_<1>"); | ||
531 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Average), new JavaTransitiveInstancesKey(java.lang.Double.class)); | ||
532 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
533 | new ExportedParameter(body, var_Average, parameter_Average) | ||
534 | )); | ||
535 | // Average == avg find freeHddPercentage(_, #_) | ||
536 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
537 | new AggregatorConstraint(new avg().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), FreeHddPercentage.instance().getInternalQueryRepresentation(), var__virtual_0_, 1); | ||
538 | new Equality(body, var_Average, var__virtual_0_); | ||
539 | bodies.add(body); | ||
540 | } | ||
541 | return bodies; | ||
542 | } | ||
543 | } | ||
544 | } | ||
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..98974ea5 --- /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,552 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
19 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
20 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.aggregators.avg; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
39 | import 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 | * // Free memory | ||
51 | * | ||
52 | * pattern averageFreeMemoryMetric(Average : java Double) { | ||
53 | * Average == avg find freeMemoryPercentage(_, #_); | ||
54 | * } | ||
55 | * </pre></code> | ||
56 | * | ||
57 | * @see Matcher | ||
58 | * @see Match | ||
59 | * | ||
60 | */ | ||
61 | @SuppressWarnings("all") | ||
62 | public final class AverageFreeMemoryMetric extends BaseGeneratedEMFQuerySpecification<AverageFreeMemoryMetric.Matcher> { | ||
63 | /** | ||
64 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric 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 fAverage; | ||
77 | |||
78 | private static List<String> parameterNames = makeImmutableList("Average"); | ||
79 | |||
80 | private Match(final Double pAverage) { | ||
81 | this.fAverage = pAverage; | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Object get(final String parameterName) { | ||
86 | if ("Average".equals(parameterName)) return this.fAverage; | ||
87 | return null; | ||
88 | } | ||
89 | |||
90 | public Double getAverage() { | ||
91 | return this.fAverage; | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public boolean set(final String parameterName, final Object newValue) { | ||
96 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
97 | if ("Average".equals(parameterName) ) { | ||
98 | this.fAverage = (Double) newValue; | ||
99 | return true; | ||
100 | } | ||
101 | return false; | ||
102 | } | ||
103 | |||
104 | public void setAverage(final Double pAverage) { | ||
105 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
106 | this.fAverage = pAverage; | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public String patternName() { | ||
111 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric"; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public List<String> parameterNames() { | ||
116 | return AverageFreeMemoryMetric.Match.parameterNames; | ||
117 | } | ||
118 | |||
119 | @Override | ||
120 | public Object[] toArray() { | ||
121 | return new Object[]{fAverage}; | ||
122 | } | ||
123 | |||
124 | @Override | ||
125 | public AverageFreeMemoryMetric.Match toImmutable() { | ||
126 | return isMutable() ? newMatch(fAverage) : this; | ||
127 | } | ||
128 | |||
129 | @Override | ||
130 | public String prettyPrint() { | ||
131 | StringBuilder result = new StringBuilder(); | ||
132 | result.append("\"Average\"=" + prettyPrintValue(fAverage)); | ||
133 | return result.toString(); | ||
134 | } | ||
135 | |||
136 | @Override | ||
137 | public int hashCode() { | ||
138 | return Objects.hash(fAverage); | ||
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 AverageFreeMemoryMetric.Match)) { | ||
149 | AverageFreeMemoryMetric.Match other = (AverageFreeMemoryMetric.Match) obj; | ||
150 | return Objects.equals(fAverage, other.fAverage); | ||
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 AverageFreeMemoryMetric specification() { | ||
163 | return AverageFreeMemoryMetric.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 AverageFreeMemoryMetric.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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
182 | * @return the new, mutable (partial) match object. | ||
183 | * | ||
184 | */ | ||
185 | public static AverageFreeMemoryMetric.Match newMutableMatch(final Double pAverage) { | ||
186 | return new Mutable(pAverage); | ||
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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
194 | * @return the (partial) match object. | ||
195 | * | ||
196 | */ | ||
197 | public static AverageFreeMemoryMetric.Match newMatch(final Double pAverage) { | ||
198 | return new Immutable(pAverage); | ||
199 | } | ||
200 | |||
201 | private static final class Mutable extends AverageFreeMemoryMetric.Match { | ||
202 | Mutable(final Double pAverage) { | ||
203 | super(pAverage); | ||
204 | } | ||
205 | |||
206 | @Override | ||
207 | public boolean isMutable() { | ||
208 | return true; | ||
209 | } | ||
210 | } | ||
211 | |||
212 | private static final class Immutable extends AverageFreeMemoryMetric.Match { | ||
213 | Immutable(final Double pAverage) { | ||
214 | super(pAverage); | ||
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.cps.queries.averageFreeMemoryMetric 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 | * // Free memory | ||
240 | * | ||
241 | * pattern averageFreeMemoryMetric(Average : java Double) { | ||
242 | * Average == avg find freeMemoryPercentage(_, #_); | ||
243 | * } | ||
244 | * </pre></code> | ||
245 | * | ||
246 | * @see Match | ||
247 | * @see AverageFreeMemoryMetric | ||
248 | * | ||
249 | */ | ||
250 | public static class Matcher extends BaseMatcher<AverageFreeMemoryMetric.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 AverageFreeMemoryMetric.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 AverageFreeMemoryMetric.Matcher create() { | ||
275 | return new Matcher(); | ||
276 | } | ||
277 | |||
278 | private static final int POSITION_AVERAGE = 0; | ||
279 | |||
280 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AverageFreeMemoryMetric.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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
297 | * @return matches represented as a Match object. | ||
298 | * | ||
299 | */ | ||
300 | public Collection<AverageFreeMemoryMetric.Match> getAllMatches(final Double pAverage) { | ||
301 | return rawStreamAllMatches(new Object[]{pAverage}).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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
311 | * @return a stream of matches represented as a Match object. | ||
312 | * | ||
313 | */ | ||
314 | public Stream<AverageFreeMemoryMetric.Match> streamAllMatches(final Double pAverage) { | ||
315 | return rawStreamAllMatches(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, 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<AverageFreeMemoryMetric.Match> getOneArbitraryMatch(final Double pAverage) { | ||
326 | return rawGetOneArbitraryMatch(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, 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 pAverage) { | ||
337 | return rawHasMatch(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
343 | * @return the number of pattern matches found. | ||
344 | * | ||
345 | */ | ||
346 | public int countMatches(final Double pAverage) { | ||
347 | return rawCountMatches(new Object[]{pAverage}); | ||
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 pAverage the fixed value of pattern parameter Average, 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 pAverage, final Consumer<? super AverageFreeMemoryMetric.Match> processor) { | ||
359 | return rawForOneArbitraryMatch(new Object[]{pAverage}, 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 pAverage the fixed value of pattern parameter Average, or null if not bound. | ||
367 | * @return the (partial) match object. | ||
368 | * | ||
369 | */ | ||
370 | public AverageFreeMemoryMetric.Match newMatch(final Double pAverage) { | ||
371 | return AverageFreeMemoryMetric.Match.newMatch(pAverage); | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * Retrieve the set of values that occur in matches for Average. | ||
376 | * @return the Set of all values or empty set if there are no matches | ||
377 | * | ||
378 | */ | ||
379 | protected Stream<Double> rawStreamAllValuesOfAverage(final Object[] parameters) { | ||
380 | return rawStreamAllValues(POSITION_AVERAGE, parameters).map(Double.class::cast); | ||
381 | } | ||
382 | |||
383 | /** | ||
384 | * Retrieve the set of values that occur in matches for Average. | ||
385 | * @return the Set of all values or empty set if there are no matches | ||
386 | * | ||
387 | */ | ||
388 | public Set<Double> getAllValuesOfAverage() { | ||
389 | return rawStreamAllValuesOfAverage(emptyArray()).collect(Collectors.toSet()); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Retrieve the set of values that occur in matches for Average. | ||
394 | * @return the Set of all values or empty set if there are no matches | ||
395 | * | ||
396 | */ | ||
397 | public Stream<Double> streamAllValuesOfAverage() { | ||
398 | return rawStreamAllValuesOfAverage(emptyArray()); | ||
399 | } | ||
400 | |||
401 | @Override | ||
402 | protected AverageFreeMemoryMetric.Match tupleToMatch(final Tuple t) { | ||
403 | try { | ||
404 | return AverageFreeMemoryMetric.Match.newMatch((Double) t.get(POSITION_AVERAGE)); | ||
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 AverageFreeMemoryMetric.Match arrayToMatch(final Object[] match) { | ||
413 | try { | ||
414 | return AverageFreeMemoryMetric.Match.newMatch((Double) match[POSITION_AVERAGE]); | ||
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 AverageFreeMemoryMetric.Match arrayToMatchMutable(final Object[] match) { | ||
423 | try { | ||
424 | return AverageFreeMemoryMetric.Match.newMutableMatch((Double) match[POSITION_AVERAGE]); | ||
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<AverageFreeMemoryMetric.Matcher> querySpecification() { | ||
437 | return AverageFreeMemoryMetric.instance(); | ||
438 | } | ||
439 | } | ||
440 | |||
441 | private AverageFreeMemoryMetric() { | ||
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 AverageFreeMemoryMetric instance() { | ||
451 | try{ | ||
452 | return LazyHolder.INSTANCE; | ||
453 | } catch (ExceptionInInitializerError err) { | ||
454 | throw processInitializerError(err); | ||
455 | } | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | protected AverageFreeMemoryMetric.Matcher instantiate(final ViatraQueryEngine engine) { | ||
460 | return AverageFreeMemoryMetric.Matcher.on(engine); | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public AverageFreeMemoryMetric.Matcher instantiate() { | ||
465 | return AverageFreeMemoryMetric.Matcher.create(); | ||
466 | } | ||
467 | |||
468 | @Override | ||
469 | public AverageFreeMemoryMetric.Match newEmptyMatch() { | ||
470 | return AverageFreeMemoryMetric.Match.newEmptyMatch(); | ||
471 | } | ||
472 | |||
473 | @Override | ||
474 | public AverageFreeMemoryMetric.Match newMatch(final Object... parameters) { | ||
475 | return AverageFreeMemoryMetric.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.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 | ||
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.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()}. | ||
482 | * | ||
483 | * <p> This workaround is required e.g. to support recursion. | ||
484 | * | ||
485 | */ | ||
486 | private static class LazyHolder { | ||
487 | private static final AverageFreeMemoryMetric INSTANCE = new AverageFreeMemoryMetric(); | ||
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 AverageFreeMemoryMetric.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
506 | |||
507 | private final PParameter parameter_Average = new PParameter("Average", "java.lang.Double", new JavaTransitiveInstancesKey(java.lang.Double.class), PParameterDirection.INOUT); | ||
508 | |||
509 | private final List<PParameter> parameters = Arrays.asList(parameter_Average); | ||
510 | |||
511 | private GeneratedPQuery() { | ||
512 | super(PVisibility.PUBLIC); | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public String getFullyQualifiedName() { | ||
517 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeMemoryMetric"; | ||
518 | } | ||
519 | |||
520 | @Override | ||
521 | public List<String> getParameterNames() { | ||
522 | return Arrays.asList("Average"); | ||
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_Average = body.getOrCreateVariableByName("Average"); | ||
537 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
538 | PVariable var___1_ = body.getOrCreateVariableByName("_<1>"); | ||
539 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Average), new JavaTransitiveInstancesKey(java.lang.Double.class)); | ||
540 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
541 | new ExportedParameter(body, var_Average, parameter_Average) | ||
542 | )); | ||
543 | // Average == avg find freeMemoryPercentage(_, #_) | ||
544 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
545 | new AggregatorConstraint(new avg().getAggregatorLogic(Double.class), body, Tuples.flatTupleOf(var___0_, var___1_), FreeMemoryPercentage.instance().getInternalQueryRepresentation(), var__virtual_0_, 1); | ||
546 | new Equality(body, var_Average, var__virtual_0_); | ||
547 | bodies.add(body); | ||
548 | } | ||
549 | return bodies; | ||
550 | } | ||
551 | } | ||
552 | } | ||
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..bf886ec0 --- /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,544 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
19 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
20 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
21 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.aggregators.sum; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
39 | import 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 | * // Total cost | ||
47 | * | ||
48 | * pattern costMetric(Cost : java Integer) { | ||
49 | * Cost == sum find cpsCost(_, #_); | ||
50 | * } | ||
51 | * </pre></code> | ||
52 | * | ||
53 | * @see Matcher | ||
54 | * @see Match | ||
55 | * | ||
56 | */ | ||
57 | @SuppressWarnings("all") | ||
58 | public final class CostMetric extends BaseGeneratedEMFQuerySpecification<CostMetric.Matcher> { | ||
59 | /** | ||
60 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.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 Integer fCost; | ||
73 | |||
74 | private static List<String> parameterNames = makeImmutableList("Cost"); | ||
75 | |||
76 | private Match(final Integer 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 Integer 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 = (Integer) newValue; | ||
95 | return true; | ||
96 | } | ||
97 | return false; | ||
98 | } | ||
99 | |||
100 | public void setCost(final Integer 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.cps.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 Integer 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 Integer pCost) { | ||
194 | return new Immutable(pCost); | ||
195 | } | ||
196 | |||
197 | private static final class Mutable extends CostMetric.Match { | ||
198 | Mutable(final Integer 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 Integer 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.cps.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 | * // Total cost | ||
232 | * | ||
233 | * pattern costMetric(Cost : java Integer) { | ||
234 | * Cost == sum find cpsCost(_, #_); | ||
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 Integer 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 Integer 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 Integer 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 Integer 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 Integer 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 Integer 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 Integer 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<Integer> rawStreamAllValuesOfCost(final Object[] parameters) { | ||
372 | return rawStreamAllValues(POSITION_COST, parameters).map(Integer.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<Integer> 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<Integer> streamAllValuesOfCost() { | ||
390 | return rawStreamAllValuesOfCost(emptyArray()); | ||
391 | } | ||
392 | |||
393 | @Override | ||
394 | protected CostMetric.Match tupleToMatch(final Tuple t) { | ||
395 | try { | ||
396 | return CostMetric.Match.newMatch((Integer) 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((Integer) 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((Integer) 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.Integer) parameters[0]); | ||
468 | } | ||
469 | |||
470 | /** | ||
471 | * 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 | ||
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.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()}. | ||
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.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.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.cps.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.Integer.class)); | ||
532 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
533 | new ExportedParameter(body, var_Cost, parameter_Cost) | ||
534 | )); | ||
535 | // Cost == sum find cpsCost(_, #_) | ||
536 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
537 | new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var___0_, var___1_), CpsCost.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.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..fc90ef12 --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost; | ||
9 | import java.util.Arrays; | ||
10 | import java.util.Collection; | ||
11 | import java.util.LinkedHashSet; | ||
12 | import java.util.List; | ||
13 | import java.util.Objects; | ||
14 | import java.util.Optional; | ||
15 | import java.util.Set; | ||
16 | import java.util.function.Consumer; | ||
17 | import java.util.stream.Collectors; | ||
18 | import java.util.stream.Stream; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.aggregators.sum; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
44 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
45 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
46 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
47 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
48 | import 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") | ||
67 | public 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/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..c889fbe0 --- /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,218 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric; | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost; | ||
12 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance; | ||
13 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective; | ||
14 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement; | ||
15 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd; | ||
16 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory; | ||
17 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost; | ||
18 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance; | ||
19 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied; | ||
20 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement; | ||
21 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.UnallocateAppInstance; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; | ||
24 | |||
25 | /** | ||
26 | * A pattern group formed of all public patterns defined in CpsQueries.vql. | ||
27 | * | ||
28 | * <p>Use the static instance as any {@link interface org.eclipse.viatra.query.runtime.api.IQueryGroup}, to conveniently prepare | ||
29 | * a VIATRA Query engine for matching all patterns originally defined in file CpsQueries.vql, | ||
30 | * in order to achieve better performance than one-by-one on-demand matcher initialization. | ||
31 | * | ||
32 | * <p> From package hu.bme.mit.inf.dslreasoner.domains.cps.queries, the group contains the definition of the following patterns: <ul> | ||
33 | * <li>resourceRequirement</li> | ||
34 | * <li>allocationWithoutResourceRequirement</li> | ||
35 | * <li>notEnoughAvailableMemory</li> | ||
36 | * <li>notEnoughAvailableHdd</li> | ||
37 | * <li>instanceDoesNotSatisfyRequirement</li> | ||
38 | * <li>requirementNotSatisfied</li> | ||
39 | * <li>redundantInstancesOnSameHost</li> | ||
40 | * <li>averageFreeMemoryMetric</li> | ||
41 | * <li>averageFreeHddMetric</li> | ||
42 | * <li>costMetric</li> | ||
43 | * <li>cpsCost</li> | ||
44 | * <li>allocate</li> | ||
45 | * <li>unallocateAppInstance</li> | ||
46 | * <li>createHostInstance</li> | ||
47 | * <li>removeHostInstance</li> | ||
48 | * <li>guidanceObjective</li> | ||
49 | * </ul> | ||
50 | * | ||
51 | * @see IQueryGroup | ||
52 | * | ||
53 | */ | ||
54 | @SuppressWarnings("all") | ||
55 | public final class CpsQueries extends BaseGeneratedPatternGroup { | ||
56 | /** | ||
57 | * Access the pattern group. | ||
58 | * | ||
59 | * @return the singleton instance of the group | ||
60 | * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications | ||
61 | * | ||
62 | */ | ||
63 | public static CpsQueries instance() { | ||
64 | if (INSTANCE == null) { | ||
65 | INSTANCE = new CpsQueries(); | ||
66 | } | ||
67 | return INSTANCE; | ||
68 | } | ||
69 | |||
70 | private static CpsQueries INSTANCE; | ||
71 | |||
72 | private CpsQueries() { | ||
73 | querySpecifications.add(ResourceRequirement.instance()); | ||
74 | querySpecifications.add(AllocationWithoutResourceRequirement.instance()); | ||
75 | querySpecifications.add(NotEnoughAvailableMemory.instance()); | ||
76 | querySpecifications.add(NotEnoughAvailableHdd.instance()); | ||
77 | querySpecifications.add(InstanceDoesNotSatisfyRequirement.instance()); | ||
78 | querySpecifications.add(RequirementNotSatisfied.instance()); | ||
79 | querySpecifications.add(RedundantInstancesOnSameHost.instance()); | ||
80 | querySpecifications.add(AverageFreeMemoryMetric.instance()); | ||
81 | querySpecifications.add(AverageFreeHddMetric.instance()); | ||
82 | querySpecifications.add(CostMetric.instance()); | ||
83 | querySpecifications.add(CpsCost.instance()); | ||
84 | querySpecifications.add(Allocate.instance()); | ||
85 | querySpecifications.add(UnallocateAppInstance.instance()); | ||
86 | querySpecifications.add(CreateHostInstance.instance()); | ||
87 | querySpecifications.add(RemoveHostInstance.instance()); | ||
88 | querySpecifications.add(GuidanceObjective.instance()); | ||
89 | } | ||
90 | |||
91 | public ResourceRequirement getResourceRequirement() { | ||
92 | return ResourceRequirement.instance(); | ||
93 | } | ||
94 | |||
95 | public ResourceRequirement.Matcher getResourceRequirement(final ViatraQueryEngine engine) { | ||
96 | return ResourceRequirement.Matcher.on(engine); | ||
97 | } | ||
98 | |||
99 | public AllocationWithoutResourceRequirement getAllocationWithoutResourceRequirement() { | ||
100 | return AllocationWithoutResourceRequirement.instance(); | ||
101 | } | ||
102 | |||
103 | public AllocationWithoutResourceRequirement.Matcher getAllocationWithoutResourceRequirement(final ViatraQueryEngine engine) { | ||
104 | return AllocationWithoutResourceRequirement.Matcher.on(engine); | ||
105 | } | ||
106 | |||
107 | public NotEnoughAvailableMemory getNotEnoughAvailableMemory() { | ||
108 | return NotEnoughAvailableMemory.instance(); | ||
109 | } | ||
110 | |||
111 | public NotEnoughAvailableMemory.Matcher getNotEnoughAvailableMemory(final ViatraQueryEngine engine) { | ||
112 | return NotEnoughAvailableMemory.Matcher.on(engine); | ||
113 | } | ||
114 | |||
115 | public NotEnoughAvailableHdd getNotEnoughAvailableHdd() { | ||
116 | return NotEnoughAvailableHdd.instance(); | ||
117 | } | ||
118 | |||
119 | public NotEnoughAvailableHdd.Matcher getNotEnoughAvailableHdd(final ViatraQueryEngine engine) { | ||
120 | return NotEnoughAvailableHdd.Matcher.on(engine); | ||
121 | } | ||
122 | |||
123 | public InstanceDoesNotSatisfyRequirement getInstanceDoesNotSatisfyRequirement() { | ||
124 | return InstanceDoesNotSatisfyRequirement.instance(); | ||
125 | } | ||
126 | |||
127 | public InstanceDoesNotSatisfyRequirement.Matcher getInstanceDoesNotSatisfyRequirement(final ViatraQueryEngine engine) { | ||
128 | return InstanceDoesNotSatisfyRequirement.Matcher.on(engine); | ||
129 | } | ||
130 | |||
131 | public RequirementNotSatisfied getRequirementNotSatisfied() { | ||
132 | return RequirementNotSatisfied.instance(); | ||
133 | } | ||
134 | |||
135 | public RequirementNotSatisfied.Matcher getRequirementNotSatisfied(final ViatraQueryEngine engine) { | ||
136 | return RequirementNotSatisfied.Matcher.on(engine); | ||
137 | } | ||
138 | |||
139 | public RedundantInstancesOnSameHost getRedundantInstancesOnSameHost() { | ||
140 | return RedundantInstancesOnSameHost.instance(); | ||
141 | } | ||
142 | |||
143 | public RedundantInstancesOnSameHost.Matcher getRedundantInstancesOnSameHost(final ViatraQueryEngine engine) { | ||
144 | return RedundantInstancesOnSameHost.Matcher.on(engine); | ||
145 | } | ||
146 | |||
147 | public AverageFreeMemoryMetric getAverageFreeMemoryMetric() { | ||
148 | return AverageFreeMemoryMetric.instance(); | ||
149 | } | ||
150 | |||
151 | public AverageFreeMemoryMetric.Matcher getAverageFreeMemoryMetric(final ViatraQueryEngine engine) { | ||
152 | return AverageFreeMemoryMetric.Matcher.on(engine); | ||
153 | } | ||
154 | |||
155 | public AverageFreeHddMetric getAverageFreeHddMetric() { | ||
156 | return AverageFreeHddMetric.instance(); | ||
157 | } | ||
158 | |||
159 | public AverageFreeHddMetric.Matcher getAverageFreeHddMetric(final ViatraQueryEngine engine) { | ||
160 | return AverageFreeHddMetric.Matcher.on(engine); | ||
161 | } | ||
162 | |||
163 | public CostMetric getCostMetric() { | ||
164 | return CostMetric.instance(); | ||
165 | } | ||
166 | |||
167 | public CostMetric.Matcher getCostMetric(final ViatraQueryEngine engine) { | ||
168 | return CostMetric.Matcher.on(engine); | ||
169 | } | ||
170 | |||
171 | public CpsCost getCpsCost() { | ||
172 | return CpsCost.instance(); | ||
173 | } | ||
174 | |||
175 | public CpsCost.Matcher getCpsCost(final ViatraQueryEngine engine) { | ||
176 | return CpsCost.Matcher.on(engine); | ||
177 | } | ||
178 | |||
179 | public Allocate getAllocate() { | ||
180 | return Allocate.instance(); | ||
181 | } | ||
182 | |||
183 | public Allocate.Matcher getAllocate(final ViatraQueryEngine engine) { | ||
184 | return Allocate.Matcher.on(engine); | ||
185 | } | ||
186 | |||
187 | public UnallocateAppInstance getUnallocateAppInstance() { | ||
188 | return UnallocateAppInstance.instance(); | ||
189 | } | ||
190 | |||
191 | public UnallocateAppInstance.Matcher getUnallocateAppInstance(final ViatraQueryEngine engine) { | ||
192 | return UnallocateAppInstance.Matcher.on(engine); | ||
193 | } | ||
194 | |||
195 | public CreateHostInstance getCreateHostInstance() { | ||
196 | return CreateHostInstance.instance(); | ||
197 | } | ||
198 | |||
199 | public CreateHostInstance.Matcher getCreateHostInstance(final ViatraQueryEngine engine) { | ||
200 | return CreateHostInstance.Matcher.on(engine); | ||
201 | } | ||
202 | |||
203 | public RemoveHostInstance getRemoveHostInstance() { | ||
204 | return RemoveHostInstance.instance(); | ||
205 | } | ||
206 | |||
207 | public RemoveHostInstance.Matcher getRemoveHostInstance(final ViatraQueryEngine engine) { | ||
208 | return RemoveHostInstance.Matcher.on(engine); | ||
209 | } | ||
210 | |||
211 | public GuidanceObjective getGuidanceObjective() { | ||
212 | return GuidanceObjective.instance(); | ||
213 | } | ||
214 | |||
215 | public GuidanceObjective.Matcher getGuidanceObjective(final ViatraQueryEngine engine) { | ||
216 | return GuidanceObjective.Matcher.on(engine); | ||
217 | } | ||
218 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CreateHostInstance.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CreateHostInstance.java new file mode 100644 index 00000000..f475c9e9 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CreateHostInstance.java | |||
@@ -0,0 +1,553 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import 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 | * pattern createHostInstance(HostType : HostType) { | ||
49 | * find unallocatedAppInstance(App); | ||
50 | * ApplicationInstance.type.requirements.hostType(App, HostType); | ||
51 | * } | ||
52 | * </pre></code> | ||
53 | * | ||
54 | * @see Matcher | ||
55 | * @see Match | ||
56 | * | ||
57 | */ | ||
58 | @SuppressWarnings("all") | ||
59 | public final class CreateHostInstance extends BaseGeneratedEMFQuerySpecification<CreateHostInstance.Matcher> { | ||
60 | /** | ||
61 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.createHostInstance 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 HostType fHostType; | ||
74 | |||
75 | private static List<String> parameterNames = makeImmutableList("HostType"); | ||
76 | |||
77 | private Match(final HostType pHostType) { | ||
78 | this.fHostType = pHostType; | ||
79 | } | ||
80 | |||
81 | @Override | ||
82 | public Object get(final String parameterName) { | ||
83 | if ("HostType".equals(parameterName)) return this.fHostType; | ||
84 | return null; | ||
85 | } | ||
86 | |||
87 | public HostType getHostType() { | ||
88 | return this.fHostType; | ||
89 | } | ||
90 | |||
91 | @Override | ||
92 | public boolean set(final String parameterName, final Object newValue) { | ||
93 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
94 | if ("HostType".equals(parameterName) ) { | ||
95 | this.fHostType = (HostType) newValue; | ||
96 | return true; | ||
97 | } | ||
98 | return false; | ||
99 | } | ||
100 | |||
101 | public void setHostType(final HostType pHostType) { | ||
102 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
103 | this.fHostType = pHostType; | ||
104 | } | ||
105 | |||
106 | @Override | ||
107 | public String patternName() { | ||
108 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.createHostInstance"; | ||
109 | } | ||
110 | |||
111 | @Override | ||
112 | public List<String> parameterNames() { | ||
113 | return CreateHostInstance.Match.parameterNames; | ||
114 | } | ||
115 | |||
116 | @Override | ||
117 | public Object[] toArray() { | ||
118 | return new Object[]{fHostType}; | ||
119 | } | ||
120 | |||
121 | @Override | ||
122 | public CreateHostInstance.Match toImmutable() { | ||
123 | return isMutable() ? newMatch(fHostType) : this; | ||
124 | } | ||
125 | |||
126 | @Override | ||
127 | public String prettyPrint() { | ||
128 | StringBuilder result = new StringBuilder(); | ||
129 | result.append("\"HostType\"=" + prettyPrintValue(fHostType)); | ||
130 | return result.toString(); | ||
131 | } | ||
132 | |||
133 | @Override | ||
134 | public int hashCode() { | ||
135 | return Objects.hash(fHostType); | ||
136 | } | ||
137 | |||
138 | @Override | ||
139 | public boolean equals(final Object obj) { | ||
140 | if (this == obj) | ||
141 | return true; | ||
142 | if (obj == null) { | ||
143 | return false; | ||
144 | } | ||
145 | if ((obj instanceof CreateHostInstance.Match)) { | ||
146 | CreateHostInstance.Match other = (CreateHostInstance.Match) obj; | ||
147 | return Objects.equals(fHostType, other.fHostType); | ||
148 | } else { | ||
149 | // this should be infrequent | ||
150 | if (!(obj instanceof IPatternMatch)) { | ||
151 | return false; | ||
152 | } | ||
153 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
154 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
155 | } | ||
156 | } | ||
157 | |||
158 | @Override | ||
159 | public CreateHostInstance specification() { | ||
160 | return CreateHostInstance.instance(); | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * Returns an empty, mutable match. | ||
165 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
166 | * | ||
167 | * @return the empty match. | ||
168 | * | ||
169 | */ | ||
170 | public static CreateHostInstance.Match newEmptyMatch() { | ||
171 | return new Mutable(null); | ||
172 | } | ||
173 | |||
174 | /** | ||
175 | * Returns a mutable (partial) match. | ||
176 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
177 | * | ||
178 | * @param pHostType the fixed value of pattern parameter HostType, or null if not bound. | ||
179 | * @return the new, mutable (partial) match object. | ||
180 | * | ||
181 | */ | ||
182 | public static CreateHostInstance.Match newMutableMatch(final HostType pHostType) { | ||
183 | return new Mutable(pHostType); | ||
184 | } | ||
185 | |||
186 | /** | ||
187 | * Returns a new (partial) match. | ||
188 | * This can be used e.g. to call the matcher with a partial match. | ||
189 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
190 | * @param pHostType the fixed value of pattern parameter HostType, or null if not bound. | ||
191 | * @return the (partial) match object. | ||
192 | * | ||
193 | */ | ||
194 | public static CreateHostInstance.Match newMatch(final HostType pHostType) { | ||
195 | return new Immutable(pHostType); | ||
196 | } | ||
197 | |||
198 | private static final class Mutable extends CreateHostInstance.Match { | ||
199 | Mutable(final HostType pHostType) { | ||
200 | super(pHostType); | ||
201 | } | ||
202 | |||
203 | @Override | ||
204 | public boolean isMutable() { | ||
205 | return true; | ||
206 | } | ||
207 | } | ||
208 | |||
209 | private static final class Immutable extends CreateHostInstance.Match { | ||
210 | Immutable(final HostType pHostType) { | ||
211 | super(pHostType); | ||
212 | } | ||
213 | |||
214 | @Override | ||
215 | public boolean isMutable() { | ||
216 | return false; | ||
217 | } | ||
218 | } | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.createHostInstance pattern, | ||
223 | * providing pattern-specific query methods. | ||
224 | * | ||
225 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
226 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
227 | * | ||
228 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
229 | * | ||
230 | * <p>Original source: | ||
231 | * <code><pre> | ||
232 | * pattern createHostInstance(HostType : HostType) { | ||
233 | * find unallocatedAppInstance(App); | ||
234 | * ApplicationInstance.type.requirements.hostType(App, HostType); | ||
235 | * } | ||
236 | * </pre></code> | ||
237 | * | ||
238 | * @see Match | ||
239 | * @see CreateHostInstance | ||
240 | * | ||
241 | */ | ||
242 | public static class Matcher extends BaseMatcher<CreateHostInstance.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 CreateHostInstance.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 CreateHostInstance.Matcher create() { | ||
267 | return new Matcher(); | ||
268 | } | ||
269 | |||
270 | private static final int POSITION_HOSTTYPE = 0; | ||
271 | |||
272 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CreateHostInstance.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 pHostType the fixed value of pattern parameter HostType, or null if not bound. | ||
289 | * @return matches represented as a Match object. | ||
290 | * | ||
291 | */ | ||
292 | public Collection<CreateHostInstance.Match> getAllMatches(final HostType pHostType) { | ||
293 | return rawStreamAllMatches(new Object[]{pHostType}).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 pHostType the fixed value of pattern parameter HostType, or null if not bound. | ||
303 | * @return a stream of matches represented as a Match object. | ||
304 | * | ||
305 | */ | ||
306 | public Stream<CreateHostInstance.Match> streamAllMatches(final HostType pHostType) { | ||
307 | return rawStreamAllMatches(new Object[]{pHostType}); | ||
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 pHostType the fixed value of pattern parameter HostType, 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<CreateHostInstance.Match> getOneArbitraryMatch(final HostType pHostType) { | ||
318 | return rawGetOneArbitraryMatch(new Object[]{pHostType}); | ||
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 pHostType the fixed value of pattern parameter HostType, 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 HostType pHostType) { | ||
329 | return rawHasMatch(new Object[]{pHostType}); | ||
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 pHostType the fixed value of pattern parameter HostType, or null if not bound. | ||
335 | * @return the number of pattern matches found. | ||
336 | * | ||
337 | */ | ||
338 | public int countMatches(final HostType pHostType) { | ||
339 | return rawCountMatches(new Object[]{pHostType}); | ||
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 pHostType the fixed value of pattern parameter HostType, 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 HostType pHostType, final Consumer<? super CreateHostInstance.Match> processor) { | ||
351 | return rawForOneArbitraryMatch(new Object[]{pHostType}, 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 pHostType the fixed value of pattern parameter HostType, or null if not bound. | ||
359 | * @return the (partial) match object. | ||
360 | * | ||
361 | */ | ||
362 | public CreateHostInstance.Match newMatch(final HostType pHostType) { | ||
363 | return CreateHostInstance.Match.newMatch(pHostType); | ||
364 | } | ||
365 | |||
366 | /** | ||
367 | * Retrieve the set of values that occur in matches for HostType. | ||
368 | * @return the Set of all values or empty set if there are no matches | ||
369 | * | ||
370 | */ | ||
371 | protected Stream<HostType> rawStreamAllValuesOfHostType(final Object[] parameters) { | ||
372 | return rawStreamAllValues(POSITION_HOSTTYPE, parameters).map(HostType.class::cast); | ||
373 | } | ||
374 | |||
375 | /** | ||
376 | * Retrieve the set of values that occur in matches for HostType. | ||
377 | * @return the Set of all values or empty set if there are no matches | ||
378 | * | ||
379 | */ | ||
380 | public Set<HostType> getAllValuesOfHostType() { | ||
381 | return rawStreamAllValuesOfHostType(emptyArray()).collect(Collectors.toSet()); | ||
382 | } | ||
383 | |||
384 | /** | ||
385 | * Retrieve the set of values that occur in matches for HostType. | ||
386 | * @return the Set of all values or empty set if there are no matches | ||
387 | * | ||
388 | */ | ||
389 | public Stream<HostType> streamAllValuesOfHostType() { | ||
390 | return rawStreamAllValuesOfHostType(emptyArray()); | ||
391 | } | ||
392 | |||
393 | @Override | ||
394 | protected CreateHostInstance.Match tupleToMatch(final Tuple t) { | ||
395 | try { | ||
396 | return CreateHostInstance.Match.newMatch((HostType) t.get(POSITION_HOSTTYPE)); | ||
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 CreateHostInstance.Match arrayToMatch(final Object[] match) { | ||
405 | try { | ||
406 | return CreateHostInstance.Match.newMatch((HostType) match[POSITION_HOSTTYPE]); | ||
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 CreateHostInstance.Match arrayToMatchMutable(final Object[] match) { | ||
415 | try { | ||
416 | return CreateHostInstance.Match.newMutableMatch((HostType) match[POSITION_HOSTTYPE]); | ||
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<CreateHostInstance.Matcher> querySpecification() { | ||
429 | return CreateHostInstance.instance(); | ||
430 | } | ||
431 | } | ||
432 | |||
433 | private CreateHostInstance() { | ||
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 CreateHostInstance instance() { | ||
443 | try{ | ||
444 | return LazyHolder.INSTANCE; | ||
445 | } catch (ExceptionInInitializerError err) { | ||
446 | throw processInitializerError(err); | ||
447 | } | ||
448 | } | ||
449 | |||
450 | @Override | ||
451 | protected CreateHostInstance.Matcher instantiate(final ViatraQueryEngine engine) { | ||
452 | return CreateHostInstance.Matcher.on(engine); | ||
453 | } | ||
454 | |||
455 | @Override | ||
456 | public CreateHostInstance.Matcher instantiate() { | ||
457 | return CreateHostInstance.Matcher.create(); | ||
458 | } | ||
459 | |||
460 | @Override | ||
461 | public CreateHostInstance.Match newEmptyMatch() { | ||
462 | return CreateHostInstance.Match.newEmptyMatch(); | ||
463 | } | ||
464 | |||
465 | @Override | ||
466 | public CreateHostInstance.Match newMatch(final Object... parameters) { | ||
467 | return CreateHostInstance.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostType) parameters[0]); | ||
468 | } | ||
469 | |||
470 | /** | ||
471 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance (visibility: PUBLIC, simpleName: CreateHostInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance, 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 | ||
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.cps.queries.CreateHostInstance (visibility: PUBLIC, simpleName: CreateHostInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.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 CreateHostInstance INSTANCE = new CreateHostInstance(); | ||
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 CreateHostInstance.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
498 | |||
499 | private final PParameter parameter_HostType = new PParameter("HostType", "hu.bme.mit.inf.dslreasoner.domains.cps.HostType", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostType")), PParameterDirection.INOUT); | ||
500 | |||
501 | private final List<PParameter> parameters = Arrays.asList(parameter_HostType); | ||
502 | |||
503 | private GeneratedPQuery() { | ||
504 | super(PVisibility.PUBLIC); | ||
505 | } | ||
506 | |||
507 | @Override | ||
508 | public String getFullyQualifiedName() { | ||
509 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.createHostInstance"; | ||
510 | } | ||
511 | |||
512 | @Override | ||
513 | public List<String> getParameterNames() { | ||
514 | return Arrays.asList("HostType"); | ||
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_HostType = body.getOrCreateVariableByName("HostType"); | ||
529 | PVariable var_App = body.getOrCreateVariableByName("App"); | ||
530 | new TypeConstraint(body, Tuples.flatTupleOf(var_HostType), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
531 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
532 | new ExportedParameter(body, var_HostType, parameter_HostType) | ||
533 | )); | ||
534 | // find unallocatedAppInstance(App) | ||
535 | new PositivePatternCall(body, Tuples.flatTupleOf(var_App), UnallocatedAppInstance.instance().getInternalQueryRepresentation()); | ||
536 | // ApplicationInstance.type.requirements.hostType(App, HostType) | ||
537 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
538 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
539 | new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "type"))); | ||
540 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType"))); | ||
541 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
542 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "requirements"))); | ||
543 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
544 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
545 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "hostType"))); | ||
546 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
547 | new Equality(body, var__virtual_2_, var_HostType); | ||
548 | bodies.add(body); | ||
549 | } | ||
550 | return bodies; | ||
551 | } | ||
552 | } | ||
553 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/GuidanceObjective.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/GuidanceObjective.java new file mode 100644 index 00000000..cfed0c4b --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/GuidanceObjective.java | |||
@@ -0,0 +1,591 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.NoHostToAllocateTo; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.RequiredAppInstances; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance; | ||
9 | import java.util.Arrays; | ||
10 | import java.util.Collection; | ||
11 | import java.util.LinkedHashSet; | ||
12 | import java.util.List; | ||
13 | import java.util.Objects; | ||
14 | import java.util.Optional; | ||
15 | import java.util.Set; | ||
16 | import java.util.function.Consumer; | ||
17 | import java.util.stream.Collectors; | ||
18 | import java.util.stream.Stream; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.aggregators.sum; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
44 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
45 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
46 | |||
47 | /** | ||
48 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
49 | * | ||
50 | * <p>Original source: | ||
51 | * <code><pre> | ||
52 | * pattern guidanceObjective(Value : java Integer) { | ||
53 | * UnallocatedInstances == count find unallocatedAppInstance(_); | ||
54 | * RequiredInstances == sum find requiredAppInstances(_, #_); | ||
55 | * NoHostToAllocate == count find noHostToAllocateTo(_); | ||
56 | * Value == eval(2 UnallocatedInstances + 4 RequiredInstances + NoHostToAllocate); | ||
57 | * } | ||
58 | * </pre></code> | ||
59 | * | ||
60 | * @see Matcher | ||
61 | * @see Match | ||
62 | * | ||
63 | */ | ||
64 | @SuppressWarnings("all") | ||
65 | public final class GuidanceObjective extends BaseGeneratedEMFQuerySpecification<GuidanceObjective.Matcher> { | ||
66 | /** | ||
67 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.guidanceObjective pattern, | ||
68 | * to be used in conjunction with {@link Matcher}. | ||
69 | * | ||
70 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
71 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
72 | * usable to represent a match of the pattern in the result of a query, | ||
73 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
74 | * | ||
75 | * @see Matcher | ||
76 | * | ||
77 | */ | ||
78 | public static abstract class Match extends BasePatternMatch { | ||
79 | private Integer fValue; | ||
80 | |||
81 | private static List<String> parameterNames = makeImmutableList("Value"); | ||
82 | |||
83 | private Match(final Integer pValue) { | ||
84 | this.fValue = pValue; | ||
85 | } | ||
86 | |||
87 | @Override | ||
88 | public Object get(final String parameterName) { | ||
89 | if ("Value".equals(parameterName)) return this.fValue; | ||
90 | return null; | ||
91 | } | ||
92 | |||
93 | public Integer getValue() { | ||
94 | return this.fValue; | ||
95 | } | ||
96 | |||
97 | @Override | ||
98 | public boolean set(final String parameterName, final Object newValue) { | ||
99 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
100 | if ("Value".equals(parameterName) ) { | ||
101 | this.fValue = (Integer) newValue; | ||
102 | return true; | ||
103 | } | ||
104 | return false; | ||
105 | } | ||
106 | |||
107 | public void setValue(final Integer pValue) { | ||
108 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
109 | this.fValue = pValue; | ||
110 | } | ||
111 | |||
112 | @Override | ||
113 | public String patternName() { | ||
114 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.guidanceObjective"; | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public List<String> parameterNames() { | ||
119 | return GuidanceObjective.Match.parameterNames; | ||
120 | } | ||
121 | |||
122 | @Override | ||
123 | public Object[] toArray() { | ||
124 | return new Object[]{fValue}; | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public GuidanceObjective.Match toImmutable() { | ||
129 | return isMutable() ? newMatch(fValue) : this; | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public String prettyPrint() { | ||
134 | StringBuilder result = new StringBuilder(); | ||
135 | result.append("\"Value\"=" + prettyPrintValue(fValue)); | ||
136 | return result.toString(); | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public int hashCode() { | ||
141 | return Objects.hash(fValue); | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public boolean equals(final Object obj) { | ||
146 | if (this == obj) | ||
147 | return true; | ||
148 | if (obj == null) { | ||
149 | return false; | ||
150 | } | ||
151 | if ((obj instanceof GuidanceObjective.Match)) { | ||
152 | GuidanceObjective.Match other = (GuidanceObjective.Match) obj; | ||
153 | return Objects.equals(fValue, other.fValue); | ||
154 | } else { | ||
155 | // this should be infrequent | ||
156 | if (!(obj instanceof IPatternMatch)) { | ||
157 | return false; | ||
158 | } | ||
159 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
160 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
161 | } | ||
162 | } | ||
163 | |||
164 | @Override | ||
165 | public GuidanceObjective specification() { | ||
166 | return GuidanceObjective.instance(); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * Returns an empty, mutable match. | ||
171 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
172 | * | ||
173 | * @return the empty match. | ||
174 | * | ||
175 | */ | ||
176 | public static GuidanceObjective.Match newEmptyMatch() { | ||
177 | return new Mutable(null); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * Returns a mutable (partial) match. | ||
182 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
183 | * | ||
184 | * @param pValue the fixed value of pattern parameter Value, or null if not bound. | ||
185 | * @return the new, mutable (partial) match object. | ||
186 | * | ||
187 | */ | ||
188 | public static GuidanceObjective.Match newMutableMatch(final Integer pValue) { | ||
189 | return new Mutable(pValue); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns a new (partial) match. | ||
194 | * This can be used e.g. to call the matcher with a partial match. | ||
195 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
196 | * @param pValue the fixed value of pattern parameter Value, or null if not bound. | ||
197 | * @return the (partial) match object. | ||
198 | * | ||
199 | */ | ||
200 | public static GuidanceObjective.Match newMatch(final Integer pValue) { | ||
201 | return new Immutable(pValue); | ||
202 | } | ||
203 | |||
204 | private static final class Mutable extends GuidanceObjective.Match { | ||
205 | Mutable(final Integer pValue) { | ||
206 | super(pValue); | ||
207 | } | ||
208 | |||
209 | @Override | ||
210 | public boolean isMutable() { | ||
211 | return true; | ||
212 | } | ||
213 | } | ||
214 | |||
215 | private static final class Immutable extends GuidanceObjective.Match { | ||
216 | Immutable(final Integer pValue) { | ||
217 | super(pValue); | ||
218 | } | ||
219 | |||
220 | @Override | ||
221 | public boolean isMutable() { | ||
222 | return false; | ||
223 | } | ||
224 | } | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.guidanceObjective pattern, | ||
229 | * providing pattern-specific query methods. | ||
230 | * | ||
231 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
232 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
233 | * | ||
234 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
235 | * | ||
236 | * <p>Original source: | ||
237 | * <code><pre> | ||
238 | * pattern guidanceObjective(Value : java Integer) { | ||
239 | * UnallocatedInstances == count find unallocatedAppInstance(_); | ||
240 | * RequiredInstances == sum find requiredAppInstances(_, #_); | ||
241 | * NoHostToAllocate == count find noHostToAllocateTo(_); | ||
242 | * Value == eval(2 UnallocatedInstances + 4 RequiredInstances + NoHostToAllocate); | ||
243 | * } | ||
244 | * </pre></code> | ||
245 | * | ||
246 | * @see Match | ||
247 | * @see GuidanceObjective | ||
248 | * | ||
249 | */ | ||
250 | public static class Matcher extends BaseMatcher<GuidanceObjective.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 GuidanceObjective.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 GuidanceObjective.Matcher create() { | ||
275 | return new Matcher(); | ||
276 | } | ||
277 | |||
278 | private static final int POSITION_VALUE = 0; | ||
279 | |||
280 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(GuidanceObjective.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 pValue the fixed value of pattern parameter Value, or null if not bound. | ||
297 | * @return matches represented as a Match object. | ||
298 | * | ||
299 | */ | ||
300 | public Collection<GuidanceObjective.Match> getAllMatches(final Integer pValue) { | ||
301 | return rawStreamAllMatches(new Object[]{pValue}).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 pValue the fixed value of pattern parameter Value, or null if not bound. | ||
311 | * @return a stream of matches represented as a Match object. | ||
312 | * | ||
313 | */ | ||
314 | public Stream<GuidanceObjective.Match> streamAllMatches(final Integer pValue) { | ||
315 | return rawStreamAllMatches(new Object[]{pValue}); | ||
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 pValue the fixed value of pattern parameter Value, 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<GuidanceObjective.Match> getOneArbitraryMatch(final Integer pValue) { | ||
326 | return rawGetOneArbitraryMatch(new Object[]{pValue}); | ||
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 pValue the fixed value of pattern parameter Value, 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 Integer pValue) { | ||
337 | return rawHasMatch(new Object[]{pValue}); | ||
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 pValue the fixed value of pattern parameter Value, or null if not bound. | ||
343 | * @return the number of pattern matches found. | ||
344 | * | ||
345 | */ | ||
346 | public int countMatches(final Integer pValue) { | ||
347 | return rawCountMatches(new Object[]{pValue}); | ||
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 pValue the fixed value of pattern parameter Value, 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 Integer pValue, final Consumer<? super GuidanceObjective.Match> processor) { | ||
359 | return rawForOneArbitraryMatch(new Object[]{pValue}, 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 pValue the fixed value of pattern parameter Value, or null if not bound. | ||
367 | * @return the (partial) match object. | ||
368 | * | ||
369 | */ | ||
370 | public GuidanceObjective.Match newMatch(final Integer pValue) { | ||
371 | return GuidanceObjective.Match.newMatch(pValue); | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * Retrieve the set of values that occur in matches for Value. | ||
376 | * @return the Set of all values or empty set if there are no matches | ||
377 | * | ||
378 | */ | ||
379 | protected Stream<Integer> rawStreamAllValuesOfValue(final Object[] parameters) { | ||
380 | return rawStreamAllValues(POSITION_VALUE, parameters).map(Integer.class::cast); | ||
381 | } | ||
382 | |||
383 | /** | ||
384 | * Retrieve the set of values that occur in matches for Value. | ||
385 | * @return the Set of all values or empty set if there are no matches | ||
386 | * | ||
387 | */ | ||
388 | public Set<Integer> getAllValuesOfValue() { | ||
389 | return rawStreamAllValuesOfValue(emptyArray()).collect(Collectors.toSet()); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Retrieve the set of values that occur in matches for Value. | ||
394 | * @return the Set of all values or empty set if there are no matches | ||
395 | * | ||
396 | */ | ||
397 | public Stream<Integer> streamAllValuesOfValue() { | ||
398 | return rawStreamAllValuesOfValue(emptyArray()); | ||
399 | } | ||
400 | |||
401 | @Override | ||
402 | protected GuidanceObjective.Match tupleToMatch(final Tuple t) { | ||
403 | try { | ||
404 | return GuidanceObjective.Match.newMatch((Integer) t.get(POSITION_VALUE)); | ||
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 GuidanceObjective.Match arrayToMatch(final Object[] match) { | ||
413 | try { | ||
414 | return GuidanceObjective.Match.newMatch((Integer) match[POSITION_VALUE]); | ||
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 GuidanceObjective.Match arrayToMatchMutable(final Object[] match) { | ||
423 | try { | ||
424 | return GuidanceObjective.Match.newMutableMatch((Integer) match[POSITION_VALUE]); | ||
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<GuidanceObjective.Matcher> querySpecification() { | ||
437 | return GuidanceObjective.instance(); | ||
438 | } | ||
439 | } | ||
440 | |||
441 | private GuidanceObjective() { | ||
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 GuidanceObjective instance() { | ||
451 | try{ | ||
452 | return LazyHolder.INSTANCE; | ||
453 | } catch (ExceptionInInitializerError err) { | ||
454 | throw processInitializerError(err); | ||
455 | } | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | protected GuidanceObjective.Matcher instantiate(final ViatraQueryEngine engine) { | ||
460 | return GuidanceObjective.Matcher.on(engine); | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public GuidanceObjective.Matcher instantiate() { | ||
465 | return GuidanceObjective.Matcher.create(); | ||
466 | } | ||
467 | |||
468 | @Override | ||
469 | public GuidanceObjective.Match newEmptyMatch() { | ||
470 | return GuidanceObjective.Match.newEmptyMatch(); | ||
471 | } | ||
472 | |||
473 | @Override | ||
474 | public GuidanceObjective.Match newMatch(final Object... parameters) { | ||
475 | return GuidanceObjective.Match.newMatch((java.lang.Integer) parameters[0]); | ||
476 | } | ||
477 | |||
478 | /** | ||
479 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective (visibility: PUBLIC, simpleName: GuidanceObjective, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective, 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 | ||
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.cps.queries.GuidanceObjective (visibility: PUBLIC, simpleName: GuidanceObjective, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.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 GuidanceObjective INSTANCE = new GuidanceObjective(); | ||
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 GuidanceObjective.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
506 | |||
507 | private final PParameter parameter_Value = new PParameter("Value", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT); | ||
508 | |||
509 | private final List<PParameter> parameters = Arrays.asList(parameter_Value); | ||
510 | |||
511 | private GeneratedPQuery() { | ||
512 | super(PVisibility.PUBLIC); | ||
513 | } | ||
514 | |||
515 | @Override | ||
516 | public String getFullyQualifiedName() { | ||
517 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.guidanceObjective"; | ||
518 | } | ||
519 | |||
520 | @Override | ||
521 | public List<String> getParameterNames() { | ||
522 | return Arrays.asList("Value"); | ||
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_Value = body.getOrCreateVariableByName("Value"); | ||
537 | PVariable var_UnallocatedInstances = body.getOrCreateVariableByName("UnallocatedInstances"); | ||
538 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
539 | PVariable var_RequiredInstances = body.getOrCreateVariableByName("RequiredInstances"); | ||
540 | PVariable var___1_ = body.getOrCreateVariableByName("_<1>"); | ||
541 | PVariable var___2_ = body.getOrCreateVariableByName("_<2>"); | ||
542 | PVariable var_NoHostToAllocate = body.getOrCreateVariableByName("NoHostToAllocate"); | ||
543 | PVariable var___3_ = body.getOrCreateVariableByName("_<3>"); | ||
544 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Value), new JavaTransitiveInstancesKey(java.lang.Integer.class)); | ||
545 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
546 | new ExportedParameter(body, var_Value, parameter_Value) | ||
547 | )); | ||
548 | // UnallocatedInstances == count find unallocatedAppInstance(_) | ||
549 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
550 | new PatternMatchCounter(body, Tuples.flatTupleOf(var___0_), UnallocatedAppInstance.instance().getInternalQueryRepresentation(), var__virtual_0_); | ||
551 | new Equality(body, var_UnallocatedInstances, var__virtual_0_); | ||
552 | // RequiredInstances == sum find requiredAppInstances(_, #_) | ||
553 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
554 | new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var___1_, var___2_), RequiredAppInstances.instance().getInternalQueryRepresentation(), var__virtual_1_, 1); | ||
555 | new Equality(body, var_RequiredInstances, var__virtual_1_); | ||
556 | // NoHostToAllocate == count find noHostToAllocateTo(_) | ||
557 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
558 | new PatternMatchCounter(body, Tuples.flatTupleOf(var___3_), NoHostToAllocateTo.instance().getInternalQueryRepresentation(), var__virtual_2_); | ||
559 | new Equality(body, var_NoHostToAllocate, var__virtual_2_); | ||
560 | // Value == eval(2 * UnallocatedInstances + 4 * RequiredInstances + NoHostToAllocate) | ||
561 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
562 | new ExpressionEvaluation(body, new IExpressionEvaluator() { | ||
563 | |||
564 | @Override | ||
565 | public String getShortDescription() { | ||
566 | return "Expression evaluation from pattern guidanceObjective"; | ||
567 | } | ||
568 | |||
569 | @Override | ||
570 | public Iterable<String> getInputParameterNames() { | ||
571 | return Arrays.asList("NoHostToAllocate", "RequiredInstances", "UnallocatedInstances");} | ||
572 | |||
573 | @Override | ||
574 | public Object evaluateExpression(IValueProvider provider) throws Exception { | ||
575 | Integer NoHostToAllocate = (Integer) provider.getValue("NoHostToAllocate"); | ||
576 | Integer RequiredInstances = (Integer) provider.getValue("RequiredInstances"); | ||
577 | Integer UnallocatedInstances = (Integer) provider.getValue("UnallocatedInstances"); | ||
578 | return evaluateExpression_1_1(NoHostToAllocate, RequiredInstances, UnallocatedInstances); | ||
579 | } | ||
580 | }, var__virtual_3_ ); | ||
581 | new Equality(body, var_Value, var__virtual_3_); | ||
582 | bodies.add(body); | ||
583 | } | ||
584 | return bodies; | ||
585 | } | ||
586 | } | ||
587 | |||
588 | private static int evaluateExpression_1_1(final Integer NoHostToAllocate, final Integer RequiredInstances, final Integer UnallocatedInstances) { | ||
589 | return (((2 * (UnallocatedInstances).intValue()) + (4 * (RequiredInstances).intValue())) + (NoHostToAllocate).intValue()); | ||
590 | } | ||
591 | } | ||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance; | ||
9 | import java.util.Arrays; | ||
10 | import java.util.Collection; | ||
11 | import java.util.LinkedHashSet; | ||
12 | import java.util.List; | ||
13 | import java.util.Objects; | ||
14 | import java.util.Optional; | ||
15 | import java.util.Set; | ||
16 | import java.util.function.Consumer; | ||
17 | import java.util.stream.Collectors; | ||
18 | import java.util.stream.Stream; | ||
19 | import org.apache.log4j.Logger; | ||
20 | import org.eclipse.emf.ecore.EClass; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
44 | import 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") | ||
64 | public 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..0c0d57a6 --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
44 | import 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") | ||
64 | public 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..9f091a95 --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
44 | import 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") | ||
64 | public 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/RedundantInstancesOnSameHost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RedundantInstancesOnSameHost.java new file mode 100644 index 00000000..bbb55158 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RedundantInstancesOnSameHost.java | |||
@@ -0,0 +1,587 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Inequality; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
42 | import 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 @}Constraint(severity = "error", key = {Req}, | ||
50 | * message = "Redundant instances must not be allocated to the same host.") | ||
51 | * pattern redundantInstancesOnSameHost(Req : Requirement) { | ||
52 | * Requirement.instances(Req, App1); | ||
53 | * Requirement.instances(Req, App2); | ||
54 | * App1 != App2; | ||
55 | * ApplicationInstance.allocatedTo(App1, Host); | ||
56 | * ApplicationInstance.allocatedTo(App2, Host); | ||
57 | * } | ||
58 | * </pre></code> | ||
59 | * | ||
60 | * @see Matcher | ||
61 | * @see Match | ||
62 | * | ||
63 | */ | ||
64 | @SuppressWarnings("all") | ||
65 | public final class RedundantInstancesOnSameHost extends BaseGeneratedEMFQuerySpecification<RedundantInstancesOnSameHost.Matcher> { | ||
66 | /** | ||
67 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.redundantInstancesOnSameHost pattern, | ||
68 | * to be used in conjunction with {@link Matcher}. | ||
69 | * | ||
70 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
71 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
72 | * usable to represent a match of the pattern in the result of a query, | ||
73 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
74 | * | ||
75 | * @see Matcher | ||
76 | * | ||
77 | */ | ||
78 | public static abstract class Match extends BasePatternMatch { | ||
79 | private Requirement fReq; | ||
80 | |||
81 | private static List<String> parameterNames = makeImmutableList("Req"); | ||
82 | |||
83 | private Match(final Requirement pReq) { | ||
84 | this.fReq = pReq; | ||
85 | } | ||
86 | |||
87 | @Override | ||
88 | public Object get(final String parameterName) { | ||
89 | if ("Req".equals(parameterName)) return this.fReq; | ||
90 | return null; | ||
91 | } | ||
92 | |||
93 | public Requirement getReq() { | ||
94 | return this.fReq; | ||
95 | } | ||
96 | |||
97 | @Override | ||
98 | public boolean set(final String parameterName, final Object newValue) { | ||
99 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
100 | if ("Req".equals(parameterName) ) { | ||
101 | this.fReq = (Requirement) newValue; | ||
102 | return true; | ||
103 | } | ||
104 | return false; | ||
105 | } | ||
106 | |||
107 | public void setReq(final Requirement pReq) { | ||
108 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
109 | this.fReq = pReq; | ||
110 | } | ||
111 | |||
112 | @Override | ||
113 | public String patternName() { | ||
114 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.redundantInstancesOnSameHost"; | ||
115 | } | ||
116 | |||
117 | @Override | ||
118 | public List<String> parameterNames() { | ||
119 | return RedundantInstancesOnSameHost.Match.parameterNames; | ||
120 | } | ||
121 | |||
122 | @Override | ||
123 | public Object[] toArray() { | ||
124 | return new Object[]{fReq}; | ||
125 | } | ||
126 | |||
127 | @Override | ||
128 | public RedundantInstancesOnSameHost.Match toImmutable() { | ||
129 | return isMutable() ? newMatch(fReq) : this; | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public String prettyPrint() { | ||
134 | StringBuilder result = new StringBuilder(); | ||
135 | result.append("\"Req\"=" + prettyPrintValue(fReq)); | ||
136 | return result.toString(); | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public int hashCode() { | ||
141 | return Objects.hash(fReq); | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public boolean equals(final Object obj) { | ||
146 | if (this == obj) | ||
147 | return true; | ||
148 | if (obj == null) { | ||
149 | return false; | ||
150 | } | ||
151 | if ((obj instanceof RedundantInstancesOnSameHost.Match)) { | ||
152 | RedundantInstancesOnSameHost.Match other = (RedundantInstancesOnSameHost.Match) obj; | ||
153 | return Objects.equals(fReq, other.fReq); | ||
154 | } else { | ||
155 | // this should be infrequent | ||
156 | if (!(obj instanceof IPatternMatch)) { | ||
157 | return false; | ||
158 | } | ||
159 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
160 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
161 | } | ||
162 | } | ||
163 | |||
164 | @Override | ||
165 | public RedundantInstancesOnSameHost specification() { | ||
166 | return RedundantInstancesOnSameHost.instance(); | ||
167 | } | ||
168 | |||
169 | /** | ||
170 | * Returns an empty, mutable match. | ||
171 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
172 | * | ||
173 | * @return the empty match. | ||
174 | * | ||
175 | */ | ||
176 | public static RedundantInstancesOnSameHost.Match newEmptyMatch() { | ||
177 | return new Mutable(null); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * Returns a mutable (partial) match. | ||
182 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
183 | * | ||
184 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
185 | * @return the new, mutable (partial) match object. | ||
186 | * | ||
187 | */ | ||
188 | public static RedundantInstancesOnSameHost.Match newMutableMatch(final Requirement pReq) { | ||
189 | return new Mutable(pReq); | ||
190 | } | ||
191 | |||
192 | /** | ||
193 | * Returns a new (partial) match. | ||
194 | * This can be used e.g. to call the matcher with a partial match. | ||
195 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
196 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
197 | * @return the (partial) match object. | ||
198 | * | ||
199 | */ | ||
200 | public static RedundantInstancesOnSameHost.Match newMatch(final Requirement pReq) { | ||
201 | return new Immutable(pReq); | ||
202 | } | ||
203 | |||
204 | private static final class Mutable extends RedundantInstancesOnSameHost.Match { | ||
205 | Mutable(final Requirement pReq) { | ||
206 | super(pReq); | ||
207 | } | ||
208 | |||
209 | @Override | ||
210 | public boolean isMutable() { | ||
211 | return true; | ||
212 | } | ||
213 | } | ||
214 | |||
215 | private static final class Immutable extends RedundantInstancesOnSameHost.Match { | ||
216 | Immutable(final Requirement pReq) { | ||
217 | super(pReq); | ||
218 | } | ||
219 | |||
220 | @Override | ||
221 | public boolean isMutable() { | ||
222 | return false; | ||
223 | } | ||
224 | } | ||
225 | } | ||
226 | |||
227 | /** | ||
228 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.redundantInstancesOnSameHost pattern, | ||
229 | * providing pattern-specific query methods. | ||
230 | * | ||
231 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
232 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
233 | * | ||
234 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
235 | * | ||
236 | * <p>Original source: | ||
237 | * <code><pre> | ||
238 | * {@literal @}Constraint(severity = "error", key = {Req}, | ||
239 | * message = "Redundant instances must not be allocated to the same host.") | ||
240 | * pattern redundantInstancesOnSameHost(Req : Requirement) { | ||
241 | * Requirement.instances(Req, App1); | ||
242 | * Requirement.instances(Req, App2); | ||
243 | * App1 != App2; | ||
244 | * ApplicationInstance.allocatedTo(App1, Host); | ||
245 | * ApplicationInstance.allocatedTo(App2, Host); | ||
246 | * } | ||
247 | * </pre></code> | ||
248 | * | ||
249 | * @see Match | ||
250 | * @see RedundantInstancesOnSameHost | ||
251 | * | ||
252 | */ | ||
253 | public static class Matcher extends BaseMatcher<RedundantInstancesOnSameHost.Match> { | ||
254 | /** | ||
255 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
256 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
257 | * | ||
258 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
259 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
260 | * | ||
261 | */ | ||
262 | public static RedundantInstancesOnSameHost.Matcher on(final ViatraQueryEngine engine) { | ||
263 | // check if matcher already exists | ||
264 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
265 | if (matcher == null) { | ||
266 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
267 | } | ||
268 | return matcher; | ||
269 | } | ||
270 | |||
271 | /** | ||
272 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
273 | * @return an initialized matcher | ||
274 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
275 | * | ||
276 | */ | ||
277 | public static RedundantInstancesOnSameHost.Matcher create() { | ||
278 | return new Matcher(); | ||
279 | } | ||
280 | |||
281 | private static final int POSITION_REQ = 0; | ||
282 | |||
283 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(RedundantInstancesOnSameHost.Matcher.class); | ||
284 | |||
285 | /** | ||
286 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
287 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
288 | * | ||
289 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
290 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
291 | * | ||
292 | */ | ||
293 | private Matcher() { | ||
294 | super(querySpecification()); | ||
295 | } | ||
296 | |||
297 | /** | ||
298 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
299 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
300 | * @return matches represented as a Match object. | ||
301 | * | ||
302 | */ | ||
303 | public Collection<RedundantInstancesOnSameHost.Match> getAllMatches(final Requirement pReq) { | ||
304 | return rawStreamAllMatches(new Object[]{pReq}).collect(Collectors.toSet()); | ||
305 | } | ||
306 | |||
307 | /** | ||
308 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
309 | * </p> | ||
310 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
311 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
312 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
313 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
314 | * @return a stream of matches represented as a Match object. | ||
315 | * | ||
316 | */ | ||
317 | public Stream<RedundantInstancesOnSameHost.Match> streamAllMatches(final Requirement pReq) { | ||
318 | return rawStreamAllMatches(new Object[]{pReq}); | ||
319 | } | ||
320 | |||
321 | /** | ||
322 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
323 | * Neither determinism nor randomness of selection is guaranteed. | ||
324 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
325 | * @return a match represented as a Match object, or null if no match is found. | ||
326 | * | ||
327 | */ | ||
328 | public Optional<RedundantInstancesOnSameHost.Match> getOneArbitraryMatch(final Requirement pReq) { | ||
329 | return rawGetOneArbitraryMatch(new Object[]{pReq}); | ||
330 | } | ||
331 | |||
332 | /** | ||
333 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
334 | * under any possible substitution of the unspecified parameters (if any). | ||
335 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
336 | * @return true if the input is a valid (partial) match of the pattern. | ||
337 | * | ||
338 | */ | ||
339 | public boolean hasMatch(final Requirement pReq) { | ||
340 | return rawHasMatch(new Object[]{pReq}); | ||
341 | } | ||
342 | |||
343 | /** | ||
344 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
345 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
346 | * @return the number of pattern matches found. | ||
347 | * | ||
348 | */ | ||
349 | public int countMatches(final Requirement pReq) { | ||
350 | return rawCountMatches(new Object[]{pReq}); | ||
351 | } | ||
352 | |||
353 | /** | ||
354 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
355 | * Neither determinism nor randomness of selection is guaranteed. | ||
356 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
357 | * @param processor the action that will process the selected match. | ||
358 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
359 | * | ||
360 | */ | ||
361 | public boolean forOneArbitraryMatch(final Requirement pReq, final Consumer<? super RedundantInstancesOnSameHost.Match> processor) { | ||
362 | return rawForOneArbitraryMatch(new Object[]{pReq}, processor); | ||
363 | } | ||
364 | |||
365 | /** | ||
366 | * Returns a new (partial) match. | ||
367 | * This can be used e.g. to call the matcher with a partial match. | ||
368 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
369 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
370 | * @return the (partial) match object. | ||
371 | * | ||
372 | */ | ||
373 | public RedundantInstancesOnSameHost.Match newMatch(final Requirement pReq) { | ||
374 | return RedundantInstancesOnSameHost.Match.newMatch(pReq); | ||
375 | } | ||
376 | |||
377 | /** | ||
378 | * Retrieve the set of values that occur in matches for Req. | ||
379 | * @return the Set of all values or empty set if there are no matches | ||
380 | * | ||
381 | */ | ||
382 | protected Stream<Requirement> rawStreamAllValuesOfReq(final Object[] parameters) { | ||
383 | return rawStreamAllValues(POSITION_REQ, parameters).map(Requirement.class::cast); | ||
384 | } | ||
385 | |||
386 | /** | ||
387 | * Retrieve the set of values that occur in matches for Req. | ||
388 | * @return the Set of all values or empty set if there are no matches | ||
389 | * | ||
390 | */ | ||
391 | public Set<Requirement> getAllValuesOfReq() { | ||
392 | return rawStreamAllValuesOfReq(emptyArray()).collect(Collectors.toSet()); | ||
393 | } | ||
394 | |||
395 | /** | ||
396 | * Retrieve the set of values that occur in matches for Req. | ||
397 | * @return the Set of all values or empty set if there are no matches | ||
398 | * | ||
399 | */ | ||
400 | public Stream<Requirement> streamAllValuesOfReq() { | ||
401 | return rawStreamAllValuesOfReq(emptyArray()); | ||
402 | } | ||
403 | |||
404 | @Override | ||
405 | protected RedundantInstancesOnSameHost.Match tupleToMatch(final Tuple t) { | ||
406 | try { | ||
407 | return RedundantInstancesOnSameHost.Match.newMatch((Requirement) t.get(POSITION_REQ)); | ||
408 | } catch(ClassCastException e) { | ||
409 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
410 | return null; | ||
411 | } | ||
412 | } | ||
413 | |||
414 | @Override | ||
415 | protected RedundantInstancesOnSameHost.Match arrayToMatch(final Object[] match) { | ||
416 | try { | ||
417 | return RedundantInstancesOnSameHost.Match.newMatch((Requirement) match[POSITION_REQ]); | ||
418 | } catch(ClassCastException e) { | ||
419 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
420 | return null; | ||
421 | } | ||
422 | } | ||
423 | |||
424 | @Override | ||
425 | protected RedundantInstancesOnSameHost.Match arrayToMatchMutable(final Object[] match) { | ||
426 | try { | ||
427 | return RedundantInstancesOnSameHost.Match.newMutableMatch((Requirement) match[POSITION_REQ]); | ||
428 | } catch(ClassCastException e) { | ||
429 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
430 | return null; | ||
431 | } | ||
432 | } | ||
433 | |||
434 | /** | ||
435 | * @return the singleton instance of the query specification of this pattern | ||
436 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
437 | * | ||
438 | */ | ||
439 | public static IQuerySpecification<RedundantInstancesOnSameHost.Matcher> querySpecification() { | ||
440 | return RedundantInstancesOnSameHost.instance(); | ||
441 | } | ||
442 | } | ||
443 | |||
444 | private RedundantInstancesOnSameHost() { | ||
445 | super(GeneratedPQuery.INSTANCE); | ||
446 | } | ||
447 | |||
448 | /** | ||
449 | * @return the singleton instance of the query specification | ||
450 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
451 | * | ||
452 | */ | ||
453 | public static RedundantInstancesOnSameHost instance() { | ||
454 | try{ | ||
455 | return LazyHolder.INSTANCE; | ||
456 | } catch (ExceptionInInitializerError err) { | ||
457 | throw processInitializerError(err); | ||
458 | } | ||
459 | } | ||
460 | |||
461 | @Override | ||
462 | protected RedundantInstancesOnSameHost.Matcher instantiate(final ViatraQueryEngine engine) { | ||
463 | return RedundantInstancesOnSameHost.Matcher.on(engine); | ||
464 | } | ||
465 | |||
466 | @Override | ||
467 | public RedundantInstancesOnSameHost.Matcher instantiate() { | ||
468 | return RedundantInstancesOnSameHost.Matcher.create(); | ||
469 | } | ||
470 | |||
471 | @Override | ||
472 | public RedundantInstancesOnSameHost.Match newEmptyMatch() { | ||
473 | return RedundantInstancesOnSameHost.Match.newEmptyMatch(); | ||
474 | } | ||
475 | |||
476 | @Override | ||
477 | public RedundantInstancesOnSameHost.Match newMatch(final Object... parameters) { | ||
478 | return RedundantInstancesOnSameHost.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.Requirement) parameters[0]); | ||
479 | } | ||
480 | |||
481 | /** | ||
482 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost (visibility: PUBLIC, simpleName: RedundantInstancesOnSameHost, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost, 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 | ||
483 | * <b>not</b> at the class load time of the outer class, | ||
484 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost (visibility: PUBLIC, simpleName: RedundantInstancesOnSameHost, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
485 | * | ||
486 | * <p> This workaround is required e.g. to support recursion. | ||
487 | * | ||
488 | */ | ||
489 | private static class LazyHolder { | ||
490 | private static final RedundantInstancesOnSameHost INSTANCE = new RedundantInstancesOnSameHost(); | ||
491 | |||
492 | /** | ||
493 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
494 | * This initialization order is required to support indirect recursion. | ||
495 | * | ||
496 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
497 | * | ||
498 | */ | ||
499 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
500 | |||
501 | public static Object ensureInitialized() { | ||
502 | INSTANCE.ensureInitializedInternal(); | ||
503 | return null; | ||
504 | } | ||
505 | } | ||
506 | |||
507 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
508 | private static final RedundantInstancesOnSameHost.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
509 | |||
510 | 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); | ||
511 | |||
512 | private final List<PParameter> parameters = Arrays.asList(parameter_Req); | ||
513 | |||
514 | private GeneratedPQuery() { | ||
515 | super(PVisibility.PUBLIC); | ||
516 | } | ||
517 | |||
518 | @Override | ||
519 | public String getFullyQualifiedName() { | ||
520 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.redundantInstancesOnSameHost"; | ||
521 | } | ||
522 | |||
523 | @Override | ||
524 | public List<String> getParameterNames() { | ||
525 | return Arrays.asList("Req"); | ||
526 | } | ||
527 | |||
528 | @Override | ||
529 | public List<PParameter> getParameters() { | ||
530 | return parameters; | ||
531 | } | ||
532 | |||
533 | @Override | ||
534 | public Set<PBody> doGetContainedBodies() { | ||
535 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
536 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
537 | { | ||
538 | PBody body = new PBody(this); | ||
539 | PVariable var_Req = body.getOrCreateVariableByName("Req"); | ||
540 | PVariable var_App1 = body.getOrCreateVariableByName("App1"); | ||
541 | PVariable var_App2 = body.getOrCreateVariableByName("App2"); | ||
542 | PVariable var_Host = body.getOrCreateVariableByName("Host"); | ||
543 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement"))); | ||
544 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
545 | new ExportedParameter(body, var_Req, parameter_Req) | ||
546 | )); | ||
547 | // Requirement.instances(Req, App1) | ||
548 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement"))); | ||
549 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
550 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "instances"))); | ||
551 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
552 | new Equality(body, var__virtual_0_, var_App1); | ||
553 | // Requirement.instances(Req, App2) | ||
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", "instances"))); | ||
557 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
558 | new Equality(body, var__virtual_1_, var_App2); | ||
559 | // App1 != App2 | ||
560 | new Inequality(body, var_App1, var_App2); | ||
561 | // ApplicationInstance.allocatedTo(App1, Host) | ||
562 | new TypeConstraint(body, Tuples.flatTupleOf(var_App1), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
563 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
564 | new TypeConstraint(body, Tuples.flatTupleOf(var_App1, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo"))); | ||
565 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
566 | new Equality(body, var__virtual_2_, var_Host); | ||
567 | // ApplicationInstance.allocatedTo(App2, Host) | ||
568 | new TypeConstraint(body, Tuples.flatTupleOf(var_App2), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
569 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
570 | new TypeConstraint(body, Tuples.flatTupleOf(var_App2, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo"))); | ||
571 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
572 | new Equality(body, var__virtual_3_, var_Host); | ||
573 | bodies.add(body); | ||
574 | } | ||
575 | { | ||
576 | PAnnotation annotation = new PAnnotation("Constraint"); | ||
577 | annotation.addAttribute("severity", "error"); | ||
578 | annotation.addAttribute("key", Arrays.asList(new Object[] { | ||
579 | new ParameterReference("Req") | ||
580 | })); | ||
581 | annotation.addAttribute("message", "Redundant instances must not be allocated to the same host."); | ||
582 | addAnnotation(annotation); | ||
583 | } | ||
584 | return bodies; | ||
585 | } | ||
586 | } | ||
587 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RemoveHostInstance.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RemoveHostInstance.java new file mode 100644 index 00000000..1141e898 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RemoveHostInstance.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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.Collections; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
41 | import 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 | * pattern removeHostInstance(HostInstance : HostInstance) { | ||
49 | * neg HostInstance.applications(HostInstance, _); | ||
50 | * } | ||
51 | * </pre></code> | ||
52 | * | ||
53 | * @see Matcher | ||
54 | * @see Match | ||
55 | * | ||
56 | */ | ||
57 | @SuppressWarnings("all") | ||
58 | public final class RemoveHostInstance extends BaseGeneratedEMFQuerySpecification<RemoveHostInstance.Matcher> { | ||
59 | /** | ||
60 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance 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 HostInstance fHostInstance; | ||
73 | |||
74 | private static List<String> parameterNames = makeImmutableList("HostInstance"); | ||
75 | |||
76 | private Match(final HostInstance pHostInstance) { | ||
77 | this.fHostInstance = pHostInstance; | ||
78 | } | ||
79 | |||
80 | @Override | ||
81 | public Object get(final String parameterName) { | ||
82 | if ("HostInstance".equals(parameterName)) return this.fHostInstance; | ||
83 | return null; | ||
84 | } | ||
85 | |||
86 | public HostInstance getHostInstance() { | ||
87 | return this.fHostInstance; | ||
88 | } | ||
89 | |||
90 | @Override | ||
91 | public boolean set(final String parameterName, final Object newValue) { | ||
92 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
93 | if ("HostInstance".equals(parameterName) ) { | ||
94 | this.fHostInstance = (HostInstance) newValue; | ||
95 | return true; | ||
96 | } | ||
97 | return false; | ||
98 | } | ||
99 | |||
100 | public void setHostInstance(final HostInstance pHostInstance) { | ||
101 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
102 | this.fHostInstance = pHostInstance; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public String patternName() { | ||
107 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance"; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public List<String> parameterNames() { | ||
112 | return RemoveHostInstance.Match.parameterNames; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Object[] toArray() { | ||
117 | return new Object[]{fHostInstance}; | ||
118 | } | ||
119 | |||
120 | @Override | ||
121 | public RemoveHostInstance.Match toImmutable() { | ||
122 | return isMutable() ? newMatch(fHostInstance) : this; | ||
123 | } | ||
124 | |||
125 | @Override | ||
126 | public String prettyPrint() { | ||
127 | StringBuilder result = new StringBuilder(); | ||
128 | result.append("\"HostInstance\"=" + prettyPrintValue(fHostInstance)); | ||
129 | return result.toString(); | ||
130 | } | ||
131 | |||
132 | @Override | ||
133 | public int hashCode() { | ||
134 | return Objects.hash(fHostInstance); | ||
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 RemoveHostInstance.Match)) { | ||
145 | RemoveHostInstance.Match other = (RemoveHostInstance.Match) obj; | ||
146 | return Objects.equals(fHostInstance, other.fHostInstance); | ||
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 RemoveHostInstance specification() { | ||
159 | return RemoveHostInstance.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 RemoveHostInstance.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 pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
178 | * @return the new, mutable (partial) match object. | ||
179 | * | ||
180 | */ | ||
181 | public static RemoveHostInstance.Match newMutableMatch(final HostInstance pHostInstance) { | ||
182 | return new Mutable(pHostInstance); | ||
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 pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
190 | * @return the (partial) match object. | ||
191 | * | ||
192 | */ | ||
193 | public static RemoveHostInstance.Match newMatch(final HostInstance pHostInstance) { | ||
194 | return new Immutable(pHostInstance); | ||
195 | } | ||
196 | |||
197 | private static final class Mutable extends RemoveHostInstance.Match { | ||
198 | Mutable(final HostInstance pHostInstance) { | ||
199 | super(pHostInstance); | ||
200 | } | ||
201 | |||
202 | @Override | ||
203 | public boolean isMutable() { | ||
204 | return true; | ||
205 | } | ||
206 | } | ||
207 | |||
208 | private static final class Immutable extends RemoveHostInstance.Match { | ||
209 | Immutable(final HostInstance pHostInstance) { | ||
210 | super(pHostInstance); | ||
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.cps.queries.removeHostInstance 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 | * pattern removeHostInstance(HostInstance : HostInstance) { | ||
232 | * neg HostInstance.applications(HostInstance, _); | ||
233 | * } | ||
234 | * </pre></code> | ||
235 | * | ||
236 | * @see Match | ||
237 | * @see RemoveHostInstance | ||
238 | * | ||
239 | */ | ||
240 | public static class Matcher extends BaseMatcher<RemoveHostInstance.Match> { | ||
241 | /** | ||
242 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
243 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
244 | * | ||
245 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
246 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
247 | * | ||
248 | */ | ||
249 | public static RemoveHostInstance.Matcher on(final ViatraQueryEngine engine) { | ||
250 | // check if matcher already exists | ||
251 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
252 | if (matcher == null) { | ||
253 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
254 | } | ||
255 | return matcher; | ||
256 | } | ||
257 | |||
258 | /** | ||
259 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
260 | * @return an initialized matcher | ||
261 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
262 | * | ||
263 | */ | ||
264 | public static RemoveHostInstance.Matcher create() { | ||
265 | return new Matcher(); | ||
266 | } | ||
267 | |||
268 | private static final int POSITION_HOSTINSTANCE = 0; | ||
269 | |||
270 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(RemoveHostInstance.Matcher.class); | ||
271 | |||
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 | private Matcher() { | ||
281 | super(querySpecification()); | ||
282 | } | ||
283 | |||
284 | /** | ||
285 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
286 | * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
287 | * @return matches represented as a Match object. | ||
288 | * | ||
289 | */ | ||
290 | public Collection<RemoveHostInstance.Match> getAllMatches(final HostInstance pHostInstance) { | ||
291 | return rawStreamAllMatches(new Object[]{pHostInstance}).collect(Collectors.toSet()); | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
296 | * </p> | ||
297 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
298 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
299 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
300 | * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
301 | * @return a stream of matches represented as a Match object. | ||
302 | * | ||
303 | */ | ||
304 | public Stream<RemoveHostInstance.Match> streamAllMatches(final HostInstance pHostInstance) { | ||
305 | return rawStreamAllMatches(new Object[]{pHostInstance}); | ||
306 | } | ||
307 | |||
308 | /** | ||
309 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
310 | * Neither determinism nor randomness of selection is guaranteed. | ||
311 | * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
312 | * @return a match represented as a Match object, or null if no match is found. | ||
313 | * | ||
314 | */ | ||
315 | public Optional<RemoveHostInstance.Match> getOneArbitraryMatch(final HostInstance pHostInstance) { | ||
316 | return rawGetOneArbitraryMatch(new Object[]{pHostInstance}); | ||
317 | } | ||
318 | |||
319 | /** | ||
320 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
321 | * under any possible substitution of the unspecified parameters (if any). | ||
322 | * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
323 | * @return true if the input is a valid (partial) match of the pattern. | ||
324 | * | ||
325 | */ | ||
326 | public boolean hasMatch(final HostInstance pHostInstance) { | ||
327 | return rawHasMatch(new Object[]{pHostInstance}); | ||
328 | } | ||
329 | |||
330 | /** | ||
331 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
332 | * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
333 | * @return the number of pattern matches found. | ||
334 | * | ||
335 | */ | ||
336 | public int countMatches(final HostInstance pHostInstance) { | ||
337 | return rawCountMatches(new Object[]{pHostInstance}); | ||
338 | } | ||
339 | |||
340 | /** | ||
341 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
342 | * Neither determinism nor randomness of selection is guaranteed. | ||
343 | * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
344 | * @param processor the action that will process the selected match. | ||
345 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
346 | * | ||
347 | */ | ||
348 | public boolean forOneArbitraryMatch(final HostInstance pHostInstance, final Consumer<? super RemoveHostInstance.Match> processor) { | ||
349 | return rawForOneArbitraryMatch(new Object[]{pHostInstance}, processor); | ||
350 | } | ||
351 | |||
352 | /** | ||
353 | * Returns a new (partial) match. | ||
354 | * This can be used e.g. to call the matcher with a partial match. | ||
355 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
356 | * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. | ||
357 | * @return the (partial) match object. | ||
358 | * | ||
359 | */ | ||
360 | public RemoveHostInstance.Match newMatch(final HostInstance pHostInstance) { | ||
361 | return RemoveHostInstance.Match.newMatch(pHostInstance); | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * Retrieve the set of values that occur in matches for HostInstance. | ||
366 | * @return the Set of all values or empty set if there are no matches | ||
367 | * | ||
368 | */ | ||
369 | protected Stream<HostInstance> rawStreamAllValuesOfHostInstance(final Object[] parameters) { | ||
370 | return rawStreamAllValues(POSITION_HOSTINSTANCE, parameters).map(HostInstance.class::cast); | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * Retrieve the set of values that occur in matches for HostInstance. | ||
375 | * @return the Set of all values or empty set if there are no matches | ||
376 | * | ||
377 | */ | ||
378 | public Set<HostInstance> getAllValuesOfHostInstance() { | ||
379 | return rawStreamAllValuesOfHostInstance(emptyArray()).collect(Collectors.toSet()); | ||
380 | } | ||
381 | |||
382 | /** | ||
383 | * Retrieve the set of values that occur in matches for HostInstance. | ||
384 | * @return the Set of all values or empty set if there are no matches | ||
385 | * | ||
386 | */ | ||
387 | public Stream<HostInstance> streamAllValuesOfHostInstance() { | ||
388 | return rawStreamAllValuesOfHostInstance(emptyArray()); | ||
389 | } | ||
390 | |||
391 | @Override | ||
392 | protected RemoveHostInstance.Match tupleToMatch(final Tuple t) { | ||
393 | try { | ||
394 | return RemoveHostInstance.Match.newMatch((HostInstance) t.get(POSITION_HOSTINSTANCE)); | ||
395 | } catch(ClassCastException e) { | ||
396 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
397 | return null; | ||
398 | } | ||
399 | } | ||
400 | |||
401 | @Override | ||
402 | protected RemoveHostInstance.Match arrayToMatch(final Object[] match) { | ||
403 | try { | ||
404 | return RemoveHostInstance.Match.newMatch((HostInstance) match[POSITION_HOSTINSTANCE]); | ||
405 | } catch(ClassCastException e) { | ||
406 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
407 | return null; | ||
408 | } | ||
409 | } | ||
410 | |||
411 | @Override | ||
412 | protected RemoveHostInstance.Match arrayToMatchMutable(final Object[] match) { | ||
413 | try { | ||
414 | return RemoveHostInstance.Match.newMutableMatch((HostInstance) match[POSITION_HOSTINSTANCE]); | ||
415 | } catch(ClassCastException e) { | ||
416 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
417 | return null; | ||
418 | } | ||
419 | } | ||
420 | |||
421 | /** | ||
422 | * @return the singleton instance of the query specification of this pattern | ||
423 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
424 | * | ||
425 | */ | ||
426 | public static IQuerySpecification<RemoveHostInstance.Matcher> querySpecification() { | ||
427 | return RemoveHostInstance.instance(); | ||
428 | } | ||
429 | } | ||
430 | |||
431 | private RemoveHostInstance() { | ||
432 | super(GeneratedPQuery.INSTANCE); | ||
433 | } | ||
434 | |||
435 | /** | ||
436 | * @return the singleton instance of the query specification | ||
437 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
438 | * | ||
439 | */ | ||
440 | public static RemoveHostInstance instance() { | ||
441 | try{ | ||
442 | return LazyHolder.INSTANCE; | ||
443 | } catch (ExceptionInInitializerError err) { | ||
444 | throw processInitializerError(err); | ||
445 | } | ||
446 | } | ||
447 | |||
448 | @Override | ||
449 | protected RemoveHostInstance.Matcher instantiate(final ViatraQueryEngine engine) { | ||
450 | return RemoveHostInstance.Matcher.on(engine); | ||
451 | } | ||
452 | |||
453 | @Override | ||
454 | public RemoveHostInstance.Matcher instantiate() { | ||
455 | return RemoveHostInstance.Matcher.create(); | ||
456 | } | ||
457 | |||
458 | @Override | ||
459 | public RemoveHostInstance.Match newEmptyMatch() { | ||
460 | return RemoveHostInstance.Match.newEmptyMatch(); | ||
461 | } | ||
462 | |||
463 | @Override | ||
464 | public RemoveHostInstance.Match newMatch(final Object... parameters) { | ||
465 | return RemoveHostInstance.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0]); | ||
466 | } | ||
467 | |||
468 | /** | ||
469 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance (visibility: PUBLIC, simpleName: RemoveHostInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance, 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 | ||
470 | * <b>not</b> at the class load time of the outer class, | ||
471 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance (visibility: PUBLIC, simpleName: RemoveHostInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
472 | * | ||
473 | * <p> This workaround is required e.g. to support recursion. | ||
474 | * | ||
475 | */ | ||
476 | private static class LazyHolder { | ||
477 | private static final RemoveHostInstance INSTANCE = new RemoveHostInstance(); | ||
478 | |||
479 | /** | ||
480 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
481 | * This initialization order is required to support indirect recursion. | ||
482 | * | ||
483 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
484 | * | ||
485 | */ | ||
486 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
487 | |||
488 | public static Object ensureInitialized() { | ||
489 | INSTANCE.ensureInitializedInternal(); | ||
490 | return null; | ||
491 | } | ||
492 | } | ||
493 | |||
494 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
495 | private static final RemoveHostInstance.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
496 | |||
497 | 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); | ||
498 | |||
499 | private final List<PParameter> parameters = Arrays.asList(parameter_HostInstance); | ||
500 | |||
501 | private class Embedded_1_HostInstance_applications extends BaseGeneratedEMFPQuery { | ||
502 | private final PParameter parameter_p0 = new PParameter("p0", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT); | ||
503 | |||
504 | private final PParameter parameter_p1 = new PParameter("p1", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT); | ||
505 | |||
506 | private final List<PParameter> embeddedParameters = Arrays.asList(parameter_p0, parameter_p1); | ||
507 | |||
508 | public Embedded_1_HostInstance_applications() { | ||
509 | super(PVisibility.EMBEDDED); | ||
510 | } | ||
511 | |||
512 | @Override | ||
513 | public String getFullyQualifiedName() { | ||
514 | return GeneratedPQuery.this.getFullyQualifiedName() + "$Embedded_1_HostInstance_applications"; | ||
515 | } | ||
516 | |||
517 | @Override | ||
518 | public List<PParameter> getParameters() { | ||
519 | return embeddedParameters; | ||
520 | } | ||
521 | |||
522 | @Override | ||
523 | public Set<PBody> doGetContainedBodies() { | ||
524 | PBody body = new PBody(this); | ||
525 | PVariable var_p0 = body.getOrCreateVariableByName("p0"); | ||
526 | PVariable var_p1 = body.getOrCreateVariableByName("p1"); | ||
527 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
528 | new ExportedParameter(body, var_p0, parameter_p0), | ||
529 | new ExportedParameter(body, var_p1, parameter_p1) | ||
530 | )); | ||
531 | // HostInstance.applications(HostInstance, _) | ||
532 | new TypeConstraint(body, Tuples.flatTupleOf(var_p0), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
533 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
534 | new TypeConstraint(body, Tuples.flatTupleOf(var_p0, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "applications"))); | ||
535 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
536 | new Equality(body, var__virtual_0_, var_p1); | ||
537 | return Collections.singleton(body); | ||
538 | } | ||
539 | } | ||
540 | |||
541 | private GeneratedPQuery() { | ||
542 | super(PVisibility.PUBLIC); | ||
543 | } | ||
544 | |||
545 | @Override | ||
546 | public String getFullyQualifiedName() { | ||
547 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance"; | ||
548 | } | ||
549 | |||
550 | @Override | ||
551 | public List<String> getParameterNames() { | ||
552 | return Arrays.asList("HostInstance"); | ||
553 | } | ||
554 | |||
555 | @Override | ||
556 | public List<PParameter> getParameters() { | ||
557 | return parameters; | ||
558 | } | ||
559 | |||
560 | @Override | ||
561 | public Set<PBody> doGetContainedBodies() { | ||
562 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
563 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
564 | { | ||
565 | PBody body = new PBody(this); | ||
566 | PVariable var_HostInstance = body.getOrCreateVariableByName("HostInstance"); | ||
567 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
568 | new TypeConstraint(body, Tuples.flatTupleOf(var_HostInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
569 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
570 | new ExportedParameter(body, var_HostInstance, parameter_HostInstance) | ||
571 | )); | ||
572 | // neg HostInstance.applications(HostInstance, _) | ||
573 | new NegativePatternCall(body, Tuples.flatTupleOf(var_HostInstance, var___0_), new RemoveHostInstance.GeneratedPQuery.Embedded_1_HostInstance_applications()); | ||
574 | bodies.add(body); | ||
575 | } | ||
576 | return bodies; | ||
577 | } | ||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.emf.ecore.EDataType; | ||
21 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
22 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
23 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
27 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
30 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.ParameterReference; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
40 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
41 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter; | ||
42 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
43 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
44 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
45 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
46 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
47 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
48 | import 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") | ||
69 | public 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/ResourceRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/ResourceRequirement.java new file mode 100644 index 00000000..db7710f5 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/ResourceRequirement.java | |||
@@ -0,0 +1,829 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.Collection; | ||
10 | import java.util.LinkedHashSet; | ||
11 | import java.util.List; | ||
12 | import java.util.Objects; | ||
13 | import java.util.Optional; | ||
14 | import java.util.Set; | ||
15 | import java.util.function.Consumer; | ||
16 | import java.util.stream.Collectors; | ||
17 | import java.util.stream.Stream; | ||
18 | import org.apache.log4j.Logger; | ||
19 | import org.eclipse.emf.ecore.EClass; | ||
20 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
21 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
22 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
26 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
39 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
40 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
41 | |||
42 | /** | ||
43 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
44 | * | ||
45 | * <p>Original source: | ||
46 | * <code><pre> | ||
47 | * pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) { | ||
48 | * ApplicationInstance.allocatedTo(App, Host); | ||
49 | * ApplicationInstance.type.requirements(App, Req); | ||
50 | * HostInstance.type(Host, HostType); | ||
51 | * ResourceRequirement.hostType(Req, HostType); | ||
52 | * } | ||
53 | * </pre></code> | ||
54 | * | ||
55 | * @see Matcher | ||
56 | * @see Match | ||
57 | * | ||
58 | */ | ||
59 | @SuppressWarnings("all") | ||
60 | public final class ResourceRequirement extends BaseGeneratedEMFQuerySpecification<ResourceRequirement.Matcher> { | ||
61 | /** | ||
62 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement 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 ApplicationInstance fApp; | ||
77 | |||
78 | private hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement fReq; | ||
79 | |||
80 | private static List<String> parameterNames = makeImmutableList("Host", "App", "Req"); | ||
81 | |||
82 | private Match(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
83 | this.fHost = pHost; | ||
84 | this.fApp = pApp; | ||
85 | this.fReq = pReq; | ||
86 | } | ||
87 | |||
88 | @Override | ||
89 | public Object get(final String parameterName) { | ||
90 | if ("Host".equals(parameterName)) return this.fHost; | ||
91 | if ("App".equals(parameterName)) return this.fApp; | ||
92 | if ("Req".equals(parameterName)) return this.fReq; | ||
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 | public hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement getReq() { | ||
105 | return this.fReq; | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public boolean set(final String parameterName, final Object newValue) { | ||
110 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
111 | if ("Host".equals(parameterName) ) { | ||
112 | this.fHost = (HostInstance) newValue; | ||
113 | return true; | ||
114 | } | ||
115 | if ("App".equals(parameterName) ) { | ||
116 | this.fApp = (ApplicationInstance) newValue; | ||
117 | return true; | ||
118 | } | ||
119 | if ("Req".equals(parameterName) ) { | ||
120 | this.fReq = (hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement) newValue; | ||
121 | return true; | ||
122 | } | ||
123 | return false; | ||
124 | } | ||
125 | |||
126 | public void setHost(final HostInstance pHost) { | ||
127 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
128 | this.fHost = pHost; | ||
129 | } | ||
130 | |||
131 | public void setApp(final ApplicationInstance pApp) { | ||
132 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
133 | this.fApp = pApp; | ||
134 | } | ||
135 | |||
136 | public void setReq(final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
137 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
138 | this.fReq = pReq; | ||
139 | } | ||
140 | |||
141 | @Override | ||
142 | public String patternName() { | ||
143 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement"; | ||
144 | } | ||
145 | |||
146 | @Override | ||
147 | public List<String> parameterNames() { | ||
148 | return ResourceRequirement.Match.parameterNames; | ||
149 | } | ||
150 | |||
151 | @Override | ||
152 | public Object[] toArray() { | ||
153 | return new Object[]{fHost, fApp, fReq}; | ||
154 | } | ||
155 | |||
156 | @Override | ||
157 | public ResourceRequirement.Match toImmutable() { | ||
158 | return isMutable() ? newMatch(fHost, fApp, fReq) : this; | ||
159 | } | ||
160 | |||
161 | @Override | ||
162 | public String prettyPrint() { | ||
163 | StringBuilder result = new StringBuilder(); | ||
164 | result.append("\"Host\"=" + prettyPrintValue(fHost) + ", "); | ||
165 | result.append("\"App\"=" + prettyPrintValue(fApp) + ", "); | ||
166 | result.append("\"Req\"=" + prettyPrintValue(fReq)); | ||
167 | return result.toString(); | ||
168 | } | ||
169 | |||
170 | @Override | ||
171 | public int hashCode() { | ||
172 | return Objects.hash(fHost, fApp, fReq); | ||
173 | } | ||
174 | |||
175 | @Override | ||
176 | public boolean equals(final Object obj) { | ||
177 | if (this == obj) | ||
178 | return true; | ||
179 | if (obj == null) { | ||
180 | return false; | ||
181 | } | ||
182 | if ((obj instanceof ResourceRequirement.Match)) { | ||
183 | ResourceRequirement.Match other = (ResourceRequirement.Match) obj; | ||
184 | return Objects.equals(fHost, other.fHost) && Objects.equals(fApp, other.fApp) && Objects.equals(fReq, other.fReq); | ||
185 | } else { | ||
186 | // this should be infrequent | ||
187 | if (!(obj instanceof IPatternMatch)) { | ||
188 | return false; | ||
189 | } | ||
190 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
191 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
192 | } | ||
193 | } | ||
194 | |||
195 | @Override | ||
196 | public ResourceRequirement specification() { | ||
197 | return ResourceRequirement.instance(); | ||
198 | } | ||
199 | |||
200 | /** | ||
201 | * Returns an empty, mutable match. | ||
202 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
203 | * | ||
204 | * @return the empty match. | ||
205 | * | ||
206 | */ | ||
207 | public static ResourceRequirement.Match newEmptyMatch() { | ||
208 | return new Mutable(null, null, null); | ||
209 | } | ||
210 | |||
211 | /** | ||
212 | * Returns a mutable (partial) match. | ||
213 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
214 | * | ||
215 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
216 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
217 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
218 | * @return the new, mutable (partial) match object. | ||
219 | * | ||
220 | */ | ||
221 | public static ResourceRequirement.Match newMutableMatch(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
222 | return new Mutable(pHost, pApp, pReq); | ||
223 | } | ||
224 | |||
225 | /** | ||
226 | * Returns a new (partial) match. | ||
227 | * This can be used e.g. to call the matcher with a partial match. | ||
228 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
229 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
230 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
231 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
232 | * @return the (partial) match object. | ||
233 | * | ||
234 | */ | ||
235 | public static ResourceRequirement.Match newMatch(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
236 | return new Immutable(pHost, pApp, pReq); | ||
237 | } | ||
238 | |||
239 | private static final class Mutable extends ResourceRequirement.Match { | ||
240 | Mutable(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
241 | super(pHost, pApp, pReq); | ||
242 | } | ||
243 | |||
244 | @Override | ||
245 | public boolean isMutable() { | ||
246 | return true; | ||
247 | } | ||
248 | } | ||
249 | |||
250 | private static final class Immutable extends ResourceRequirement.Match { | ||
251 | Immutable(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
252 | super(pHost, pApp, pReq); | ||
253 | } | ||
254 | |||
255 | @Override | ||
256 | public boolean isMutable() { | ||
257 | return false; | ||
258 | } | ||
259 | } | ||
260 | } | ||
261 | |||
262 | /** | ||
263 | * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement pattern, | ||
264 | * providing pattern-specific query methods. | ||
265 | * | ||
266 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
267 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
268 | * | ||
269 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
270 | * | ||
271 | * <p>Original source: | ||
272 | * <code><pre> | ||
273 | * pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) { | ||
274 | * ApplicationInstance.allocatedTo(App, Host); | ||
275 | * ApplicationInstance.type.requirements(App, Req); | ||
276 | * HostInstance.type(Host, HostType); | ||
277 | * ResourceRequirement.hostType(Req, HostType); | ||
278 | * } | ||
279 | * </pre></code> | ||
280 | * | ||
281 | * @see Match | ||
282 | * @see ResourceRequirement | ||
283 | * | ||
284 | */ | ||
285 | public static class Matcher extends BaseMatcher<ResourceRequirement.Match> { | ||
286 | /** | ||
287 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
288 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
289 | * | ||
290 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
291 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
292 | * | ||
293 | */ | ||
294 | public static ResourceRequirement.Matcher on(final ViatraQueryEngine engine) { | ||
295 | // check if matcher already exists | ||
296 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
297 | if (matcher == null) { | ||
298 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
299 | } | ||
300 | return matcher; | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
305 | * @return an initialized matcher | ||
306 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
307 | * | ||
308 | */ | ||
309 | public static ResourceRequirement.Matcher create() { | ||
310 | return new Matcher(); | ||
311 | } | ||
312 | |||
313 | private static final int POSITION_HOST = 0; | ||
314 | |||
315 | private static final int POSITION_APP = 1; | ||
316 | |||
317 | private static final int POSITION_REQ = 2; | ||
318 | |||
319 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(ResourceRequirement.Matcher.class); | ||
320 | |||
321 | /** | ||
322 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
323 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
324 | * | ||
325 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
326 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
327 | * | ||
328 | */ | ||
329 | private Matcher() { | ||
330 | super(querySpecification()); | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
335 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
336 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
337 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
338 | * @return matches represented as a Match object. | ||
339 | * | ||
340 | */ | ||
341 | public Collection<ResourceRequirement.Match> getAllMatches(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
342 | return rawStreamAllMatches(new Object[]{pHost, pApp, pReq}).collect(Collectors.toSet()); | ||
343 | } | ||
344 | |||
345 | /** | ||
346 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
347 | * </p> | ||
348 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
349 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
350 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
351 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
352 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
353 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
354 | * @return a stream of matches represented as a Match object. | ||
355 | * | ||
356 | */ | ||
357 | public Stream<ResourceRequirement.Match> streamAllMatches(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
358 | return rawStreamAllMatches(new Object[]{pHost, pApp, pReq}); | ||
359 | } | ||
360 | |||
361 | /** | ||
362 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
363 | * Neither determinism nor randomness of selection is guaranteed. | ||
364 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
365 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
366 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
367 | * @return a match represented as a Match object, or null if no match is found. | ||
368 | * | ||
369 | */ | ||
370 | public Optional<ResourceRequirement.Match> getOneArbitraryMatch(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
371 | return rawGetOneArbitraryMatch(new Object[]{pHost, pApp, pReq}); | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
376 | * under any possible substitution of the unspecified parameters (if any). | ||
377 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
378 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
379 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
380 | * @return true if the input is a valid (partial) match of the pattern. | ||
381 | * | ||
382 | */ | ||
383 | public boolean hasMatch(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
384 | return rawHasMatch(new Object[]{pHost, pApp, pReq}); | ||
385 | } | ||
386 | |||
387 | /** | ||
388 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
389 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
390 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
391 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
392 | * @return the number of pattern matches found. | ||
393 | * | ||
394 | */ | ||
395 | public int countMatches(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
396 | return rawCountMatches(new Object[]{pHost, pApp, pReq}); | ||
397 | } | ||
398 | |||
399 | /** | ||
400 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
401 | * Neither determinism nor randomness of selection is guaranteed. | ||
402 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
403 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
404 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
405 | * @param processor the action that will process the selected match. | ||
406 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
407 | * | ||
408 | */ | ||
409 | public boolean forOneArbitraryMatch(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq, final Consumer<? super ResourceRequirement.Match> processor) { | ||
410 | return rawForOneArbitraryMatch(new Object[]{pHost, pApp, pReq}, processor); | ||
411 | } | ||
412 | |||
413 | /** | ||
414 | * Returns a new (partial) match. | ||
415 | * This can be used e.g. to call the matcher with a partial match. | ||
416 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
417 | * @param pHost the fixed value of pattern parameter Host, or null if not bound. | ||
418 | * @param pApp the fixed value of pattern parameter App, or null if not bound. | ||
419 | * @param pReq the fixed value of pattern parameter Req, or null if not bound. | ||
420 | * @return the (partial) match object. | ||
421 | * | ||
422 | */ | ||
423 | public ResourceRequirement.Match newMatch(final HostInstance pHost, final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
424 | return ResourceRequirement.Match.newMatch(pHost, pApp, pReq); | ||
425 | } | ||
426 | |||
427 | /** | ||
428 | * Retrieve the set of values that occur in matches for Host. | ||
429 | * @return the Set of all values or empty set if there are no matches | ||
430 | * | ||
431 | */ | ||
432 | protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) { | ||
433 | return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast); | ||
434 | } | ||
435 | |||
436 | /** | ||
437 | * Retrieve the set of values that occur in matches for Host. | ||
438 | * @return the Set of all values or empty set if there are no matches | ||
439 | * | ||
440 | */ | ||
441 | public Set<HostInstance> getAllValuesOfHost() { | ||
442 | return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet()); | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * Retrieve the set of values that occur in matches for Host. | ||
447 | * @return the Set of all values or empty set if there are no matches | ||
448 | * | ||
449 | */ | ||
450 | public Stream<HostInstance> streamAllValuesOfHost() { | ||
451 | return rawStreamAllValuesOfHost(emptyArray()); | ||
452 | } | ||
453 | |||
454 | /** | ||
455 | * Retrieve the set of values that occur in matches for Host. | ||
456 | * </p> | ||
457 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
458 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
459 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
460 | * | ||
461 | * @return the Stream of all values or empty set if there are no matches | ||
462 | * | ||
463 | */ | ||
464 | public Stream<HostInstance> streamAllValuesOfHost(final ResourceRequirement.Match partialMatch) { | ||
465 | return rawStreamAllValuesOfHost(partialMatch.toArray()); | ||
466 | } | ||
467 | |||
468 | /** | ||
469 | * Retrieve the set of values that occur in matches for Host. | ||
470 | * </p> | ||
471 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
472 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
473 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
474 | * | ||
475 | * @return the Stream of all values or empty set if there are no matches | ||
476 | * | ||
477 | */ | ||
478 | public Stream<HostInstance> streamAllValuesOfHost(final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
479 | return rawStreamAllValuesOfHost(new Object[]{null, pApp, pReq}); | ||
480 | } | ||
481 | |||
482 | /** | ||
483 | * Retrieve the set of values that occur in matches for Host. | ||
484 | * @return the Set of all values or empty set if there are no matches | ||
485 | * | ||
486 | */ | ||
487 | public Set<HostInstance> getAllValuesOfHost(final ResourceRequirement.Match partialMatch) { | ||
488 | return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet()); | ||
489 | } | ||
490 | |||
491 | /** | ||
492 | * Retrieve the set of values that occur in matches for Host. | ||
493 | * @return the Set of all values or empty set if there are no matches | ||
494 | * | ||
495 | */ | ||
496 | public Set<HostInstance> getAllValuesOfHost(final ApplicationInstance pApp, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
497 | return rawStreamAllValuesOfHost(new Object[]{null, pApp, pReq}).collect(Collectors.toSet()); | ||
498 | } | ||
499 | |||
500 | /** | ||
501 | * Retrieve the set of values that occur in matches for App. | ||
502 | * @return the Set of all values or empty set if there are no matches | ||
503 | * | ||
504 | */ | ||
505 | protected Stream<ApplicationInstance> rawStreamAllValuesOfApp(final Object[] parameters) { | ||
506 | return rawStreamAllValues(POSITION_APP, parameters).map(ApplicationInstance.class::cast); | ||
507 | } | ||
508 | |||
509 | /** | ||
510 | * Retrieve the set of values that occur in matches for App. | ||
511 | * @return the Set of all values or empty set if there are no matches | ||
512 | * | ||
513 | */ | ||
514 | public Set<ApplicationInstance> getAllValuesOfApp() { | ||
515 | return rawStreamAllValuesOfApp(emptyArray()).collect(Collectors.toSet()); | ||
516 | } | ||
517 | |||
518 | /** | ||
519 | * Retrieve the set of values that occur in matches for App. | ||
520 | * @return the Set of all values or empty set if there are no matches | ||
521 | * | ||
522 | */ | ||
523 | public Stream<ApplicationInstance> streamAllValuesOfApp() { | ||
524 | return rawStreamAllValuesOfApp(emptyArray()); | ||
525 | } | ||
526 | |||
527 | /** | ||
528 | * Retrieve the set of values that occur in matches for App. | ||
529 | * </p> | ||
530 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
531 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
532 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
533 | * | ||
534 | * @return the Stream of all values or empty set if there are no matches | ||
535 | * | ||
536 | */ | ||
537 | public Stream<ApplicationInstance> streamAllValuesOfApp(final ResourceRequirement.Match partialMatch) { | ||
538 | return rawStreamAllValuesOfApp(partialMatch.toArray()); | ||
539 | } | ||
540 | |||
541 | /** | ||
542 | * Retrieve the set of values that occur in matches for App. | ||
543 | * </p> | ||
544 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
545 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
546 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
547 | * | ||
548 | * @return the Stream of all values or empty set if there are no matches | ||
549 | * | ||
550 | */ | ||
551 | public Stream<ApplicationInstance> streamAllValuesOfApp(final HostInstance pHost, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
552 | return rawStreamAllValuesOfApp(new Object[]{pHost, null, pReq}); | ||
553 | } | ||
554 | |||
555 | /** | ||
556 | * Retrieve the set of values that occur in matches for App. | ||
557 | * @return the Set of all values or empty set if there are no matches | ||
558 | * | ||
559 | */ | ||
560 | public Set<ApplicationInstance> getAllValuesOfApp(final ResourceRequirement.Match partialMatch) { | ||
561 | return rawStreamAllValuesOfApp(partialMatch.toArray()).collect(Collectors.toSet()); | ||
562 | } | ||
563 | |||
564 | /** | ||
565 | * Retrieve the set of values that occur in matches for App. | ||
566 | * @return the Set of all values or empty set if there are no matches | ||
567 | * | ||
568 | */ | ||
569 | public Set<ApplicationInstance> getAllValuesOfApp(final HostInstance pHost, final hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement pReq) { | ||
570 | return rawStreamAllValuesOfApp(new Object[]{pHost, null, pReq}).collect(Collectors.toSet()); | ||
571 | } | ||
572 | |||
573 | /** | ||
574 | * Retrieve the set of values that occur in matches for Req. | ||
575 | * @return the Set of all values or empty set if there are no matches | ||
576 | * | ||
577 | */ | ||
578 | protected Stream<hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement> rawStreamAllValuesOfReq(final Object[] parameters) { | ||
579 | return rawStreamAllValues(POSITION_REQ, parameters).map(hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement.class::cast); | ||
580 | } | ||
581 | |||
582 | /** | ||
583 | * Retrieve the set of values that occur in matches for Req. | ||
584 | * @return the Set of all values or empty set if there are no matches | ||
585 | * | ||
586 | */ | ||
587 | public Set<hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement> getAllValuesOfReq() { | ||
588 | return rawStreamAllValuesOfReq(emptyArray()).collect(Collectors.toSet()); | ||
589 | } | ||
590 | |||
591 | /** | ||
592 | * Retrieve the set of values that occur in matches for Req. | ||
593 | * @return the Set of all values or empty set if there are no matches | ||
594 | * | ||
595 | */ | ||
596 | public Stream<hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement> streamAllValuesOfReq() { | ||
597 | return rawStreamAllValuesOfReq(emptyArray()); | ||
598 | } | ||
599 | |||
600 | /** | ||
601 | * Retrieve the set of values that occur in matches for Req. | ||
602 | * </p> | ||
603 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
604 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
605 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
606 | * | ||
607 | * @return the Stream of all values or empty set if there are no matches | ||
608 | * | ||
609 | */ | ||
610 | public Stream<hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement> streamAllValuesOfReq(final ResourceRequirement.Match partialMatch) { | ||
611 | return rawStreamAllValuesOfReq(partialMatch.toArray()); | ||
612 | } | ||
613 | |||
614 | /** | ||
615 | * Retrieve the set of values that occur in matches for Req. | ||
616 | * </p> | ||
617 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
618 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
619 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
620 | * | ||
621 | * @return the Stream of all values or empty set if there are no matches | ||
622 | * | ||
623 | */ | ||
624 | public Stream<hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement> streamAllValuesOfReq(final HostInstance pHost, final ApplicationInstance pApp) { | ||
625 | return rawStreamAllValuesOfReq(new Object[]{pHost, pApp, null}); | ||
626 | } | ||
627 | |||
628 | /** | ||
629 | * Retrieve the set of values that occur in matches for Req. | ||
630 | * @return the Set of all values or empty set if there are no matches | ||
631 | * | ||
632 | */ | ||
633 | public Set<hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement> getAllValuesOfReq(final ResourceRequirement.Match partialMatch) { | ||
634 | return rawStreamAllValuesOfReq(partialMatch.toArray()).collect(Collectors.toSet()); | ||
635 | } | ||
636 | |||
637 | /** | ||
638 | * Retrieve the set of values that occur in matches for Req. | ||
639 | * @return the Set of all values or empty set if there are no matches | ||
640 | * | ||
641 | */ | ||
642 | public Set<hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement> getAllValuesOfReq(final HostInstance pHost, final ApplicationInstance pApp) { | ||
643 | return rawStreamAllValuesOfReq(new Object[]{pHost, pApp, null}).collect(Collectors.toSet()); | ||
644 | } | ||
645 | |||
646 | @Override | ||
647 | protected ResourceRequirement.Match tupleToMatch(final Tuple t) { | ||
648 | try { | ||
649 | return ResourceRequirement.Match.newMatch((HostInstance) t.get(POSITION_HOST), (ApplicationInstance) t.get(POSITION_APP), (hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement) t.get(POSITION_REQ)); | ||
650 | } catch(ClassCastException e) { | ||
651 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
652 | return null; | ||
653 | } | ||
654 | } | ||
655 | |||
656 | @Override | ||
657 | protected ResourceRequirement.Match arrayToMatch(final Object[] match) { | ||
658 | try { | ||
659 | return ResourceRequirement.Match.newMatch((HostInstance) match[POSITION_HOST], (ApplicationInstance) match[POSITION_APP], (hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement) match[POSITION_REQ]); | ||
660 | } catch(ClassCastException e) { | ||
661 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
662 | return null; | ||
663 | } | ||
664 | } | ||
665 | |||
666 | @Override | ||
667 | protected ResourceRequirement.Match arrayToMatchMutable(final Object[] match) { | ||
668 | try { | ||
669 | return ResourceRequirement.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (ApplicationInstance) match[POSITION_APP], (hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement) match[POSITION_REQ]); | ||
670 | } catch(ClassCastException e) { | ||
671 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
672 | return null; | ||
673 | } | ||
674 | } | ||
675 | |||
676 | /** | ||
677 | * @return the singleton instance of the query specification of this pattern | ||
678 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
679 | * | ||
680 | */ | ||
681 | public static IQuerySpecification<ResourceRequirement.Matcher> querySpecification() { | ||
682 | return ResourceRequirement.instance(); | ||
683 | } | ||
684 | } | ||
685 | |||
686 | private ResourceRequirement() { | ||
687 | super(GeneratedPQuery.INSTANCE); | ||
688 | } | ||
689 | |||
690 | /** | ||
691 | * @return the singleton instance of the query specification | ||
692 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
693 | * | ||
694 | */ | ||
695 | public static ResourceRequirement instance() { | ||
696 | try{ | ||
697 | return LazyHolder.INSTANCE; | ||
698 | } catch (ExceptionInInitializerError err) { | ||
699 | throw processInitializerError(err); | ||
700 | } | ||
701 | } | ||
702 | |||
703 | @Override | ||
704 | protected ResourceRequirement.Matcher instantiate(final ViatraQueryEngine engine) { | ||
705 | return ResourceRequirement.Matcher.on(engine); | ||
706 | } | ||
707 | |||
708 | @Override | ||
709 | public ResourceRequirement.Matcher instantiate() { | ||
710 | return ResourceRequirement.Matcher.create(); | ||
711 | } | ||
712 | |||
713 | @Override | ||
714 | public ResourceRequirement.Match newEmptyMatch() { | ||
715 | return ResourceRequirement.Match.newEmptyMatch(); | ||
716 | } | ||
717 | |||
718 | @Override | ||
719 | public ResourceRequirement.Match newMatch(final Object... parameters) { | ||
720 | return ResourceRequirement.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance) parameters[1], (hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement) parameters[2]); | ||
721 | } | ||
722 | |||
723 | /** | ||
724 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement (visibility: PUBLIC, simpleName: ResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement, 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 | ||
725 | * <b>not</b> at the class load time of the outer class, | ||
726 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement (visibility: PUBLIC, simpleName: ResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. | ||
727 | * | ||
728 | * <p> This workaround is required e.g. to support recursion. | ||
729 | * | ||
730 | */ | ||
731 | private static class LazyHolder { | ||
732 | private static final ResourceRequirement INSTANCE = new ResourceRequirement(); | ||
733 | |||
734 | /** | ||
735 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
736 | * This initialization order is required to support indirect recursion. | ||
737 | * | ||
738 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
739 | * | ||
740 | */ | ||
741 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
742 | |||
743 | public static Object ensureInitialized() { | ||
744 | INSTANCE.ensureInitializedInternal(); | ||
745 | return null; | ||
746 | } | ||
747 | } | ||
748 | |||
749 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
750 | private static final ResourceRequirement.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
751 | |||
752 | 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); | ||
753 | |||
754 | 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); | ||
755 | |||
756 | 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); | ||
757 | |||
758 | private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_App, parameter_Req); | ||
759 | |||
760 | private GeneratedPQuery() { | ||
761 | super(PVisibility.PUBLIC); | ||
762 | } | ||
763 | |||
764 | @Override | ||
765 | public String getFullyQualifiedName() { | ||
766 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement"; | ||
767 | } | ||
768 | |||
769 | @Override | ||
770 | public List<String> getParameterNames() { | ||
771 | return Arrays.asList("Host","App","Req"); | ||
772 | } | ||
773 | |||
774 | @Override | ||
775 | public List<PParameter> getParameters() { | ||
776 | return parameters; | ||
777 | } | ||
778 | |||
779 | @Override | ||
780 | public Set<PBody> doGetContainedBodies() { | ||
781 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
782 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
783 | { | ||
784 | PBody body = new PBody(this); | ||
785 | PVariable var_Host = body.getOrCreateVariableByName("Host"); | ||
786 | PVariable var_App = body.getOrCreateVariableByName("App"); | ||
787 | PVariable var_Req = body.getOrCreateVariableByName("Req"); | ||
788 | PVariable var_HostType = body.getOrCreateVariableByName("HostType"); | ||
789 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
790 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
791 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
792 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
793 | new ExportedParameter(body, var_Host, parameter_Host), | ||
794 | new ExportedParameter(body, var_App, parameter_App), | ||
795 | new ExportedParameter(body, var_Req, parameter_Req) | ||
796 | )); | ||
797 | // ApplicationInstance.allocatedTo(App, Host) | ||
798 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
799 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
800 | new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo"))); | ||
801 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
802 | new Equality(body, var__virtual_0_, var_Host); | ||
803 | // ApplicationInstance.type.requirements(App, Req) | ||
804 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
805 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
806 | new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "type"))); | ||
807 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType"))); | ||
808 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
809 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "requirements"))); | ||
810 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
811 | new Equality(body, var__virtual_2_, var_Req); | ||
812 | // HostInstance.type(Host, HostType) | ||
813 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
814 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
815 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type"))); | ||
816 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
817 | new Equality(body, var__virtual_3_, var_HostType); | ||
818 | // ResourceRequirement.hostType(Req, HostType) | ||
819 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement"))); | ||
820 | PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}"); | ||
821 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "hostType"))); | ||
822 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
823 | new Equality(body, var__virtual_4_, var_HostType); | ||
824 | bodies.add(body); | ||
825 | } | ||
826 | return bodies; | ||
827 | } | ||
828 | } | ||
829 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/UnallocateAppInstance.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/UnallocateAppInstance.java new file mode 100644 index 00000000..ccc0ba22 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/UnallocateAppInstance.java | |||
@@ -0,0 +1,541 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
39 | import 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 unallocateAppInstance(App : ApplicationInstance) { | ||
47 | * ApplicationInstance.allocatedTo(App, _); | ||
48 | * } | ||
49 | * </pre></code> | ||
50 | * | ||
51 | * @see Matcher | ||
52 | * @see Match | ||
53 | * | ||
54 | */ | ||
55 | @SuppressWarnings("all") | ||
56 | public final class UnallocateAppInstance extends BaseGeneratedEMFQuerySpecification<UnallocateAppInstance.Matcher> { | ||
57 | /** | ||
58 | * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.unallocateAppInstance 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 ApplicationInstance fApp; | ||
71 | |||
72 | private static List<String> parameterNames = makeImmutableList("App"); | ||
73 | |||
74 | private Match(final ApplicationInstance pApp) { | ||
75 | this.fApp = pApp; | ||
76 | } | ||
77 | |||
78 | @Override | ||
79 | public Object get(final String parameterName) { | ||
80 | if ("App".equals(parameterName)) return this.fApp; | ||
81 | return null; | ||
82 | } | ||
83 | |||
84 | public ApplicationInstance getApp() { | ||
85 | return this.fApp; | ||
86 | } | ||
87 | |||
88 | @Override | ||
89 | public boolean set(final String parameterName, final Object newValue) { | ||
90 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
91 | if ("App".equals(parameterName) ) { | ||
92 | this.fApp = (ApplicationInstance) newValue; | ||
93 | return true; | ||
94 | } | ||
95 | return false; | ||
96 | } | ||
97 | |||
98 | public void setApp(final ApplicationInstance pApp) { | ||
99 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
100 | this.fApp = pApp; | ||
101 | } | ||
102 | |||
103 | @Override | ||
104 | public String patternName() { | ||
105 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.unallocateAppInstance"; | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public List<String> parameterNames() { | ||
110 | return UnallocateAppInstance.Match.parameterNames; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public Object[] toArray() { | ||
115 | return new Object[]{fApp}; | ||
116 | } | ||
117 | |||
118 | @Override | ||
119 | public UnallocateAppInstance.Match toImmutable() { | ||
120 | return isMutable() ? newMatch(fApp) : this; | ||
121 | } | ||
122 | |||
123 | @Override | ||
124 | public String prettyPrint() { | ||
125 | StringBuilder result = new StringBuilder(); | ||
126 | result.append("\"App\"=" + prettyPrintValue(fApp)); | ||
127 | return result.toString(); | ||
128 | } | ||
129 | |||
130 | @Override | ||
131 | public int hashCode() { | ||
132 | return Objects.hash(fApp); | ||
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 UnallocateAppInstance.Match)) { | ||
143 | UnallocateAppInstance.Match other = (UnallocateAppInstance.Match) obj; | ||
144 | return Objects.equals(fApp, other.fApp); | ||
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 UnallocateAppInstance specification() { | ||
157 | return UnallocateAppInstance.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 UnallocateAppInstance.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 pApp the fixed value of pattern parameter App, or null if not bound. | ||
176 | * @return the new, mutable (partial) match object. | ||
177 | * | ||
178 | */ | ||
179 | public static UnallocateAppInstance.Match newMutableMatch(final ApplicationInstance pApp) { | ||
180 | return new Mutable(pApp); | ||
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 pApp the fixed value of pattern parameter App, or null if not bound. | ||
188 | * @return the (partial) match object. | ||
189 | * | ||
190 | */ | ||
191 | public static UnallocateAppInstance.Match newMatch(final ApplicationInstance pApp) { | ||
192 | return new Immutable(pApp); | ||
193 | } | ||
194 | |||
195 | private static final class Mutable extends UnallocateAppInstance.Match { | ||
196 | Mutable(final ApplicationInstance pApp) { | ||
197 | super(pApp); | ||
198 | } | ||
199 | |||
200 | @Override | ||
201 | public boolean isMutable() { | ||
202 | return true; | ||
203 | } | ||
204 | } | ||
205 | |||
206 | private static final class Immutable extends UnallocateAppInstance.Match { | ||
207 | Immutable(final ApplicationInstance pApp) { | ||
208 | super(pApp); | ||
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.unallocateAppInstance 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 unallocateAppInstance(App : ApplicationInstance) { | ||
230 | * ApplicationInstance.allocatedTo(App, _); | ||
231 | * } | ||
232 | * </pre></code> | ||
233 | * | ||
234 | * @see Match | ||
235 | * @see UnallocateAppInstance | ||
236 | * | ||
237 | */ | ||
238 | public static class Matcher extends BaseMatcher<UnallocateAppInstance.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 UnallocateAppInstance.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 UnallocateAppInstance.Matcher create() { | ||
263 | return new Matcher(); | ||
264 | } | ||
265 | |||
266 | private static final int POSITION_APP = 0; | ||
267 | |||
268 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(UnallocateAppInstance.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 pApp the fixed value of pattern parameter App, or null if not bound. | ||
285 | * @return matches represented as a Match object. | ||
286 | * | ||
287 | */ | ||
288 | public Collection<UnallocateAppInstance.Match> getAllMatches(final ApplicationInstance pApp) { | ||
289 | return rawStreamAllMatches(new Object[]{pApp}).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 pApp the fixed value of pattern parameter App, or null if not bound. | ||
299 | * @return a stream of matches represented as a Match object. | ||
300 | * | ||
301 | */ | ||
302 | public Stream<UnallocateAppInstance.Match> streamAllMatches(final ApplicationInstance pApp) { | ||
303 | return rawStreamAllMatches(new Object[]{pApp}); | ||
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 pApp the fixed value of pattern parameter App, 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<UnallocateAppInstance.Match> getOneArbitraryMatch(final ApplicationInstance pApp) { | ||
314 | return rawGetOneArbitraryMatch(new Object[]{pApp}); | ||
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 pApp the fixed value of pattern parameter App, 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 ApplicationInstance pApp) { | ||
325 | return rawHasMatch(new Object[]{pApp}); | ||
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 pApp the fixed value of pattern parameter App, or null if not bound. | ||
331 | * @return the number of pattern matches found. | ||
332 | * | ||
333 | */ | ||
334 | public int countMatches(final ApplicationInstance pApp) { | ||
335 | return rawCountMatches(new Object[]{pApp}); | ||
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 pApp the fixed value of pattern parameter App, 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 ApplicationInstance pApp, final Consumer<? super UnallocateAppInstance.Match> processor) { | ||
347 | return rawForOneArbitraryMatch(new Object[]{pApp}, 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 pApp the fixed value of pattern parameter App, or null if not bound. | ||
355 | * @return the (partial) match object. | ||
356 | * | ||
357 | */ | ||
358 | public UnallocateAppInstance.Match newMatch(final ApplicationInstance pApp) { | ||
359 | return UnallocateAppInstance.Match.newMatch(pApp); | ||
360 | } | ||
361 | |||
362 | /** | ||
363 | * Retrieve the set of values that occur in matches for App. | ||
364 | * @return the Set of all values or empty set if there are no matches | ||
365 | * | ||
366 | */ | ||
367 | protected Stream<ApplicationInstance> rawStreamAllValuesOfApp(final Object[] parameters) { | ||
368 | return rawStreamAllValues(POSITION_APP, parameters).map(ApplicationInstance.class::cast); | ||
369 | } | ||
370 | |||
371 | /** | ||
372 | * Retrieve the set of values that occur in matches for App. | ||
373 | * @return the Set of all values or empty set if there are no matches | ||
374 | * | ||
375 | */ | ||
376 | public Set<ApplicationInstance> getAllValuesOfApp() { | ||
377 | return rawStreamAllValuesOfApp(emptyArray()).collect(Collectors.toSet()); | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * Retrieve the set of values that occur in matches for App. | ||
382 | * @return the Set of all values or empty set if there are no matches | ||
383 | * | ||
384 | */ | ||
385 | public Stream<ApplicationInstance> streamAllValuesOfApp() { | ||
386 | return rawStreamAllValuesOfApp(emptyArray()); | ||
387 | } | ||
388 | |||
389 | @Override | ||
390 | protected UnallocateAppInstance.Match tupleToMatch(final Tuple t) { | ||
391 | try { | ||
392 | return UnallocateAppInstance.Match.newMatch((ApplicationInstance) t.get(POSITION_APP)); | ||
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 UnallocateAppInstance.Match arrayToMatch(final Object[] match) { | ||
401 | try { | ||
402 | return UnallocateAppInstance.Match.newMatch((ApplicationInstance) match[POSITION_APP]); | ||
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 UnallocateAppInstance.Match arrayToMatchMutable(final Object[] match) { | ||
411 | try { | ||
412 | return UnallocateAppInstance.Match.newMutableMatch((ApplicationInstance) match[POSITION_APP]); | ||
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<UnallocateAppInstance.Matcher> querySpecification() { | ||
425 | return UnallocateAppInstance.instance(); | ||
426 | } | ||
427 | } | ||
428 | |||
429 | private UnallocateAppInstance() { | ||
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 UnallocateAppInstance instance() { | ||
439 | try{ | ||
440 | return LazyHolder.INSTANCE; | ||
441 | } catch (ExceptionInInitializerError err) { | ||
442 | throw processInitializerError(err); | ||
443 | } | ||
444 | } | ||
445 | |||
446 | @Override | ||
447 | protected UnallocateAppInstance.Matcher instantiate(final ViatraQueryEngine engine) { | ||
448 | return UnallocateAppInstance.Matcher.on(engine); | ||
449 | } | ||
450 | |||
451 | @Override | ||
452 | public UnallocateAppInstance.Matcher instantiate() { | ||
453 | return UnallocateAppInstance.Matcher.create(); | ||
454 | } | ||
455 | |||
456 | @Override | ||
457 | public UnallocateAppInstance.Match newEmptyMatch() { | ||
458 | return UnallocateAppInstance.Match.newEmptyMatch(); | ||
459 | } | ||
460 | |||
461 | @Override | ||
462 | public UnallocateAppInstance.Match newMatch(final Object... parameters) { | ||
463 | return UnallocateAppInstance.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance) parameters[0]); | ||
464 | } | ||
465 | |||
466 | /** | ||
467 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.UnallocateAppInstance (visibility: PUBLIC, simpleName: UnallocateAppInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.UnallocateAppInstance, 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.UnallocateAppInstance (visibility: PUBLIC, simpleName: UnallocateAppInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.UnallocateAppInstance, 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 UnallocateAppInstance INSTANCE = new UnallocateAppInstance(); | ||
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 UnallocateAppInstance.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
494 | |||
495 | 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); | ||
496 | |||
497 | private final List<PParameter> parameters = Arrays.asList(parameter_App); | ||
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.unallocateAppInstance"; | ||
506 | } | ||
507 | |||
508 | @Override | ||
509 | public List<String> getParameterNames() { | ||
510 | return Arrays.asList("App"); | ||
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_App = body.getOrCreateVariableByName("App"); | ||
525 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
526 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
527 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
528 | new ExportedParameter(body, var_App, parameter_App) | ||
529 | )); | ||
530 | // ApplicationInstance.allocatedTo(App, _) | ||
531 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
532 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
533 | new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo"))); | ||
534 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
535 | new Equality(body, var__virtual_0_, var___0_); | ||
536 | bodies.add(body); | ||
537 | } | ||
538 | return bodies; | ||
539 | } | ||
540 | } | ||
541 | } | ||
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..a4f039d9 --- /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,36 @@ | |||
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 | ||
12 | /.AvailableHdd.java._trace | ||
13 | /.AvailableMemory.java._trace | ||
14 | /.CpsApplications.java._trace | ||
15 | /.CpsHosts.java._trace | ||
16 | /.TotalHdd.java._trace | ||
17 | /.TotalMemory.java._trace | ||
18 | /.RequiredAppInstances.java._trace | ||
19 | /.UnallocatedAppInstance.java._trace | ||
20 | /.NoHostToAllocateTo.java._trace | ||
21 | /AvailableHdd.java | ||
22 | /AvailableMemory.java | ||
23 | /CpsApplications.java | ||
24 | /CpsHosts.java | ||
25 | /CpsQueriesAll.java | ||
26 | /FreeHddPercentage.java | ||
27 | /FreeMemoryPercentage.java | ||
28 | /HddRequirement.java | ||
29 | /HostInstanceCost.java | ||
30 | /MemoryRequirement.java | ||
31 | /NoHostToAllocateTo.java | ||
32 | /RequiredAppInstances.java | ||
33 | /SatisfyingInstance.java | ||
34 | /TotalHdd.java | ||
35 | /TotalMemory.java | ||
36 | /UnallocatedAppInstance.java | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableHdd.java new file mode 100644 index 00000000..7d07b83a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableHdd.java | |||
@@ -0,0 +1,178 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Set; | ||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.aggregators.sum; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
33 | import 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 availableHdd(Host : HostInstance, Hdd : java Integer) { | ||
41 | * find totalHdd(Host, TotalHdd); | ||
42 | * RequiredHdd == sum find hddRequirement(Host, _, #_); | ||
43 | * Hdd == eval(TotalHdd - RequiredHdd); | ||
44 | * } | ||
45 | * </pre></code> | ||
46 | * | ||
47 | * @see GenericPatternMatcher | ||
48 | * @see GenericPatternMatch | ||
49 | * | ||
50 | */ | ||
51 | @SuppressWarnings("all") | ||
52 | public final class AvailableHdd extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
53 | private AvailableHdd() { | ||
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 AvailableHdd 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.cps.queries.internal.AvailableHdd (visibility: PUBLIC, simpleName: AvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd, 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 | ||
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.cps.queries.internal.AvailableHdd (visibility: PUBLIC, simpleName: AvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd, 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()}. | ||
74 | * | ||
75 | * <p> This workaround is required e.g. to support recursion. | ||
76 | * | ||
77 | */ | ||
78 | private static class LazyHolder { | ||
79 | private static final AvailableHdd INSTANCE = new AvailableHdd(); | ||
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 AvailableHdd.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
98 | |||
99 | 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); | ||
100 | |||
101 | private final PParameter parameter_Hdd = new PParameter("Hdd", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT); | ||
102 | |||
103 | private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Hdd); | ||
104 | |||
105 | private GeneratedPQuery() { | ||
106 | super(PVisibility.PRIVATE); | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public String getFullyQualifiedName() { | ||
111 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd"; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public List<String> getParameterNames() { | ||
116 | return Arrays.asList("Host","Hdd"); | ||
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_Host = body.getOrCreateVariableByName("Host"); | ||
131 | PVariable var_Hdd = body.getOrCreateVariableByName("Hdd"); | ||
132 | PVariable var_TotalHdd = body.getOrCreateVariableByName("TotalHdd"); | ||
133 | PVariable var_RequiredHdd = body.getOrCreateVariableByName("RequiredHdd"); | ||
134 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
135 | PVariable var___1_ = body.getOrCreateVariableByName("_<1>"); | ||
136 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
137 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Hdd), new JavaTransitiveInstancesKey(java.lang.Integer.class)); | ||
138 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
139 | new ExportedParameter(body, var_Host, parameter_Host), | ||
140 | new ExportedParameter(body, var_Hdd, parameter_Hdd) | ||
141 | )); | ||
142 | // find totalHdd(Host, TotalHdd) | ||
143 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_TotalHdd), TotalHdd.instance().getInternalQueryRepresentation()); | ||
144 | // RequiredHdd == sum find hddRequirement(Host, _, #_) | ||
145 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
146 | new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var_Host, var___0_, var___1_), HddRequirement.instance().getInternalQueryRepresentation(), var__virtual_0_, 2); | ||
147 | new Equality(body, var_RequiredHdd, var__virtual_0_); | ||
148 | // Hdd == eval(TotalHdd - RequiredHdd) | ||
149 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
150 | new ExpressionEvaluation(body, new IExpressionEvaluator() { | ||
151 | |||
152 | @Override | ||
153 | public String getShortDescription() { | ||
154 | return "Expression evaluation from pattern availableHdd"; | ||
155 | } | ||
156 | |||
157 | @Override | ||
158 | public Iterable<String> getInputParameterNames() { | ||
159 | return Arrays.asList("RequiredHdd", "TotalHdd");} | ||
160 | |||
161 | @Override | ||
162 | public Object evaluateExpression(IValueProvider provider) throws Exception { | ||
163 | Integer RequiredHdd = (Integer) provider.getValue("RequiredHdd"); | ||
164 | Integer TotalHdd = (Integer) provider.getValue("TotalHdd"); | ||
165 | return evaluateExpression_1_1(RequiredHdd, TotalHdd); | ||
166 | } | ||
167 | }, var__virtual_1_ ); | ||
168 | new Equality(body, var_Hdd, var__virtual_1_); | ||
169 | bodies.add(body); | ||
170 | } | ||
171 | return bodies; | ||
172 | } | ||
173 | } | ||
174 | |||
175 | private static int evaluateExpression_1_1(final Integer RequiredHdd, final Integer TotalHdd) { | ||
176 | return ((TotalHdd).intValue() - (RequiredHdd).intValue()); | ||
177 | } | ||
178 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableMemory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableMemory.java new file mode 100644 index 00000000..b06544d5 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableMemory.java | |||
@@ -0,0 +1,178 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Set; | ||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.aggregators.sum; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
33 | import 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 availableMemory(Host : HostInstance, Memory : java Integer) { | ||
41 | * find totalMemory(Host, TotalMemory); | ||
42 | * RequiredMemory == sum find memoryRequirement(Host, _, #_); | ||
43 | * Memory == eval(TotalMemory - RequiredMemory); | ||
44 | * } | ||
45 | * </pre></code> | ||
46 | * | ||
47 | * @see GenericPatternMatcher | ||
48 | * @see GenericPatternMatch | ||
49 | * | ||
50 | */ | ||
51 | @SuppressWarnings("all") | ||
52 | public final class AvailableMemory extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
53 | private AvailableMemory() { | ||
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 AvailableMemory 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.cps.queries.internal.AvailableMemory (visibility: PUBLIC, simpleName: AvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory, 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 | ||
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.cps.queries.internal.AvailableMemory (visibility: PUBLIC, simpleName: AvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory, 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()}. | ||
74 | * | ||
75 | * <p> This workaround is required e.g. to support recursion. | ||
76 | * | ||
77 | */ | ||
78 | private static class LazyHolder { | ||
79 | private static final AvailableMemory INSTANCE = new AvailableMemory(); | ||
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 AvailableMemory.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
98 | |||
99 | 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); | ||
100 | |||
101 | private final PParameter parameter_Memory = new PParameter("Memory", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT); | ||
102 | |||
103 | private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Memory); | ||
104 | |||
105 | private GeneratedPQuery() { | ||
106 | super(PVisibility.PRIVATE); | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public String getFullyQualifiedName() { | ||
111 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory"; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public List<String> getParameterNames() { | ||
116 | return Arrays.asList("Host","Memory"); | ||
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_Host = body.getOrCreateVariableByName("Host"); | ||
131 | PVariable var_Memory = body.getOrCreateVariableByName("Memory"); | ||
132 | PVariable var_TotalMemory = body.getOrCreateVariableByName("TotalMemory"); | ||
133 | PVariable var_RequiredMemory = body.getOrCreateVariableByName("RequiredMemory"); | ||
134 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
135 | PVariable var___1_ = body.getOrCreateVariableByName("_<1>"); | ||
136 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
137 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Memory), new JavaTransitiveInstancesKey(java.lang.Integer.class)); | ||
138 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
139 | new ExportedParameter(body, var_Host, parameter_Host), | ||
140 | new ExportedParameter(body, var_Memory, parameter_Memory) | ||
141 | )); | ||
142 | // find totalMemory(Host, TotalMemory) | ||
143 | new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_TotalMemory), TotalMemory.instance().getInternalQueryRepresentation()); | ||
144 | // RequiredMemory == sum find memoryRequirement(Host, _, #_) | ||
145 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
146 | new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var_Host, var___0_, var___1_), MemoryRequirement.instance().getInternalQueryRepresentation(), var__virtual_0_, 2); | ||
147 | new Equality(body, var_RequiredMemory, var__virtual_0_); | ||
148 | // Memory == eval(TotalMemory - RequiredMemory) | ||
149 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
150 | new ExpressionEvaluation(body, new IExpressionEvaluator() { | ||
151 | |||
152 | @Override | ||
153 | public String getShortDescription() { | ||
154 | return "Expression evaluation from pattern availableMemory"; | ||
155 | } | ||
156 | |||
157 | @Override | ||
158 | public Iterable<String> getInputParameterNames() { | ||
159 | return Arrays.asList("RequiredMemory", "TotalMemory");} | ||
160 | |||
161 | @Override | ||
162 | public Object evaluateExpression(IValueProvider provider) throws Exception { | ||
163 | Integer RequiredMemory = (Integer) provider.getValue("RequiredMemory"); | ||
164 | Integer TotalMemory = (Integer) provider.getValue("TotalMemory"); | ||
165 | return evaluateExpression_1_1(RequiredMemory, TotalMemory); | ||
166 | } | ||
167 | }, var__virtual_1_ ); | ||
168 | new Equality(body, var_Memory, var__virtual_1_); | ||
169 | bodies.add(body); | ||
170 | } | ||
171 | return bodies; | ||
172 | } | ||
173 | } | ||
174 | |||
175 | private static int evaluateExpression_1_1(final Integer RequiredMemory, final Integer TotalMemory) { | ||
176 | return ((TotalMemory).intValue() - (RequiredMemory).intValue()); | ||
177 | } | ||
178 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsApplications.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsApplications.java new file mode 100644 index 00000000..23867558 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsApplications.java | |||
@@ -0,0 +1,141 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.LinkedHashSet; | ||
8 | import java.util.List; | ||
9 | import java.util.Set; | ||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import 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 cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) { | ||
32 | * CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance); | ||
33 | * } | ||
34 | * </pre></code> | ||
35 | * | ||
36 | * @see GenericPatternMatcher | ||
37 | * @see GenericPatternMatch | ||
38 | * | ||
39 | */ | ||
40 | @SuppressWarnings("all") | ||
41 | public final class CpsApplications extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
42 | private CpsApplications() { | ||
43 | super(GeneratedPQuery.INSTANCE); | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * @return the singleton instance of the query specification | ||
48 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
49 | * | ||
50 | */ | ||
51 | public static CpsApplications instance() { | ||
52 | try{ | ||
53 | return LazyHolder.INSTANCE; | ||
54 | } catch (ExceptionInInitializerError err) { | ||
55 | throw processInitializerError(err); | ||
56 | } | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications (visibility: PUBLIC, simpleName: CpsApplications, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications, 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 | ||
61 | * <b>not</b> at the class load time of the outer class, | ||
62 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications (visibility: PUBLIC, simpleName: CpsApplications, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications, 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()}. | ||
63 | * | ||
64 | * <p> This workaround is required e.g. to support recursion. | ||
65 | * | ||
66 | */ | ||
67 | private static class LazyHolder { | ||
68 | private static final CpsApplications INSTANCE = new CpsApplications(); | ||
69 | |||
70 | /** | ||
71 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
72 | * This initialization order is required to support indirect recursion. | ||
73 | * | ||
74 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
75 | * | ||
76 | */ | ||
77 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
78 | |||
79 | public static Object ensureInitialized() { | ||
80 | INSTANCE.ensureInitializedInternal(); | ||
81 | return null; | ||
82 | } | ||
83 | } | ||
84 | |||
85 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
86 | private static final CpsApplications.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
87 | |||
88 | 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); | ||
89 | |||
90 | 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); | ||
91 | |||
92 | private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_AppInstance); | ||
93 | |||
94 | private GeneratedPQuery() { | ||
95 | super(PVisibility.PRIVATE); | ||
96 | } | ||
97 | |||
98 | @Override | ||
99 | public String getFullyQualifiedName() { | ||
100 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications"; | ||
101 | } | ||
102 | |||
103 | @Override | ||
104 | public List<String> getParameterNames() { | ||
105 | return Arrays.asList("Cps","AppInstance"); | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public List<PParameter> getParameters() { | ||
110 | return parameters; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public Set<PBody> doGetContainedBodies() { | ||
115 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
116 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
117 | { | ||
118 | PBody body = new PBody(this); | ||
119 | PVariable var_Cps = body.getOrCreateVariableByName("Cps"); | ||
120 | PVariable var_AppInstance = body.getOrCreateVariableByName("AppInstance"); | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem"))); | ||
122 | new TypeConstraint(body, Tuples.flatTupleOf(var_AppInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
123 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
124 | new ExportedParameter(body, var_Cps, parameter_Cps), | ||
125 | new ExportedParameter(body, var_AppInstance, parameter_AppInstance) | ||
126 | )); | ||
127 | // CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance) | ||
128 | new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem"))); | ||
129 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
130 | new TypeConstraint(body, Tuples.flatTupleOf(var_Cps, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "CyberPhysicalSystem", "applicationTypes"))); | ||
131 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType"))); | ||
132 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "instances"))); | ||
134 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
135 | new Equality(body, var__virtual_1_, var_AppInstance); | ||
136 | bodies.add(body); | ||
137 | } | ||
138 | return bodies; | ||
139 | } | ||
140 | } | ||
141 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsHosts.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsHosts.java new file mode 100644 index 00000000..e55bddff --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsHosts.java | |||
@@ -0,0 +1,141 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.LinkedHashSet; | ||
8 | import java.util.List; | ||
9 | import java.util.Set; | ||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import 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 cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) { | ||
32 | * CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance); | ||
33 | * } | ||
34 | * </pre></code> | ||
35 | * | ||
36 | * @see GenericPatternMatcher | ||
37 | * @see GenericPatternMatch | ||
38 | * | ||
39 | */ | ||
40 | @SuppressWarnings("all") | ||
41 | public final class CpsHosts extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
42 | private CpsHosts() { | ||
43 | super(GeneratedPQuery.INSTANCE); | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * @return the singleton instance of the query specification | ||
48 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
49 | * | ||
50 | */ | ||
51 | public static CpsHosts instance() { | ||
52 | try{ | ||
53 | return LazyHolder.INSTANCE; | ||
54 | } catch (ExceptionInInitializerError err) { | ||
55 | throw processInitializerError(err); | ||
56 | } | ||
57 | } | ||
58 | |||
59 | /** | ||
60 | * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts (visibility: PUBLIC, simpleName: CpsHosts, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts, 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 | ||
61 | * <b>not</b> at the class load time of the outer class, | ||
62 | * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts (visibility: PUBLIC, simpleName: CpsHosts, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts, 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()}. | ||
63 | * | ||
64 | * <p> This workaround is required e.g. to support recursion. | ||
65 | * | ||
66 | */ | ||
67 | private static class LazyHolder { | ||
68 | private static final CpsHosts INSTANCE = new CpsHosts(); | ||
69 | |||
70 | /** | ||
71 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
72 | * This initialization order is required to support indirect recursion. | ||
73 | * | ||
74 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
75 | * | ||
76 | */ | ||
77 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
78 | |||
79 | public static Object ensureInitialized() { | ||
80 | INSTANCE.ensureInitializedInternal(); | ||
81 | return null; | ||
82 | } | ||
83 | } | ||
84 | |||
85 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
86 | private static final CpsHosts.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
87 | |||
88 | 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); | ||
89 | |||
90 | 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); | ||
91 | |||
92 | private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_HostInstance); | ||
93 | |||
94 | private GeneratedPQuery() { | ||
95 | super(PVisibility.PRIVATE); | ||
96 | } | ||
97 | |||
98 | @Override | ||
99 | public String getFullyQualifiedName() { | ||
100 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts"; | ||
101 | } | ||
102 | |||
103 | @Override | ||
104 | public List<String> getParameterNames() { | ||
105 | return Arrays.asList("Cps","HostInstance"); | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public List<PParameter> getParameters() { | ||
110 | return parameters; | ||
111 | } | ||
112 | |||
113 | @Override | ||
114 | public Set<PBody> doGetContainedBodies() { | ||
115 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
116 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
117 | { | ||
118 | PBody body = new PBody(this); | ||
119 | PVariable var_Cps = body.getOrCreateVariableByName("Cps"); | ||
120 | PVariable var_HostInstance = body.getOrCreateVariableByName("HostInstance"); | ||
121 | new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem"))); | ||
122 | new TypeConstraint(body, Tuples.flatTupleOf(var_HostInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
123 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
124 | new ExportedParameter(body, var_Cps, parameter_Cps), | ||
125 | new ExportedParameter(body, var_HostInstance, parameter_HostInstance) | ||
126 | )); | ||
127 | // CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance) | ||
128 | new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem"))); | ||
129 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
130 | new TypeConstraint(body, Tuples.flatTupleOf(var_Cps, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "CyberPhysicalSystem", "hostTypes"))); | ||
131 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
132 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "instances"))); | ||
134 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
135 | new Equality(body, var__virtual_1_, var_HostInstance); | ||
136 | bodies.add(body); | ||
137 | } | ||
138 | return bodies; | ||
139 | } | ||
140 | } | ||
141 | } | ||
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..67f75e1d --- /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,132 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement; | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric; | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric; | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric; | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost; | ||
12 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance; | ||
13 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective; | ||
14 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement; | ||
15 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd; | ||
16 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory; | ||
17 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost; | ||
18 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance; | ||
19 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied; | ||
20 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement; | ||
21 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.UnallocateAppInstance; | ||
22 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd; | ||
23 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory; | ||
24 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications; | ||
25 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts; | ||
26 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage; | ||
27 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage; | ||
28 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement; | ||
29 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost; | ||
30 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement; | ||
31 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.NoHostToAllocateTo; | ||
32 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.RequiredAppInstances; | ||
33 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance; | ||
34 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd; | ||
35 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory; | ||
36 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance; | ||
37 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; | ||
38 | |||
39 | /** | ||
40 | * A pattern group formed of all patterns defined in CpsQueries.vql. | ||
41 | * | ||
42 | * <p>A private group that includes private patterns as well. Only intended use case is for pattern testing. | ||
43 | * | ||
44 | * <p> From package hu.bme.mit.inf.dslreasoner.domains.cps.queries, the group contains the definition of the following patterns: <ul> | ||
45 | * <li>cpsApplications</li> | ||
46 | * <li>cpsHosts</li> | ||
47 | * <li>totalMemory</li> | ||
48 | * <li>totalHdd</li> | ||
49 | * <li>availableMemory</li> | ||
50 | * <li>memoryRequirement</li> | ||
51 | * <li>availableHdd</li> | ||
52 | * <li>hddRequirement</li> | ||
53 | * <li>resourceRequirement</li> | ||
54 | * <li>allocationWithoutResourceRequirement</li> | ||
55 | * <li>notEnoughAvailableMemory</li> | ||
56 | * <li>notEnoughAvailableHdd</li> | ||
57 | * <li>instanceDoesNotSatisfyRequirement</li> | ||
58 | * <li>satisfyingInstance</li> | ||
59 | * <li>requirementNotSatisfied</li> | ||
60 | * <li>redundantInstancesOnSameHost</li> | ||
61 | * <li>averageFreeMemoryMetric</li> | ||
62 | * <li>freeMemoryPercentage</li> | ||
63 | * <li>averageFreeHddMetric</li> | ||
64 | * <li>freeHddPercentage</li> | ||
65 | * <li>costMetric</li> | ||
66 | * <li>cpsCost</li> | ||
67 | * <li>hostInstanceCost</li> | ||
68 | * <li>allocate</li> | ||
69 | * <li>unallocateAppInstance</li> | ||
70 | * <li>createHostInstance</li> | ||
71 | * <li>removeHostInstance</li> | ||
72 | * <li>unallocatedAppInstance</li> | ||
73 | * <li>requiredAppInstances</li> | ||
74 | * <li>noHostToAllocateTo</li> | ||
75 | * <li>guidanceObjective</li> | ||
76 | * </ul> | ||
77 | * | ||
78 | * @see IQueryGroup | ||
79 | * | ||
80 | */ | ||
81 | @SuppressWarnings("all") | ||
82 | public final class CpsQueriesAll extends BaseGeneratedPatternGroup { | ||
83 | /** | ||
84 | * Access the pattern group. | ||
85 | * | ||
86 | * @return the singleton instance of the group | ||
87 | * @throws ViatraQueryRuntimeException if there was an error loading the generated code of pattern specifications | ||
88 | * | ||
89 | */ | ||
90 | public static CpsQueriesAll instance() { | ||
91 | if (INSTANCE == null) { | ||
92 | INSTANCE = new CpsQueriesAll(); | ||
93 | } | ||
94 | return INSTANCE; | ||
95 | } | ||
96 | |||
97 | private static CpsQueriesAll INSTANCE; | ||
98 | |||
99 | private CpsQueriesAll() { | ||
100 | querySpecifications.add(CpsApplications.instance()); | ||
101 | querySpecifications.add(CpsHosts.instance()); | ||
102 | querySpecifications.add(TotalMemory.instance()); | ||
103 | querySpecifications.add(TotalHdd.instance()); | ||
104 | querySpecifications.add(AvailableMemory.instance()); | ||
105 | querySpecifications.add(MemoryRequirement.instance()); | ||
106 | querySpecifications.add(AvailableHdd.instance()); | ||
107 | querySpecifications.add(HddRequirement.instance()); | ||
108 | querySpecifications.add(ResourceRequirement.instance()); | ||
109 | querySpecifications.add(AllocationWithoutResourceRequirement.instance()); | ||
110 | querySpecifications.add(NotEnoughAvailableMemory.instance()); | ||
111 | querySpecifications.add(NotEnoughAvailableHdd.instance()); | ||
112 | querySpecifications.add(InstanceDoesNotSatisfyRequirement.instance()); | ||
113 | querySpecifications.add(SatisfyingInstance.instance()); | ||
114 | querySpecifications.add(RequirementNotSatisfied.instance()); | ||
115 | querySpecifications.add(RedundantInstancesOnSameHost.instance()); | ||
116 | querySpecifications.add(AverageFreeMemoryMetric.instance()); | ||
117 | querySpecifications.add(FreeMemoryPercentage.instance()); | ||
118 | querySpecifications.add(AverageFreeHddMetric.instance()); | ||
119 | querySpecifications.add(FreeHddPercentage.instance()); | ||
120 | querySpecifications.add(CostMetric.instance()); | ||
121 | querySpecifications.add(CpsCost.instance()); | ||
122 | querySpecifications.add(HostInstanceCost.instance()); | ||
123 | querySpecifications.add(Allocate.instance()); | ||
124 | querySpecifications.add(UnallocateAppInstance.instance()); | ||
125 | querySpecifications.add(CreateHostInstance.instance()); | ||
126 | querySpecifications.add(RemoveHostInstance.instance()); | ||
127 | querySpecifications.add(UnallocatedAppInstance.instance()); | ||
128 | querySpecifications.add(RequiredAppInstances.instance()); | ||
129 | querySpecifications.add(NoHostToAllocateTo.instance()); | ||
130 | querySpecifications.add(GuidanceObjective.instance()); | ||
131 | } | ||
132 | } | ||
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..c24f46a1 --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Set; | ||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
31 | import 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") | ||
50 | public 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..c2bb2bb3 --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Set; | ||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
31 | import 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") | ||
50 | public 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..68448930 --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.EDataType; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
17 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
28 | import 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") | ||
46 | public 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..db7f7021 --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.EDataType; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
17 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
28 | import 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") | ||
46 | public 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..d15f9bfa --- /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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.EDataType; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
17 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
28 | import 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") | ||
46 | public 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/NoHostToAllocateTo.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/NoHostToAllocateTo.java new file mode 100644 index 00000000..50597805 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/NoHostToAllocateTo.java | |||
@@ -0,0 +1,135 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate; | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance; | ||
8 | import java.util.Arrays; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Set; | ||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
26 | import 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 noHostToAllocateTo(App : ApplicationInstance) { | ||
34 | * find unallocatedAppInstance(App); | ||
35 | * neg find allocate(App, _); | ||
36 | * } | ||
37 | * </pre></code> | ||
38 | * | ||
39 | * @see GenericPatternMatcher | ||
40 | * @see GenericPatternMatch | ||
41 | * | ||
42 | */ | ||
43 | @SuppressWarnings("all") | ||
44 | public final class NoHostToAllocateTo extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
45 | private NoHostToAllocateTo() { | ||
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 NoHostToAllocateTo 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.NoHostToAllocateTo (visibility: PUBLIC, simpleName: NoHostToAllocateTo, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.NoHostToAllocateTo, 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.NoHostToAllocateTo (visibility: PUBLIC, simpleName: NoHostToAllocateTo, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.NoHostToAllocateTo, 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 NoHostToAllocateTo INSTANCE = new NoHostToAllocateTo(); | ||
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 NoHostToAllocateTo.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
90 | |||
91 | 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); | ||
92 | |||
93 | private final List<PParameter> parameters = Arrays.asList(parameter_App); | ||
94 | |||
95 | private GeneratedPQuery() { | ||
96 | super(PVisibility.PRIVATE); | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public String getFullyQualifiedName() { | ||
101 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.noHostToAllocateTo"; | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public List<String> getParameterNames() { | ||
106 | return Arrays.asList("App"); | ||
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_App = body.getOrCreateVariableByName("App"); | ||
121 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
122 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
123 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
124 | new ExportedParameter(body, var_App, parameter_App) | ||
125 | )); | ||
126 | // find unallocatedAppInstance(App) | ||
127 | new PositivePatternCall(body, Tuples.flatTupleOf(var_App), UnallocatedAppInstance.instance().getInternalQueryRepresentation()); | ||
128 | // neg find allocate(App, _) | ||
129 | new NegativePatternCall(body, Tuples.flatTupleOf(var_App, var___0_), Allocate.instance().getInternalQueryRepresentation()); | ||
130 | bodies.add(body); | ||
131 | } | ||
132 | return bodies; | ||
133 | } | ||
134 | } | ||
135 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/RequiredAppInstances.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/RequiredAppInstances.java new file mode 100644 index 00000000..dc76cbde --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/RequiredAppInstances.java | |||
@@ -0,0 +1,181 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.emf.ecore.EDataType; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
14 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
17 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
26 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation; | ||
27 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
33 | import 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 requiredAppInstances(Req : Requirement, Remaining : java Integer) { | ||
41 | * Instances == count find satisfyingInstance(Req, _); | ||
42 | * Requirement.count(Req, RequiredCount); | ||
43 | * Remaining == eval(RequiredCount - Instances); | ||
44 | * } | ||
45 | * </pre></code> | ||
46 | * | ||
47 | * @see GenericPatternMatcher | ||
48 | * @see GenericPatternMatch | ||
49 | * | ||
50 | */ | ||
51 | @SuppressWarnings("all") | ||
52 | public final class RequiredAppInstances extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
53 | private RequiredAppInstances() { | ||
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 RequiredAppInstances 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.cps.queries.internal.RequiredAppInstances (visibility: PUBLIC, simpleName: RequiredAppInstances, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.RequiredAppInstances, 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 | ||
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.cps.queries.internal.RequiredAppInstances (visibility: PUBLIC, simpleName: RequiredAppInstances, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.RequiredAppInstances, 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()}. | ||
74 | * | ||
75 | * <p> This workaround is required e.g. to support recursion. | ||
76 | * | ||
77 | */ | ||
78 | private static class LazyHolder { | ||
79 | private static final RequiredAppInstances INSTANCE = new RequiredAppInstances(); | ||
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 RequiredAppInstances.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
98 | |||
99 | 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); | ||
100 | |||
101 | private final PParameter parameter_Remaining = new PParameter("Remaining", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT); | ||
102 | |||
103 | private final List<PParameter> parameters = Arrays.asList(parameter_Req, parameter_Remaining); | ||
104 | |||
105 | private GeneratedPQuery() { | ||
106 | super(PVisibility.PRIVATE); | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public String getFullyQualifiedName() { | ||
111 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.requiredAppInstances"; | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public List<String> getParameterNames() { | ||
116 | return Arrays.asList("Req","Remaining"); | ||
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_Req = body.getOrCreateVariableByName("Req"); | ||
131 | PVariable var_Remaining = body.getOrCreateVariableByName("Remaining"); | ||
132 | PVariable var_Instances = body.getOrCreateVariableByName("Instances"); | ||
133 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
134 | PVariable var_RequiredCount = body.getOrCreateVariableByName("RequiredCount"); | ||
135 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement"))); | ||
136 | new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Remaining), new JavaTransitiveInstancesKey(java.lang.Integer.class)); | ||
137 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
138 | new ExportedParameter(body, var_Req, parameter_Req), | ||
139 | new ExportedParameter(body, var_Remaining, parameter_Remaining) | ||
140 | )); | ||
141 | // Instances == count find satisfyingInstance(Req, _) | ||
142 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
143 | new PatternMatchCounter(body, Tuples.flatTupleOf(var_Req, var___0_), SatisfyingInstance.instance().getInternalQueryRepresentation(), var__virtual_0_); | ||
144 | new Equality(body, var_Instances, var__virtual_0_); | ||
145 | // Requirement.count(Req, RequiredCount) | ||
146 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "Requirement"))); | ||
147 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
148 | new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "Requirement", "count"))); | ||
149 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
150 | new Equality(body, var__virtual_1_, var_RequiredCount); | ||
151 | // Remaining == eval(RequiredCount - Instances) | ||
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 requiredAppInstances"; | ||
158 | } | ||
159 | |||
160 | @Override | ||
161 | public Iterable<String> getInputParameterNames() { | ||
162 | return Arrays.asList("Instances", "RequiredCount");} | ||
163 | |||
164 | @Override | ||
165 | public Object evaluateExpression(IValueProvider provider) throws Exception { | ||
166 | Integer Instances = (Integer) provider.getValue("Instances"); | ||
167 | Integer RequiredCount = (Integer) provider.getValue("RequiredCount"); | ||
168 | return evaluateExpression_1_1(Instances, RequiredCount); | ||
169 | } | ||
170 | }, var__virtual_2_ ); | ||
171 | new Equality(body, var_Remaining, var__virtual_2_); | ||
172 | bodies.add(body); | ||
173 | } | ||
174 | return bodies; | ||
175 | } | ||
176 | } | ||
177 | |||
178 | private static int evaluateExpression_1_1(final Integer Instances, final Integer RequiredCount) { | ||
179 | return ((RequiredCount).intValue() - (Instances).intValue()); | ||
180 | } | ||
181 | } | ||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.LinkedHashSet; | ||
8 | import java.util.List; | ||
9 | import java.util.Set; | ||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
13 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
24 | import 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") | ||
43 | public 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-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalHdd.java new file mode 100644 index 00000000..f250f76d --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalHdd.java | |||
@@ -0,0 +1,143 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.LinkedHashSet; | ||
8 | import java.util.List; | ||
9 | import java.util.Set; | ||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.emf.ecore.EDataType; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
26 | import 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 totalHdd(Host : HostInstance, Hdd : EInt) { | ||
34 | * HostInstance.type.defaultHdd(Host, Hdd); | ||
35 | * } | ||
36 | * </pre></code> | ||
37 | * | ||
38 | * @see GenericPatternMatcher | ||
39 | * @see GenericPatternMatch | ||
40 | * | ||
41 | */ | ||
42 | @SuppressWarnings("all") | ||
43 | public final class TotalHdd extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
44 | private TotalHdd() { | ||
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 TotalHdd 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.TotalHdd (visibility: PUBLIC, simpleName: TotalHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd, 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.TotalHdd (visibility: PUBLIC, simpleName: TotalHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd, 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 TotalHdd INSTANCE = new TotalHdd(); | ||
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 TotalHdd.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
89 | |||
90 | 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); | ||
91 | |||
92 | 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); | ||
93 | |||
94 | private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Hdd); | ||
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.totalHdd"; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public List<String> getParameterNames() { | ||
107 | return Arrays.asList("Host","Hdd"); | ||
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_Host = body.getOrCreateVariableByName("Host"); | ||
122 | PVariable var_Hdd = body.getOrCreateVariableByName("Hdd"); | ||
123 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
124 | new TypeConstraint(body, Tuples.flatTupleOf(var_Hdd), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
125 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
126 | new ExportedParameter(body, var_Host, parameter_Host), | ||
127 | new ExportedParameter(body, var_Hdd, parameter_Hdd) | ||
128 | )); | ||
129 | // HostInstance.type.defaultHdd(Host, Hdd) | ||
130 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
131 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
132 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type"))); | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
134 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
135 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "defaultHdd"))); | ||
136 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
137 | new Equality(body, var__virtual_1_, var_Hdd); | ||
138 | bodies.add(body); | ||
139 | } | ||
140 | return bodies; | ||
141 | } | ||
142 | } | ||
143 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalMemory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalMemory.java new file mode 100644 index 00000000..aecd97e2 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalMemory.java | |||
@@ -0,0 +1,143 @@ | |||
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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.LinkedHashSet; | ||
8 | import java.util.List; | ||
9 | import java.util.Set; | ||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.emf.ecore.EDataType; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey; | ||
16 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
26 | import 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 totalMemory(Host : HostInstance, Memory : EInt) { | ||
34 | * HostInstance.type.defaultMemory(Host, Memory); | ||
35 | * } | ||
36 | * </pre></code> | ||
37 | * | ||
38 | * @see GenericPatternMatcher | ||
39 | * @see GenericPatternMatch | ||
40 | * | ||
41 | */ | ||
42 | @SuppressWarnings("all") | ||
43 | public final class TotalMemory extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
44 | private TotalMemory() { | ||
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 TotalMemory 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.TotalMemory (visibility: PUBLIC, simpleName: TotalMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory, 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.TotalMemory (visibility: PUBLIC, simpleName: TotalMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory, 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 TotalMemory INSTANCE = new TotalMemory(); | ||
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 TotalMemory.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
89 | |||
90 | 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); | ||
91 | |||
92 | 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); | ||
93 | |||
94 | private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Memory); | ||
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.totalMemory"; | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public List<String> getParameterNames() { | ||
107 | return Arrays.asList("Host","Memory"); | ||
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_Host = body.getOrCreateVariableByName("Host"); | ||
122 | PVariable var_Memory = body.getOrCreateVariableByName("Memory"); | ||
123 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
124 | new TypeConstraint(body, Tuples.flatTupleOf(var_Memory), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
125 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
126 | new ExportedParameter(body, var_Host, parameter_Host), | ||
127 | new ExportedParameter(body, var_Memory, parameter_Memory) | ||
128 | )); | ||
129 | // HostInstance.type.defaultMemory(Host, Memory) | ||
130 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
131 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
132 | new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type"))); | ||
133 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType"))); | ||
134 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
135 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "defaultMemory"))); | ||
136 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); | ||
137 | new Equality(body, var__virtual_1_, var_Memory); | ||
138 | bodies.add(body); | ||
139 | } | ||
140 | return bodies; | ||
141 | } | ||
142 | } | ||
143 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/UnallocatedAppInstance.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/UnallocatedAppInstance.java new file mode 100644 index 00000000..a20b534c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/UnallocatedAppInstance.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 | */ | ||
4 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; | ||
5 | |||
6 | import java.util.Arrays; | ||
7 | import java.util.Collections; | ||
8 | import java.util.LinkedHashSet; | ||
9 | import java.util.List; | ||
10 | import java.util.Set; | ||
11 | import org.eclipse.emf.ecore.EClass; | ||
12 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
13 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher; | ||
14 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
15 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
16 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
17 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
18 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
19 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
20 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
21 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall; | ||
22 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
23 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
24 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
25 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
26 | import 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 unallocatedAppInstance(App : ApplicationInstance) { | ||
34 | * neg ApplicationInstance.allocatedTo(App, _); | ||
35 | * } | ||
36 | * </pre></code> | ||
37 | * | ||
38 | * @see GenericPatternMatcher | ||
39 | * @see GenericPatternMatch | ||
40 | * | ||
41 | */ | ||
42 | @SuppressWarnings("all") | ||
43 | public final class UnallocatedAppInstance extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher { | ||
44 | private UnallocatedAppInstance() { | ||
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 UnallocatedAppInstance 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.UnallocatedAppInstance (visibility: PUBLIC, simpleName: UnallocatedAppInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance, 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.UnallocatedAppInstance (visibility: PUBLIC, simpleName: UnallocatedAppInstance, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance, 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 UnallocatedAppInstance INSTANCE = new UnallocatedAppInstance(); | ||
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 UnallocatedAppInstance.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
89 | |||
90 | 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); | ||
91 | |||
92 | private final List<PParameter> parameters = Arrays.asList(parameter_App); | ||
93 | |||
94 | private class Embedded_1_ApplicationInstance_allocatedTo extends BaseGeneratedEMFPQuery { | ||
95 | private final PParameter parameter_p0 = new PParameter("p0", "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_p1 = new PParameter("p1", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT); | ||
98 | |||
99 | private final List<PParameter> embeddedParameters = Arrays.asList(parameter_p0, parameter_p1); | ||
100 | |||
101 | public Embedded_1_ApplicationInstance_allocatedTo() { | ||
102 | super(PVisibility.EMBEDDED); | ||
103 | } | ||
104 | |||
105 | @Override | ||
106 | public String getFullyQualifiedName() { | ||
107 | return GeneratedPQuery.this.getFullyQualifiedName() + "$Embedded_1_ApplicationInstance_allocatedTo"; | ||
108 | } | ||
109 | |||
110 | @Override | ||
111 | public List<PParameter> getParameters() { | ||
112 | return embeddedParameters; | ||
113 | } | ||
114 | |||
115 | @Override | ||
116 | public Set<PBody> doGetContainedBodies() { | ||
117 | PBody body = new PBody(this); | ||
118 | PVariable var_p0 = body.getOrCreateVariableByName("p0"); | ||
119 | PVariable var_p1 = body.getOrCreateVariableByName("p1"); | ||
120 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
121 | new ExportedParameter(body, var_p0, parameter_p0), | ||
122 | new ExportedParameter(body, var_p1, parameter_p1) | ||
123 | )); | ||
124 | // ApplicationInstance.allocatedTo(App, _) | ||
125 | new TypeConstraint(body, Tuples.flatTupleOf(var_p0), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
126 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
127 | new TypeConstraint(body, Tuples.flatTupleOf(var_p0, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo"))); | ||
128 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); | ||
129 | new Equality(body, var__virtual_0_, var_p1); | ||
130 | return Collections.singleton(body); | ||
131 | } | ||
132 | } | ||
133 | |||
134 | private GeneratedPQuery() { | ||
135 | super(PVisibility.PRIVATE); | ||
136 | } | ||
137 | |||
138 | @Override | ||
139 | public String getFullyQualifiedName() { | ||
140 | return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.unallocatedAppInstance"; | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public List<String> getParameterNames() { | ||
145 | return Arrays.asList("App"); | ||
146 | } | ||
147 | |||
148 | @Override | ||
149 | public List<PParameter> getParameters() { | ||
150 | return parameters; | ||
151 | } | ||
152 | |||
153 | @Override | ||
154 | public Set<PBody> doGetContainedBodies() { | ||
155 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
156 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
157 | { | ||
158 | PBody body = new PBody(this); | ||
159 | PVariable var_App = body.getOrCreateVariableByName("App"); | ||
160 | PVariable var___0_ = body.getOrCreateVariableByName("_<0>"); | ||
161 | new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance"))); | ||
162 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
163 | new ExportedParameter(body, var_App, parameter_App) | ||
164 | )); | ||
165 | // neg ApplicationInstance.allocatedTo(App, _) | ||
166 | new NegativePatternCall(body, Tuples.flatTupleOf(var_App, var___0_), new UnallocatedAppInstance.GeneratedPQuery.Embedded_1_ApplicationInstance_allocatedTo()); | ||
167 | bodies.add(body); | ||
168 | } | ||
169 | return bodies; | ||
170 | } | ||
171 | } | ||
172 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.xtend new file mode 100644 index 00000000..1a07e26e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.xtend | |||
@@ -0,0 +1,67 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.cplex | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator | ||
5 | import java.io.BufferedReader | ||
6 | import java.io.BufferedWriter | ||
7 | import java.io.FileReader | ||
8 | import java.io.FileWriter | ||
9 | import java.util.concurrent.TimeUnit | ||
10 | import java.util.regex.Pattern | ||
11 | import org.eclipse.emf.ecore.EPackage | ||
12 | import org.eclipse.emf.ecore.resource.Resource | ||
13 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | ||
14 | |||
15 | class CbcCpsMain { | ||
16 | static val PROBLEM_FILE = "problem.lp" | ||
17 | static val SOLUTION_FILE = "solution.txt" | ||
18 | static val VALUE_REGEX = Pattern.compile("Optimal - objective value\\s*([0-9]+(\\.[0-9]+)?)") | ||
19 | |||
20 | private new() { | ||
21 | new IllegalStateException("This is a static utility class and should not be instantiated directly.") | ||
22 | } | ||
23 | |||
24 | public static def void main(String[] args) { | ||
25 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put(Resource.Factory.Registry.DEFAULT_EXTENSION, | ||
26 | new XMIResourceFactoryImpl) | ||
27 | EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, CpsPackage.eINSTANCE) | ||
28 | val generator = new CpsGenerator(1, 4, 1) | ||
29 | val problem = generator.generateCpsProblem | ||
30 | val toLp = new CpsToLpTranslator(problem, 10, true) | ||
31 | val lp = toLp.lpProblem | ||
32 | val writer = new BufferedWriter(new FileWriter(PROBLEM_FILE)) | ||
33 | try { | ||
34 | writer.append(lp) | ||
35 | } finally { | ||
36 | writer.close | ||
37 | } | ||
38 | val process = new ProcessBuilder().inheritIO.command("cbc", PROBLEM_FILE, "solve", "solu", SOLUTION_FILE).start | ||
39 | if (!process.waitFor(120, TimeUnit.SECONDS)) { | ||
40 | System.err.println("Timeout reached") | ||
41 | process.destroyForcibly | ||
42 | System.exit(-1) | ||
43 | } | ||
44 | if (process.exitValue != 0) { | ||
45 | System.err.println("Unexpected exit value " + process.exitValue) | ||
46 | System.exit(-1) | ||
47 | } | ||
48 | val reader = new BufferedReader(new FileReader(SOLUTION_FILE)) | ||
49 | var double value = Double.NaN | ||
50 | try { | ||
51 | var String line | ||
52 | while ((line = reader.readLine) !== null) { | ||
53 | println(line) | ||
54 | val matcher = VALUE_REGEX.matcher(line) | ||
55 | if (matcher.matches) { | ||
56 | value = Double.parseDouble(matcher.group(1)) | ||
57 | } | ||
58 | } | ||
59 | } finally { | ||
60 | reader.close | ||
61 | } | ||
62 | val applicationCost = problem.requests.flatMap[requirements.map[count]].reduce[p1, p2|p1 + p2] * 5 | ||
63 | val cost = applicationCost + value | ||
64 | println | ||
65 | println("Cost: " + cost) | ||
66 | } | ||
67 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.xtend new file mode 100644 index 00000000..c38af3a0 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.xtend | |||
@@ -0,0 +1,171 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.cplex | ||
2 | |||
3 | import com.google.common.collect.ImmutableList | ||
4 | import com.google.common.collect.ImmutableMap | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement | ||
9 | import java.util.List | ||
10 | import java.util.Map | ||
11 | |||
12 | class CpsToLpTranslator { | ||
13 | static val MINIMUM_MEMORY_USAGE = 0.25 | ||
14 | static val MINIMUM_HDD_USAGE = 0.25 | ||
15 | |||
16 | val CyberPhysicalSystem cps | ||
17 | val Map<Requirement, ? extends List<String>> appInstances | ||
18 | val Map<HostType, ? extends List<String>> hostInstances | ||
19 | val boolean breakSymmetry | ||
20 | |||
21 | new(CyberPhysicalSystem cps, int hostInstanceCount, boolean breakSymmetry) { | ||
22 | this.cps = cps | ||
23 | appInstances = createAppInstances | ||
24 | hostInstances = createHostInstances(hostInstanceCount) | ||
25 | this.breakSymmetry = breakSymmetry | ||
26 | } | ||
27 | |||
28 | private def createAppInstances() { | ||
29 | val builder = ImmutableMap.builder | ||
30 | var int i = 0 | ||
31 | for (req : requirements) { | ||
32 | val listBuilder = ImmutableList.builder | ||
33 | for (var int j = 0; j < req.count; j++) { | ||
34 | listBuilder.add('''r«i»a«j»''') | ||
35 | } | ||
36 | builder.put(req, listBuilder.build) | ||
37 | i++ | ||
38 | } | ||
39 | builder.build | ||
40 | } | ||
41 | |||
42 | private def createHostInstances(int hostInstanceCount) { | ||
43 | val builder = ImmutableMap.builder | ||
44 | var int i = 0 | ||
45 | for (hostType : cps.hostTypes) { | ||
46 | val listBuilder = ImmutableList.builder | ||
47 | for (var int j = 0; j < hostInstanceCount; j++) { | ||
48 | listBuilder.add('''h«i»i«j»''') | ||
49 | } | ||
50 | builder.put(hostType, listBuilder.build) | ||
51 | i++ | ||
52 | } | ||
53 | builder.build | ||
54 | } | ||
55 | |||
56 | def getLpProblem() { | ||
57 | ''' | ||
58 | Minimize | ||
59 | total_cost: «objective» | ||
60 | Subject To | ||
61 | «constraints» | ||
62 | Bounds | ||
63 | «bounds» | ||
64 | Binary | ||
65 | «binaryVariables» | ||
66 | End | ||
67 | ''' | ||
68 | } | ||
69 | |||
70 | private def getObjective() { | ||
71 | '''«FOR pair : hostInstancesWithType SEPARATOR " + "»«pair.key.cost» «pair.value.existsVariable»«ENDFOR»''' | ||
72 | } | ||
73 | |||
74 | private def getConstraints() { | ||
75 | ''' | ||
76 | «FOR appPair : appInstancesWithType» | ||
77 | «appPair.value»_allocated: «FOR host : appPair.key.possibleHostInstances SEPARATOR " + "»«getAllocatedToVariable(appPair.value, host)»«ENDFOR» = 1 | ||
78 | «FOR host : appPair.key.possibleHostInstances» | ||
79 | «appPair.value»_to_«host»_exists: «host.existsVariable» - «getAllocatedToVariable(appPair.value, host)» >= 0 | ||
80 | «ENDFOR» | ||
81 | «ENDFOR» | ||
82 | «FOR hostPair : hostInstancesWithType» | ||
83 | «hostPair.value»_mem_use: «FOR appPair : hostPair.key.possibleAppInstancesWithRequirements SEPARATOR " + "»«appPair.key.requiredMemory» «getAllocatedToVariable(appPair.value, hostPair.value)»«ENDFOR» - «hostPair.key.defaultMemory» «hostPair.value.memoryUsageVariable» = 0 | ||
84 | «hostPair.value»_hdd_use: «FOR appPair : hostPair.key.possibleAppInstancesWithRequirements SEPARATOR " + "»«appPair.key.requiredHdd» «getAllocatedToVariable(appPair.value, hostPair.value)»«ENDFOR» - «hostPair.key.defaultHdd» «hostPair.value.hddUsageVariable» = 0 | ||
85 | «ENDFOR» | ||
86 | average_mem: «FOR host : allHostInstances SEPARATOR " + "»«host.memoryUsageVariable» - «MINIMUM_MEMORY_USAGE» «host.existsVariable»«ENDFOR» >= 0 | ||
87 | average_hdd: «FOR host : allHostInstances SEPARATOR " + "»«host.memoryUsageVariable» - «MINIMUM_HDD_USAGE» «host.existsVariable»«ENDFOR» >= 0 | ||
88 | «FOR reqPair : requirements.filter[count > 1].indexed» | ||
89 | «FOR host : reqPair.value.type.requirements.flatMap[hostInstances.get(hostType)]» | ||
90 | r«reqPair.key»_«host»_redundant: «FOR app : appInstances.get(reqPair.value) SEPARATOR " + "»«getAllocatedToVariable(app, host)»«ENDFOR» <= 1 | ||
91 | «ENDFOR» | ||
92 | «ENDFOR» | ||
93 | «IF breakSymmetry» | ||
94 | «FOR hosts : hostInstances.values» | ||
95 | «FOR i : 0 ..< (hosts.size - 1)» | ||
96 | «hosts.get(i + 1)»_after_«hosts.get(i)»: «hosts.get(i).existsVariable» - «hosts.get(i + 1).existsVariable» >= 0 | ||
97 | «ENDFOR» | ||
98 | «ENDFOR» | ||
99 | «ENDIF» | ||
100 | ''' | ||
101 | } | ||
102 | |||
103 | private def getBounds() { | ||
104 | ''' | ||
105 | «FOR host : allHostInstances» | ||
106 | 0 <= «host.memoryUsageVariable» <= 1 | ||
107 | 0 <= «host.hddUsageVariable» <= 1 | ||
108 | «ENDFOR» | ||
109 | ''' | ||
110 | } | ||
111 | |||
112 | private def getBinaryVariables() { | ||
113 | ''' | ||
114 | «FOR host : allHostInstances» | ||
115 | «host.existsVariable» | ||
116 | «ENDFOR» | ||
117 | «FOR appPair : appInstancesWithType» | ||
118 | «FOR host : appPair.key.possibleHostInstances» | ||
119 | «getAllocatedToVariable(appPair.value, host)» | ||
120 | «ENDFOR» | ||
121 | «ENDFOR» | ||
122 | ''' | ||
123 | } | ||
124 | |||
125 | private def getRequirements() { | ||
126 | cps.requests.flatMap[requirements] | ||
127 | } | ||
128 | |||
129 | private def getAllHostInstances() { | ||
130 | hostInstances.values.flatMap[it] | ||
131 | } | ||
132 | |||
133 | private def getHostInstancesWithType() { | ||
134 | hostInstances.entrySet.flatMap[pair|pair.value.map[pair.key -> it]] | ||
135 | } | ||
136 | |||
137 | private def getAppInstancesWithType() { | ||
138 | appInstances.entrySet.flatMap[pair|pair.value.map[pair.key.type -> it]] | ||
139 | } | ||
140 | |||
141 | private def getPossibleHostInstances(ApplicationType appType) { | ||
142 | appType.requirements.flatMap[req|hostInstances.get(req.hostType)] | ||
143 | } | ||
144 | |||
145 | private def getPossibleAppInstancesWithRequirements(HostType hostType) { | ||
146 | appInstances.entrySet.flatMap [ pair | | ||
147 | val resourceReq = pair.key.type.requirements.findFirst[it.hostType == hostType] | ||
148 | if (resourceReq === null) { | ||
149 | emptyList | ||
150 | } else { | ||
151 | pair.value.map[resourceReq -> it] | ||
152 | } | ||
153 | ] | ||
154 | } | ||
155 | |||
156 | private def getExistsVariable(String hostInstance) { | ||
157 | '''«hostInstance»_exists''' | ||
158 | } | ||
159 | |||
160 | private def getMemoryUsageVariable(String hostInstance) { | ||
161 | '''«hostInstance»_mem''' | ||
162 | } | ||
163 | |||
164 | private def getHddUsageVariable(String hostInstance) { | ||
165 | '''«hostInstance»_hdd''' | ||
166 | } | ||
167 | |||
168 | private def getAllocatedToVariable(String appInstance, String hostInstance) { | ||
169 | '''«appInstance»_to_«hostInstance»''' | ||
170 | } | ||
171 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.xtend new file mode 100644 index 00000000..223cee03 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.xtend | |||
@@ -0,0 +1,134 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.dse | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.Request | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement | ||
9 | import org.eclipse.emf.common.notify.Notifier | ||
10 | import org.eclipse.emf.ecore.resource.Resource | ||
11 | import org.eclipse.emf.ecore.resource.ResourceSet | ||
12 | import org.eclipse.viatra.dse.statecode.IStateCoder | ||
13 | import org.eclipse.viatra.dse.statecode.IStateCoderFactory | ||
14 | import org.eclipse.viatra.query.runtime.api.IPatternMatch | ||
15 | import org.eclipse.xtend2.lib.StringConcatenationClient | ||
16 | |||
17 | class CpsStateCoder implements IStateCoder { | ||
18 | CyberPhysicalSystem cps | ||
19 | |||
20 | protected new() { | ||
21 | } | ||
22 | |||
23 | override init(Notifier notifier) { | ||
24 | cps = switch (notifier) { | ||
25 | ResourceSet: getCpsFromResourceSet(notifier) | ||
26 | Resource: getCpsFromResource(notifier) | ||
27 | CyberPhysicalSystem: notifier | ||
28 | default: throw new IllegalArgumentException("notifier is not a CyberPhysicalSystem") | ||
29 | } | ||
30 | } | ||
31 | |||
32 | private def getCpsFromResourceSet(ResourceSet resourceSet) { | ||
33 | if (resourceSet.resources.empty) { | ||
34 | throw new IllegalArgumentException("No Resource in ResourceSet") | ||
35 | } | ||
36 | val resource = resourceSet.resources.head | ||
37 | getCpsFromResource(resource) | ||
38 | } | ||
39 | |||
40 | private def getCpsFromResource(Resource resource) { | ||
41 | if (resource.contents.empty) { | ||
42 | throw new IllegalArgumentException("No EObject in Resource") | ||
43 | } | ||
44 | val cps = resource.contents.head | ||
45 | if (cps instanceof CyberPhysicalSystem) { | ||
46 | cps | ||
47 | } else { | ||
48 | throw new IllegalArgumentException("EObject in Resource is not a CyberPhysicalSystem") | ||
49 | } | ||
50 | } | ||
51 | |||
52 | override String createStateCode() { | ||
53 | '''«createRequestsCode»«createHostTypesCode»''' | ||
54 | } | ||
55 | |||
56 | private def StringConcatenationClient createRequestsCode() { | ||
57 | '''«FOR request : cps.requests»«createRequestCode(request)»«ENDFOR»''' | ||
58 | } | ||
59 | |||
60 | private def StringConcatenationClient createRequestCode(Request request) { | ||
61 | '''[«FOR requirement : request.requirements»«createRequirementCode(requirement)»«ENDFOR»]''' | ||
62 | } | ||
63 | |||
64 | private def StringConcatenationClient createRequirementCode(Requirement requirement) { | ||
65 | '''[«FOR app : requirement.instances SEPARATOR ","»«createAppCode(app)»«ENDFOR»]''' | ||
66 | } | ||
67 | |||
68 | private def createAppCode(ApplicationInstance app) { | ||
69 | if (app.allocatedTo === null) { | ||
70 | "-" | ||
71 | } else { | ||
72 | createMatchArgumentCode(app.allocatedTo) | ||
73 | } | ||
74 | } | ||
75 | |||
76 | private def createHostTypesCode() { | ||
77 | '''(«FOR hostType : cps.hostTypes SEPARATOR ","»«hostType.instances.size»«ENDFOR»)''' | ||
78 | } | ||
79 | |||
80 | override String createActivationCode(IPatternMatch match) { | ||
81 | '''«match.specification.simpleName»(«FOR arg : match.toArray SEPARATOR ","»«createMatchArgumentCode(arg)»«ENDFOR»)''' | ||
82 | } | ||
83 | |||
84 | protected dispatch def String createMatchArgumentCode(Requirement requirement) { | ||
85 | val request = requirement.eContainer | ||
86 | if (request instanceof Request) { | ||
87 | if (request.eContainer != cps) { | ||
88 | throw new IllegalArgumentException("Request is not contained in the CPS") | ||
89 | } | ||
90 | val requestIndex = cps.requests.indexOf(request) | ||
91 | val requirementIndex = request.requirements.indexOf(requirement) | ||
92 | requestIndex + "." + requirementIndex | ||
93 | } else { | ||
94 | throw new IllegalArgumentException("Requirement is not contained in a request") | ||
95 | } | ||
96 | } | ||
97 | |||
98 | protected dispatch def String createMatchArgumentCode(ApplicationInstance app) { | ||
99 | val requirement = app.requirement | ||
100 | if (requirement === null) { | ||
101 | throw new IllegalArgumentException("Application instance is not associated with a requirement") | ||
102 | } | ||
103 | val instanceIndex = requirement.instances.indexOf(app) | ||
104 | createMatchArgumentCode(requirement) + "." + instanceIndex | ||
105 | } | ||
106 | |||
107 | protected dispatch def String createMatchArgumentCode(HostInstance host) { | ||
108 | val hostType = host.eContainer | ||
109 | if (hostType instanceof HostType) { | ||
110 | val hostIndex = hostType.instances.indexOf(host) | ||
111 | createMatchArgumentCode(hostType) + "." + hostIndex | ||
112 | } else { | ||
113 | throw new IllegalArgumentException("Host is not contained in a host type") | ||
114 | } | ||
115 | } | ||
116 | |||
117 | protected dispatch def String createMatchArgumentCode(HostType hostType) { | ||
118 | if (hostType.eContainer != cps) { | ||
119 | throw new IllegalArgumentException("Host type is not contained in the CPS") | ||
120 | } | ||
121 | val hostTypeIndex = cps.hostTypes.indexOf(hostType) | ||
122 | hostTypeIndex.toString | ||
123 | } | ||
124 | |||
125 | protected dispatch def createMatchArgumentCode(Object object) { | ||
126 | throw new IllegalArgumentException("Unknown match argument: ") | ||
127 | } | ||
128 | |||
129 | static class Factory implements IStateCoderFactory { | ||
130 | override createStateCoder() { | ||
131 | new CpsStateCoder | ||
132 | } | ||
133 | } | ||
134 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.xtend new file mode 100644 index 00000000..35b3b1df --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.xtend | |||
@@ -0,0 +1,39 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.dse | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries | ||
6 | import org.eclipse.emf.ecore.EPackage | ||
7 | import org.eclipse.emf.ecore.EStructuralFeature | ||
8 | import org.eclipse.emf.ecore.resource.Resource | ||
9 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | ||
10 | import org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory | ||
11 | import org.eclipse.viatra.addon.querybasedfeatures.runtime.handler.QueryBasedFeatures | ||
12 | import org.eclipse.viatra.dse.api.DesignSpaceExplorer | ||
13 | import org.eclipse.viatra.dse.api.DesignSpaceExplorer.DseLoggingLevel | ||
14 | import org.eclipse.viatra.query.runtime.extensibility.SingletonQueryGroupProvider | ||
15 | import org.eclipse.viatra.query.runtime.registry.QuerySpecificationRegistry | ||
16 | import org.eclipse.viatra.query.runtime.registry.connector.QueryGroupProviderSourceConnector | ||
17 | |||
18 | class RuleBasedCpsMain { | ||
19 | private new() { | ||
20 | new IllegalStateException("This is a static utility class and should not be instantiated directly.") | ||
21 | } | ||
22 | |||
23 | public static def void main(String[] args) { | ||
24 | DesignSpaceExplorer.turnOnLogging(DseLoggingLevel.VERBOSE_FULL) | ||
25 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put(Resource.Factory.Registry.DEFAULT_EXTENSION, | ||
26 | new XMIResourceFactoryImpl) | ||
27 | EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put(QueryBasedFeatures.ANNOTATION_SOURCE, | ||
28 | new QueryBasedFeatureSettingDelegateFactory) | ||
29 | EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, CpsPackage.eINSTANCE) | ||
30 | QuerySpecificationRegistry.instance.addSource( | ||
31 | new QueryGroupProviderSourceConnector("CpsQueries", new SingletonQueryGroupProvider(CpsQueries.instance), | ||
32 | true)) | ||
33 | val generator = new CpsGenerator(1, 4, 1) | ||
34 | val problem = generator.generateCpsProblem | ||
35 | // problem.eResource.save(emptyMap) | ||
36 | val solver = new RuleBasedCpsSolver | ||
37 | solver.solve(problem) | ||
38 | } | ||
39 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.xtend new file mode 100644 index 00000000..503c06ea --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.xtend | |||
@@ -0,0 +1,74 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.dse | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
6 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate | ||
7 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric | ||
8 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric | ||
9 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric | ||
10 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance | ||
11 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective | ||
12 | import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied | ||
13 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.CompositeDirectionalThresholdObjective | ||
14 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveKind | ||
15 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveThreshold | ||
16 | import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.QueryBasedObjective | ||
17 | import org.eclipse.viatra.dse.api.DesignSpaceExplorer | ||
18 | import org.eclipse.viatra.dse.evolutionary.EvolutionaryStrategyBuilder | ||
19 | import org.eclipse.viatra.transformation.runtime.emf.rules.batch.BatchTransformationRuleFactory | ||
20 | |||
21 | class RuleBasedCpsSolver { | ||
22 | extension val BatchTransformationRuleFactory = new BatchTransformationRuleFactory | ||
23 | extension val CpsFactory = CpsFactory.eINSTANCE | ||
24 | |||
25 | def solve(CyberPhysicalSystem problem) { | ||
26 | // for (request : problem.requests) { | ||
27 | // for (req : request.requirements) { | ||
28 | // for (i : 0 ..< req.count) { | ||
29 | // val app = createApplicationInstance | ||
30 | // req.type.instances += app | ||
31 | // req.instances += app | ||
32 | // } | ||
33 | // } | ||
34 | // } | ||
35 | val dse = new DesignSpaceExplorer | ||
36 | dse.addMetaModelPackage(CpsPackage.eINSTANCE) | ||
37 | dse.initialModel = problem.eResource.resourceSet | ||
38 | dse.addTransformationRule(createRule.precondition(RequirementNotSatisfied.instance).action [ | ||
39 | val app = createApplicationInstance | ||
40 | req.type.instances += app | ||
41 | req.instances += app | ||
42 | ].build) | ||
43 | dse.addTransformationRule(createRule.precondition(Allocate.instance).action [ | ||
44 | app.allocatedTo = host | ||
45 | ].build) | ||
46 | // dse.addTransformationRule(createRule(UnallocateAppInstance.instance).action [ | ||
47 | // app.allocatedTo = null | ||
48 | // ].build) | ||
49 | dse.addTransformationRule(createRule.precondition(CreateHostInstance.instance).action [ | ||
50 | hostType.instances += createHostInstance | ||
51 | ].build) | ||
52 | // dse.addTransformationRule(createRule(RemoveHostInstance.instance).action [ | ||
53 | // hostInstance.type.instances -= hostInstance | ||
54 | // ].build) | ||
55 | dse.addObjective( | ||
56 | new CompositeDirectionalThresholdObjective("Composite", | ||
57 | new QueryBasedObjective(GuidanceObjective.instance, ObjectiveKind.LOWER_IS_BETTER, | ||
58 | new ObjectiveThreshold.Inclusive(0), 0), | ||
59 | new QueryBasedObjective(AverageFreeMemoryMetric.instance, ObjectiveKind.LOWER_IS_BETTER, | ||
60 | new ObjectiveThreshold.Inclusive(0.75), 0), | ||
61 | new QueryBasedObjective(AverageFreeHddMetric.instance, ObjectiveKind.LOWER_IS_BETTER, | ||
62 | new ObjectiveThreshold.Inclusive(0.75), 0))) | ||
63 | dse.addObjective( | ||
64 | new QueryBasedObjective(CostMetric.instance, ObjectiveKind.LOWER_IS_BETTER, | ||
65 | ObjectiveThreshold.NO_THRESHOLD, 0)) | ||
66 | dse.maxNumberOfThreads = 1 | ||
67 | dse.stateCoderFactory = new CpsStateCoder.Factory | ||
68 | val strategy = EvolutionaryStrategyBuilder.createNsga2Strategy(25) | ||
69 | dse.startExplorationWithTimeout(strategy, 2 * 60 * 1000) | ||
70 | for (solution : dse.solutions) { | ||
71 | println("Found solution: " + solution.stateCode + " " + solution.arbitraryTrajectory.fitness) | ||
72 | } | ||
73 | } | ||
74 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend new file mode 100644 index 00000000..e8d29949 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend | |||
@@ -0,0 +1,117 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.generator | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
5 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostType | ||
6 | import java.util.Collection | ||
7 | import java.util.Random | ||
8 | import org.eclipse.emf.common.util.URI | ||
9 | import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl | ||
10 | |||
11 | class CpsGenerator { | ||
12 | extension val CpsFactory = CpsFactory.eINSTANCE | ||
13 | |||
14 | static val MIN_MEMORY = 1 | ||
15 | static val MAX_MEMORY = 6 | ||
16 | static val MIN_HDD = 1 | ||
17 | static val MAX_HDD = 30 | ||
18 | static val HIGH_CPU_FRACTION = 4 | ||
19 | static val MIN_REPLICAS = 1 | ||
20 | static val MAX_REPLICAS = 4 | ||
21 | |||
22 | val Random random | ||
23 | val int applicationTypeCount | ||
24 | val int demandFactor | ||
25 | val boolean populateAppInstances | ||
26 | |||
27 | new(long randomSeed, int applicationTypeCount, int demandFactor) { | ||
28 | this(randomSeed, applicationTypeCount, demandFactor, false) | ||
29 | } | ||
30 | |||
31 | new(long randomSeed, int applicationTypeCount, int demandFactor, boolean populateAppInstances) { | ||
32 | this.random = new Random(randomSeed) | ||
33 | this.applicationTypeCount = applicationTypeCount | ||
34 | this.demandFactor = demandFactor | ||
35 | this.populateAppInstances = populateAppInstances | ||
36 | } | ||
37 | |||
38 | def generateCpsProblem() { | ||
39 | val resourceSet = new ResourceSetImpl | ||
40 | val resource = resourceSet.createResource(URI.createFileURI("dummy.dummyext")) | ||
41 | createCyberPhysicalSystem => [ | ||
42 | val cps = it | ||
43 | resource.contents += cps | ||
44 | createLowCpuHostTypes | ||
45 | val highCpuHostTypes = createHighCpuHostTypes | ||
46 | for (var int i = 0; i < applicationTypeCount; i++) { | ||
47 | if (i % HIGH_CPU_FRACTION == 0) { | ||
48 | createRandomApplicationType(highCpuHostTypes) | ||
49 | } else { | ||
50 | createRandomApplicationType(hostTypes) | ||
51 | } | ||
52 | } | ||
53 | for (var int i = 0; i < demandFactor; i++) { | ||
54 | requests += createRequest => [ | ||
55 | for (appType : cps.applicationTypes) { | ||
56 | requirements += createRequirement => [ | ||
57 | count = nextInt(CpsGenerator.MIN_REPLICAS, CpsGenerator.MAX_REPLICAS) | ||
58 | type = appType | ||
59 | if (populateAppInstances) { | ||
60 | for (j : 0 ..< count) { | ||
61 | val app = createApplicationInstance | ||
62 | app.type = appType | ||
63 | appType.instances += app | ||
64 | instances += app | ||
65 | } | ||
66 | } | ||
67 | ] | ||
68 | } | ||
69 | ] | ||
70 | } | ||
71 | ] | ||
72 | } | ||
73 | |||
74 | private def void createRandomApplicationType(CyberPhysicalSystem it, Collection<HostType> allowedHostTypes) { | ||
75 | val appType = createApplicationType | ||
76 | val memory = nextInt(MIN_MEMORY, MAX_MEMORY) | ||
77 | val hdd = nextInt(MIN_HDD, MAX_HDD) | ||
78 | for (hostType : allowedHostTypes) { | ||
79 | appType.requirements += createResourceRequirement => [ | ||
80 | it.hostType = hostType | ||
81 | requiredMemory = memory | ||
82 | requiredHdd = hdd | ||
83 | ] | ||
84 | } | ||
85 | applicationTypes += appType | ||
86 | } | ||
87 | |||
88 | private def createLowCpuHostTypes(CyberPhysicalSystem it) { | ||
89 | #[ | ||
90 | createHostType(2, 8, 75), // m5d.large | ||
91 | createHostType(4, 16, 150), // m5d.xlarge | ||
92 | createHostType(3, 16, 75), // r5d.large | ||
93 | createHostType(6, 32, 150) // r5d.xlarge | ||
94 | ] | ||
95 | } | ||
96 | |||
97 | private def createHighCpuHostTypes(CyberPhysicalSystem it) { | ||
98 | #[ | ||
99 | createHostType(2, 4, 50), // c5d.large | ||
100 | createHostType(4, 8, 100) // c5d.xlarge | ||
101 | ] | ||
102 | } | ||
103 | |||
104 | private def createHostType(CyberPhysicalSystem it, int cost, int memory, int hdd) { | ||
105 | val hostType = createHostType => [ | ||
106 | it.cost = cost | ||
107 | defaultMemory = memory | ||
108 | defaultHdd = hdd | ||
109 | ] | ||
110 | hostTypes += hostType | ||
111 | hostType | ||
112 | } | ||
113 | |||
114 | private def nextInt(int lower, int upper) { | ||
115 | lower + random.nextInt(upper - lower + 1) | ||
116 | } | ||
117 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/CpsMdeOptimiserMain.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/CpsMdeOptimiserMain.xtend new file mode 100644 index 00000000..4a4b7a87 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/CpsMdeOptimiserMain.xtend | |||
@@ -0,0 +1,57 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage | ||
4 | import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator | ||
5 | import java.io.BufferedReader | ||
6 | import java.io.BufferedWriter | ||
7 | import java.io.FileReader | ||
8 | import java.io.FileWriter | ||
9 | import java.util.Map | ||
10 | import org.eclipse.emf.common.util.URI | ||
11 | import org.eclipse.emf.ecore.EPackage | ||
12 | import org.eclipse.emf.ecore.resource.Resource | ||
13 | import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl | ||
14 | import uk.ac.kcl.inf.mdeoptimiser.interfaces.cli.Run | ||
15 | |||
16 | class CpsMdeOptimiserMain { | ||
17 | static val PROJECT_PATH = "." | ||
18 | static val PROBLEM_PATH = "model/problem.xmi" | ||
19 | static val MOPT_PATH = "src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/cps.mopt" | ||
20 | |||
21 | private new() { | ||
22 | new IllegalStateException("This is a static utility class and should not be instantiated directly.") | ||
23 | } | ||
24 | |||
25 | public static def void main(String[] args) { | ||
26 | Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put(Resource.Factory.Registry.DEFAULT_EXTENSION, | ||
27 | new XMIResourceFactoryImpl) | ||
28 | EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, CpsPackage.eINSTANCE) | ||
29 | val generator = new CpsGenerator(1, 4, 1) | ||
30 | val problem = generator.generateCpsProblem | ||
31 | problem.eResource.URI = URI.createFileURI(PROBLEM_PATH) | ||
32 | problem.eResource.save(emptyMap) | ||
33 | fixupHenshinModel("model/cps.henshin", "model/cps_fixup.henshin", #{"cps.ecore" -> CpsPackage.eNS_URI}) | ||
34 | Run.main(#["-p", PROJECT_PATH, "-m", MOPT_PATH]) | ||
35 | } | ||
36 | |||
37 | private def static void fixupHenshinModel(String originalPath, String outputPath, Map<String, String> remapMap) { | ||
38 | val reader = new BufferedReader(new FileReader(originalPath)) | ||
39 | try { | ||
40 | val writer = new BufferedWriter(new FileWriter(outputPath)) | ||
41 | try { | ||
42 | var String line | ||
43 | while ((line = reader.readLine) !== null) { | ||
44 | for (entry : remapMap.entrySet) { | ||
45 | line = line.replace(entry.key, entry.value) | ||
46 | } | ||
47 | writer.write(line) | ||
48 | writer.write("\n") | ||
49 | } | ||
50 | } finally { | ||
51 | writer.close | ||
52 | } | ||
53 | } finally { | ||
54 | reader.close | ||
55 | } | ||
56 | } | ||
57 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NonRedundantAllocationsConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NonRedundantAllocationsConstraint.xtend new file mode 100644 index 00000000..1a9286b3 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NonRedundantAllocationsConstraint.xtend | |||
@@ -0,0 +1,29 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | import com.google.common.collect.HashMultiset | ||
7 | |||
8 | class NonRedundantAllocationsConstraint implements IGuidanceFunction { | ||
9 | override getName() { | ||
10 | "NonRedundantAllocations" | ||
11 | } | ||
12 | |||
13 | override computeFitness(Solution solution) { | ||
14 | val cps = solution.model as CyberPhysicalSystem | ||
15 | var int cost = 0 | ||
16 | for (hostType : cps.hostTypes) { | ||
17 | for (host : hostType.instances) { | ||
18 | val bins = HashMultiset.create | ||
19 | for (app : host.applications) { | ||
20 | bins.add(app.requirement) | ||
21 | } | ||
22 | for (entry : bins.entrySet) { | ||
23 | cost += entry.count - 1 | ||
24 | } | ||
25 | } | ||
26 | } | ||
27 | cost | ||
28 | } | ||
29 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend new file mode 100644 index 00000000..663aa26c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotAllocatedAppInstancesConstraint.xtend | |||
@@ -0,0 +1,24 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class NotAllocatedAppInstancesConstraint implements IGuidanceFunction { | ||
8 | override getName() { | ||
9 | "NotAllocatedAppInstances" | ||
10 | } | ||
11 | |||
12 | override computeFitness(Solution solution) { | ||
13 | val cps = solution.model as CyberPhysicalSystem | ||
14 | var int cost = 0 | ||
15 | for (appType : cps.applicationTypes) { | ||
16 | for (app : appType.instances) { | ||
17 | if (app.allocatedTo === null || !appType.requirements.exists[hostType == app.allocatedTo.type]) { | ||
18 | cost++ | ||
19 | } | ||
20 | } | ||
21 | } | ||
22 | cost | ||
23 | } | ||
24 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotSatisfiedRequirementsConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotSatisfiedRequirementsConstraint.xtend new file mode 100644 index 00000000..e44381ec --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/NotSatisfiedRequirementsConstraint.xtend | |||
@@ -0,0 +1,27 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class NotSatisfiedRequirementsConstraint implements IGuidanceFunction { | ||
8 | override getName() { | ||
9 | "NotSatisfiedRequirements" | ||
10 | } | ||
11 | |||
12 | override computeFitness(Solution solution) { | ||
13 | val cps = solution.model as CyberPhysicalSystem | ||
14 | var int cost = 0 | ||
15 | for (request : cps.requests) { | ||
16 | for (requirement : request.requirements) { | ||
17 | cost += Math.abs(requirement.count - requirement.instances.size) | ||
18 | for (app : requirement.instances) { | ||
19 | if (app.type != requirement.type) { | ||
20 | cost++ | ||
21 | } | ||
22 | } | ||
23 | } | ||
24 | } | ||
25 | cost | ||
26 | } | ||
27 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ResourceUtilizationUtil.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ResourceUtilizationUtil.xtend new file mode 100644 index 00000000..fc1d666f --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/ResourceUtilizationUtil.xtend | |||
@@ -0,0 +1,31 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance | ||
4 | |||
5 | class ResourceUtilizationUtil { | ||
6 | private new() { | ||
7 | new IllegalStateException("This is a static utility class and should not be instantiated directly.") | ||
8 | } | ||
9 | |||
10 | static def getMemoryUtilization(HostInstance host) { | ||
11 | var int utilization = 0 | ||
12 | for (app : host.applications) { | ||
13 | val req = app.type.requirements.findFirst[hostType == host.type] | ||
14 | if (req !== null) { | ||
15 | utilization += req.requiredMemory | ||
16 | } | ||
17 | } | ||
18 | utilization | ||
19 | } | ||
20 | |||
21 | static def getHddUtilization(HostInstance host) { | ||
22 | var int utilization = 0 | ||
23 | for (app : host.applications) { | ||
24 | val req = app.type.requirements.findFirst[hostType == host.type] | ||
25 | if (req !== null) { | ||
26 | utilization += req.requiredHdd | ||
27 | } | ||
28 | } | ||
29 | utilization | ||
30 | } | ||
31 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TooLowAverageHddConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TooLowAverageHddConstraint.xtend new file mode 100644 index 00000000..85cc8115 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TooLowAverageHddConstraint.xtend | |||
@@ -0,0 +1,33 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class TooLowAverageHddConstraint implements IGuidanceFunction { | ||
8 | static val THRESHOLD = 0.25 | ||
9 | |||
10 | override getName() { | ||
11 | "TooLowAverageHdd" | ||
12 | } | ||
13 | |||
14 | override computeFitness(Solution solution) { | ||
15 | val cps = solution.model as CyberPhysicalSystem | ||
16 | var double sumUtilization | ||
17 | var int numHosts | ||
18 | for (hostType : cps.hostTypes) { | ||
19 | numHosts += hostType.instances.size | ||
20 | for (host : hostType.instances) { | ||
21 | val utilization = ResourceUtilizationUtil.getHddUtilization(host) | ||
22 | sumUtilization += (utilization as double) / hostType.defaultHdd | ||
23 | } | ||
24 | } | ||
25 | val averageUtilization = sumUtilization / numHosts | ||
26 | val difference = THRESHOLD - averageUtilization | ||
27 | if (difference > 0) { | ||
28 | difference | ||
29 | } else { | ||
30 | 0 | ||
31 | } | ||
32 | } | ||
33 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TooLowAverageMemoryConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TooLowAverageMemoryConstraint.xtend new file mode 100644 index 00000000..e9b47d4c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TooLowAverageMemoryConstraint.xtend | |||
@@ -0,0 +1,33 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class TooLowAverageMemoryConstraint implements IGuidanceFunction { | ||
8 | static val THRESHOLD = 0.25 | ||
9 | |||
10 | override getName() { | ||
11 | "TooLowAverageMemory" | ||
12 | } | ||
13 | |||
14 | override computeFitness(Solution solution) { | ||
15 | val cps = solution.model as CyberPhysicalSystem | ||
16 | var double sumUtilization | ||
17 | var int numHosts | ||
18 | for (hostType : cps.hostTypes) { | ||
19 | numHosts += hostType.instances.size | ||
20 | for (host : hostType.instances) { | ||
21 | val utilization = ResourceUtilizationUtil.getMemoryUtilization(host) | ||
22 | sumUtilization += (utilization as double) / hostType.defaultMemory | ||
23 | } | ||
24 | } | ||
25 | val averageUtilization = sumUtilization / numHosts | ||
26 | val difference = THRESHOLD - averageUtilization | ||
27 | if (difference > 0) { | ||
28 | difference | ||
29 | } else { | ||
30 | 0 | ||
31 | } | ||
32 | } | ||
33 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.xtend new file mode 100644 index 00000000..af65e442 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/TotalCostFitnessFunction.xtend | |||
@@ -0,0 +1,23 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class TotalCostFitnessFunction implements IGuidanceFunction { | ||
8 | override getName() { | ||
9 | "TotalCost" | ||
10 | } | ||
11 | |||
12 | override computeFitness(Solution solution) { | ||
13 | val cps = solution.model as CyberPhysicalSystem | ||
14 | var int cost = 0 | ||
15 | for (appType : cps.applicationTypes) { | ||
16 | cost += 5 * appType.instances.size | ||
17 | } | ||
18 | for (hostType : cps.hostTypes) { | ||
19 | cost += hostType.cost * hostType.instances.size | ||
20 | } | ||
21 | cost | ||
22 | } | ||
23 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/UnavailableHddConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/UnavailableHddConstraint.xtend new file mode 100644 index 00000000..08450f45 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/UnavailableHddConstraint.xtend | |||
@@ -0,0 +1,27 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class UnavailableHddConstraint implements IGuidanceFunction { | ||
8 | override getName() { | ||
9 | "UnavailableHdd" | ||
10 | } | ||
11 | |||
12 | override computeFitness(Solution solution) { | ||
13 | val cps = solution.model as CyberPhysicalSystem | ||
14 | var int cost = 0 | ||
15 | for (hostType : cps.hostTypes) { | ||
16 | for (host : hostType.instances) { | ||
17 | val utilization = ResourceUtilizationUtil.getHddUtilization(host) | ||
18 | val difference = utilization - hostType.defaultHdd | ||
19 | if (difference > 0) { | ||
20 | cost += difference | ||
21 | } | ||
22 | } | ||
23 | } | ||
24 | cost | ||
25 | } | ||
26 | |||
27 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/UnavailableMemoryConstraint.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/UnavailableMemoryConstraint.xtend new file mode 100644 index 00000000..e46d59a6 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/UnavailableMemoryConstraint.xtend | |||
@@ -0,0 +1,27 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.mdeo | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem | ||
4 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.IGuidanceFunction | ||
5 | import uk.ac.kcl.inf.mdeoptimiser.libraries.core.optimisation.interpreter.guidance.Solution | ||
6 | |||
7 | class UnavailableMemoryConstraint implements IGuidanceFunction { | ||
8 | override getName() { | ||
9 | "UnavailableMemory" | ||
10 | } | ||
11 | |||
12 | override computeFitness(Solution solution) { | ||
13 | val cps = solution.model as CyberPhysicalSystem | ||
14 | var int cost = 0 | ||
15 | for (hostType : cps.hostTypes) { | ||
16 | for (host : hostType.instances) { | ||
17 | val utilization = ResourceUtilizationUtil.getMemoryUtilization(host) | ||
18 | val difference = utilization - hostType.defaultMemory | ||
19 | if (difference > 0) { | ||
20 | cost += difference | ||
21 | } | ||
22 | } | ||
23 | } | ||
24 | cost | ||
25 | } | ||
26 | |||
27 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/cps.mopt b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/cps.mopt new file mode 100644 index 00000000..67fe7508 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/mdeo/cps.mopt | |||
@@ -0,0 +1,43 @@ | |||
1 | problem { | ||
2 | basepath <model> | ||
3 | metamodel <hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage> | ||
4 | model <problem.xmi> | ||
5 | } | ||
6 | |||
7 | goal { | ||
8 | objective TotalCost minimise java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.TotalCostFitnessFunction" } | ||
9 | constraint NotSatisfiedRequriements java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.NotSatisfiedRequirementsConstraint" } | ||
10 | constraint NotAllocatedAppInstances java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.NotAllocatedAppInstancesConstraint" } | ||
11 | constraint NonRedundantAllocations java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.NonRedundantAllocationsConstraint" } | ||
12 | constraint UnavailableMemory java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.UnavailableMemoryConstraint" } | ||
13 | constraint UnavailableHdd java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.UnavailableHddConstraint" } | ||
14 | constraint TooLowAverageMemory java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.TooLowAverageMemoryConstraint" } | ||
15 | constraint TooLowAverageHdd java { "hu.bme.mit.inf.dslreasoner.domains.cps.mdeo.TooLowAverageHddConstraint" } | ||
16 | } | ||
17 | |||
18 | search { | ||
19 | // mutate using <cps_fixup.henshin> unit "createAppInstance" | ||
20 | // mutate using <cps_fixup.henshin> unit "deleteAppInstance" | ||
21 | // mutate using <cps_fixup.henshin> unit "createHostInstance" | ||
22 | // mutate using <cps_fixup.henshin> unit "deleteHostInstance" | ||
23 | // mutate using <cps_fixup.henshin> unit "allocate" | ||
24 | // mutate using <cps_fixup.henshin> unit "unallocate" | ||
25 | // mutate using <cps_fixup.henshin> unit "reallocate" | ||
26 | mutate { "ApplicationInstance" } | ||
27 | mutate { "HostInstance" } | ||
28 | } | ||
29 | |||
30 | solver { | ||
31 | optimisation provider moea algorithm NSGAII { | ||
32 | variation: mutation | ||
33 | population: 25 | ||
34 | mutation.step: 3 | ||
35 | mutation.strategy: random | ||
36 | } | ||
37 | |||
38 | termination { | ||
39 | time: 120 | ||
40 | } | ||
41 | |||
42 | batches 1 | ||
43 | } | ||
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..aa78dc38 --- /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,198 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.cps.queries | ||
2 | |||
3 | import "http://www.eclipse.org/emf/2002/Ecore" | ||
4 | import "http://www.example.org/cps" | ||
5 | |||
6 | private pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) { | ||
7 | CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance); | ||
8 | } | ||
9 | |||
10 | private pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) { | ||
11 | CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance); | ||
12 | } | ||
13 | |||
14 | private pattern totalMemory(Host : HostInstance, Memory : EInt) { | ||
15 | HostInstance.type.defaultMemory(Host, Memory); | ||
16 | } | ||
17 | |||
18 | private pattern totalHdd(Host : HostInstance, Hdd : EInt) { | ||
19 | HostInstance.type.defaultHdd(Host, Hdd); | ||
20 | } | ||
21 | |||
22 | private pattern availableMemory(Host : HostInstance, Memory : java Integer) { | ||
23 | find totalMemory(Host, TotalMemory); | ||
24 | RequiredMemory == sum find memoryRequirement(Host, _, #_); | ||
25 | Memory == eval(TotalMemory - RequiredMemory); | ||
26 | } | ||
27 | |||
28 | private pattern memoryRequirement(Host : HostInstance, App : ApplicationInstance, Memory : EInt) { | ||
29 | find resourceRequirement(Host, App, Req); | ||
30 | ResourceRequirement.requiredMemory(Req, Memory); | ||
31 | } | ||
32 | |||
33 | private pattern availableHdd(Host : HostInstance, Hdd : java Integer) { | ||
34 | find totalHdd(Host, TotalHdd); | ||
35 | RequiredHdd == sum find hddRequirement(Host, _, #_); | ||
36 | Hdd == eval(TotalHdd - RequiredHdd); | ||
37 | } | ||
38 | |||
39 | private pattern hddRequirement(Host : HostInstance, App : ApplicationInstance, Hdd : EInt) { | ||
40 | find resourceRequirement(Host, App, Req); | ||
41 | ResourceRequirement.requiredHdd(Req, Hdd); | ||
42 | } | ||
43 | |||
44 | pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) { | ||
45 | ApplicationInstance.allocatedTo(App, Host); | ||
46 | ApplicationInstance.type.requirements(App, Req); | ||
47 | HostInstance.type(Host, HostType); | ||
48 | ResourceRequirement.hostType(Req, HostType); | ||
49 | } | ||
50 | |||
51 | @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 | |||
58 | @Constraint(severity = "error", key = {Host}, | ||
59 | message = "Insufficient memory available on host.") | ||
60 | pattern notEnoughAvailableMemory(Host : HostInstance) { | ||
61 | find availableMemory(Host, Memory); | ||
62 | check(Memory < 0); | ||
63 | } | ||
64 | |||
65 | @Constraint(severity = "error", key = {Host}, | ||
66 | message = "Insufficient HDD available on host.") | ||
67 | pattern notEnoughAvailableHdd(Host : HostInstance) { | ||
68 | find availableHdd(Host, Hdd); | ||
69 | check(Hdd < 0); | ||
70 | } | ||
71 | |||
72 | @Constraint(severity = "error", key = {Req, App}, | ||
73 | message = "Requirement must be satisfied by the required application type.") | ||
74 | pattern instanceDoesNotSatisfyRequirement(Req : Requirement, App : ApplicationInstance) { | ||
75 | Requirement.instances(Req, App); | ||
76 | neg find satisfyingInstance(Req, App); | ||
77 | } | ||
78 | |||
79 | private pattern satisfyingInstance(Req : Requirement, App : ApplicationInstance) { | ||
80 | Requirement.instances(Req, App); | ||
81 | Requirement.type(Req, Type); | ||
82 | ApplicationInstance.type(App, Type); | ||
83 | } | ||
84 | |||
85 | @Constraint(severity = "error", key = {Req}, | ||
86 | message = "Requirement is not satisfied by enough application instances.") | ||
87 | pattern requirementNotSatisfied(Req : Requirement) { | ||
88 | Instances == count find satisfyingInstance(Req, _); | ||
89 | Requirement.count(Req, RequiredCount); | ||
90 | check(Instances < RequiredCount); | ||
91 | } | ||
92 | |||
93 | @Constraint(severity = "error", key = {Req}, | ||
94 | message = "Redundant instances must not be allocated to the same host.") | ||
95 | pattern redundantInstancesOnSameHost(Req : Requirement) { | ||
96 | Requirement.instances(Req, App1); | ||
97 | Requirement.instances(Req, App2); | ||
98 | App1 != App2; | ||
99 | ApplicationInstance.allocatedTo(App1, Host); | ||
100 | ApplicationInstance.allocatedTo(App2, Host); | ||
101 | } | ||
102 | |||
103 | // | ||
104 | // Metrics | ||
105 | // | ||
106 | |||
107 | // Free memory | ||
108 | |||
109 | pattern averageFreeMemoryMetric(Average : java Double) { | ||
110 | Average == avg find freeMemoryPercentage(_, #_); | ||
111 | } | ||
112 | |||
113 | private pattern freeMemoryPercentage(Host : HostInstance, Free : java Double) { | ||
114 | find totalMemory(Host, Total); | ||
115 | find availableMemory(Host, Available); | ||
116 | Free == eval((Available as double) / Total); | ||
117 | } | ||
118 | |||
119 | // Free HDD | ||
120 | |||
121 | pattern averageFreeHddMetric(Average : java Double) { | ||
122 | Average == avg find freeHddPercentage(_, #_); | ||
123 | } | ||
124 | |||
125 | private pattern freeHddPercentage(Host : HostInstance, Free : java Double) { | ||
126 | find totalHdd(Host, Total); | ||
127 | find availableHdd(Host, Available); | ||
128 | Free == eval((Available as double) / Total); | ||
129 | } | ||
130 | |||
131 | // Total cost | ||
132 | |||
133 | pattern costMetric(Cost : java Integer) { | ||
134 | Cost == sum find cpsCost(_, #_); | ||
135 | } | ||
136 | |||
137 | pattern cpsCost(Cps : CyberPhysicalSystem, Cost : java Integer) { | ||
138 | AppCount == count find cpsApplications(Cps, _); | ||
139 | HostCost == sum find hostInstanceCost(Cps, _, #_); | ||
140 | Cost == eval(5 * AppCount + HostCost); | ||
141 | } | ||
142 | |||
143 | private pattern hostInstanceCost(Cps : CyberPhysicalSystem, Host : HostInstance, Cost : EInt) { | ||
144 | find cpsHosts(Cps, Host); | ||
145 | HostInstance.type.cost(Host, Cost); | ||
146 | } | ||
147 | |||
148 | // | ||
149 | // Transformation rule preconditions for rule-based DSE | ||
150 | // | ||
151 | |||
152 | pattern allocate(App : ApplicationInstance, Host : HostInstance) { | ||
153 | ApplicationInstance.type.requirements(App, Req); | ||
154 | ResourceRequirement.hostType.instances(Req, Host); | ||
155 | find unallocatedAppInstance(App); | ||
156 | find availableMemory(Host, AvailableMem); | ||
157 | find availableHdd(Host, AvailableHdd); | ||
158 | ResourceRequirement.requiredMemory(Req, RequiredMem); | ||
159 | ResourceRequirement.requiredHdd(Req, RequiredHdd); | ||
160 | check(AvailableMem >= RequiredMem); | ||
161 | check(AvailableHdd >= RequiredHdd); | ||
162 | neg ApplicationInstance.requirement.instances.allocatedTo(App, Host); | ||
163 | } | ||
164 | |||
165 | pattern unallocateAppInstance(App : ApplicationInstance) { | ||
166 | ApplicationInstance.allocatedTo(App, _); | ||
167 | } | ||
168 | |||
169 | pattern createHostInstance(HostType : HostType) { | ||
170 | find unallocatedAppInstance(App); | ||
171 | ApplicationInstance.type.requirements.hostType(App, HostType); | ||
172 | } | ||
173 | |||
174 | pattern removeHostInstance(HostInstance : HostInstance) { | ||
175 | neg HostInstance.applications(HostInstance, _); | ||
176 | } | ||
177 | |||
178 | private pattern unallocatedAppInstance(App : ApplicationInstance) { | ||
179 | neg ApplicationInstance.allocatedTo(App, _); | ||
180 | } | ||
181 | |||
182 | private pattern requiredAppInstances(Req : Requirement, Remaining : java Integer) { | ||
183 | Instances == count find satisfyingInstance(Req, _); | ||
184 | Requirement.count(Req, RequiredCount); | ||
185 | Remaining == eval(RequiredCount - Instances); | ||
186 | } | ||
187 | |||
188 | private pattern noHostToAllocateTo(App : ApplicationInstance) { | ||
189 | find unallocatedAppInstance(App); | ||
190 | neg find allocate(App, _); | ||
191 | } | ||
192 | |||
193 | pattern guidanceObjective(Value : java Integer) { | ||
194 | UnallocatedInstances == count find unallocatedAppInstance(_); | ||
195 | RequiredInstances == sum find requiredAppInstances(_, #_); | ||
196 | NoHostToAllocate == count find noHostToAllocateTo(_); | ||
197 | Value == eval(2 * UnallocatedInstances + 4 * RequiredInstances + NoHostToAllocate); | ||
198 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.classpath b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.classpath new file mode 100644 index 00000000..6781ea8f --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.classpath | |||
@@ -0,0 +1,14 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <classpath> | ||
3 | <classpathentry kind="src" path="ecore-gen"/> | ||
4 | <classpathentry kind="src" path="src"/> | ||
5 | <classpathentry kind="src" path="xtend-gen"/> | ||
6 | <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"> | ||
7 | <attributes> | ||
8 | <attribute name="module" value="true"/> | ||
9 | </attributes> | ||
10 | </classpathentry> | ||
11 | <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/> | ||
12 | <classpathentry kind="src" path="src-gen"/> | ||
13 | <classpathentry kind="output" path="bin"/> | ||
14 | </classpath> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.gitignore new file mode 100644 index 00000000..7c70320a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.gitignore | |||
@@ -0,0 +1,5 @@ | |||
1 | /bin/ | ||
2 | /mdeo-results/ | ||
3 | /outputs/ | ||
4 | /src-gen/ | ||
5 | /xtend-gen/ | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.project b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.project new file mode 100644 index 00000000..16db5fc5 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/.project | |||
@@ -0,0 +1,40 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <projectDescription> | ||
3 | <name>hu.bme.mit.inf.dslreasoner.domains.satellite</name> | ||
4 | <comment></comment> | ||
5 | <projects> | ||
6 | </projects> | ||
7 | <buildSpec> | ||
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> | ||
19 | <name>org.eclipse.jdt.core.javabuilder</name> | ||
20 | <arguments> | ||
21 | </arguments> | ||
22 | </buildCommand> | ||
23 | <buildCommand> | ||
24 | <name>org.eclipse.pde.ManifestBuilder</name> | ||
25 | <arguments> | ||
26 | </arguments> | ||
27 | </buildCommand> | ||
28 | <buildCommand> | ||
29 | <name>org.eclipse.pde.SchemaBuilder</name> | ||
30 | <arguments> | ||
31 | </arguments> | ||
32 | </buildCommand> | ||
33 | </buildSpec> | ||
34 | <natures> | ||
35 | <nature>org.eclipse.jdt.core.javanature</nature> | ||
36 | <nature>org.eclipse.pde.PluginNature</nature> | ||
37 | <nature>org.eclipse.viatra.query.projectnature</nature> | ||
38 | <nature>org.eclipse.xtext.ui.shared.xtextNature</nature> | ||
39 | </natures> | ||
40 | </projectDescription> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/META-INF/MANIFEST.MF b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/META-INF/MANIFEST.MF new file mode 100644 index 00000000..966fc660 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/META-INF/MANIFEST.MF | |||
@@ -0,0 +1,30 @@ | |||
1 | Manifest-Version: 1.0 | ||
2 | Bundle-ManifestVersion: 2 | ||
3 | Bundle-Name: %pluginName | ||
4 | Bundle-SymbolicName: hu.bme.mit.inf.dslreasoner.domains.satellite;singleton:=true | ||
5 | Bundle-Version: 0.1.0.qualifier | ||
6 | Bundle-ClassPath: . | ||
7 | Bundle-Vendor: %providerName | ||
8 | Bundle-Localization: plugin | ||
9 | Export-Package: hu.bme.mit.inf.dslreasoner.domains.satellite.queries, | ||
10 | hu.bme.mit.inf.dslreasoner.domains.satellite.queries.internal, | ||
11 | satellite, | ||
12 | satellite.impl, | ||
13 | satellite.util | ||
14 | Require-Bundle: org.eclipse.viatra.addon.querybasedfeatures.runtime, | ||
15 | org.eclipse.viatra.query.runtime, | ||
16 | org.eclipse.viatra.query.runtime.rete, | ||
17 | org.eclipse.viatra.query.runtime.localsearch, | ||
18 | org.eclipse.xtext.xbase.lib, | ||
19 | org.eclipse.emf.ecore;visibility:=reexport, | ||
20 | org.eclipse.core.runtime, | ||
21 | hu.bme.mit.inf.dslreasoner.application, | ||
22 | org.eclipse.viatra.dse, | ||
23 | org.eclipse.viatra.dse.genetic, | ||
24 | hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner;bundle-version="1.0.0", | ||
25 | org.eclipse.emf.ecore.xmi;bundle-version="2.15.0", | ||
26 | org.eclipse.viatra.query.runtime.rete;bundle-version="2.0.0" | ||
27 | Import-Package: org.apache.log4j | ||
28 | Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.domains.satellite | ||
29 | Bundle-ActivationPolicy: lazy | ||
30 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/build.properties b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/build.properties new file mode 100644 index 00000000..368af38e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/build.properties | |||
@@ -0,0 +1,11 @@ | |||
1 | bin.includes = .,\ | ||
2 | model/,\ | ||
3 | META-INF/,\ | ||
4 | plugin.xml,\ | ||
5 | plugin.properties | ||
6 | jars.compile.order = . | ||
7 | source.. = ecore-gen/,\ | ||
8 | src-gen/,\ | ||
9 | src/,\ | ||
10 | xtend-gen/ | ||
11 | output.. = bin/ | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig new file mode 100644 index 00000000..2fb246c9 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig | |||
@@ -0,0 +1,25 @@ | |||
1 | import epackage "model/satellite.ecore" | ||
2 | import viatra "src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql" | ||
3 | |||
4 | generate { | ||
5 | metamodel = { package satellite } | ||
6 | constraints = { package hu.bme.mit.inf.dslreasoner.domains.satellite.queries } | ||
7 | partial-model = { "inputs/SatelliteInstance.xmi"} | ||
8 | solver = ViatraSolver | ||
9 | scope = { | ||
10 | #node += 32..64 | ||
11 | } | ||
12 | |||
13 | config = { | ||
14 | runtime = 10000, | ||
15 | log-level = normal | ||
16 | } | ||
17 | |||
18 | number = 1 | ||
19 | runs = 5 | ||
20 | |||
21 | debug = "outputs/debug" | ||
22 | log = "outputs/log.txt" | ||
23 | output = "outputs/models" | ||
24 | statistics = "outputs/statistics.csv" | ||
25 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/AntennaGain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/AntennaGain.java new file mode 100644 index 00000000..c4cdfbf6 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/AntennaGain.java | |||
@@ -0,0 +1,230 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import java.util.Arrays; | ||
6 | import java.util.Collections; | ||
7 | import java.util.List; | ||
8 | |||
9 | import org.eclipse.emf.common.util.Enumerator; | ||
10 | |||
11 | /** | ||
12 | * <!-- begin-user-doc --> | ||
13 | * A representation of the literals of the enumeration '<em><b>Antenna Gain</b></em>', | ||
14 | * and utility methods for working with them. | ||
15 | * <!-- end-user-doc --> | ||
16 | * @see satellite.SatellitePackage#getAntennaGain() | ||
17 | * @model | ||
18 | * @generated | ||
19 | */ | ||
20 | public enum AntennaGain implements Enumerator { | ||
21 | /** | ||
22 | * The '<em><b>LOW</b></em>' literal object. | ||
23 | * <!-- begin-user-doc --> | ||
24 | * <!-- end-user-doc --> | ||
25 | * @see #LOW_VALUE | ||
26 | * @generated | ||
27 | * @ordered | ||
28 | */ | ||
29 | LOW(0, "LOW", "LOW"), | ||
30 | |||
31 | /** | ||
32 | * The '<em><b>MEDIUM</b></em>' literal object. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @see #MEDIUM_VALUE | ||
36 | * @generated | ||
37 | * @ordered | ||
38 | */ | ||
39 | MEDIUM(1, "MEDIUM", "MEDIUM"), | ||
40 | |||
41 | /** | ||
42 | * The '<em><b>HIGH</b></em>' literal object. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #HIGH_VALUE | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | HIGH(2, "HIGH", "HIGH"); | ||
50 | |||
51 | /** | ||
52 | * The '<em><b>LOW</b></em>' literal value. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #LOW | ||
56 | * @model | ||
57 | * @generated | ||
58 | * @ordered | ||
59 | */ | ||
60 | public static final int LOW_VALUE = 0; | ||
61 | |||
62 | /** | ||
63 | * The '<em><b>MEDIUM</b></em>' literal value. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @see #MEDIUM | ||
67 | * @model | ||
68 | * @generated | ||
69 | * @ordered | ||
70 | */ | ||
71 | public static final int MEDIUM_VALUE = 1; | ||
72 | |||
73 | /** | ||
74 | * The '<em><b>HIGH</b></em>' literal value. | ||
75 | * <!-- begin-user-doc --> | ||
76 | * <!-- end-user-doc --> | ||
77 | * @see #HIGH | ||
78 | * @model | ||
79 | * @generated | ||
80 | * @ordered | ||
81 | */ | ||
82 | public static final int HIGH_VALUE = 2; | ||
83 | |||
84 | /** | ||
85 | * An array of all the '<em><b>Antenna Gain</b></em>' enumerators. | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @generated | ||
89 | */ | ||
90 | private static final AntennaGain[] VALUES_ARRAY = new AntennaGain[] { LOW, MEDIUM, HIGH, }; | ||
91 | |||
92 | /** | ||
93 | * A public read-only list of all the '<em><b>Antenna Gain</b></em>' enumerators. | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | public static final List<AntennaGain> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); | ||
99 | |||
100 | /** | ||
101 | * Returns the '<em><b>Antenna Gain</b></em>' literal with the specified literal value. | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @param literal the literal. | ||
105 | * @return the matching enumerator or <code>null</code>. | ||
106 | * @generated | ||
107 | */ | ||
108 | public static AntennaGain get(String literal) { | ||
109 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { | ||
110 | AntennaGain result = VALUES_ARRAY[i]; | ||
111 | if (result.toString().equals(literal)) { | ||
112 | return result; | ||
113 | } | ||
114 | } | ||
115 | return null; | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * Returns the '<em><b>Antenna Gain</b></em>' literal with the specified name. | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @param name the name. | ||
123 | * @return the matching enumerator or <code>null</code>. | ||
124 | * @generated | ||
125 | */ | ||
126 | public static AntennaGain getByName(String name) { | ||
127 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { | ||
128 | AntennaGain result = VALUES_ARRAY[i]; | ||
129 | if (result.getName().equals(name)) { | ||
130 | return result; | ||
131 | } | ||
132 | } | ||
133 | return null; | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * Returns the '<em><b>Antenna Gain</b></em>' literal with the specified integer value. | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @param value the integer value. | ||
141 | * @return the matching enumerator or <code>null</code>. | ||
142 | * @generated | ||
143 | */ | ||
144 | public static AntennaGain get(int value) { | ||
145 | switch (value) { | ||
146 | case LOW_VALUE: | ||
147 | return LOW; | ||
148 | case MEDIUM_VALUE: | ||
149 | return MEDIUM; | ||
150 | case HIGH_VALUE: | ||
151 | return HIGH; | ||
152 | } | ||
153 | return null; | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * <!-- begin-user-doc --> | ||
158 | * <!-- end-user-doc --> | ||
159 | * @generated | ||
160 | */ | ||
161 | private final int value; | ||
162 | |||
163 | /** | ||
164 | * <!-- begin-user-doc --> | ||
165 | * <!-- end-user-doc --> | ||
166 | * @generated | ||
167 | */ | ||
168 | private final String name; | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | private final String literal; | ||
176 | |||
177 | /** | ||
178 | * Only this class can construct instances. | ||
179 | * <!-- begin-user-doc --> | ||
180 | * <!-- end-user-doc --> | ||
181 | * @generated | ||
182 | */ | ||
183 | private AntennaGain(int value, String name, String literal) { | ||
184 | this.value = value; | ||
185 | this.name = name; | ||
186 | this.literal = literal; | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | */ | ||
194 | @Override | ||
195 | public int getValue() { | ||
196 | return value; | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * <!-- begin-user-doc --> | ||
201 | * <!-- end-user-doc --> | ||
202 | * @generated | ||
203 | */ | ||
204 | @Override | ||
205 | public String getName() { | ||
206 | return name; | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * <!-- begin-user-doc --> | ||
211 | * <!-- end-user-doc --> | ||
212 | * @generated | ||
213 | */ | ||
214 | @Override | ||
215 | public String getLiteral() { | ||
216 | return literal; | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * Returns the literal value of the enumerator, which is its string representation. | ||
221 | * <!-- begin-user-doc --> | ||
222 | * <!-- end-user-doc --> | ||
223 | * @generated | ||
224 | */ | ||
225 | @Override | ||
226 | public String toString() { | ||
227 | return literal; | ||
228 | } | ||
229 | |||
230 | } //AntennaGain | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java new file mode 100644 index 00000000..3b9d7ecf --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java | |||
@@ -0,0 +1,47 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | |||
7 | /** | ||
8 | * <!-- begin-user-doc --> | ||
9 | * A representation of the model object '<em><b>Comm Subsystem</b></em>'. | ||
10 | * <!-- end-user-doc --> | ||
11 | * | ||
12 | * <p> | ||
13 | * The following features are supported: | ||
14 | * </p> | ||
15 | * <ul> | ||
16 | * <li>{@link satellite.CommSubsystem#getTarget <em>Target</em>}</li> | ||
17 | * </ul> | ||
18 | * | ||
19 | * @see satellite.SatellitePackage#getCommSubsystem() | ||
20 | * @model abstract="true" | ||
21 | * @generated | ||
22 | */ | ||
23 | public interface CommSubsystem extends EObject { | ||
24 | |||
25 | /** | ||
26 | * Returns the value of the '<em><b>Target</b></em>' reference. | ||
27 | * <!-- begin-user-doc --> | ||
28 | * <!-- end-user-doc --> | ||
29 | * @return the value of the '<em>Target</em>' reference. | ||
30 | * @see #setTarget(CommSubsystem) | ||
31 | * @see satellite.SatellitePackage#getCommSubsystem_Target() | ||
32 | * @model | ||
33 | * @generated | ||
34 | */ | ||
35 | CommSubsystem getTarget(); | ||
36 | |||
37 | /** | ||
38 | * Sets the value of the '{@link satellite.CommSubsystem#getTarget <em>Target</em>}' reference. | ||
39 | * <!-- begin-user-doc --> | ||
40 | * <!-- end-user-doc --> | ||
41 | * @param value the new value of the '<em>Target</em>' reference. | ||
42 | * @see #getTarget() | ||
43 | * @generated | ||
44 | */ | ||
45 | void setTarget(CommSubsystem value); | ||
46 | |||
47 | } // CommSubsystem | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommunicatingElement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommunicatingElement.java new file mode 100644 index 00000000..e8c3bc41 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommunicatingElement.java | |||
@@ -0,0 +1,38 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>Communicating Element</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link satellite.CommunicatingElement#getCommSubsystem <em>Comm Subsystem</em>}</li> | ||
19 | * </ul> | ||
20 | * | ||
21 | * @see satellite.SatellitePackage#getCommunicatingElement() | ||
22 | * @model abstract="true" | ||
23 | * @generated | ||
24 | */ | ||
25 | public interface CommunicatingElement extends EObject { | ||
26 | /** | ||
27 | * Returns the value of the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
28 | * The list contents are of type {@link satellite.CommSubsystem}. | ||
29 | * <!-- begin-user-doc --> | ||
30 | * <!-- end-user-doc --> | ||
31 | * @return the value of the '<em>Comm Subsystem</em>' containment reference list. | ||
32 | * @see satellite.SatellitePackage#getCommunicatingElement_CommSubsystem() | ||
33 | * @model containment="true" required="true" upper="2" | ||
34 | * @generated | ||
35 | */ | ||
36 | EList<CommSubsystem> getCommSubsystem(); | ||
37 | |||
38 | } // CommunicatingElement | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/ConstellationMission.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/ConstellationMission.java new file mode 100644 index 00000000..8ff69955 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/ConstellationMission.java | |||
@@ -0,0 +1,61 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import org.eclipse.emf.common.util.EList; | ||
6 | |||
7 | import org.eclipse.emf.ecore.EObject; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * A representation of the model object '<em><b>Constellation Mission</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * <p> | ||
15 | * The following features are supported: | ||
16 | * </p> | ||
17 | * <ul> | ||
18 | * <li>{@link satellite.ConstellationMission#getGroundStationNetwork <em>Ground Station Network</em>}</li> | ||
19 | * <li>{@link satellite.ConstellationMission#getSpacecraft <em>Spacecraft</em>}</li> | ||
20 | * </ul> | ||
21 | * | ||
22 | * @see satellite.SatellitePackage#getConstellationMission() | ||
23 | * @model abstract="true" | ||
24 | * @generated | ||
25 | */ | ||
26 | public interface ConstellationMission extends EObject { | ||
27 | /** | ||
28 | * Returns the value of the '<em><b>Ground Station Network</b></em>' containment reference. | ||
29 | * <!-- begin-user-doc --> | ||
30 | * <!-- end-user-doc --> | ||
31 | * @return the value of the '<em>Ground Station Network</em>' containment reference. | ||
32 | * @see #setGroundStationNetwork(GroundStationNetwork) | ||
33 | * @see satellite.SatellitePackage#getConstellationMission_GroundStationNetwork() | ||
34 | * @model containment="true" required="true" | ||
35 | * @generated | ||
36 | */ | ||
37 | GroundStationNetwork getGroundStationNetwork(); | ||
38 | |||
39 | /** | ||
40 | * Sets the value of the '{@link satellite.ConstellationMission#getGroundStationNetwork <em>Ground Station Network</em>}' containment reference. | ||
41 | * <!-- begin-user-doc --> | ||
42 | * <!-- end-user-doc --> | ||
43 | * @param value the new value of the '<em>Ground Station Network</em>' containment reference. | ||
44 | * @see #getGroundStationNetwork() | ||
45 | * @generated | ||
46 | */ | ||
47 | void setGroundStationNetwork(GroundStationNetwork value); | ||
48 | |||
49 | /** | ||
50 | * Returns the value of the '<em><b>Spacecraft</b></em>' containment reference list. | ||
51 | * The list contents are of type {@link satellite.Spacecraft}. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @return the value of the '<em>Spacecraft</em>' containment reference list. | ||
55 | * @see satellite.SatellitePackage#getConstellationMission_Spacecraft() | ||
56 | * @model containment="true" lower="2" | ||
57 | * @generated | ||
58 | */ | ||
59 | EList<Spacecraft> getSpacecraft(); | ||
60 | |||
61 | } // ConstellationMission | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat.java new file mode 100644 index 00000000..a38926d4 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Cube Sat</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getCubeSat() | ||
12 | * @model abstract="true" | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface CubeSat extends Spacecraft { | ||
16 | } // CubeSat | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat3U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat3U.java new file mode 100644 index 00000000..c68bf52c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat3U.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Cube Sat3 U</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getCubeSat3U() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface CubeSat3U extends CubeSat { | ||
16 | } // CubeSat3U | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat6U.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat6U.java new file mode 100644 index 00000000..5ade601a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CubeSat6U.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Cube Sat6 U</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getCubeSat6U() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface CubeSat6U extends CubeSat { | ||
16 | } // CubeSat6U | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/GroundStationNetwork.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/GroundStationNetwork.java new file mode 100644 index 00000000..8df20913 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/GroundStationNetwork.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Ground Station Network</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getGroundStationNetwork() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface GroundStationNetwork extends CommunicatingElement { | ||
16 | } // GroundStationNetwork | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/InterferometryMission.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/InterferometryMission.java new file mode 100644 index 00000000..4e28df38 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/InterferometryMission.java | |||
@@ -0,0 +1,17 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Interferometry Mission</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getInterferometryMission() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface InterferometryMission extends ConstellationMission { | ||
16 | |||
17 | } // InterferometryMission | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/InterferometryPayload.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/InterferometryPayload.java new file mode 100644 index 00000000..67156bdb --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/InterferometryPayload.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Interferometry Payload</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getInterferometryPayload() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface InterferometryPayload extends Payload { | ||
16 | } // InterferometryPayload | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/KaCommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/KaCommSubsystem.java new file mode 100644 index 00000000..458831cf --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/KaCommSubsystem.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Ka Comm Subsystem</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getKaCommSubsystem() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface KaCommSubsystem extends CommSubsystem { | ||
16 | } // KaCommSubsystem | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Payload.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Payload.java new file mode 100644 index 00000000..3222fd3b --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Payload.java | |||
@@ -0,0 +1,18 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | |||
7 | /** | ||
8 | * <!-- begin-user-doc --> | ||
9 | * A representation of the model object '<em><b>Payload</b></em>'. | ||
10 | * <!-- end-user-doc --> | ||
11 | * | ||
12 | * | ||
13 | * @see satellite.SatellitePackage#getPayload() | ||
14 | * @model abstract="true" | ||
15 | * @generated | ||
16 | */ | ||
17 | public interface Payload extends EObject { | ||
18 | } // Payload | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatelliteFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatelliteFactory.java new file mode 100644 index 00000000..c906bde6 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatelliteFactory.java | |||
@@ -0,0 +1,114 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import 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 satellite.SatellitePackage | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface SatelliteFactory extends EFactory { | ||
16 | /** | ||
17 | * The singleton instance of the factory. | ||
18 | * <!-- begin-user-doc --> | ||
19 | * <!-- end-user-doc --> | ||
20 | * @generated | ||
21 | */ | ||
22 | SatelliteFactory eINSTANCE = satellite.impl.SatelliteFactoryImpl.init(); | ||
23 | |||
24 | /** | ||
25 | * Returns a new object of class '<em>Interferometry Mission</em>'. | ||
26 | * <!-- begin-user-doc --> | ||
27 | * <!-- end-user-doc --> | ||
28 | * @return a new object of class '<em>Interferometry Mission</em>'. | ||
29 | * @generated | ||
30 | */ | ||
31 | InterferometryMission createInterferometryMission(); | ||
32 | |||
33 | /** | ||
34 | * Returns a new object of class '<em>Ground Station Network</em>'. | ||
35 | * <!-- begin-user-doc --> | ||
36 | * <!-- end-user-doc --> | ||
37 | * @return a new object of class '<em>Ground Station Network</em>'. | ||
38 | * @generated | ||
39 | */ | ||
40 | GroundStationNetwork createGroundStationNetwork(); | ||
41 | |||
42 | /** | ||
43 | * Returns a new object of class '<em>Interferometry Payload</em>'. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @return a new object of class '<em>Interferometry Payload</em>'. | ||
47 | * @generated | ||
48 | */ | ||
49 | InterferometryPayload createInterferometryPayload(); | ||
50 | |||
51 | /** | ||
52 | * Returns a new object of class '<em>Cube Sat3 U</em>'. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @return a new object of class '<em>Cube Sat3 U</em>'. | ||
56 | * @generated | ||
57 | */ | ||
58 | CubeSat3U createCubeSat3U(); | ||
59 | |||
60 | /** | ||
61 | * Returns a new object of class '<em>Cube Sat6 U</em>'. | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @return a new object of class '<em>Cube Sat6 U</em>'. | ||
65 | * @generated | ||
66 | */ | ||
67 | CubeSat6U createCubeSat6U(); | ||
68 | |||
69 | /** | ||
70 | * Returns a new object of class '<em>Small Sat</em>'. | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @return a new object of class '<em>Small Sat</em>'. | ||
74 | * @generated | ||
75 | */ | ||
76 | SmallSat createSmallSat(); | ||
77 | |||
78 | /** | ||
79 | * Returns a new object of class '<em>UHF Comm Subsystem</em>'. | ||
80 | * <!-- begin-user-doc --> | ||
81 | * <!-- end-user-doc --> | ||
82 | * @return a new object of class '<em>UHF Comm Subsystem</em>'. | ||
83 | * @generated | ||
84 | */ | ||
85 | UHFCommSubsystem createUHFCommSubsystem(); | ||
86 | |||
87 | /** | ||
88 | * Returns a new object of class '<em>XComm Subsystem</em>'. | ||
89 | * <!-- begin-user-doc --> | ||
90 | * <!-- end-user-doc --> | ||
91 | * @return a new object of class '<em>XComm Subsystem</em>'. | ||
92 | * @generated | ||
93 | */ | ||
94 | XCommSubsystem createXCommSubsystem(); | ||
95 | |||
96 | /** | ||
97 | * Returns a new object of class '<em>Ka Comm Subsystem</em>'. | ||
98 | * <!-- begin-user-doc --> | ||
99 | * <!-- end-user-doc --> | ||
100 | * @return a new object of class '<em>Ka Comm Subsystem</em>'. | ||
101 | * @generated | ||
102 | */ | ||
103 | KaCommSubsystem createKaCommSubsystem(); | ||
104 | |||
105 | /** | ||
106 | * Returns the package supported by this factory. | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @return the package supported by this factory. | ||
110 | * @generated | ||
111 | */ | ||
112 | SatellitePackage getSatellitePackage(); | ||
113 | |||
114 | } //SatelliteFactory | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java new file mode 100644 index 00000000..9ca99311 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java | |||
@@ -0,0 +1,1079 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | import org.eclipse.emf.ecore.EReference; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * The <b>Package</b> for the model. | ||
12 | * It contains accessors for the meta objects to represent | ||
13 | * <ul> | ||
14 | * <li>each class,</li> | ||
15 | * <li>each feature of each class,</li> | ||
16 | * <li>each operation of each class,</li> | ||
17 | * <li>each enum,</li> | ||
18 | * <li>and each data type</li> | ||
19 | * </ul> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @see satellite.SatelliteFactory | ||
22 | * @model kind="package" | ||
23 | * @generated | ||
24 | */ | ||
25 | public interface SatellitePackage extends EPackage { | ||
26 | /** | ||
27 | * The package name. | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | String eNAME = "satellite"; | ||
33 | |||
34 | /** | ||
35 | * The package namespace URI. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | String eNS_URI = "http://www.example.org/satellite"; | ||
41 | |||
42 | /** | ||
43 | * The package namespace name. | ||
44 | * <!-- begin-user-doc --> | ||
45 | * <!-- end-user-doc --> | ||
46 | * @generated | ||
47 | */ | ||
48 | String eNS_PREFIX = "satellite"; | ||
49 | |||
50 | /** | ||
51 | * The singleton instance of the package. | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | SatellitePackage eINSTANCE = satellite.impl.SatellitePackageImpl.init(); | ||
57 | |||
58 | /** | ||
59 | * The meta object id for the '{@link satellite.impl.ConstellationMissionImpl <em>Constellation Mission</em>}' class. | ||
60 | * <!-- begin-user-doc --> | ||
61 | * <!-- end-user-doc --> | ||
62 | * @see satellite.impl.ConstellationMissionImpl | ||
63 | * @see satellite.impl.SatellitePackageImpl#getConstellationMission() | ||
64 | * @generated | ||
65 | */ | ||
66 | int CONSTELLATION_MISSION = 0; | ||
67 | |||
68 | /** | ||
69 | * The feature id for the '<em><b>Ground Station Network</b></em>' containment reference. | ||
70 | * <!-- begin-user-doc --> | ||
71 | * <!-- end-user-doc --> | ||
72 | * @generated | ||
73 | * @ordered | ||
74 | */ | ||
75 | int CONSTELLATION_MISSION__GROUND_STATION_NETWORK = 0; | ||
76 | |||
77 | /** | ||
78 | * The feature id for the '<em><b>Spacecraft</b></em>' containment reference list. | ||
79 | * <!-- begin-user-doc --> | ||
80 | * <!-- end-user-doc --> | ||
81 | * @generated | ||
82 | * @ordered | ||
83 | */ | ||
84 | int CONSTELLATION_MISSION__SPACECRAFT = 1; | ||
85 | |||
86 | /** | ||
87 | * The number of structural features of the '<em>Constellation Mission</em>' class. | ||
88 | * <!-- begin-user-doc --> | ||
89 | * <!-- end-user-doc --> | ||
90 | * @generated | ||
91 | * @ordered | ||
92 | */ | ||
93 | int CONSTELLATION_MISSION_FEATURE_COUNT = 2; | ||
94 | |||
95 | /** | ||
96 | * The number of operations of the '<em>Constellation Mission</em>' class. | ||
97 | * <!-- begin-user-doc --> | ||
98 | * <!-- end-user-doc --> | ||
99 | * @generated | ||
100 | * @ordered | ||
101 | */ | ||
102 | int CONSTELLATION_MISSION_OPERATION_COUNT = 0; | ||
103 | |||
104 | /** | ||
105 | * The meta object id for the '{@link satellite.impl.InterferometryMissionImpl <em>Interferometry Mission</em>}' class. | ||
106 | * <!-- begin-user-doc --> | ||
107 | * <!-- end-user-doc --> | ||
108 | * @see satellite.impl.InterferometryMissionImpl | ||
109 | * @see satellite.impl.SatellitePackageImpl#getInterferometryMission() | ||
110 | * @generated | ||
111 | */ | ||
112 | int INTERFEROMETRY_MISSION = 1; | ||
113 | |||
114 | /** | ||
115 | * The feature id for the '<em><b>Ground Station Network</b></em>' containment reference. | ||
116 | * <!-- begin-user-doc --> | ||
117 | * <!-- end-user-doc --> | ||
118 | * @generated | ||
119 | * @ordered | ||
120 | */ | ||
121 | int INTERFEROMETRY_MISSION__GROUND_STATION_NETWORK = CONSTELLATION_MISSION__GROUND_STATION_NETWORK; | ||
122 | |||
123 | /** | ||
124 | * The feature id for the '<em><b>Spacecraft</b></em>' containment reference list. | ||
125 | * <!-- begin-user-doc --> | ||
126 | * <!-- end-user-doc --> | ||
127 | * @generated | ||
128 | * @ordered | ||
129 | */ | ||
130 | int INTERFEROMETRY_MISSION__SPACECRAFT = CONSTELLATION_MISSION__SPACECRAFT; | ||
131 | |||
132 | /** | ||
133 | * The number of structural features of the '<em>Interferometry Mission</em>' class. | ||
134 | * <!-- begin-user-doc --> | ||
135 | * <!-- end-user-doc --> | ||
136 | * @generated | ||
137 | * @ordered | ||
138 | */ | ||
139 | int INTERFEROMETRY_MISSION_FEATURE_COUNT = CONSTELLATION_MISSION_FEATURE_COUNT + 0; | ||
140 | |||
141 | /** | ||
142 | * The number of operations of the '<em>Interferometry Mission</em>' class. | ||
143 | * <!-- begin-user-doc --> | ||
144 | * <!-- end-user-doc --> | ||
145 | * @generated | ||
146 | * @ordered | ||
147 | */ | ||
148 | int INTERFEROMETRY_MISSION_OPERATION_COUNT = CONSTELLATION_MISSION_OPERATION_COUNT + 0; | ||
149 | |||
150 | /** | ||
151 | * The meta object id for the '{@link satellite.impl.CommunicatingElementImpl <em>Communicating Element</em>}' class. | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @see satellite.impl.CommunicatingElementImpl | ||
155 | * @see satellite.impl.SatellitePackageImpl#getCommunicatingElement() | ||
156 | * @generated | ||
157 | */ | ||
158 | int COMMUNICATING_ELEMENT = 2; | ||
159 | |||
160 | /** | ||
161 | * The feature id for the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
162 | * <!-- begin-user-doc --> | ||
163 | * <!-- end-user-doc --> | ||
164 | * @generated | ||
165 | * @ordered | ||
166 | */ | ||
167 | int COMMUNICATING_ELEMENT__COMM_SUBSYSTEM = 0; | ||
168 | |||
169 | /** | ||
170 | * The number of structural features of the '<em>Communicating Element</em>' class. | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | * @ordered | ||
175 | */ | ||
176 | int COMMUNICATING_ELEMENT_FEATURE_COUNT = 1; | ||
177 | |||
178 | /** | ||
179 | * The number of operations of the '<em>Communicating Element</em>' class. | ||
180 | * <!-- begin-user-doc --> | ||
181 | * <!-- end-user-doc --> | ||
182 | * @generated | ||
183 | * @ordered | ||
184 | */ | ||
185 | int COMMUNICATING_ELEMENT_OPERATION_COUNT = 0; | ||
186 | |||
187 | /** | ||
188 | * The meta object id for the '{@link satellite.impl.GroundStationNetworkImpl <em>Ground Station Network</em>}' class. | ||
189 | * <!-- begin-user-doc --> | ||
190 | * <!-- end-user-doc --> | ||
191 | * @see satellite.impl.GroundStationNetworkImpl | ||
192 | * @see satellite.impl.SatellitePackageImpl#getGroundStationNetwork() | ||
193 | * @generated | ||
194 | */ | ||
195 | int GROUND_STATION_NETWORK = 3; | ||
196 | |||
197 | /** | ||
198 | * The feature id for the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
199 | * <!-- begin-user-doc --> | ||
200 | * <!-- end-user-doc --> | ||
201 | * @generated | ||
202 | * @ordered | ||
203 | */ | ||
204 | int GROUND_STATION_NETWORK__COMM_SUBSYSTEM = COMMUNICATING_ELEMENT__COMM_SUBSYSTEM; | ||
205 | |||
206 | /** | ||
207 | * The number of structural features of the '<em>Ground Station Network</em>' class. | ||
208 | * <!-- begin-user-doc --> | ||
209 | * <!-- end-user-doc --> | ||
210 | * @generated | ||
211 | * @ordered | ||
212 | */ | ||
213 | int GROUND_STATION_NETWORK_FEATURE_COUNT = COMMUNICATING_ELEMENT_FEATURE_COUNT + 0; | ||
214 | |||
215 | /** | ||
216 | * The number of operations of the '<em>Ground Station Network</em>' class. | ||
217 | * <!-- begin-user-doc --> | ||
218 | * <!-- end-user-doc --> | ||
219 | * @generated | ||
220 | * @ordered | ||
221 | */ | ||
222 | int GROUND_STATION_NETWORK_OPERATION_COUNT = COMMUNICATING_ELEMENT_OPERATION_COUNT + 0; | ||
223 | |||
224 | /** | ||
225 | * The meta object id for the '{@link satellite.impl.SpacecraftImpl <em>Spacecraft</em>}' class. | ||
226 | * <!-- begin-user-doc --> | ||
227 | * <!-- end-user-doc --> | ||
228 | * @see satellite.impl.SpacecraftImpl | ||
229 | * @see satellite.impl.SatellitePackageImpl#getSpacecraft() | ||
230 | * @generated | ||
231 | */ | ||
232 | int SPACECRAFT = 4; | ||
233 | |||
234 | /** | ||
235 | * The feature id for the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
236 | * <!-- begin-user-doc --> | ||
237 | * <!-- end-user-doc --> | ||
238 | * @generated | ||
239 | * @ordered | ||
240 | */ | ||
241 | int SPACECRAFT__COMM_SUBSYSTEM = COMMUNICATING_ELEMENT__COMM_SUBSYSTEM; | ||
242 | |||
243 | /** | ||
244 | * The feature id for the '<em><b>Payload</b></em>' containment reference. | ||
245 | * <!-- begin-user-doc --> | ||
246 | * <!-- end-user-doc --> | ||
247 | * @generated | ||
248 | * @ordered | ||
249 | */ | ||
250 | int SPACECRAFT__PAYLOAD = COMMUNICATING_ELEMENT_FEATURE_COUNT + 0; | ||
251 | |||
252 | /** | ||
253 | * The number of structural features of the '<em>Spacecraft</em>' class. | ||
254 | * <!-- begin-user-doc --> | ||
255 | * <!-- end-user-doc --> | ||
256 | * @generated | ||
257 | * @ordered | ||
258 | */ | ||
259 | int SPACECRAFT_FEATURE_COUNT = COMMUNICATING_ELEMENT_FEATURE_COUNT + 1; | ||
260 | |||
261 | /** | ||
262 | * The number of operations of the '<em>Spacecraft</em>' class. | ||
263 | * <!-- begin-user-doc --> | ||
264 | * <!-- end-user-doc --> | ||
265 | * @generated | ||
266 | * @ordered | ||
267 | */ | ||
268 | int SPACECRAFT_OPERATION_COUNT = COMMUNICATING_ELEMENT_OPERATION_COUNT + 0; | ||
269 | |||
270 | /** | ||
271 | * The meta object id for the '{@link satellite.impl.CommSubsystemImpl <em>Comm Subsystem</em>}' class. | ||
272 | * <!-- begin-user-doc --> | ||
273 | * <!-- end-user-doc --> | ||
274 | * @see satellite.impl.CommSubsystemImpl | ||
275 | * @see satellite.impl.SatellitePackageImpl#getCommSubsystem() | ||
276 | * @generated | ||
277 | */ | ||
278 | int COMM_SUBSYSTEM = 5; | ||
279 | |||
280 | /** | ||
281 | * The feature id for the '<em><b>Target</b></em>' reference. | ||
282 | * <!-- begin-user-doc --> | ||
283 | * <!-- end-user-doc --> | ||
284 | * @generated | ||
285 | * @ordered | ||
286 | */ | ||
287 | int COMM_SUBSYSTEM__TARGET = 0; | ||
288 | |||
289 | /** | ||
290 | * The number of structural features of the '<em>Comm Subsystem</em>' class. | ||
291 | * <!-- begin-user-doc --> | ||
292 | * <!-- end-user-doc --> | ||
293 | * @generated | ||
294 | * @ordered | ||
295 | */ | ||
296 | int COMM_SUBSYSTEM_FEATURE_COUNT = 1; | ||
297 | |||
298 | /** | ||
299 | * The number of operations of the '<em>Comm Subsystem</em>' class. | ||
300 | * <!-- begin-user-doc --> | ||
301 | * <!-- end-user-doc --> | ||
302 | * @generated | ||
303 | * @ordered | ||
304 | */ | ||
305 | int COMM_SUBSYSTEM_OPERATION_COUNT = 0; | ||
306 | |||
307 | /** | ||
308 | * The meta object id for the '{@link satellite.impl.PayloadImpl <em>Payload</em>}' class. | ||
309 | * <!-- begin-user-doc --> | ||
310 | * <!-- end-user-doc --> | ||
311 | * @see satellite.impl.PayloadImpl | ||
312 | * @see satellite.impl.SatellitePackageImpl#getPayload() | ||
313 | * @generated | ||
314 | */ | ||
315 | int PAYLOAD = 6; | ||
316 | |||
317 | /** | ||
318 | * The number of structural features of the '<em>Payload</em>' class. | ||
319 | * <!-- begin-user-doc --> | ||
320 | * <!-- end-user-doc --> | ||
321 | * @generated | ||
322 | * @ordered | ||
323 | */ | ||
324 | int PAYLOAD_FEATURE_COUNT = 0; | ||
325 | |||
326 | /** | ||
327 | * The number of operations of the '<em>Payload</em>' class. | ||
328 | * <!-- begin-user-doc --> | ||
329 | * <!-- end-user-doc --> | ||
330 | * @generated | ||
331 | * @ordered | ||
332 | */ | ||
333 | int PAYLOAD_OPERATION_COUNT = 0; | ||
334 | |||
335 | /** | ||
336 | * The meta object id for the '{@link satellite.impl.InterferometryPayloadImpl <em>Interferometry Payload</em>}' class. | ||
337 | * <!-- begin-user-doc --> | ||
338 | * <!-- end-user-doc --> | ||
339 | * @see satellite.impl.InterferometryPayloadImpl | ||
340 | * @see satellite.impl.SatellitePackageImpl#getInterferometryPayload() | ||
341 | * @generated | ||
342 | */ | ||
343 | int INTERFEROMETRY_PAYLOAD = 7; | ||
344 | |||
345 | /** | ||
346 | * The number of structural features of the '<em>Interferometry Payload</em>' class. | ||
347 | * <!-- begin-user-doc --> | ||
348 | * <!-- end-user-doc --> | ||
349 | * @generated | ||
350 | * @ordered | ||
351 | */ | ||
352 | int INTERFEROMETRY_PAYLOAD_FEATURE_COUNT = PAYLOAD_FEATURE_COUNT + 0; | ||
353 | |||
354 | /** | ||
355 | * The number of operations of the '<em>Interferometry Payload</em>' class. | ||
356 | * <!-- begin-user-doc --> | ||
357 | * <!-- end-user-doc --> | ||
358 | * @generated | ||
359 | * @ordered | ||
360 | */ | ||
361 | int INTERFEROMETRY_PAYLOAD_OPERATION_COUNT = PAYLOAD_OPERATION_COUNT + 0; | ||
362 | |||
363 | /** | ||
364 | * The meta object id for the '{@link satellite.impl.CubeSatImpl <em>Cube Sat</em>}' class. | ||
365 | * <!-- begin-user-doc --> | ||
366 | * <!-- end-user-doc --> | ||
367 | * @see satellite.impl.CubeSatImpl | ||
368 | * @see satellite.impl.SatellitePackageImpl#getCubeSat() | ||
369 | * @generated | ||
370 | */ | ||
371 | int CUBE_SAT = 11; | ||
372 | |||
373 | /** | ||
374 | * The feature id for the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
375 | * <!-- begin-user-doc --> | ||
376 | * <!-- end-user-doc --> | ||
377 | * @generated | ||
378 | * @ordered | ||
379 | */ | ||
380 | int CUBE_SAT__COMM_SUBSYSTEM = SPACECRAFT__COMM_SUBSYSTEM; | ||
381 | |||
382 | /** | ||
383 | * The feature id for the '<em><b>Payload</b></em>' containment reference. | ||
384 | * <!-- begin-user-doc --> | ||
385 | * <!-- end-user-doc --> | ||
386 | * @generated | ||
387 | * @ordered | ||
388 | */ | ||
389 | int CUBE_SAT__PAYLOAD = SPACECRAFT__PAYLOAD; | ||
390 | |||
391 | /** | ||
392 | * The number of structural features of the '<em>Cube Sat</em>' class. | ||
393 | * <!-- begin-user-doc --> | ||
394 | * <!-- end-user-doc --> | ||
395 | * @generated | ||
396 | * @ordered | ||
397 | */ | ||
398 | int CUBE_SAT_FEATURE_COUNT = SPACECRAFT_FEATURE_COUNT + 0; | ||
399 | |||
400 | /** | ||
401 | * The number of operations of the '<em>Cube Sat</em>' class. | ||
402 | * <!-- begin-user-doc --> | ||
403 | * <!-- end-user-doc --> | ||
404 | * @generated | ||
405 | * @ordered | ||
406 | */ | ||
407 | int CUBE_SAT_OPERATION_COUNT = SPACECRAFT_OPERATION_COUNT + 0; | ||
408 | |||
409 | /** | ||
410 | * The meta object id for the '{@link satellite.impl.CubeSat3UImpl <em>Cube Sat3 U</em>}' class. | ||
411 | * <!-- begin-user-doc --> | ||
412 | * <!-- end-user-doc --> | ||
413 | * @see satellite.impl.CubeSat3UImpl | ||
414 | * @see satellite.impl.SatellitePackageImpl#getCubeSat3U() | ||
415 | * @generated | ||
416 | */ | ||
417 | int CUBE_SAT3_U = 8; | ||
418 | |||
419 | /** | ||
420 | * The feature id for the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
421 | * <!-- begin-user-doc --> | ||
422 | * <!-- end-user-doc --> | ||
423 | * @generated | ||
424 | * @ordered | ||
425 | */ | ||
426 | int CUBE_SAT3_U__COMM_SUBSYSTEM = CUBE_SAT__COMM_SUBSYSTEM; | ||
427 | |||
428 | /** | ||
429 | * The feature id for the '<em><b>Payload</b></em>' containment reference. | ||
430 | * <!-- begin-user-doc --> | ||
431 | * <!-- end-user-doc --> | ||
432 | * @generated | ||
433 | * @ordered | ||
434 | */ | ||
435 | int CUBE_SAT3_U__PAYLOAD = CUBE_SAT__PAYLOAD; | ||
436 | |||
437 | /** | ||
438 | * The number of structural features of the '<em>Cube Sat3 U</em>' class. | ||
439 | * <!-- begin-user-doc --> | ||
440 | * <!-- end-user-doc --> | ||
441 | * @generated | ||
442 | * @ordered | ||
443 | */ | ||
444 | int CUBE_SAT3_U_FEATURE_COUNT = CUBE_SAT_FEATURE_COUNT + 0; | ||
445 | |||
446 | /** | ||
447 | * The number of operations of the '<em>Cube Sat3 U</em>' class. | ||
448 | * <!-- begin-user-doc --> | ||
449 | * <!-- end-user-doc --> | ||
450 | * @generated | ||
451 | * @ordered | ||
452 | */ | ||
453 | int CUBE_SAT3_U_OPERATION_COUNT = CUBE_SAT_OPERATION_COUNT + 0; | ||
454 | |||
455 | /** | ||
456 | * The meta object id for the '{@link satellite.impl.CubeSat6UImpl <em>Cube Sat6 U</em>}' class. | ||
457 | * <!-- begin-user-doc --> | ||
458 | * <!-- end-user-doc --> | ||
459 | * @see satellite.impl.CubeSat6UImpl | ||
460 | * @see satellite.impl.SatellitePackageImpl#getCubeSat6U() | ||
461 | * @generated | ||
462 | */ | ||
463 | int CUBE_SAT6_U = 9; | ||
464 | |||
465 | /** | ||
466 | * The feature id for the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
467 | * <!-- begin-user-doc --> | ||
468 | * <!-- end-user-doc --> | ||
469 | * @generated | ||
470 | * @ordered | ||
471 | */ | ||
472 | int CUBE_SAT6_U__COMM_SUBSYSTEM = CUBE_SAT__COMM_SUBSYSTEM; | ||
473 | |||
474 | /** | ||
475 | * The feature id for the '<em><b>Payload</b></em>' containment reference. | ||
476 | * <!-- begin-user-doc --> | ||
477 | * <!-- end-user-doc --> | ||
478 | * @generated | ||
479 | * @ordered | ||
480 | */ | ||
481 | int CUBE_SAT6_U__PAYLOAD = CUBE_SAT__PAYLOAD; | ||
482 | |||
483 | /** | ||
484 | * The number of structural features of the '<em>Cube Sat6 U</em>' class. | ||
485 | * <!-- begin-user-doc --> | ||
486 | * <!-- end-user-doc --> | ||
487 | * @generated | ||
488 | * @ordered | ||
489 | */ | ||
490 | int CUBE_SAT6_U_FEATURE_COUNT = CUBE_SAT_FEATURE_COUNT + 0; | ||
491 | |||
492 | /** | ||
493 | * The number of operations of the '<em>Cube Sat6 U</em>' class. | ||
494 | * <!-- begin-user-doc --> | ||
495 | * <!-- end-user-doc --> | ||
496 | * @generated | ||
497 | * @ordered | ||
498 | */ | ||
499 | int CUBE_SAT6_U_OPERATION_COUNT = CUBE_SAT_OPERATION_COUNT + 0; | ||
500 | |||
501 | /** | ||
502 | * The meta object id for the '{@link satellite.impl.SmallSatImpl <em>Small Sat</em>}' class. | ||
503 | * <!-- begin-user-doc --> | ||
504 | * <!-- end-user-doc --> | ||
505 | * @see satellite.impl.SmallSatImpl | ||
506 | * @see satellite.impl.SatellitePackageImpl#getSmallSat() | ||
507 | * @generated | ||
508 | */ | ||
509 | int SMALL_SAT = 10; | ||
510 | |||
511 | /** | ||
512 | * The feature id for the '<em><b>Comm Subsystem</b></em>' containment reference list. | ||
513 | * <!-- begin-user-doc --> | ||
514 | * <!-- end-user-doc --> | ||
515 | * @generated | ||
516 | * @ordered | ||
517 | */ | ||
518 | int SMALL_SAT__COMM_SUBSYSTEM = SPACECRAFT__COMM_SUBSYSTEM; | ||
519 | |||
520 | /** | ||
521 | * The feature id for the '<em><b>Payload</b></em>' containment reference. | ||
522 | * <!-- begin-user-doc --> | ||
523 | * <!-- end-user-doc --> | ||
524 | * @generated | ||
525 | * @ordered | ||
526 | */ | ||
527 | int SMALL_SAT__PAYLOAD = SPACECRAFT__PAYLOAD; | ||
528 | |||
529 | /** | ||
530 | * The number of structural features of the '<em>Small Sat</em>' class. | ||
531 | * <!-- begin-user-doc --> | ||
532 | * <!-- end-user-doc --> | ||
533 | * @generated | ||
534 | * @ordered | ||
535 | */ | ||
536 | int SMALL_SAT_FEATURE_COUNT = SPACECRAFT_FEATURE_COUNT + 0; | ||
537 | |||
538 | /** | ||
539 | * The number of operations of the '<em>Small Sat</em>' class. | ||
540 | * <!-- begin-user-doc --> | ||
541 | * <!-- end-user-doc --> | ||
542 | * @generated | ||
543 | * @ordered | ||
544 | */ | ||
545 | int SMALL_SAT_OPERATION_COUNT = SPACECRAFT_OPERATION_COUNT + 0; | ||
546 | |||
547 | /** | ||
548 | * The meta object id for the '{@link satellite.impl.UHFCommSubsystemImpl <em>UHF Comm Subsystem</em>}' class. | ||
549 | * <!-- begin-user-doc --> | ||
550 | * <!-- end-user-doc --> | ||
551 | * @see satellite.impl.UHFCommSubsystemImpl | ||
552 | * @see satellite.impl.SatellitePackageImpl#getUHFCommSubsystem() | ||
553 | * @generated | ||
554 | */ | ||
555 | int UHF_COMM_SUBSYSTEM = 12; | ||
556 | |||
557 | /** | ||
558 | * The feature id for the '<em><b>Target</b></em>' reference. | ||
559 | * <!-- begin-user-doc --> | ||
560 | * <!-- end-user-doc --> | ||
561 | * @generated | ||
562 | * @ordered | ||
563 | */ | ||
564 | int UHF_COMM_SUBSYSTEM__TARGET = COMM_SUBSYSTEM__TARGET; | ||
565 | |||
566 | /** | ||
567 | * The number of structural features of the '<em>UHF Comm Subsystem</em>' class. | ||
568 | * <!-- begin-user-doc --> | ||
569 | * <!-- end-user-doc --> | ||
570 | * @generated | ||
571 | * @ordered | ||
572 | */ | ||
573 | int UHF_COMM_SUBSYSTEM_FEATURE_COUNT = COMM_SUBSYSTEM_FEATURE_COUNT + 0; | ||
574 | |||
575 | /** | ||
576 | * The number of operations of the '<em>UHF Comm Subsystem</em>' class. | ||
577 | * <!-- begin-user-doc --> | ||
578 | * <!-- end-user-doc --> | ||
579 | * @generated | ||
580 | * @ordered | ||
581 | */ | ||
582 | int UHF_COMM_SUBSYSTEM_OPERATION_COUNT = COMM_SUBSYSTEM_OPERATION_COUNT + 0; | ||
583 | |||
584 | /** | ||
585 | * The meta object id for the '{@link satellite.impl.XCommSubsystemImpl <em>XComm Subsystem</em>}' class. | ||
586 | * <!-- begin-user-doc --> | ||
587 | * <!-- end-user-doc --> | ||
588 | * @see satellite.impl.XCommSubsystemImpl | ||
589 | * @see satellite.impl.SatellitePackageImpl#getXCommSubsystem() | ||
590 | * @generated | ||
591 | */ | ||
592 | int XCOMM_SUBSYSTEM = 13; | ||
593 | |||
594 | /** | ||
595 | * The feature id for the '<em><b>Target</b></em>' reference. | ||
596 | * <!-- begin-user-doc --> | ||
597 | * <!-- end-user-doc --> | ||
598 | * @generated | ||
599 | * @ordered | ||
600 | */ | ||
601 | int XCOMM_SUBSYSTEM__TARGET = COMM_SUBSYSTEM__TARGET; | ||
602 | |||
603 | /** | ||
604 | * The number of structural features of the '<em>XComm Subsystem</em>' class. | ||
605 | * <!-- begin-user-doc --> | ||
606 | * <!-- end-user-doc --> | ||
607 | * @generated | ||
608 | * @ordered | ||
609 | */ | ||
610 | int XCOMM_SUBSYSTEM_FEATURE_COUNT = COMM_SUBSYSTEM_FEATURE_COUNT + 0; | ||
611 | |||
612 | /** | ||
613 | * The number of operations of the '<em>XComm Subsystem</em>' class. | ||
614 | * <!-- begin-user-doc --> | ||
615 | * <!-- end-user-doc --> | ||
616 | * @generated | ||
617 | * @ordered | ||
618 | */ | ||
619 | int XCOMM_SUBSYSTEM_OPERATION_COUNT = COMM_SUBSYSTEM_OPERATION_COUNT + 0; | ||
620 | |||
621 | /** | ||
622 | * The meta object id for the '{@link satellite.impl.KaCommSubsystemImpl <em>Ka Comm Subsystem</em>}' class. | ||
623 | * <!-- begin-user-doc --> | ||
624 | * <!-- end-user-doc --> | ||
625 | * @see satellite.impl.KaCommSubsystemImpl | ||
626 | * @see satellite.impl.SatellitePackageImpl#getKaCommSubsystem() | ||
627 | * @generated | ||
628 | */ | ||
629 | int KA_COMM_SUBSYSTEM = 14; | ||
630 | |||
631 | /** | ||
632 | * The feature id for the '<em><b>Target</b></em>' reference. | ||
633 | * <!-- begin-user-doc --> | ||
634 | * <!-- end-user-doc --> | ||
635 | * @generated | ||
636 | * @ordered | ||
637 | */ | ||
638 | int KA_COMM_SUBSYSTEM__TARGET = COMM_SUBSYSTEM__TARGET; | ||
639 | |||
640 | /** | ||
641 | * The number of structural features of the '<em>Ka Comm Subsystem</em>' class. | ||
642 | * <!-- begin-user-doc --> | ||
643 | * <!-- end-user-doc --> | ||
644 | * @generated | ||
645 | * @ordered | ||
646 | */ | ||
647 | int KA_COMM_SUBSYSTEM_FEATURE_COUNT = COMM_SUBSYSTEM_FEATURE_COUNT + 0; | ||
648 | |||
649 | /** | ||
650 | * The number of operations of the '<em>Ka Comm Subsystem</em>' class. | ||
651 | * <!-- begin-user-doc --> | ||
652 | * <!-- end-user-doc --> | ||
653 | * @generated | ||
654 | * @ordered | ||
655 | */ | ||
656 | int KA_COMM_SUBSYSTEM_OPERATION_COUNT = COMM_SUBSYSTEM_OPERATION_COUNT + 0; | ||
657 | |||
658 | /** | ||
659 | * Returns the meta object for class '{@link satellite.ConstellationMission <em>Constellation Mission</em>}'. | ||
660 | * <!-- begin-user-doc --> | ||
661 | * <!-- end-user-doc --> | ||
662 | * @return the meta object for class '<em>Constellation Mission</em>'. | ||
663 | * @see satellite.ConstellationMission | ||
664 | * @generated | ||
665 | */ | ||
666 | EClass getConstellationMission(); | ||
667 | |||
668 | /** | ||
669 | * Returns the meta object for the containment reference '{@link satellite.ConstellationMission#getGroundStationNetwork <em>Ground Station Network</em>}'. | ||
670 | * <!-- begin-user-doc --> | ||
671 | * <!-- end-user-doc --> | ||
672 | * @return the meta object for the containment reference '<em>Ground Station Network</em>'. | ||
673 | * @see satellite.ConstellationMission#getGroundStationNetwork() | ||
674 | * @see #getConstellationMission() | ||
675 | * @generated | ||
676 | */ | ||
677 | EReference getConstellationMission_GroundStationNetwork(); | ||
678 | |||
679 | /** | ||
680 | * Returns the meta object for the containment reference list '{@link satellite.ConstellationMission#getSpacecraft <em>Spacecraft</em>}'. | ||
681 | * <!-- begin-user-doc --> | ||
682 | * <!-- end-user-doc --> | ||
683 | * @return the meta object for the containment reference list '<em>Spacecraft</em>'. | ||
684 | * @see satellite.ConstellationMission#getSpacecraft() | ||
685 | * @see #getConstellationMission() | ||
686 | * @generated | ||
687 | */ | ||
688 | EReference getConstellationMission_Spacecraft(); | ||
689 | |||
690 | /** | ||
691 | * Returns the meta object for class '{@link satellite.InterferometryMission <em>Interferometry Mission</em>}'. | ||
692 | * <!-- begin-user-doc --> | ||
693 | * <!-- end-user-doc --> | ||
694 | * @return the meta object for class '<em>Interferometry Mission</em>'. | ||
695 | * @see satellite.InterferometryMission | ||
696 | * @generated | ||
697 | */ | ||
698 | EClass getInterferometryMission(); | ||
699 | |||
700 | /** | ||
701 | * Returns the meta object for class '{@link satellite.CommunicatingElement <em>Communicating Element</em>}'. | ||
702 | * <!-- begin-user-doc --> | ||
703 | * <!-- end-user-doc --> | ||
704 | * @return the meta object for class '<em>Communicating Element</em>'. | ||
705 | * @see satellite.CommunicatingElement | ||
706 | * @generated | ||
707 | */ | ||
708 | EClass getCommunicatingElement(); | ||
709 | |||
710 | /** | ||
711 | * Returns the meta object for the containment reference list '{@link satellite.CommunicatingElement#getCommSubsystem <em>Comm Subsystem</em>}'. | ||
712 | * <!-- begin-user-doc --> | ||
713 | * <!-- end-user-doc --> | ||
714 | * @return the meta object for the containment reference list '<em>Comm Subsystem</em>'. | ||
715 | * @see satellite.CommunicatingElement#getCommSubsystem() | ||
716 | * @see #getCommunicatingElement() | ||
717 | * @generated | ||
718 | */ | ||
719 | EReference getCommunicatingElement_CommSubsystem(); | ||
720 | |||
721 | /** | ||
722 | * Returns the meta object for class '{@link satellite.GroundStationNetwork <em>Ground Station Network</em>}'. | ||
723 | * <!-- begin-user-doc --> | ||
724 | * <!-- end-user-doc --> | ||
725 | * @return the meta object for class '<em>Ground Station Network</em>'. | ||
726 | * @see satellite.GroundStationNetwork | ||
727 | * @generated | ||
728 | */ | ||
729 | EClass getGroundStationNetwork(); | ||
730 | |||
731 | /** | ||
732 | * Returns the meta object for class '{@link satellite.Spacecraft <em>Spacecraft</em>}'. | ||
733 | * <!-- begin-user-doc --> | ||
734 | * <!-- end-user-doc --> | ||
735 | * @return the meta object for class '<em>Spacecraft</em>'. | ||
736 | * @see satellite.Spacecraft | ||
737 | * @generated | ||
738 | */ | ||
739 | EClass getSpacecraft(); | ||
740 | |||
741 | /** | ||
742 | * Returns the meta object for the containment reference '{@link satellite.Spacecraft#getPayload <em>Payload</em>}'. | ||
743 | * <!-- begin-user-doc --> | ||
744 | * <!-- end-user-doc --> | ||
745 | * @return the meta object for the containment reference '<em>Payload</em>'. | ||
746 | * @see satellite.Spacecraft#getPayload() | ||
747 | * @see #getSpacecraft() | ||
748 | * @generated | ||
749 | */ | ||
750 | EReference getSpacecraft_Payload(); | ||
751 | |||
752 | /** | ||
753 | * Returns the meta object for class '{@link satellite.CommSubsystem <em>Comm Subsystem</em>}'. | ||
754 | * <!-- begin-user-doc --> | ||
755 | * <!-- end-user-doc --> | ||
756 | * @return the meta object for class '<em>Comm Subsystem</em>'. | ||
757 | * @see satellite.CommSubsystem | ||
758 | * @generated | ||
759 | */ | ||
760 | EClass getCommSubsystem(); | ||
761 | |||
762 | /** | ||
763 | * Returns the meta object for the reference '{@link satellite.CommSubsystem#getTarget <em>Target</em>}'. | ||
764 | * <!-- begin-user-doc --> | ||
765 | * <!-- end-user-doc --> | ||
766 | * @return the meta object for the reference '<em>Target</em>'. | ||
767 | * @see satellite.CommSubsystem#getTarget() | ||
768 | * @see #getCommSubsystem() | ||
769 | * @generated | ||
770 | */ | ||
771 | EReference getCommSubsystem_Target(); | ||
772 | |||
773 | /** | ||
774 | * Returns the meta object for class '{@link satellite.Payload <em>Payload</em>}'. | ||
775 | * <!-- begin-user-doc --> | ||
776 | * <!-- end-user-doc --> | ||
777 | * @return the meta object for class '<em>Payload</em>'. | ||
778 | * @see satellite.Payload | ||
779 | * @generated | ||
780 | */ | ||
781 | EClass getPayload(); | ||
782 | |||
783 | /** | ||
784 | * Returns the meta object for class '{@link satellite.InterferometryPayload <em>Interferometry Payload</em>}'. | ||
785 | * <!-- begin-user-doc --> | ||
786 | * <!-- end-user-doc --> | ||
787 | * @return the meta object for class '<em>Interferometry Payload</em>'. | ||
788 | * @see satellite.InterferometryPayload | ||
789 | * @generated | ||
790 | */ | ||
791 | EClass getInterferometryPayload(); | ||
792 | |||
793 | /** | ||
794 | * Returns the meta object for class '{@link satellite.CubeSat3U <em>Cube Sat3 U</em>}'. | ||
795 | * <!-- begin-user-doc --> | ||
796 | * <!-- end-user-doc --> | ||
797 | * @return the meta object for class '<em>Cube Sat3 U</em>'. | ||
798 | * @see satellite.CubeSat3U | ||
799 | * @generated | ||
800 | */ | ||
801 | EClass getCubeSat3U(); | ||
802 | |||
803 | /** | ||
804 | * Returns the meta object for class '{@link satellite.CubeSat6U <em>Cube Sat6 U</em>}'. | ||
805 | * <!-- begin-user-doc --> | ||
806 | * <!-- end-user-doc --> | ||
807 | * @return the meta object for class '<em>Cube Sat6 U</em>'. | ||
808 | * @see satellite.CubeSat6U | ||
809 | * @generated | ||
810 | */ | ||
811 | EClass getCubeSat6U(); | ||
812 | |||
813 | /** | ||
814 | * Returns the meta object for class '{@link satellite.SmallSat <em>Small Sat</em>}'. | ||
815 | * <!-- begin-user-doc --> | ||
816 | * <!-- end-user-doc --> | ||
817 | * @return the meta object for class '<em>Small Sat</em>'. | ||
818 | * @see satellite.SmallSat | ||
819 | * @generated | ||
820 | */ | ||
821 | EClass getSmallSat(); | ||
822 | |||
823 | /** | ||
824 | * Returns the meta object for class '{@link satellite.CubeSat <em>Cube Sat</em>}'. | ||
825 | * <!-- begin-user-doc --> | ||
826 | * <!-- end-user-doc --> | ||
827 | * @return the meta object for class '<em>Cube Sat</em>'. | ||
828 | * @see satellite.CubeSat | ||
829 | * @generated | ||
830 | */ | ||
831 | EClass getCubeSat(); | ||
832 | |||
833 | /** | ||
834 | * Returns the meta object for class '{@link satellite.UHFCommSubsystem <em>UHF Comm Subsystem</em>}'. | ||
835 | * <!-- begin-user-doc --> | ||
836 | * <!-- end-user-doc --> | ||
837 | * @return the meta object for class '<em>UHF Comm Subsystem</em>'. | ||
838 | * @see satellite.UHFCommSubsystem | ||
839 | * @generated | ||
840 | */ | ||
841 | EClass getUHFCommSubsystem(); | ||
842 | |||
843 | /** | ||
844 | * Returns the meta object for class '{@link satellite.XCommSubsystem <em>XComm Subsystem</em>}'. | ||
845 | * <!-- begin-user-doc --> | ||
846 | * <!-- end-user-doc --> | ||
847 | * @return the meta object for class '<em>XComm Subsystem</em>'. | ||
848 | * @see satellite.XCommSubsystem | ||
849 | * @generated | ||
850 | */ | ||
851 | EClass getXCommSubsystem(); | ||
852 | |||
853 | /** | ||
854 | * Returns the meta object for class '{@link satellite.KaCommSubsystem <em>Ka Comm Subsystem</em>}'. | ||
855 | * <!-- begin-user-doc --> | ||
856 | * <!-- end-user-doc --> | ||
857 | * @return the meta object for class '<em>Ka Comm Subsystem</em>'. | ||
858 | * @see satellite.KaCommSubsystem | ||
859 | * @generated | ||
860 | */ | ||
861 | EClass getKaCommSubsystem(); | ||
862 | |||
863 | /** | ||
864 | * Returns the factory that creates the instances of the model. | ||
865 | * <!-- begin-user-doc --> | ||
866 | * <!-- end-user-doc --> | ||
867 | * @return the factory that creates the instances of the model. | ||
868 | * @generated | ||
869 | */ | ||
870 | SatelliteFactory getSatelliteFactory(); | ||
871 | |||
872 | /** | ||
873 | * <!-- begin-user-doc --> | ||
874 | * Defines literals for the meta objects that represent | ||
875 | * <ul> | ||
876 | * <li>each class,</li> | ||
877 | * <li>each feature of each class,</li> | ||
878 | * <li>each operation of each class,</li> | ||
879 | * <li>each enum,</li> | ||
880 | * <li>and each data type</li> | ||
881 | * </ul> | ||
882 | * <!-- end-user-doc --> | ||
883 | * @generated | ||
884 | */ | ||
885 | interface Literals { | ||
886 | /** | ||
887 | * The meta object literal for the '{@link satellite.impl.ConstellationMissionImpl <em>Constellation Mission</em>}' class. | ||
888 | * <!-- begin-user-doc --> | ||
889 | * <!-- end-user-doc --> | ||
890 | * @see satellite.impl.ConstellationMissionImpl | ||
891 | * @see satellite.impl.SatellitePackageImpl#getConstellationMission() | ||
892 | * @generated | ||
893 | */ | ||
894 | EClass CONSTELLATION_MISSION = eINSTANCE.getConstellationMission(); | ||
895 | |||
896 | /** | ||
897 | * The meta object literal for the '<em><b>Ground Station Network</b></em>' containment reference feature. | ||
898 | * <!-- begin-user-doc --> | ||
899 | * <!-- end-user-doc --> | ||
900 | * @generated | ||
901 | */ | ||
902 | EReference CONSTELLATION_MISSION__GROUND_STATION_NETWORK = eINSTANCE | ||
903 | .getConstellationMission_GroundStationNetwork(); | ||
904 | |||
905 | /** | ||
906 | * The meta object literal for the '<em><b>Spacecraft</b></em>' containment reference list feature. | ||
907 | * <!-- begin-user-doc --> | ||
908 | * <!-- end-user-doc --> | ||
909 | * @generated | ||
910 | */ | ||
911 | EReference CONSTELLATION_MISSION__SPACECRAFT = eINSTANCE.getConstellationMission_Spacecraft(); | ||
912 | |||
913 | /** | ||
914 | * The meta object literal for the '{@link satellite.impl.InterferometryMissionImpl <em>Interferometry Mission</em>}' class. | ||
915 | * <!-- begin-user-doc --> | ||
916 | * <!-- end-user-doc --> | ||
917 | * @see satellite.impl.InterferometryMissionImpl | ||
918 | * @see satellite.impl.SatellitePackageImpl#getInterferometryMission() | ||
919 | * @generated | ||
920 | */ | ||
921 | EClass INTERFEROMETRY_MISSION = eINSTANCE.getInterferometryMission(); | ||
922 | |||
923 | /** | ||
924 | * The meta object literal for the '{@link satellite.impl.CommunicatingElementImpl <em>Communicating Element</em>}' class. | ||
925 | * <!-- begin-user-doc --> | ||
926 | * <!-- end-user-doc --> | ||
927 | * @see satellite.impl.CommunicatingElementImpl | ||
928 | * @see satellite.impl.SatellitePackageImpl#getCommunicatingElement() | ||
929 | * @generated | ||
930 | */ | ||
931 | EClass COMMUNICATING_ELEMENT = eINSTANCE.getCommunicatingElement(); | ||
932 | |||
933 | /** | ||
934 | * The meta object literal for the '<em><b>Comm Subsystem</b></em>' containment reference list feature. | ||
935 | * <!-- begin-user-doc --> | ||
936 | * <!-- end-user-doc --> | ||
937 | * @generated | ||
938 | */ | ||
939 | EReference COMMUNICATING_ELEMENT__COMM_SUBSYSTEM = eINSTANCE.getCommunicatingElement_CommSubsystem(); | ||
940 | |||
941 | /** | ||
942 | * The meta object literal for the '{@link satellite.impl.GroundStationNetworkImpl <em>Ground Station Network</em>}' class. | ||
943 | * <!-- begin-user-doc --> | ||
944 | * <!-- end-user-doc --> | ||
945 | * @see satellite.impl.GroundStationNetworkImpl | ||
946 | * @see satellite.impl.SatellitePackageImpl#getGroundStationNetwork() | ||
947 | * @generated | ||
948 | */ | ||
949 | EClass GROUND_STATION_NETWORK = eINSTANCE.getGroundStationNetwork(); | ||
950 | |||
951 | /** | ||
952 | * The meta object literal for the '{@link satellite.impl.SpacecraftImpl <em>Spacecraft</em>}' class. | ||
953 | * <!-- begin-user-doc --> | ||
954 | * <!-- end-user-doc --> | ||
955 | * @see satellite.impl.SpacecraftImpl | ||
956 | * @see satellite.impl.SatellitePackageImpl#getSpacecraft() | ||
957 | * @generated | ||
958 | */ | ||
959 | EClass SPACECRAFT = eINSTANCE.getSpacecraft(); | ||
960 | |||
961 | /** | ||
962 | * The meta object literal for the '<em><b>Payload</b></em>' containment reference feature. | ||
963 | * <!-- begin-user-doc --> | ||
964 | * <!-- end-user-doc --> | ||
965 | * @generated | ||
966 | */ | ||
967 | EReference SPACECRAFT__PAYLOAD = eINSTANCE.getSpacecraft_Payload(); | ||
968 | |||
969 | /** | ||
970 | * The meta object literal for the '{@link satellite.impl.CommSubsystemImpl <em>Comm Subsystem</em>}' class. | ||
971 | * <!-- begin-user-doc --> | ||
972 | * <!-- end-user-doc --> | ||
973 | * @see satellite.impl.CommSubsystemImpl | ||
974 | * @see satellite.impl.SatellitePackageImpl#getCommSubsystem() | ||
975 | * @generated | ||
976 | */ | ||
977 | EClass COMM_SUBSYSTEM = eINSTANCE.getCommSubsystem(); | ||
978 | |||
979 | /** | ||
980 | * The meta object literal for the '<em><b>Target</b></em>' reference feature. | ||
981 | * <!-- begin-user-doc --> | ||
982 | * <!-- end-user-doc --> | ||
983 | * @generated | ||
984 | */ | ||
985 | EReference COMM_SUBSYSTEM__TARGET = eINSTANCE.getCommSubsystem_Target(); | ||
986 | |||
987 | /** | ||
988 | * The meta object literal for the '{@link satellite.impl.PayloadImpl <em>Payload</em>}' class. | ||
989 | * <!-- begin-user-doc --> | ||
990 | * <!-- end-user-doc --> | ||
991 | * @see satellite.impl.PayloadImpl | ||
992 | * @see satellite.impl.SatellitePackageImpl#getPayload() | ||
993 | * @generated | ||
994 | */ | ||
995 | EClass PAYLOAD = eINSTANCE.getPayload(); | ||
996 | |||
997 | /** | ||
998 | * The meta object literal for the '{@link satellite.impl.InterferometryPayloadImpl <em>Interferometry Payload</em>}' class. | ||
999 | * <!-- begin-user-doc --> | ||
1000 | * <!-- end-user-doc --> | ||
1001 | * @see satellite.impl.InterferometryPayloadImpl | ||
1002 | * @see satellite.impl.SatellitePackageImpl#getInterferometryPayload() | ||
1003 | * @generated | ||
1004 | */ | ||
1005 | EClass INTERFEROMETRY_PAYLOAD = eINSTANCE.getInterferometryPayload(); | ||
1006 | |||
1007 | /** | ||
1008 | * The meta object literal for the '{@link satellite.impl.CubeSat3UImpl <em>Cube Sat3 U</em>}' class. | ||
1009 | * <!-- begin-user-doc --> | ||
1010 | * <!-- end-user-doc --> | ||
1011 | * @see satellite.impl.CubeSat3UImpl | ||
1012 | * @see satellite.impl.SatellitePackageImpl#getCubeSat3U() | ||
1013 | * @generated | ||
1014 | */ | ||
1015 | EClass CUBE_SAT3_U = eINSTANCE.getCubeSat3U(); | ||
1016 | |||
1017 | /** | ||
1018 | * The meta object literal for the '{@link satellite.impl.CubeSat6UImpl <em>Cube Sat6 U</em>}' class. | ||
1019 | * <!-- begin-user-doc --> | ||
1020 | * <!-- end-user-doc --> | ||
1021 | * @see satellite.impl.CubeSat6UImpl | ||
1022 | * @see satellite.impl.SatellitePackageImpl#getCubeSat6U() | ||
1023 | * @generated | ||
1024 | */ | ||
1025 | EClass CUBE_SAT6_U = eINSTANCE.getCubeSat6U(); | ||
1026 | |||
1027 | /** | ||
1028 | * The meta object literal for the '{@link satellite.impl.SmallSatImpl <em>Small Sat</em>}' class. | ||
1029 | * <!-- begin-user-doc --> | ||
1030 | * <!-- end-user-doc --> | ||
1031 | * @see satellite.impl.SmallSatImpl | ||
1032 | * @see satellite.impl.SatellitePackageImpl#getSmallSat() | ||
1033 | * @generated | ||
1034 | */ | ||
1035 | EClass SMALL_SAT = eINSTANCE.getSmallSat(); | ||
1036 | |||
1037 | /** | ||
1038 | * The meta object literal for the '{@link satellite.impl.CubeSatImpl <em>Cube Sat</em>}' class. | ||
1039 | * <!-- begin-user-doc --> | ||
1040 | * <!-- end-user-doc --> | ||
1041 | * @see satellite.impl.CubeSatImpl | ||
1042 | * @see satellite.impl.SatellitePackageImpl#getCubeSat() | ||
1043 | * @generated | ||
1044 | */ | ||
1045 | EClass CUBE_SAT = eINSTANCE.getCubeSat(); | ||
1046 | |||
1047 | /** | ||
1048 | * The meta object literal for the '{@link satellite.impl.UHFCommSubsystemImpl <em>UHF Comm Subsystem</em>}' class. | ||
1049 | * <!-- begin-user-doc --> | ||
1050 | * <!-- end-user-doc --> | ||
1051 | * @see satellite.impl.UHFCommSubsystemImpl | ||
1052 | * @see satellite.impl.SatellitePackageImpl#getUHFCommSubsystem() | ||
1053 | * @generated | ||
1054 | */ | ||
1055 | EClass UHF_COMM_SUBSYSTEM = eINSTANCE.getUHFCommSubsystem(); | ||
1056 | |||
1057 | /** | ||
1058 | * The meta object literal for the '{@link satellite.impl.XCommSubsystemImpl <em>XComm Subsystem</em>}' class. | ||
1059 | * <!-- begin-user-doc --> | ||
1060 | * <!-- end-user-doc --> | ||
1061 | * @see satellite.impl.XCommSubsystemImpl | ||
1062 | * @see satellite.impl.SatellitePackageImpl#getXCommSubsystem() | ||
1063 | * @generated | ||
1064 | */ | ||
1065 | EClass XCOMM_SUBSYSTEM = eINSTANCE.getXCommSubsystem(); | ||
1066 | |||
1067 | /** | ||
1068 | * The meta object literal for the '{@link satellite.impl.KaCommSubsystemImpl <em>Ka Comm Subsystem</em>}' class. | ||
1069 | * <!-- begin-user-doc --> | ||
1070 | * <!-- end-user-doc --> | ||
1071 | * @see satellite.impl.KaCommSubsystemImpl | ||
1072 | * @see satellite.impl.SatellitePackageImpl#getKaCommSubsystem() | ||
1073 | * @generated | ||
1074 | */ | ||
1075 | EClass KA_COMM_SUBSYSTEM = eINSTANCE.getKaCommSubsystem(); | ||
1076 | |||
1077 | } | ||
1078 | |||
1079 | } //SatellitePackage | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SmallSat.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SmallSat.java new file mode 100644 index 00000000..230958f6 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SmallSat.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Small Sat</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getSmallSat() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface SmallSat extends Spacecraft { | ||
16 | } // SmallSat | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Spacecraft.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Spacecraft.java new file mode 100644 index 00000000..b0a2754e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/Spacecraft.java | |||
@@ -0,0 +1,44 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>Spacecraft</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * <p> | ||
11 | * The following features are supported: | ||
12 | * </p> | ||
13 | * <ul> | ||
14 | * <li>{@link satellite.Spacecraft#getPayload <em>Payload</em>}</li> | ||
15 | * </ul> | ||
16 | * | ||
17 | * @see satellite.SatellitePackage#getSpacecraft() | ||
18 | * @model abstract="true" | ||
19 | * @generated | ||
20 | */ | ||
21 | public interface Spacecraft extends CommunicatingElement { | ||
22 | /** | ||
23 | * Returns the value of the '<em><b>Payload</b></em>' containment reference. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @return the value of the '<em>Payload</em>' containment reference. | ||
27 | * @see #setPayload(Payload) | ||
28 | * @see satellite.SatellitePackage#getSpacecraft_Payload() | ||
29 | * @model containment="true" | ||
30 | * @generated | ||
31 | */ | ||
32 | Payload getPayload(); | ||
33 | |||
34 | /** | ||
35 | * Sets the value of the '{@link satellite.Spacecraft#getPayload <em>Payload</em>}' containment reference. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @param value the new value of the '<em>Payload</em>' containment reference. | ||
39 | * @see #getPayload() | ||
40 | * @generated | ||
41 | */ | ||
42 | void setPayload(Payload value); | ||
43 | |||
44 | } // Spacecraft | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SpacecraftKind.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SpacecraftKind.java new file mode 100644 index 00000000..76232414 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SpacecraftKind.java | |||
@@ -0,0 +1,230 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import java.util.Arrays; | ||
6 | import java.util.Collections; | ||
7 | import java.util.List; | ||
8 | |||
9 | import org.eclipse.emf.common.util.Enumerator; | ||
10 | |||
11 | /** | ||
12 | * <!-- begin-user-doc --> | ||
13 | * A representation of the literals of the enumeration '<em><b>Spacecraft Kind</b></em>', | ||
14 | * and utility methods for working with them. | ||
15 | * <!-- end-user-doc --> | ||
16 | * @see satellite.SatellitePackage#getSpacecraftKind() | ||
17 | * @model | ||
18 | * @generated | ||
19 | */ | ||
20 | public enum SpacecraftKind implements Enumerator { | ||
21 | /** | ||
22 | * The '<em><b>Cube Sat3 U</b></em>' literal object. | ||
23 | * <!-- begin-user-doc --> | ||
24 | * <!-- end-user-doc --> | ||
25 | * @see #CUBE_SAT3_U_VALUE | ||
26 | * @generated | ||
27 | * @ordered | ||
28 | */ | ||
29 | CUBE_SAT3_U(0, "CubeSat3U", "CubeSat3U"), | ||
30 | |||
31 | /** | ||
32 | * The '<em><b>Cube Sat6 U</b></em>' literal object. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @see #CUBE_SAT6_U_VALUE | ||
36 | * @generated | ||
37 | * @ordered | ||
38 | */ | ||
39 | CUBE_SAT6_U(1, "CubeSat6U", "CubeSat6U"), | ||
40 | |||
41 | /** | ||
42 | * The '<em><b>Small Sat</b></em>' literal object. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #SMALL_SAT_VALUE | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | SMALL_SAT(2, "SmallSat", "SmallSat"); | ||
50 | |||
51 | /** | ||
52 | * The '<em><b>Cube Sat3 U</b></em>' literal value. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #CUBE_SAT3_U | ||
56 | * @model name="CubeSat3U" | ||
57 | * @generated | ||
58 | * @ordered | ||
59 | */ | ||
60 | public static final int CUBE_SAT3_U_VALUE = 0; | ||
61 | |||
62 | /** | ||
63 | * The '<em><b>Cube Sat6 U</b></em>' literal value. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @see #CUBE_SAT6_U | ||
67 | * @model name="CubeSat6U" | ||
68 | * @generated | ||
69 | * @ordered | ||
70 | */ | ||
71 | public static final int CUBE_SAT6_U_VALUE = 1; | ||
72 | |||
73 | /** | ||
74 | * The '<em><b>Small Sat</b></em>' literal value. | ||
75 | * <!-- begin-user-doc --> | ||
76 | * <!-- end-user-doc --> | ||
77 | * @see #SMALL_SAT | ||
78 | * @model name="SmallSat" | ||
79 | * @generated | ||
80 | * @ordered | ||
81 | */ | ||
82 | public static final int SMALL_SAT_VALUE = 2; | ||
83 | |||
84 | /** | ||
85 | * An array of all the '<em><b>Spacecraft Kind</b></em>' enumerators. | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @generated | ||
89 | */ | ||
90 | private static final SpacecraftKind[] VALUES_ARRAY = new SpacecraftKind[] { CUBE_SAT3_U, CUBE_SAT6_U, SMALL_SAT, }; | ||
91 | |||
92 | /** | ||
93 | * A public read-only list of all the '<em><b>Spacecraft Kind</b></em>' enumerators. | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | public static final List<SpacecraftKind> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); | ||
99 | |||
100 | /** | ||
101 | * Returns the '<em><b>Spacecraft Kind</b></em>' literal with the specified literal value. | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @param literal the literal. | ||
105 | * @return the matching enumerator or <code>null</code>. | ||
106 | * @generated | ||
107 | */ | ||
108 | public static SpacecraftKind get(String literal) { | ||
109 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { | ||
110 | SpacecraftKind result = VALUES_ARRAY[i]; | ||
111 | if (result.toString().equals(literal)) { | ||
112 | return result; | ||
113 | } | ||
114 | } | ||
115 | return null; | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * Returns the '<em><b>Spacecraft Kind</b></em>' literal with the specified name. | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @param name the name. | ||
123 | * @return the matching enumerator or <code>null</code>. | ||
124 | * @generated | ||
125 | */ | ||
126 | public static SpacecraftKind getByName(String name) { | ||
127 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { | ||
128 | SpacecraftKind result = VALUES_ARRAY[i]; | ||
129 | if (result.getName().equals(name)) { | ||
130 | return result; | ||
131 | } | ||
132 | } | ||
133 | return null; | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * Returns the '<em><b>Spacecraft Kind</b></em>' literal with the specified integer value. | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @param value the integer value. | ||
141 | * @return the matching enumerator or <code>null</code>. | ||
142 | * @generated | ||
143 | */ | ||
144 | public static SpacecraftKind get(int value) { | ||
145 | switch (value) { | ||
146 | case CUBE_SAT3_U_VALUE: | ||
147 | return CUBE_SAT3_U; | ||
148 | case CUBE_SAT6_U_VALUE: | ||
149 | return CUBE_SAT6_U; | ||
150 | case SMALL_SAT_VALUE: | ||
151 | return SMALL_SAT; | ||
152 | } | ||
153 | return null; | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * <!-- begin-user-doc --> | ||
158 | * <!-- end-user-doc --> | ||
159 | * @generated | ||
160 | */ | ||
161 | private final int value; | ||
162 | |||
163 | /** | ||
164 | * <!-- begin-user-doc --> | ||
165 | * <!-- end-user-doc --> | ||
166 | * @generated | ||
167 | */ | ||
168 | private final String name; | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | private final String literal; | ||
176 | |||
177 | /** | ||
178 | * Only this class can construct instances. | ||
179 | * <!-- begin-user-doc --> | ||
180 | * <!-- end-user-doc --> | ||
181 | * @generated | ||
182 | */ | ||
183 | private SpacecraftKind(int value, String name, String literal) { | ||
184 | this.value = value; | ||
185 | this.name = name; | ||
186 | this.literal = literal; | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | */ | ||
194 | @Override | ||
195 | public int getValue() { | ||
196 | return value; | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * <!-- begin-user-doc --> | ||
201 | * <!-- end-user-doc --> | ||
202 | * @generated | ||
203 | */ | ||
204 | @Override | ||
205 | public String getName() { | ||
206 | return name; | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * <!-- begin-user-doc --> | ||
211 | * <!-- end-user-doc --> | ||
212 | * @generated | ||
213 | */ | ||
214 | @Override | ||
215 | public String getLiteral() { | ||
216 | return literal; | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * Returns the literal value of the enumerator, which is its string representation. | ||
221 | * <!-- begin-user-doc --> | ||
222 | * <!-- end-user-doc --> | ||
223 | * @generated | ||
224 | */ | ||
225 | @Override | ||
226 | public String toString() { | ||
227 | return literal; | ||
228 | } | ||
229 | |||
230 | } //SpacecraftKind | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/TransceiverBand.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/TransceiverBand.java new file mode 100644 index 00000000..9d8d5697 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/TransceiverBand.java | |||
@@ -0,0 +1,230 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | import java.util.Arrays; | ||
6 | import java.util.Collections; | ||
7 | import java.util.List; | ||
8 | |||
9 | import org.eclipse.emf.common.util.Enumerator; | ||
10 | |||
11 | /** | ||
12 | * <!-- begin-user-doc --> | ||
13 | * A representation of the literals of the enumeration '<em><b>Transceiver Band</b></em>', | ||
14 | * and utility methods for working with them. | ||
15 | * <!-- end-user-doc --> | ||
16 | * @see satellite.SatellitePackage#getTransceiverBand() | ||
17 | * @model | ||
18 | * @generated | ||
19 | */ | ||
20 | public enum TransceiverBand implements Enumerator { | ||
21 | /** | ||
22 | * The '<em><b>UHF</b></em>' literal object. | ||
23 | * <!-- begin-user-doc --> | ||
24 | * <!-- end-user-doc --> | ||
25 | * @see #UHF_VALUE | ||
26 | * @generated | ||
27 | * @ordered | ||
28 | */ | ||
29 | UHF(0, "UHF", "UHF"), | ||
30 | |||
31 | /** | ||
32 | * The '<em><b>X</b></em>' literal object. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @see #X_VALUE | ||
36 | * @generated | ||
37 | * @ordered | ||
38 | */ | ||
39 | X(1, "X", "X"), | ||
40 | |||
41 | /** | ||
42 | * The '<em><b>Ka</b></em>' literal object. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #KA_VALUE | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | KA(2, "Ka", "Ka"); | ||
50 | |||
51 | /** | ||
52 | * The '<em><b>UHF</b></em>' literal value. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #UHF | ||
56 | * @model | ||
57 | * @generated | ||
58 | * @ordered | ||
59 | */ | ||
60 | public static final int UHF_VALUE = 0; | ||
61 | |||
62 | /** | ||
63 | * The '<em><b>X</b></em>' literal value. | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @see #X | ||
67 | * @model | ||
68 | * @generated | ||
69 | * @ordered | ||
70 | */ | ||
71 | public static final int X_VALUE = 1; | ||
72 | |||
73 | /** | ||
74 | * The '<em><b>Ka</b></em>' literal value. | ||
75 | * <!-- begin-user-doc --> | ||
76 | * <!-- end-user-doc --> | ||
77 | * @see #KA | ||
78 | * @model name="Ka" | ||
79 | * @generated | ||
80 | * @ordered | ||
81 | */ | ||
82 | public static final int KA_VALUE = 2; | ||
83 | |||
84 | /** | ||
85 | * An array of all the '<em><b>Transceiver Band</b></em>' enumerators. | ||
86 | * <!-- begin-user-doc --> | ||
87 | * <!-- end-user-doc --> | ||
88 | * @generated | ||
89 | */ | ||
90 | private static final TransceiverBand[] VALUES_ARRAY = new TransceiverBand[] { UHF, X, KA, }; | ||
91 | |||
92 | /** | ||
93 | * A public read-only list of all the '<em><b>Transceiver Band</b></em>' enumerators. | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | public static final List<TransceiverBand> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY)); | ||
99 | |||
100 | /** | ||
101 | * Returns the '<em><b>Transceiver Band</b></em>' literal with the specified literal value. | ||
102 | * <!-- begin-user-doc --> | ||
103 | * <!-- end-user-doc --> | ||
104 | * @param literal the literal. | ||
105 | * @return the matching enumerator or <code>null</code>. | ||
106 | * @generated | ||
107 | */ | ||
108 | public static TransceiverBand get(String literal) { | ||
109 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { | ||
110 | TransceiverBand result = VALUES_ARRAY[i]; | ||
111 | if (result.toString().equals(literal)) { | ||
112 | return result; | ||
113 | } | ||
114 | } | ||
115 | return null; | ||
116 | } | ||
117 | |||
118 | /** | ||
119 | * Returns the '<em><b>Transceiver Band</b></em>' literal with the specified name. | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @param name the name. | ||
123 | * @return the matching enumerator or <code>null</code>. | ||
124 | * @generated | ||
125 | */ | ||
126 | public static TransceiverBand getByName(String name) { | ||
127 | for (int i = 0; i < VALUES_ARRAY.length; ++i) { | ||
128 | TransceiverBand result = VALUES_ARRAY[i]; | ||
129 | if (result.getName().equals(name)) { | ||
130 | return result; | ||
131 | } | ||
132 | } | ||
133 | return null; | ||
134 | } | ||
135 | |||
136 | /** | ||
137 | * Returns the '<em><b>Transceiver Band</b></em>' literal with the specified integer value. | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @param value the integer value. | ||
141 | * @return the matching enumerator or <code>null</code>. | ||
142 | * @generated | ||
143 | */ | ||
144 | public static TransceiverBand get(int value) { | ||
145 | switch (value) { | ||
146 | case UHF_VALUE: | ||
147 | return UHF; | ||
148 | case X_VALUE: | ||
149 | return X; | ||
150 | case KA_VALUE: | ||
151 | return KA; | ||
152 | } | ||
153 | return null; | ||
154 | } | ||
155 | |||
156 | /** | ||
157 | * <!-- begin-user-doc --> | ||
158 | * <!-- end-user-doc --> | ||
159 | * @generated | ||
160 | */ | ||
161 | private final int value; | ||
162 | |||
163 | /** | ||
164 | * <!-- begin-user-doc --> | ||
165 | * <!-- end-user-doc --> | ||
166 | * @generated | ||
167 | */ | ||
168 | private final String name; | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | private final String literal; | ||
176 | |||
177 | /** | ||
178 | * Only this class can construct instances. | ||
179 | * <!-- begin-user-doc --> | ||
180 | * <!-- end-user-doc --> | ||
181 | * @generated | ||
182 | */ | ||
183 | private TransceiverBand(int value, String name, String literal) { | ||
184 | this.value = value; | ||
185 | this.name = name; | ||
186 | this.literal = literal; | ||
187 | } | ||
188 | |||
189 | /** | ||
190 | * <!-- begin-user-doc --> | ||
191 | * <!-- end-user-doc --> | ||
192 | * @generated | ||
193 | */ | ||
194 | @Override | ||
195 | public int getValue() { | ||
196 | return value; | ||
197 | } | ||
198 | |||
199 | /** | ||
200 | * <!-- begin-user-doc --> | ||
201 | * <!-- end-user-doc --> | ||
202 | * @generated | ||
203 | */ | ||
204 | @Override | ||
205 | public String getName() { | ||
206 | return name; | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * <!-- begin-user-doc --> | ||
211 | * <!-- end-user-doc --> | ||
212 | * @generated | ||
213 | */ | ||
214 | @Override | ||
215 | public String getLiteral() { | ||
216 | return literal; | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * Returns the literal value of the enumerator, which is its string representation. | ||
221 | * <!-- begin-user-doc --> | ||
222 | * <!-- end-user-doc --> | ||
223 | * @generated | ||
224 | */ | ||
225 | @Override | ||
226 | public String toString() { | ||
227 | return literal; | ||
228 | } | ||
229 | |||
230 | } //TransceiverBand | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/UHFCommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/UHFCommSubsystem.java new file mode 100644 index 00000000..5b36d6c7 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/UHFCommSubsystem.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>UHF Comm Subsystem</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getUHFCommSubsystem() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface UHFCommSubsystem extends CommSubsystem { | ||
16 | } // UHFCommSubsystem | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/XCommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/XCommSubsystem.java new file mode 100644 index 00000000..c2b0ecd5 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/XCommSubsystem.java | |||
@@ -0,0 +1,16 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite; | ||
4 | |||
5 | /** | ||
6 | * <!-- begin-user-doc --> | ||
7 | * A representation of the model object '<em><b>XComm Subsystem</b></em>'. | ||
8 | * <!-- end-user-doc --> | ||
9 | * | ||
10 | * | ||
11 | * @see satellite.SatellitePackage#getXCommSubsystem() | ||
12 | * @model | ||
13 | * @generated | ||
14 | */ | ||
15 | public interface XCommSubsystem extends CommSubsystem { | ||
16 | } // XCommSubsystem | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java new file mode 100644 index 00000000..d39abd4d --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java | |||
@@ -0,0 +1,159 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.common.notify.Notification; | ||
6 | import org.eclipse.emf.ecore.EClass; | ||
7 | import org.eclipse.emf.ecore.InternalEObject; | ||
8 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
9 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
10 | import satellite.CommSubsystem; | ||
11 | import satellite.SatellitePackage; | ||
12 | |||
13 | /** | ||
14 | * <!-- begin-user-doc --> | ||
15 | * An implementation of the model object '<em><b>Comm Subsystem</b></em>'. | ||
16 | * <!-- end-user-doc --> | ||
17 | * <p> | ||
18 | * The following features are implemented: | ||
19 | * </p> | ||
20 | * <ul> | ||
21 | * <li>{@link satellite.impl.CommSubsystemImpl#getTarget <em>Target</em>}</li> | ||
22 | * </ul> | ||
23 | * | ||
24 | * @generated | ||
25 | */ | ||
26 | public abstract class CommSubsystemImpl extends MinimalEObjectImpl.Container implements CommSubsystem { | ||
27 | /** | ||
28 | * The cached value of the '{@link #getTarget() <em>Target</em>}' reference. | ||
29 | * <!-- begin-user-doc --> | ||
30 | * <!-- end-user-doc --> | ||
31 | * @see #getTarget() | ||
32 | * @generated | ||
33 | * @ordered | ||
34 | */ | ||
35 | protected CommSubsystem target; | ||
36 | |||
37 | /** | ||
38 | * <!-- begin-user-doc --> | ||
39 | * <!-- end-user-doc --> | ||
40 | * @generated | ||
41 | */ | ||
42 | protected CommSubsystemImpl() { | ||
43 | super(); | ||
44 | } | ||
45 | |||
46 | /** | ||
47 | * <!-- begin-user-doc --> | ||
48 | * <!-- end-user-doc --> | ||
49 | * @generated | ||
50 | */ | ||
51 | @Override | ||
52 | protected EClass eStaticClass() { | ||
53 | return SatellitePackage.Literals.COMM_SUBSYSTEM; | ||
54 | } | ||
55 | |||
56 | /** | ||
57 | * <!-- begin-user-doc --> | ||
58 | * <!-- end-user-doc --> | ||
59 | * @generated | ||
60 | */ | ||
61 | @Override | ||
62 | public CommSubsystem getTarget() { | ||
63 | if (target != null && target.eIsProxy()) { | ||
64 | InternalEObject oldTarget = (InternalEObject) target; | ||
65 | target = (CommSubsystem) eResolveProxy(oldTarget); | ||
66 | if (target != oldTarget) { | ||
67 | if (eNotificationRequired()) | ||
68 | eNotify(new ENotificationImpl(this, Notification.RESOLVE, SatellitePackage.COMM_SUBSYSTEM__TARGET, | ||
69 | oldTarget, target)); | ||
70 | } | ||
71 | } | ||
72 | return target; | ||
73 | } | ||
74 | |||
75 | /** | ||
76 | * <!-- begin-user-doc --> | ||
77 | * <!-- end-user-doc --> | ||
78 | * @generated | ||
79 | */ | ||
80 | public CommSubsystem basicGetTarget() { | ||
81 | return target; | ||
82 | } | ||
83 | |||
84 | /** | ||
85 | * <!-- begin-user-doc --> | ||
86 | * <!-- end-user-doc --> | ||
87 | * @generated | ||
88 | */ | ||
89 | @Override | ||
90 | public void setTarget(CommSubsystem newTarget) { | ||
91 | CommSubsystem oldTarget = target; | ||
92 | target = newTarget; | ||
93 | if (eNotificationRequired()) | ||
94 | eNotify(new ENotificationImpl(this, Notification.SET, SatellitePackage.COMM_SUBSYSTEM__TARGET, oldTarget, | ||
95 | target)); | ||
96 | } | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | */ | ||
103 | @Override | ||
104 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
105 | switch (featureID) { | ||
106 | case SatellitePackage.COMM_SUBSYSTEM__TARGET: | ||
107 | if (resolve) | ||
108 | return getTarget(); | ||
109 | return basicGetTarget(); | ||
110 | } | ||
111 | return super.eGet(featureID, resolve, coreType); | ||
112 | } | ||
113 | |||
114 | /** | ||
115 | * <!-- begin-user-doc --> | ||
116 | * <!-- end-user-doc --> | ||
117 | * @generated | ||
118 | */ | ||
119 | @SuppressWarnings("unchecked") | ||
120 | @Override | ||
121 | public void eSet(int featureID, Object newValue) { | ||
122 | switch (featureID) { | ||
123 | case SatellitePackage.COMM_SUBSYSTEM__TARGET: | ||
124 | setTarget((CommSubsystem) newValue); | ||
125 | return; | ||
126 | } | ||
127 | super.eSet(featureID, newValue); | ||
128 | } | ||
129 | |||
130 | /** | ||
131 | * <!-- begin-user-doc --> | ||
132 | * <!-- end-user-doc --> | ||
133 | * @generated | ||
134 | */ | ||
135 | @Override | ||
136 | public void eUnset(int featureID) { | ||
137 | switch (featureID) { | ||
138 | case SatellitePackage.COMM_SUBSYSTEM__TARGET: | ||
139 | setTarget((CommSubsystem) null); | ||
140 | return; | ||
141 | } | ||
142 | super.eUnset(featureID); | ||
143 | } | ||
144 | |||
145 | /** | ||
146 | * <!-- begin-user-doc --> | ||
147 | * <!-- end-user-doc --> | ||
148 | * @generated | ||
149 | */ | ||
150 | @Override | ||
151 | public boolean eIsSet(int featureID) { | ||
152 | switch (featureID) { | ||
153 | case SatellitePackage.COMM_SUBSYSTEM__TARGET: | ||
154 | return target != null; | ||
155 | } | ||
156 | return super.eIsSet(featureID); | ||
157 | } | ||
158 | |||
159 | } //CommSubsystemImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommunicatingElementImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommunicatingElementImpl.java new file mode 100644 index 00000000..d44547d3 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommunicatingElementImpl.java | |||
@@ -0,0 +1,152 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | import org.eclipse.emf.common.notify.NotificationChain; | ||
7 | |||
8 | import org.eclipse.emf.common.util.EList; | ||
9 | |||
10 | import org.eclipse.emf.ecore.EClass; | ||
11 | import org.eclipse.emf.ecore.InternalEObject; | ||
12 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
13 | |||
14 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
15 | import org.eclipse.emf.ecore.util.InternalEList; | ||
16 | |||
17 | import satellite.CommSubsystem; | ||
18 | import satellite.CommunicatingElement; | ||
19 | import satellite.SatellitePackage; | ||
20 | |||
21 | /** | ||
22 | * <!-- begin-user-doc --> | ||
23 | * An implementation of the model object '<em><b>Communicating Element</b></em>'. | ||
24 | * <!-- end-user-doc --> | ||
25 | * <p> | ||
26 | * The following features are implemented: | ||
27 | * </p> | ||
28 | * <ul> | ||
29 | * <li>{@link satellite.impl.CommunicatingElementImpl#getCommSubsystem <em>Comm Subsystem</em>}</li> | ||
30 | * </ul> | ||
31 | * | ||
32 | * @generated | ||
33 | */ | ||
34 | public abstract class CommunicatingElementImpl extends MinimalEObjectImpl.Container implements CommunicatingElement { | ||
35 | /** | ||
36 | * The cached value of the '{@link #getCommSubsystem() <em>Comm Subsystem</em>}' containment reference list. | ||
37 | * <!-- begin-user-doc --> | ||
38 | * <!-- end-user-doc --> | ||
39 | * @see #getCommSubsystem() | ||
40 | * @generated | ||
41 | * @ordered | ||
42 | */ | ||
43 | protected EList<CommSubsystem> commSubsystem; | ||
44 | |||
45 | /** | ||
46 | * <!-- begin-user-doc --> | ||
47 | * <!-- end-user-doc --> | ||
48 | * @generated | ||
49 | */ | ||
50 | protected CommunicatingElementImpl() { | ||
51 | super(); | ||
52 | } | ||
53 | |||
54 | /** | ||
55 | * <!-- begin-user-doc --> | ||
56 | * <!-- end-user-doc --> | ||
57 | * @generated | ||
58 | */ | ||
59 | @Override | ||
60 | protected EClass eStaticClass() { | ||
61 | return SatellitePackage.Literals.COMMUNICATING_ELEMENT; | ||
62 | } | ||
63 | |||
64 | /** | ||
65 | * <!-- begin-user-doc --> | ||
66 | * <!-- end-user-doc --> | ||
67 | * @generated | ||
68 | */ | ||
69 | @Override | ||
70 | public EList<CommSubsystem> getCommSubsystem() { | ||
71 | if (commSubsystem == null) { | ||
72 | commSubsystem = new EObjectContainmentEList<CommSubsystem>(CommSubsystem.class, this, | ||
73 | SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM); | ||
74 | } | ||
75 | return commSubsystem; | ||
76 | } | ||
77 | |||
78 | /** | ||
79 | * <!-- begin-user-doc --> | ||
80 | * <!-- end-user-doc --> | ||
81 | * @generated | ||
82 | */ | ||
83 | @Override | ||
84 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
85 | switch (featureID) { | ||
86 | case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: | ||
87 | return ((InternalEList<?>) getCommSubsystem()).basicRemove(otherEnd, msgs); | ||
88 | } | ||
89 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
90 | } | ||
91 | |||
92 | /** | ||
93 | * <!-- begin-user-doc --> | ||
94 | * <!-- end-user-doc --> | ||
95 | * @generated | ||
96 | */ | ||
97 | @Override | ||
98 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
99 | switch (featureID) { | ||
100 | case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: | ||
101 | return getCommSubsystem(); | ||
102 | } | ||
103 | return super.eGet(featureID, resolve, coreType); | ||
104 | } | ||
105 | |||
106 | /** | ||
107 | * <!-- begin-user-doc --> | ||
108 | * <!-- end-user-doc --> | ||
109 | * @generated | ||
110 | */ | ||
111 | @SuppressWarnings("unchecked") | ||
112 | @Override | ||
113 | public void eSet(int featureID, Object newValue) { | ||
114 | switch (featureID) { | ||
115 | case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: | ||
116 | getCommSubsystem().clear(); | ||
117 | getCommSubsystem().addAll((Collection<? extends CommSubsystem>) newValue); | ||
118 | return; | ||
119 | } | ||
120 | super.eSet(featureID, newValue); | ||
121 | } | ||
122 | |||
123 | /** | ||
124 | * <!-- begin-user-doc --> | ||
125 | * <!-- end-user-doc --> | ||
126 | * @generated | ||
127 | */ | ||
128 | @Override | ||
129 | public void eUnset(int featureID) { | ||
130 | switch (featureID) { | ||
131 | case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: | ||
132 | getCommSubsystem().clear(); | ||
133 | return; | ||
134 | } | ||
135 | super.eUnset(featureID); | ||
136 | } | ||
137 | |||
138 | /** | ||
139 | * <!-- begin-user-doc --> | ||
140 | * <!-- end-user-doc --> | ||
141 | * @generated | ||
142 | */ | ||
143 | @Override | ||
144 | public boolean eIsSet(int featureID) { | ||
145 | switch (featureID) { | ||
146 | case SatellitePackage.COMMUNICATING_ELEMENT__COMM_SUBSYSTEM: | ||
147 | return commSubsystem != null && !commSubsystem.isEmpty(); | ||
148 | } | ||
149 | return super.eIsSet(featureID); | ||
150 | } | ||
151 | |||
152 | } //CommunicatingElementImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/ConstellationMissionImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/ConstellationMissionImpl.java new file mode 100644 index 00000000..7635d7cd --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/ConstellationMissionImpl.java | |||
@@ -0,0 +1,237 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import java.util.Collection; | ||
6 | |||
7 | import org.eclipse.emf.common.notify.Notification; | ||
8 | import org.eclipse.emf.common.notify.NotificationChain; | ||
9 | |||
10 | import org.eclipse.emf.common.util.EList; | ||
11 | |||
12 | import org.eclipse.emf.ecore.EClass; | ||
13 | import org.eclipse.emf.ecore.InternalEObject; | ||
14 | |||
15 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
16 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
17 | |||
18 | import org.eclipse.emf.ecore.util.EObjectContainmentEList; | ||
19 | import org.eclipse.emf.ecore.util.InternalEList; | ||
20 | |||
21 | import satellite.ConstellationMission; | ||
22 | import satellite.GroundStationNetwork; | ||
23 | import satellite.SatellitePackage; | ||
24 | import satellite.Spacecraft; | ||
25 | |||
26 | /** | ||
27 | * <!-- begin-user-doc --> | ||
28 | * An implementation of the model object '<em><b>Constellation Mission</b></em>'. | ||
29 | * <!-- end-user-doc --> | ||
30 | * <p> | ||
31 | * The following features are implemented: | ||
32 | * </p> | ||
33 | * <ul> | ||
34 | * <li>{@link satellite.impl.ConstellationMissionImpl#getGroundStationNetwork <em>Ground Station Network</em>}</li> | ||
35 | * <li>{@link satellite.impl.ConstellationMissionImpl#getSpacecraft <em>Spacecraft</em>}</li> | ||
36 | * </ul> | ||
37 | * | ||
38 | * @generated | ||
39 | */ | ||
40 | public abstract class ConstellationMissionImpl extends MinimalEObjectImpl.Container implements ConstellationMission { | ||
41 | /** | ||
42 | * The cached value of the '{@link #getGroundStationNetwork() <em>Ground Station Network</em>}' containment reference. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @see #getGroundStationNetwork() | ||
46 | * @generated | ||
47 | * @ordered | ||
48 | */ | ||
49 | protected GroundStationNetwork groundStationNetwork; | ||
50 | |||
51 | /** | ||
52 | * The cached value of the '{@link #getSpacecraft() <em>Spacecraft</em>}' containment reference list. | ||
53 | * <!-- begin-user-doc --> | ||
54 | * <!-- end-user-doc --> | ||
55 | * @see #getSpacecraft() | ||
56 | * @generated | ||
57 | * @ordered | ||
58 | */ | ||
59 | protected EList<Spacecraft> spacecraft; | ||
60 | |||
61 | /** | ||
62 | * <!-- begin-user-doc --> | ||
63 | * <!-- end-user-doc --> | ||
64 | * @generated | ||
65 | */ | ||
66 | protected ConstellationMissionImpl() { | ||
67 | super(); | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | @Override | ||
76 | protected EClass eStaticClass() { | ||
77 | return SatellitePackage.Literals.CONSTELLATION_MISSION; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * <!-- begin-user-doc --> | ||
82 | * <!-- end-user-doc --> | ||
83 | * @generated | ||
84 | */ | ||
85 | @Override | ||
86 | public GroundStationNetwork getGroundStationNetwork() { | ||
87 | return groundStationNetwork; | ||
88 | } | ||
89 | |||
90 | /** | ||
91 | * <!-- begin-user-doc --> | ||
92 | * <!-- end-user-doc --> | ||
93 | * @generated | ||
94 | */ | ||
95 | public NotificationChain basicSetGroundStationNetwork(GroundStationNetwork newGroundStationNetwork, | ||
96 | NotificationChain msgs) { | ||
97 | GroundStationNetwork oldGroundStationNetwork = groundStationNetwork; | ||
98 | groundStationNetwork = newGroundStationNetwork; | ||
99 | if (eNotificationRequired()) { | ||
100 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, | ||
101 | SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, oldGroundStationNetwork, | ||
102 | newGroundStationNetwork); | ||
103 | if (msgs == null) | ||
104 | msgs = notification; | ||
105 | else | ||
106 | msgs.add(notification); | ||
107 | } | ||
108 | return msgs; | ||
109 | } | ||
110 | |||
111 | /** | ||
112 | * <!-- begin-user-doc --> | ||
113 | * <!-- end-user-doc --> | ||
114 | * @generated | ||
115 | */ | ||
116 | @Override | ||
117 | public void setGroundStationNetwork(GroundStationNetwork newGroundStationNetwork) { | ||
118 | if (newGroundStationNetwork != groundStationNetwork) { | ||
119 | NotificationChain msgs = null; | ||
120 | if (groundStationNetwork != null) | ||
121 | msgs = ((InternalEObject) groundStationNetwork).eInverseRemove(this, | ||
122 | EOPPOSITE_FEATURE_BASE - SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, null, | ||
123 | msgs); | ||
124 | if (newGroundStationNetwork != null) | ||
125 | msgs = ((InternalEObject) newGroundStationNetwork).eInverseAdd(this, | ||
126 | EOPPOSITE_FEATURE_BASE - SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, null, | ||
127 | msgs); | ||
128 | msgs = basicSetGroundStationNetwork(newGroundStationNetwork, msgs); | ||
129 | if (msgs != null) | ||
130 | msgs.dispatch(); | ||
131 | } else if (eNotificationRequired()) | ||
132 | eNotify(new ENotificationImpl(this, Notification.SET, | ||
133 | SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK, newGroundStationNetwork, | ||
134 | newGroundStationNetwork)); | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @generated | ||
141 | */ | ||
142 | @Override | ||
143 | public EList<Spacecraft> getSpacecraft() { | ||
144 | if (spacecraft == null) { | ||
145 | spacecraft = new EObjectContainmentEList<Spacecraft>(Spacecraft.class, this, | ||
146 | SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT); | ||
147 | } | ||
148 | return spacecraft; | ||
149 | } | ||
150 | |||
151 | /** | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @generated | ||
155 | */ | ||
156 | @Override | ||
157 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
158 | switch (featureID) { | ||
159 | case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: | ||
160 | return basicSetGroundStationNetwork(null, msgs); | ||
161 | case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: | ||
162 | return ((InternalEList<?>) getSpacecraft()).basicRemove(otherEnd, msgs); | ||
163 | } | ||
164 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
165 | } | ||
166 | |||
167 | /** | ||
168 | * <!-- begin-user-doc --> | ||
169 | * <!-- end-user-doc --> | ||
170 | * @generated | ||
171 | */ | ||
172 | @Override | ||
173 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
174 | switch (featureID) { | ||
175 | case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: | ||
176 | return getGroundStationNetwork(); | ||
177 | case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: | ||
178 | return getSpacecraft(); | ||
179 | } | ||
180 | return super.eGet(featureID, resolve, coreType); | ||
181 | } | ||
182 | |||
183 | /** | ||
184 | * <!-- begin-user-doc --> | ||
185 | * <!-- end-user-doc --> | ||
186 | * @generated | ||
187 | */ | ||
188 | @SuppressWarnings("unchecked") | ||
189 | @Override | ||
190 | public void eSet(int featureID, Object newValue) { | ||
191 | switch (featureID) { | ||
192 | case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: | ||
193 | setGroundStationNetwork((GroundStationNetwork) newValue); | ||
194 | return; | ||
195 | case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: | ||
196 | getSpacecraft().clear(); | ||
197 | getSpacecraft().addAll((Collection<? extends Spacecraft>) newValue); | ||
198 | return; | ||
199 | } | ||
200 | super.eSet(featureID, newValue); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * <!-- begin-user-doc --> | ||
205 | * <!-- end-user-doc --> | ||
206 | * @generated | ||
207 | */ | ||
208 | @Override | ||
209 | public void eUnset(int featureID) { | ||
210 | switch (featureID) { | ||
211 | case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: | ||
212 | setGroundStationNetwork((GroundStationNetwork) null); | ||
213 | return; | ||
214 | case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: | ||
215 | getSpacecraft().clear(); | ||
216 | return; | ||
217 | } | ||
218 | super.eUnset(featureID); | ||
219 | } | ||
220 | |||
221 | /** | ||
222 | * <!-- begin-user-doc --> | ||
223 | * <!-- end-user-doc --> | ||
224 | * @generated | ||
225 | */ | ||
226 | @Override | ||
227 | public boolean eIsSet(int featureID) { | ||
228 | switch (featureID) { | ||
229 | case SatellitePackage.CONSTELLATION_MISSION__GROUND_STATION_NETWORK: | ||
230 | return groundStationNetwork != null; | ||
231 | case SatellitePackage.CONSTELLATION_MISSION__SPACECRAFT: | ||
232 | return spacecraft != null && !spacecraft.isEmpty(); | ||
233 | } | ||
234 | return super.eIsSet(featureID); | ||
235 | } | ||
236 | |||
237 | } //ConstellationMissionImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat3UImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat3UImpl.java new file mode 100644 index 00000000..350a9bcc --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat3UImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.CubeSat3U; | ||
8 | import satellite.SatellitePackage; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Cube Sat3 U</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class CubeSat3UImpl extends CubeSatImpl implements CubeSat3U { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected CubeSat3UImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.CUBE_SAT3_U; | ||
35 | } | ||
36 | |||
37 | } //CubeSat3UImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat6UImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat6UImpl.java new file mode 100644 index 00000000..3b9c5988 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSat6UImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.CubeSat6U; | ||
8 | import satellite.SatellitePackage; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Cube Sat6 U</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class CubeSat6UImpl extends CubeSatImpl implements CubeSat6U { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected CubeSat6UImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.CUBE_SAT6_U; | ||
35 | } | ||
36 | |||
37 | } //CubeSat6UImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSatImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSatImpl.java new file mode 100644 index 00000000..660bd062 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CubeSatImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.CubeSat; | ||
8 | import satellite.SatellitePackage; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Cube Sat</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public abstract class CubeSatImpl extends SpacecraftImpl implements CubeSat { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected CubeSatImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.CUBE_SAT; | ||
35 | } | ||
36 | |||
37 | } //CubeSatImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/GroundStationNetworkImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/GroundStationNetworkImpl.java new file mode 100644 index 00000000..244b9568 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/GroundStationNetworkImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.GroundStationNetwork; | ||
8 | import satellite.SatellitePackage; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Ground Station Network</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class GroundStationNetworkImpl extends CommunicatingElementImpl implements GroundStationNetwork { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected GroundStationNetworkImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.GROUND_STATION_NETWORK; | ||
35 | } | ||
36 | |||
37 | } //GroundStationNetworkImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/InterferometryMissionImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/InterferometryMissionImpl.java new file mode 100644 index 00000000..450f8a9a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/InterferometryMissionImpl.java | |||
@@ -0,0 +1,36 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import satellite.InterferometryMission; | ||
7 | import satellite.SatellitePackage; | ||
8 | |||
9 | /** | ||
10 | * <!-- begin-user-doc --> | ||
11 | * An implementation of the model object '<em><b>Interferometry Mission</b></em>'. | ||
12 | * <!-- end-user-doc --> | ||
13 | * | ||
14 | * @generated | ||
15 | */ | ||
16 | public class InterferometryMissionImpl extends ConstellationMissionImpl implements InterferometryMission { | ||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * <!-- end-user-doc --> | ||
20 | * @generated | ||
21 | */ | ||
22 | protected InterferometryMissionImpl() { | ||
23 | super(); | ||
24 | } | ||
25 | |||
26 | /** | ||
27 | * <!-- begin-user-doc --> | ||
28 | * <!-- end-user-doc --> | ||
29 | * @generated | ||
30 | */ | ||
31 | @Override | ||
32 | protected EClass eStaticClass() { | ||
33 | return SatellitePackage.Literals.INTERFEROMETRY_MISSION; | ||
34 | } | ||
35 | |||
36 | } //InterferometryMissionImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/InterferometryPayloadImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/InterferometryPayloadImpl.java new file mode 100644 index 00000000..c8f9e816 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/InterferometryPayloadImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.InterferometryPayload; | ||
8 | import satellite.SatellitePackage; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Interferometry Payload</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class InterferometryPayloadImpl extends PayloadImpl implements InterferometryPayload { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected InterferometryPayloadImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.INTERFEROMETRY_PAYLOAD; | ||
35 | } | ||
36 | |||
37 | } //InterferometryPayloadImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/KaCommSubsystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/KaCommSubsystemImpl.java new file mode 100644 index 00000000..3f4fc432 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/KaCommSubsystemImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.KaCommSubsystem; | ||
8 | import satellite.SatellitePackage; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Ka Comm Subsystem</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class KaCommSubsystemImpl extends CommSubsystemImpl implements KaCommSubsystem { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected KaCommSubsystemImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.KA_COMM_SUBSYSTEM; | ||
35 | } | ||
36 | |||
37 | } //KaCommSubsystemImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/PayloadImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/PayloadImpl.java new file mode 100644 index 00000000..6ee96353 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/PayloadImpl.java | |||
@@ -0,0 +1,39 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; | ||
8 | |||
9 | import satellite.Payload; | ||
10 | import satellite.SatellitePackage; | ||
11 | |||
12 | /** | ||
13 | * <!-- begin-user-doc --> | ||
14 | * An implementation of the model object '<em><b>Payload</b></em>'. | ||
15 | * <!-- end-user-doc --> | ||
16 | * | ||
17 | * @generated | ||
18 | */ | ||
19 | public abstract class PayloadImpl extends MinimalEObjectImpl.Container implements Payload { | ||
20 | /** | ||
21 | * <!-- begin-user-doc --> | ||
22 | * <!-- end-user-doc --> | ||
23 | * @generated | ||
24 | */ | ||
25 | protected PayloadImpl() { | ||
26 | super(); | ||
27 | } | ||
28 | |||
29 | /** | ||
30 | * <!-- begin-user-doc --> | ||
31 | * <!-- end-user-doc --> | ||
32 | * @generated | ||
33 | */ | ||
34 | @Override | ||
35 | protected EClass eStaticClass() { | ||
36 | return SatellitePackage.Literals.PAYLOAD; | ||
37 | } | ||
38 | |||
39 | } //PayloadImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatelliteFactoryImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatelliteFactoryImpl.java new file mode 100644 index 00000000..71e16abf --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatelliteFactoryImpl.java | |||
@@ -0,0 +1,202 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EObject; | ||
7 | import org.eclipse.emf.ecore.EPackage; | ||
8 | |||
9 | import org.eclipse.emf.ecore.impl.EFactoryImpl; | ||
10 | |||
11 | import org.eclipse.emf.ecore.plugin.EcorePlugin; | ||
12 | |||
13 | import satellite.*; | ||
14 | |||
15 | /** | ||
16 | * <!-- begin-user-doc --> | ||
17 | * An implementation of the model <b>Factory</b>. | ||
18 | * <!-- end-user-doc --> | ||
19 | * @generated | ||
20 | */ | ||
21 | public class SatelliteFactoryImpl extends EFactoryImpl implements SatelliteFactory { | ||
22 | /** | ||
23 | * Creates the default factory implementation. | ||
24 | * <!-- begin-user-doc --> | ||
25 | * <!-- end-user-doc --> | ||
26 | * @generated | ||
27 | */ | ||
28 | public static SatelliteFactory init() { | ||
29 | try { | ||
30 | SatelliteFactory theSatelliteFactory = (SatelliteFactory) EPackage.Registry.INSTANCE | ||
31 | .getEFactory(SatellitePackage.eNS_URI); | ||
32 | if (theSatelliteFactory != null) { | ||
33 | return theSatelliteFactory; | ||
34 | } | ||
35 | } catch (Exception exception) { | ||
36 | EcorePlugin.INSTANCE.log(exception); | ||
37 | } | ||
38 | return new SatelliteFactoryImpl(); | ||
39 | } | ||
40 | |||
41 | /** | ||
42 | * Creates an instance of the factory. | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | public SatelliteFactoryImpl() { | ||
48 | super(); | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * <!-- begin-user-doc --> | ||
53 | * <!-- end-user-doc --> | ||
54 | * @generated | ||
55 | */ | ||
56 | @Override | ||
57 | public EObject create(EClass eClass) { | ||
58 | switch (eClass.getClassifierID()) { | ||
59 | case SatellitePackage.INTERFEROMETRY_MISSION: | ||
60 | return createInterferometryMission(); | ||
61 | case SatellitePackage.GROUND_STATION_NETWORK: | ||
62 | return createGroundStationNetwork(); | ||
63 | case SatellitePackage.INTERFEROMETRY_PAYLOAD: | ||
64 | return createInterferometryPayload(); | ||
65 | case SatellitePackage.CUBE_SAT3_U: | ||
66 | return createCubeSat3U(); | ||
67 | case SatellitePackage.CUBE_SAT6_U: | ||
68 | return createCubeSat6U(); | ||
69 | case SatellitePackage.SMALL_SAT: | ||
70 | return createSmallSat(); | ||
71 | case SatellitePackage.UHF_COMM_SUBSYSTEM: | ||
72 | return createUHFCommSubsystem(); | ||
73 | case SatellitePackage.XCOMM_SUBSYSTEM: | ||
74 | return createXCommSubsystem(); | ||
75 | case SatellitePackage.KA_COMM_SUBSYSTEM: | ||
76 | return createKaCommSubsystem(); | ||
77 | default: | ||
78 | throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); | ||
79 | } | ||
80 | } | ||
81 | |||
82 | /** | ||
83 | * <!-- begin-user-doc --> | ||
84 | * <!-- end-user-doc --> | ||
85 | * @generated | ||
86 | */ | ||
87 | @Override | ||
88 | public InterferometryMission createInterferometryMission() { | ||
89 | InterferometryMissionImpl interferometryMission = new InterferometryMissionImpl(); | ||
90 | return interferometryMission; | ||
91 | } | ||
92 | |||
93 | /** | ||
94 | * <!-- begin-user-doc --> | ||
95 | * <!-- end-user-doc --> | ||
96 | * @generated | ||
97 | */ | ||
98 | @Override | ||
99 | public GroundStationNetwork createGroundStationNetwork() { | ||
100 | GroundStationNetworkImpl groundStationNetwork = new GroundStationNetworkImpl(); | ||
101 | return groundStationNetwork; | ||
102 | } | ||
103 | |||
104 | /** | ||
105 | * <!-- begin-user-doc --> | ||
106 | * <!-- end-user-doc --> | ||
107 | * @generated | ||
108 | */ | ||
109 | @Override | ||
110 | public InterferometryPayload createInterferometryPayload() { | ||
111 | InterferometryPayloadImpl interferometryPayload = new InterferometryPayloadImpl(); | ||
112 | return interferometryPayload; | ||
113 | } | ||
114 | |||
115 | /** | ||
116 | * <!-- begin-user-doc --> | ||
117 | * <!-- end-user-doc --> | ||
118 | * @generated | ||
119 | */ | ||
120 | @Override | ||
121 | public CubeSat3U createCubeSat3U() { | ||
122 | CubeSat3UImpl cubeSat3U = new CubeSat3UImpl(); | ||
123 | return cubeSat3U; | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * <!-- begin-user-doc --> | ||
128 | * <!-- end-user-doc --> | ||
129 | * @generated | ||
130 | */ | ||
131 | @Override | ||
132 | public CubeSat6U createCubeSat6U() { | ||
133 | CubeSat6UImpl cubeSat6U = new CubeSat6UImpl(); | ||
134 | return cubeSat6U; | ||
135 | } | ||
136 | |||
137 | /** | ||
138 | * <!-- begin-user-doc --> | ||
139 | * <!-- end-user-doc --> | ||
140 | * @generated | ||
141 | */ | ||
142 | @Override | ||
143 | public SmallSat createSmallSat() { | ||
144 | SmallSatImpl smallSat = new SmallSatImpl(); | ||
145 | return smallSat; | ||
146 | } | ||
147 | |||
148 | /** | ||
149 | * <!-- begin-user-doc --> | ||
150 | * <!-- end-user-doc --> | ||
151 | * @generated | ||
152 | */ | ||
153 | @Override | ||
154 | public UHFCommSubsystem createUHFCommSubsystem() { | ||
155 | UHFCommSubsystemImpl uhfCommSubsystem = new UHFCommSubsystemImpl(); | ||
156 | return uhfCommSubsystem; | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * <!-- begin-user-doc --> | ||
161 | * <!-- end-user-doc --> | ||
162 | * @generated | ||
163 | */ | ||
164 | @Override | ||
165 | public XCommSubsystem createXCommSubsystem() { | ||
166 | XCommSubsystemImpl xCommSubsystem = new XCommSubsystemImpl(); | ||
167 | return xCommSubsystem; | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | @Override | ||
176 | public KaCommSubsystem createKaCommSubsystem() { | ||
177 | KaCommSubsystemImpl kaCommSubsystem = new KaCommSubsystemImpl(); | ||
178 | return kaCommSubsystem; | ||
179 | } | ||
180 | |||
181 | /** | ||
182 | * <!-- begin-user-doc --> | ||
183 | * <!-- end-user-doc --> | ||
184 | * @generated | ||
185 | */ | ||
186 | @Override | ||
187 | public SatellitePackage getSatellitePackage() { | ||
188 | return (SatellitePackage) getEPackage(); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * <!-- begin-user-doc --> | ||
193 | * <!-- end-user-doc --> | ||
194 | * @deprecated | ||
195 | * @generated | ||
196 | */ | ||
197 | @Deprecated | ||
198 | public static SatellitePackage getPackage() { | ||
199 | return SatellitePackage.eINSTANCE; | ||
200 | } | ||
201 | |||
202 | } //SatelliteFactoryImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java new file mode 100644 index 00000000..f6dc1e30 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java | |||
@@ -0,0 +1,574 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | import org.eclipse.emf.ecore.EReference; | ||
8 | |||
9 | import org.eclipse.emf.ecore.impl.EPackageImpl; | ||
10 | import satellite.CommSubsystem; | ||
11 | import satellite.CommunicatingElement; | ||
12 | import satellite.ConstellationMission; | ||
13 | import satellite.CubeSat; | ||
14 | import satellite.CubeSat3U; | ||
15 | import satellite.CubeSat6U; | ||
16 | import satellite.GroundStationNetwork; | ||
17 | import satellite.InterferometryMission; | ||
18 | import satellite.InterferometryPayload; | ||
19 | import satellite.KaCommSubsystem; | ||
20 | import satellite.Payload; | ||
21 | import satellite.SatelliteFactory; | ||
22 | import satellite.SatellitePackage; | ||
23 | import satellite.SmallSat; | ||
24 | import satellite.Spacecraft; | ||
25 | import satellite.UHFCommSubsystem; | ||
26 | import satellite.XCommSubsystem; | ||
27 | |||
28 | /** | ||
29 | * <!-- begin-user-doc --> | ||
30 | * An implementation of the model <b>Package</b>. | ||
31 | * <!-- end-user-doc --> | ||
32 | * @generated | ||
33 | */ | ||
34 | public class SatellitePackageImpl extends EPackageImpl implements SatellitePackage { | ||
35 | /** | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | private EClass constellationMissionEClass = null; | ||
41 | |||
42 | /** | ||
43 | * <!-- begin-user-doc --> | ||
44 | * <!-- end-user-doc --> | ||
45 | * @generated | ||
46 | */ | ||
47 | private EClass interferometryMissionEClass = null; | ||
48 | |||
49 | /** | ||
50 | * <!-- begin-user-doc --> | ||
51 | * <!-- end-user-doc --> | ||
52 | * @generated | ||
53 | */ | ||
54 | private EClass communicatingElementEClass = null; | ||
55 | |||
56 | /** | ||
57 | * <!-- begin-user-doc --> | ||
58 | * <!-- end-user-doc --> | ||
59 | * @generated | ||
60 | */ | ||
61 | private EClass groundStationNetworkEClass = null; | ||
62 | |||
63 | /** | ||
64 | * <!-- begin-user-doc --> | ||
65 | * <!-- end-user-doc --> | ||
66 | * @generated | ||
67 | */ | ||
68 | private EClass spacecraftEClass = null; | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | private EClass commSubsystemEClass = null; | ||
76 | |||
77 | /** | ||
78 | * <!-- begin-user-doc --> | ||
79 | * <!-- end-user-doc --> | ||
80 | * @generated | ||
81 | */ | ||
82 | private EClass payloadEClass = null; | ||
83 | |||
84 | /** | ||
85 | * <!-- begin-user-doc --> | ||
86 | * <!-- end-user-doc --> | ||
87 | * @generated | ||
88 | */ | ||
89 | private EClass interferometryPayloadEClass = null; | ||
90 | |||
91 | /** | ||
92 | * <!-- begin-user-doc --> | ||
93 | * <!-- end-user-doc --> | ||
94 | * @generated | ||
95 | */ | ||
96 | private EClass cubeSat3UEClass = null; | ||
97 | |||
98 | /** | ||
99 | * <!-- begin-user-doc --> | ||
100 | * <!-- end-user-doc --> | ||
101 | * @generated | ||
102 | */ | ||
103 | private EClass cubeSat6UEClass = null; | ||
104 | |||
105 | /** | ||
106 | * <!-- begin-user-doc --> | ||
107 | * <!-- end-user-doc --> | ||
108 | * @generated | ||
109 | */ | ||
110 | private EClass smallSatEClass = null; | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | private EClass cubeSatEClass = null; | ||
118 | |||
119 | /** | ||
120 | * <!-- begin-user-doc --> | ||
121 | * <!-- end-user-doc --> | ||
122 | * @generated | ||
123 | */ | ||
124 | private EClass uhfCommSubsystemEClass = null; | ||
125 | |||
126 | /** | ||
127 | * <!-- begin-user-doc --> | ||
128 | * <!-- end-user-doc --> | ||
129 | * @generated | ||
130 | */ | ||
131 | private EClass xCommSubsystemEClass = null; | ||
132 | |||
133 | /** | ||
134 | * <!-- begin-user-doc --> | ||
135 | * <!-- end-user-doc --> | ||
136 | * @generated | ||
137 | */ | ||
138 | private EClass kaCommSubsystemEClass = null; | ||
139 | |||
140 | /** | ||
141 | * Creates an instance of the model <b>Package</b>, registered with | ||
142 | * {@link org.eclipse.emf.ecore.EPackage.Registry EPackage.Registry} by the package | ||
143 | * package URI value. | ||
144 | * <p>Note: the correct way to create the package is via the static | ||
145 | * factory method {@link #init init()}, which also performs | ||
146 | * initialization of the package, or returns the registered package, | ||
147 | * if one already exists. | ||
148 | * <!-- begin-user-doc --> | ||
149 | * <!-- end-user-doc --> | ||
150 | * @see org.eclipse.emf.ecore.EPackage.Registry | ||
151 | * @see satellite.SatellitePackage#eNS_URI | ||
152 | * @see #init() | ||
153 | * @generated | ||
154 | */ | ||
155 | private SatellitePackageImpl() { | ||
156 | super(eNS_URI, SatelliteFactory.eINSTANCE); | ||
157 | } | ||
158 | |||
159 | /** | ||
160 | * <!-- begin-user-doc --> | ||
161 | * <!-- end-user-doc --> | ||
162 | * @generated | ||
163 | */ | ||
164 | private static boolean isInited = false; | ||
165 | |||
166 | /** | ||
167 | * Creates, registers, and initializes the <b>Package</b> for this model, and for any others upon which it depends. | ||
168 | * | ||
169 | * <p>This method is used to initialize {@link SatellitePackage#eINSTANCE} when that field is accessed. | ||
170 | * Clients should not invoke it directly. Instead, they should simply access that field to obtain the package. | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @see #eNS_URI | ||
174 | * @see #createPackageContents() | ||
175 | * @see #initializePackageContents() | ||
176 | * @generated | ||
177 | */ | ||
178 | public static SatellitePackage init() { | ||
179 | if (isInited) | ||
180 | return (SatellitePackage) EPackage.Registry.INSTANCE.getEPackage(SatellitePackage.eNS_URI); | ||
181 | |||
182 | // Obtain or create and register package | ||
183 | Object registeredSatellitePackage = EPackage.Registry.INSTANCE.get(eNS_URI); | ||
184 | SatellitePackageImpl theSatellitePackage = registeredSatellitePackage instanceof SatellitePackageImpl | ||
185 | ? (SatellitePackageImpl) registeredSatellitePackage | ||
186 | : new SatellitePackageImpl(); | ||
187 | |||
188 | isInited = true; | ||
189 | |||
190 | // Create package meta-data objects | ||
191 | theSatellitePackage.createPackageContents(); | ||
192 | |||
193 | // Initialize created meta-data | ||
194 | theSatellitePackage.initializePackageContents(); | ||
195 | |||
196 | // Mark meta-data to indicate it can't be changed | ||
197 | theSatellitePackage.freeze(); | ||
198 | |||
199 | // Update the registry and return the package | ||
200 | EPackage.Registry.INSTANCE.put(SatellitePackage.eNS_URI, theSatellitePackage); | ||
201 | return theSatellitePackage; | ||
202 | } | ||
203 | |||
204 | /** | ||
205 | * <!-- begin-user-doc --> | ||
206 | * <!-- end-user-doc --> | ||
207 | * @generated | ||
208 | */ | ||
209 | @Override | ||
210 | public EClass getConstellationMission() { | ||
211 | return constellationMissionEClass; | ||
212 | } | ||
213 | |||
214 | /** | ||
215 | * <!-- begin-user-doc --> | ||
216 | * <!-- end-user-doc --> | ||
217 | * @generated | ||
218 | */ | ||
219 | @Override | ||
220 | public EReference getConstellationMission_GroundStationNetwork() { | ||
221 | return (EReference) constellationMissionEClass.getEStructuralFeatures().get(0); | ||
222 | } | ||
223 | |||
224 | /** | ||
225 | * <!-- begin-user-doc --> | ||
226 | * <!-- end-user-doc --> | ||
227 | * @generated | ||
228 | */ | ||
229 | @Override | ||
230 | public EReference getConstellationMission_Spacecraft() { | ||
231 | return (EReference) constellationMissionEClass.getEStructuralFeatures().get(1); | ||
232 | } | ||
233 | |||
234 | /** | ||
235 | * <!-- begin-user-doc --> | ||
236 | * <!-- end-user-doc --> | ||
237 | * @generated | ||
238 | */ | ||
239 | @Override | ||
240 | public EClass getInterferometryMission() { | ||
241 | return interferometryMissionEClass; | ||
242 | } | ||
243 | |||
244 | /** | ||
245 | * <!-- begin-user-doc --> | ||
246 | * <!-- end-user-doc --> | ||
247 | * @generated | ||
248 | */ | ||
249 | @Override | ||
250 | public EClass getCommunicatingElement() { | ||
251 | return communicatingElementEClass; | ||
252 | } | ||
253 | |||
254 | /** | ||
255 | * <!-- begin-user-doc --> | ||
256 | * <!-- end-user-doc --> | ||
257 | * @generated | ||
258 | */ | ||
259 | @Override | ||
260 | public EReference getCommunicatingElement_CommSubsystem() { | ||
261 | return (EReference) communicatingElementEClass.getEStructuralFeatures().get(0); | ||
262 | } | ||
263 | |||
264 | /** | ||
265 | * <!-- begin-user-doc --> | ||
266 | * <!-- end-user-doc --> | ||
267 | * @generated | ||
268 | */ | ||
269 | @Override | ||
270 | public EClass getGroundStationNetwork() { | ||
271 | return groundStationNetworkEClass; | ||
272 | } | ||
273 | |||
274 | /** | ||
275 | * <!-- begin-user-doc --> | ||
276 | * <!-- end-user-doc --> | ||
277 | * @generated | ||
278 | */ | ||
279 | @Override | ||
280 | public EClass getSpacecraft() { | ||
281 | return spacecraftEClass; | ||
282 | } | ||
283 | |||
284 | /** | ||
285 | * <!-- begin-user-doc --> | ||
286 | * <!-- end-user-doc --> | ||
287 | * @generated | ||
288 | */ | ||
289 | @Override | ||
290 | public EReference getSpacecraft_Payload() { | ||
291 | return (EReference) spacecraftEClass.getEStructuralFeatures().get(0); | ||
292 | } | ||
293 | |||
294 | /** | ||
295 | * <!-- begin-user-doc --> | ||
296 | * <!-- end-user-doc --> | ||
297 | * @generated | ||
298 | */ | ||
299 | @Override | ||
300 | public EClass getCommSubsystem() { | ||
301 | return commSubsystemEClass; | ||
302 | } | ||
303 | |||
304 | /** | ||
305 | * <!-- begin-user-doc --> | ||
306 | * <!-- end-user-doc --> | ||
307 | * @generated | ||
308 | */ | ||
309 | @Override | ||
310 | public EReference getCommSubsystem_Target() { | ||
311 | return (EReference) commSubsystemEClass.getEStructuralFeatures().get(0); | ||
312 | } | ||
313 | |||
314 | /** | ||
315 | * <!-- begin-user-doc --> | ||
316 | * <!-- end-user-doc --> | ||
317 | * @generated | ||
318 | */ | ||
319 | @Override | ||
320 | public EClass getPayload() { | ||
321 | return payloadEClass; | ||
322 | } | ||
323 | |||
324 | /** | ||
325 | * <!-- begin-user-doc --> | ||
326 | * <!-- end-user-doc --> | ||
327 | * @generated | ||
328 | */ | ||
329 | @Override | ||
330 | public EClass getInterferometryPayload() { | ||
331 | return interferometryPayloadEClass; | ||
332 | } | ||
333 | |||
334 | /** | ||
335 | * <!-- begin-user-doc --> | ||
336 | * <!-- end-user-doc --> | ||
337 | * @generated | ||
338 | */ | ||
339 | @Override | ||
340 | public EClass getCubeSat3U() { | ||
341 | return cubeSat3UEClass; | ||
342 | } | ||
343 | |||
344 | /** | ||
345 | * <!-- begin-user-doc --> | ||
346 | * <!-- end-user-doc --> | ||
347 | * @generated | ||
348 | */ | ||
349 | @Override | ||
350 | public EClass getCubeSat6U() { | ||
351 | return cubeSat6UEClass; | ||
352 | } | ||
353 | |||
354 | /** | ||
355 | * <!-- begin-user-doc --> | ||
356 | * <!-- end-user-doc --> | ||
357 | * @generated | ||
358 | */ | ||
359 | @Override | ||
360 | public EClass getSmallSat() { | ||
361 | return smallSatEClass; | ||
362 | } | ||
363 | |||
364 | /** | ||
365 | * <!-- begin-user-doc --> | ||
366 | * <!-- end-user-doc --> | ||
367 | * @generated | ||
368 | */ | ||
369 | @Override | ||
370 | public EClass getCubeSat() { | ||
371 | return cubeSatEClass; | ||
372 | } | ||
373 | |||
374 | /** | ||
375 | * <!-- begin-user-doc --> | ||
376 | * <!-- end-user-doc --> | ||
377 | * @generated | ||
378 | */ | ||
379 | @Override | ||
380 | public EClass getUHFCommSubsystem() { | ||
381 | return uhfCommSubsystemEClass; | ||
382 | } | ||
383 | |||
384 | /** | ||
385 | * <!-- begin-user-doc --> | ||
386 | * <!-- end-user-doc --> | ||
387 | * @generated | ||
388 | */ | ||
389 | @Override | ||
390 | public EClass getXCommSubsystem() { | ||
391 | return xCommSubsystemEClass; | ||
392 | } | ||
393 | |||
394 | /** | ||
395 | * <!-- begin-user-doc --> | ||
396 | * <!-- end-user-doc --> | ||
397 | * @generated | ||
398 | */ | ||
399 | @Override | ||
400 | public EClass getKaCommSubsystem() { | ||
401 | return kaCommSubsystemEClass; | ||
402 | } | ||
403 | |||
404 | /** | ||
405 | * <!-- begin-user-doc --> | ||
406 | * <!-- end-user-doc --> | ||
407 | * @generated | ||
408 | */ | ||
409 | @Override | ||
410 | public SatelliteFactory getSatelliteFactory() { | ||
411 | return (SatelliteFactory) getEFactoryInstance(); | ||
412 | } | ||
413 | |||
414 | /** | ||
415 | * <!-- begin-user-doc --> | ||
416 | * <!-- end-user-doc --> | ||
417 | * @generated | ||
418 | */ | ||
419 | private boolean isCreated = false; | ||
420 | |||
421 | /** | ||
422 | * Creates the meta-model objects for the package. This method is | ||
423 | * guarded to have no affect on any invocation but its first. | ||
424 | * <!-- begin-user-doc --> | ||
425 | * <!-- end-user-doc --> | ||
426 | * @generated | ||
427 | */ | ||
428 | public void createPackageContents() { | ||
429 | if (isCreated) | ||
430 | return; | ||
431 | isCreated = true; | ||
432 | |||
433 | // Create classes and their features | ||
434 | constellationMissionEClass = createEClass(CONSTELLATION_MISSION); | ||
435 | createEReference(constellationMissionEClass, CONSTELLATION_MISSION__GROUND_STATION_NETWORK); | ||
436 | createEReference(constellationMissionEClass, CONSTELLATION_MISSION__SPACECRAFT); | ||
437 | |||
438 | interferometryMissionEClass = createEClass(INTERFEROMETRY_MISSION); | ||
439 | |||
440 | communicatingElementEClass = createEClass(COMMUNICATING_ELEMENT); | ||
441 | createEReference(communicatingElementEClass, COMMUNICATING_ELEMENT__COMM_SUBSYSTEM); | ||
442 | |||
443 | groundStationNetworkEClass = createEClass(GROUND_STATION_NETWORK); | ||
444 | |||
445 | spacecraftEClass = createEClass(SPACECRAFT); | ||
446 | createEReference(spacecraftEClass, SPACECRAFT__PAYLOAD); | ||
447 | |||
448 | commSubsystemEClass = createEClass(COMM_SUBSYSTEM); | ||
449 | createEReference(commSubsystemEClass, COMM_SUBSYSTEM__TARGET); | ||
450 | |||
451 | payloadEClass = createEClass(PAYLOAD); | ||
452 | |||
453 | interferometryPayloadEClass = createEClass(INTERFEROMETRY_PAYLOAD); | ||
454 | |||
455 | cubeSat3UEClass = createEClass(CUBE_SAT3_U); | ||
456 | |||
457 | cubeSat6UEClass = createEClass(CUBE_SAT6_U); | ||
458 | |||
459 | smallSatEClass = createEClass(SMALL_SAT); | ||
460 | |||
461 | cubeSatEClass = createEClass(CUBE_SAT); | ||
462 | |||
463 | uhfCommSubsystemEClass = createEClass(UHF_COMM_SUBSYSTEM); | ||
464 | |||
465 | xCommSubsystemEClass = createEClass(XCOMM_SUBSYSTEM); | ||
466 | |||
467 | kaCommSubsystemEClass = createEClass(KA_COMM_SUBSYSTEM); | ||
468 | } | ||
469 | |||
470 | /** | ||
471 | * <!-- begin-user-doc --> | ||
472 | * <!-- end-user-doc --> | ||
473 | * @generated | ||
474 | */ | ||
475 | private boolean isInitialized = false; | ||
476 | |||
477 | /** | ||
478 | * Complete the initialization of the package and its meta-model. This | ||
479 | * method is guarded to have no affect on any invocation but its first. | ||
480 | * <!-- begin-user-doc --> | ||
481 | * <!-- end-user-doc --> | ||
482 | * @generated | ||
483 | */ | ||
484 | public void initializePackageContents() { | ||
485 | if (isInitialized) | ||
486 | return; | ||
487 | isInitialized = true; | ||
488 | |||
489 | // Initialize package | ||
490 | setName(eNAME); | ||
491 | setNsPrefix(eNS_PREFIX); | ||
492 | setNsURI(eNS_URI); | ||
493 | |||
494 | // Create type parameters | ||
495 | |||
496 | // Set bounds for type parameters | ||
497 | |||
498 | // Add supertypes to classes | ||
499 | interferometryMissionEClass.getESuperTypes().add(this.getConstellationMission()); | ||
500 | groundStationNetworkEClass.getESuperTypes().add(this.getCommunicatingElement()); | ||
501 | spacecraftEClass.getESuperTypes().add(this.getCommunicatingElement()); | ||
502 | interferometryPayloadEClass.getESuperTypes().add(this.getPayload()); | ||
503 | cubeSat3UEClass.getESuperTypes().add(this.getCubeSat()); | ||
504 | cubeSat6UEClass.getESuperTypes().add(this.getCubeSat()); | ||
505 | smallSatEClass.getESuperTypes().add(this.getSpacecraft()); | ||
506 | cubeSatEClass.getESuperTypes().add(this.getSpacecraft()); | ||
507 | uhfCommSubsystemEClass.getESuperTypes().add(this.getCommSubsystem()); | ||
508 | xCommSubsystemEClass.getESuperTypes().add(this.getCommSubsystem()); | ||
509 | kaCommSubsystemEClass.getESuperTypes().add(this.getCommSubsystem()); | ||
510 | |||
511 | // Initialize classes, features, and operations; add parameters | ||
512 | initEClass(constellationMissionEClass, ConstellationMission.class, "ConstellationMission", IS_ABSTRACT, | ||
513 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
514 | initEReference(getConstellationMission_GroundStationNetwork(), this.getGroundStationNetwork(), null, | ||
515 | "groundStationNetwork", null, 1, 1, ConstellationMission.class, !IS_TRANSIENT, !IS_VOLATILE, | ||
516 | IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
517 | initEReference(getConstellationMission_Spacecraft(), this.getSpacecraft(), null, "spacecraft", null, 2, -1, | ||
518 | ConstellationMission.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
519 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
520 | |||
521 | initEClass(interferometryMissionEClass, InterferometryMission.class, "InterferometryMission", !IS_ABSTRACT, | ||
522 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
523 | |||
524 | initEClass(communicatingElementEClass, CommunicatingElement.class, "CommunicatingElement", IS_ABSTRACT, | ||
525 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
526 | initEReference(getCommunicatingElement_CommSubsystem(), this.getCommSubsystem(), null, "commSubsystem", null, 1, | ||
527 | 2, CommunicatingElement.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, | ||
528 | !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
529 | |||
530 | initEClass(groundStationNetworkEClass, GroundStationNetwork.class, "GroundStationNetwork", !IS_ABSTRACT, | ||
531 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
532 | |||
533 | initEClass(spacecraftEClass, Spacecraft.class, "Spacecraft", IS_ABSTRACT, !IS_INTERFACE, | ||
534 | IS_GENERATED_INSTANCE_CLASS); | ||
535 | initEReference(getSpacecraft_Payload(), this.getPayload(), null, "payload", null, 0, 1, Spacecraft.class, | ||
536 | !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, | ||
537 | IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
538 | |||
539 | initEClass(commSubsystemEClass, CommSubsystem.class, "CommSubsystem", IS_ABSTRACT, !IS_INTERFACE, | ||
540 | IS_GENERATED_INSTANCE_CLASS); | ||
541 | initEReference(getCommSubsystem_Target(), this.getCommSubsystem(), null, "target", null, 0, 1, | ||
542 | CommSubsystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, | ||
543 | !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); | ||
544 | |||
545 | initEClass(payloadEClass, Payload.class, "Payload", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
546 | |||
547 | initEClass(interferometryPayloadEClass, InterferometryPayload.class, "InterferometryPayload", !IS_ABSTRACT, | ||
548 | !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
549 | |||
550 | initEClass(cubeSat3UEClass, CubeSat3U.class, "CubeSat3U", !IS_ABSTRACT, !IS_INTERFACE, | ||
551 | IS_GENERATED_INSTANCE_CLASS); | ||
552 | |||
553 | initEClass(cubeSat6UEClass, CubeSat6U.class, "CubeSat6U", !IS_ABSTRACT, !IS_INTERFACE, | ||
554 | IS_GENERATED_INSTANCE_CLASS); | ||
555 | |||
556 | initEClass(smallSatEClass, SmallSat.class, "SmallSat", !IS_ABSTRACT, !IS_INTERFACE, | ||
557 | IS_GENERATED_INSTANCE_CLASS); | ||
558 | |||
559 | initEClass(cubeSatEClass, CubeSat.class, "CubeSat", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); | ||
560 | |||
561 | initEClass(uhfCommSubsystemEClass, UHFCommSubsystem.class, "UHFCommSubsystem", !IS_ABSTRACT, !IS_INTERFACE, | ||
562 | IS_GENERATED_INSTANCE_CLASS); | ||
563 | |||
564 | initEClass(xCommSubsystemEClass, XCommSubsystem.class, "XCommSubsystem", !IS_ABSTRACT, !IS_INTERFACE, | ||
565 | IS_GENERATED_INSTANCE_CLASS); | ||
566 | |||
567 | initEClass(kaCommSubsystemEClass, KaCommSubsystem.class, "KaCommSubsystem", !IS_ABSTRACT, !IS_INTERFACE, | ||
568 | IS_GENERATED_INSTANCE_CLASS); | ||
569 | |||
570 | // Create resource | ||
571 | createResource(eNS_URI); | ||
572 | } | ||
573 | |||
574 | } //SatellitePackageImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SmallSatImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SmallSatImpl.java new file mode 100644 index 00000000..1785dbf3 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SmallSatImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.SatellitePackage; | ||
8 | import satellite.SmallSat; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>Small Sat</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class SmallSatImpl extends SpacecraftImpl implements SmallSat { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected SmallSatImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.SMALL_SAT; | ||
35 | } | ||
36 | |||
37 | } //SmallSatImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SpacecraftImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SpacecraftImpl.java new file mode 100644 index 00000000..58f5d069 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SpacecraftImpl.java | |||
@@ -0,0 +1,184 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.common.notify.Notification; | ||
6 | import org.eclipse.emf.common.notify.NotificationChain; | ||
7 | |||
8 | import org.eclipse.emf.ecore.EClass; | ||
9 | import org.eclipse.emf.ecore.InternalEObject; | ||
10 | |||
11 | import org.eclipse.emf.ecore.impl.ENotificationImpl; | ||
12 | |||
13 | import satellite.Payload; | ||
14 | import satellite.SatellitePackage; | ||
15 | import satellite.Spacecraft; | ||
16 | |||
17 | /** | ||
18 | * <!-- begin-user-doc --> | ||
19 | * An implementation of the model object '<em><b>Spacecraft</b></em>'. | ||
20 | * <!-- end-user-doc --> | ||
21 | * <p> | ||
22 | * The following features are implemented: | ||
23 | * </p> | ||
24 | * <ul> | ||
25 | * <li>{@link satellite.impl.SpacecraftImpl#getPayload <em>Payload</em>}</li> | ||
26 | * </ul> | ||
27 | * | ||
28 | * @generated | ||
29 | */ | ||
30 | public abstract class SpacecraftImpl extends CommunicatingElementImpl implements Spacecraft { | ||
31 | /** | ||
32 | * The cached value of the '{@link #getPayload() <em>Payload</em>}' containment reference. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @see #getPayload() | ||
36 | * @generated | ||
37 | * @ordered | ||
38 | */ | ||
39 | protected Payload payload; | ||
40 | |||
41 | /** | ||
42 | * <!-- begin-user-doc --> | ||
43 | * <!-- end-user-doc --> | ||
44 | * @generated | ||
45 | */ | ||
46 | protected SpacecraftImpl() { | ||
47 | super(); | ||
48 | } | ||
49 | |||
50 | /** | ||
51 | * <!-- begin-user-doc --> | ||
52 | * <!-- end-user-doc --> | ||
53 | * @generated | ||
54 | */ | ||
55 | @Override | ||
56 | protected EClass eStaticClass() { | ||
57 | return SatellitePackage.Literals.SPACECRAFT; | ||
58 | } | ||
59 | |||
60 | /** | ||
61 | * <!-- begin-user-doc --> | ||
62 | * <!-- end-user-doc --> | ||
63 | * @generated | ||
64 | */ | ||
65 | @Override | ||
66 | public Payload getPayload() { | ||
67 | return payload; | ||
68 | } | ||
69 | |||
70 | /** | ||
71 | * <!-- begin-user-doc --> | ||
72 | * <!-- end-user-doc --> | ||
73 | * @generated | ||
74 | */ | ||
75 | public NotificationChain basicSetPayload(Payload newPayload, NotificationChain msgs) { | ||
76 | Payload oldPayload = payload; | ||
77 | payload = newPayload; | ||
78 | if (eNotificationRequired()) { | ||
79 | ENotificationImpl notification = new ENotificationImpl(this, Notification.SET, | ||
80 | SatellitePackage.SPACECRAFT__PAYLOAD, oldPayload, newPayload); | ||
81 | if (msgs == null) | ||
82 | msgs = notification; | ||
83 | else | ||
84 | msgs.add(notification); | ||
85 | } | ||
86 | return msgs; | ||
87 | } | ||
88 | |||
89 | /** | ||
90 | * <!-- begin-user-doc --> | ||
91 | * <!-- end-user-doc --> | ||
92 | * @generated | ||
93 | */ | ||
94 | @Override | ||
95 | public void setPayload(Payload newPayload) { | ||
96 | if (newPayload != payload) { | ||
97 | NotificationChain msgs = null; | ||
98 | if (payload != null) | ||
99 | msgs = ((InternalEObject) payload).eInverseRemove(this, | ||
100 | EOPPOSITE_FEATURE_BASE - SatellitePackage.SPACECRAFT__PAYLOAD, null, msgs); | ||
101 | if (newPayload != null) | ||
102 | msgs = ((InternalEObject) newPayload).eInverseAdd(this, | ||
103 | EOPPOSITE_FEATURE_BASE - SatellitePackage.SPACECRAFT__PAYLOAD, null, msgs); | ||
104 | msgs = basicSetPayload(newPayload, msgs); | ||
105 | if (msgs != null) | ||
106 | msgs.dispatch(); | ||
107 | } else if (eNotificationRequired()) | ||
108 | eNotify(new ENotificationImpl(this, Notification.SET, SatellitePackage.SPACECRAFT__PAYLOAD, newPayload, | ||
109 | newPayload)); | ||
110 | } | ||
111 | |||
112 | /** | ||
113 | * <!-- begin-user-doc --> | ||
114 | * <!-- end-user-doc --> | ||
115 | * @generated | ||
116 | */ | ||
117 | @Override | ||
118 | public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { | ||
119 | switch (featureID) { | ||
120 | case SatellitePackage.SPACECRAFT__PAYLOAD: | ||
121 | return basicSetPayload(null, msgs); | ||
122 | } | ||
123 | return super.eInverseRemove(otherEnd, featureID, msgs); | ||
124 | } | ||
125 | |||
126 | /** | ||
127 | * <!-- begin-user-doc --> | ||
128 | * <!-- end-user-doc --> | ||
129 | * @generated | ||
130 | */ | ||
131 | @Override | ||
132 | public Object eGet(int featureID, boolean resolve, boolean coreType) { | ||
133 | switch (featureID) { | ||
134 | case SatellitePackage.SPACECRAFT__PAYLOAD: | ||
135 | return getPayload(); | ||
136 | } | ||
137 | return super.eGet(featureID, resolve, coreType); | ||
138 | } | ||
139 | |||
140 | /** | ||
141 | * <!-- begin-user-doc --> | ||
142 | * <!-- end-user-doc --> | ||
143 | * @generated | ||
144 | */ | ||
145 | @Override | ||
146 | public void eSet(int featureID, Object newValue) { | ||
147 | switch (featureID) { | ||
148 | case SatellitePackage.SPACECRAFT__PAYLOAD: | ||
149 | setPayload((Payload) newValue); | ||
150 | return; | ||
151 | } | ||
152 | super.eSet(featureID, newValue); | ||
153 | } | ||
154 | |||
155 | /** | ||
156 | * <!-- begin-user-doc --> | ||
157 | * <!-- end-user-doc --> | ||
158 | * @generated | ||
159 | */ | ||
160 | @Override | ||
161 | public void eUnset(int featureID) { | ||
162 | switch (featureID) { | ||
163 | case SatellitePackage.SPACECRAFT__PAYLOAD: | ||
164 | setPayload((Payload) null); | ||
165 | return; | ||
166 | } | ||
167 | super.eUnset(featureID); | ||
168 | } | ||
169 | |||
170 | /** | ||
171 | * <!-- begin-user-doc --> | ||
172 | * <!-- end-user-doc --> | ||
173 | * @generated | ||
174 | */ | ||
175 | @Override | ||
176 | public boolean eIsSet(int featureID) { | ||
177 | switch (featureID) { | ||
178 | case SatellitePackage.SPACECRAFT__PAYLOAD: | ||
179 | return payload != null; | ||
180 | } | ||
181 | return super.eIsSet(featureID); | ||
182 | } | ||
183 | |||
184 | } //SpacecraftImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/UHFCommSubsystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/UHFCommSubsystemImpl.java new file mode 100644 index 00000000..df21b9e1 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/UHFCommSubsystemImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.SatellitePackage; | ||
8 | import satellite.UHFCommSubsystem; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>UHF Comm Subsystem</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class UHFCommSubsystemImpl extends CommSubsystemImpl implements UHFCommSubsystem { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected UHFCommSubsystemImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.UHF_COMM_SUBSYSTEM; | ||
35 | } | ||
36 | |||
37 | } //UHFCommSubsystemImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/XCommSubsystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/XCommSubsystemImpl.java new file mode 100644 index 00000000..c686a50e --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/XCommSubsystemImpl.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.impl; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EClass; | ||
6 | |||
7 | import satellite.SatellitePackage; | ||
8 | import satellite.XCommSubsystem; | ||
9 | |||
10 | /** | ||
11 | * <!-- begin-user-doc --> | ||
12 | * An implementation of the model object '<em><b>XComm Subsystem</b></em>'. | ||
13 | * <!-- end-user-doc --> | ||
14 | * | ||
15 | * @generated | ||
16 | */ | ||
17 | public class XCommSubsystemImpl extends CommSubsystemImpl implements XCommSubsystem { | ||
18 | /** | ||
19 | * <!-- begin-user-doc --> | ||
20 | * <!-- end-user-doc --> | ||
21 | * @generated | ||
22 | */ | ||
23 | protected XCommSubsystemImpl() { | ||
24 | super(); | ||
25 | } | ||
26 | |||
27 | /** | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | @Override | ||
33 | protected EClass eStaticClass() { | ||
34 | return SatellitePackage.Literals.XCOMM_SUBSYSTEM; | ||
35 | } | ||
36 | |||
37 | } //XCommSubsystemImpl | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java new file mode 100644 index 00000000..175f474f --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteAdapterFactory.java | |||
@@ -0,0 +1,385 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.util; | ||
4 | |||
5 | import org.eclipse.emf.common.notify.Adapter; | ||
6 | import org.eclipse.emf.common.notify.Notifier; | ||
7 | |||
8 | import org.eclipse.emf.common.notify.impl.AdapterFactoryImpl; | ||
9 | |||
10 | import org.eclipse.emf.ecore.EObject; | ||
11 | |||
12 | import satellite.*; | ||
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 satellite.SatellitePackage | ||
20 | * @generated | ||
21 | */ | ||
22 | public class SatelliteAdapterFactory extends AdapterFactoryImpl { | ||
23 | /** | ||
24 | * The cached model package. | ||
25 | * <!-- begin-user-doc --> | ||
26 | * <!-- end-user-doc --> | ||
27 | * @generated | ||
28 | */ | ||
29 | protected static SatellitePackage modelPackage; | ||
30 | |||
31 | /** | ||
32 | * Creates an instance of the adapter factory. | ||
33 | * <!-- begin-user-doc --> | ||
34 | * <!-- end-user-doc --> | ||
35 | * @generated | ||
36 | */ | ||
37 | public SatelliteAdapterFactory() { | ||
38 | if (modelPackage == null) { | ||
39 | modelPackage = SatellitePackage.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 SatelliteSwitch<Adapter> modelSwitch = new SatelliteSwitch<Adapter>() { | ||
69 | @Override | ||
70 | public Adapter caseConstellationMission(ConstellationMission object) { | ||
71 | return createConstellationMissionAdapter(); | ||
72 | } | ||
73 | |||
74 | @Override | ||
75 | public Adapter caseInterferometryMission(InterferometryMission object) { | ||
76 | return createInterferometryMissionAdapter(); | ||
77 | } | ||
78 | |||
79 | @Override | ||
80 | public Adapter caseCommunicatingElement(CommunicatingElement object) { | ||
81 | return createCommunicatingElementAdapter(); | ||
82 | } | ||
83 | |||
84 | @Override | ||
85 | public Adapter caseGroundStationNetwork(GroundStationNetwork object) { | ||
86 | return createGroundStationNetworkAdapter(); | ||
87 | } | ||
88 | |||
89 | @Override | ||
90 | public Adapter caseSpacecraft(Spacecraft object) { | ||
91 | return createSpacecraftAdapter(); | ||
92 | } | ||
93 | |||
94 | @Override | ||
95 | public Adapter caseCommSubsystem(CommSubsystem object) { | ||
96 | return createCommSubsystemAdapter(); | ||
97 | } | ||
98 | |||
99 | @Override | ||
100 | public Adapter casePayload(Payload object) { | ||
101 | return createPayloadAdapter(); | ||
102 | } | ||
103 | |||
104 | @Override | ||
105 | public Adapter caseInterferometryPayload(InterferometryPayload object) { | ||
106 | return createInterferometryPayloadAdapter(); | ||
107 | } | ||
108 | |||
109 | @Override | ||
110 | public Adapter caseCubeSat3U(CubeSat3U object) { | ||
111 | return createCubeSat3UAdapter(); | ||
112 | } | ||
113 | |||
114 | @Override | ||
115 | public Adapter caseCubeSat6U(CubeSat6U object) { | ||
116 | return createCubeSat6UAdapter(); | ||
117 | } | ||
118 | |||
119 | @Override | ||
120 | public Adapter caseSmallSat(SmallSat object) { | ||
121 | return createSmallSatAdapter(); | ||
122 | } | ||
123 | |||
124 | @Override | ||
125 | public Adapter caseCubeSat(CubeSat object) { | ||
126 | return createCubeSatAdapter(); | ||
127 | } | ||
128 | |||
129 | @Override | ||
130 | public Adapter caseUHFCommSubsystem(UHFCommSubsystem object) { | ||
131 | return createUHFCommSubsystemAdapter(); | ||
132 | } | ||
133 | |||
134 | @Override | ||
135 | public Adapter caseXCommSubsystem(XCommSubsystem object) { | ||
136 | return createXCommSubsystemAdapter(); | ||
137 | } | ||
138 | |||
139 | @Override | ||
140 | public Adapter caseKaCommSubsystem(KaCommSubsystem object) { | ||
141 | return createKaCommSubsystemAdapter(); | ||
142 | } | ||
143 | |||
144 | @Override | ||
145 | public Adapter defaultCase(EObject object) { | ||
146 | return createEObjectAdapter(); | ||
147 | } | ||
148 | }; | ||
149 | |||
150 | /** | ||
151 | * Creates an adapter for the <code>target</code>. | ||
152 | * <!-- begin-user-doc --> | ||
153 | * <!-- end-user-doc --> | ||
154 | * @param target the object to adapt. | ||
155 | * @return the adapter for the <code>target</code>. | ||
156 | * @generated | ||
157 | */ | ||
158 | @Override | ||
159 | public Adapter createAdapter(Notifier target) { | ||
160 | return modelSwitch.doSwitch((EObject) target); | ||
161 | } | ||
162 | |||
163 | /** | ||
164 | * Creates a new adapter for an object of class '{@link satellite.ConstellationMission <em>Constellation Mission</em>}'. | ||
165 | * <!-- begin-user-doc --> | ||
166 | * This default implementation returns null so that we can easily ignore cases; | ||
167 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
168 | * <!-- end-user-doc --> | ||
169 | * @return the new adapter. | ||
170 | * @see satellite.ConstellationMission | ||
171 | * @generated | ||
172 | */ | ||
173 | public Adapter createConstellationMissionAdapter() { | ||
174 | return null; | ||
175 | } | ||
176 | |||
177 | /** | ||
178 | * Creates a new adapter for an object of class '{@link satellite.InterferometryMission <em>Interferometry Mission</em>}'. | ||
179 | * <!-- begin-user-doc --> | ||
180 | * This default implementation returns null so that we can easily ignore cases; | ||
181 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
182 | * <!-- end-user-doc --> | ||
183 | * @return the new adapter. | ||
184 | * @see satellite.InterferometryMission | ||
185 | * @generated | ||
186 | */ | ||
187 | public Adapter createInterferometryMissionAdapter() { | ||
188 | return null; | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * Creates a new adapter for an object of class '{@link satellite.CommunicatingElement <em>Communicating Element</em>}'. | ||
193 | * <!-- begin-user-doc --> | ||
194 | * This default implementation returns null so that we can easily ignore cases; | ||
195 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
196 | * <!-- end-user-doc --> | ||
197 | * @return the new adapter. | ||
198 | * @see satellite.CommunicatingElement | ||
199 | * @generated | ||
200 | */ | ||
201 | public Adapter createCommunicatingElementAdapter() { | ||
202 | return null; | ||
203 | } | ||
204 | |||
205 | /** | ||
206 | * Creates a new adapter for an object of class '{@link satellite.GroundStationNetwork <em>Ground Station Network</em>}'. | ||
207 | * <!-- begin-user-doc --> | ||
208 | * This default implementation returns null so that we can easily ignore cases; | ||
209 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
210 | * <!-- end-user-doc --> | ||
211 | * @return the new adapter. | ||
212 | * @see satellite.GroundStationNetwork | ||
213 | * @generated | ||
214 | */ | ||
215 | public Adapter createGroundStationNetworkAdapter() { | ||
216 | return null; | ||
217 | } | ||
218 | |||
219 | /** | ||
220 | * Creates a new adapter for an object of class '{@link satellite.Spacecraft <em>Spacecraft</em>}'. | ||
221 | * <!-- begin-user-doc --> | ||
222 | * This default implementation returns null so that we can easily ignore cases; | ||
223 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
224 | * <!-- end-user-doc --> | ||
225 | * @return the new adapter. | ||
226 | * @see satellite.Spacecraft | ||
227 | * @generated | ||
228 | */ | ||
229 | public Adapter createSpacecraftAdapter() { | ||
230 | return null; | ||
231 | } | ||
232 | |||
233 | /** | ||
234 | * Creates a new adapter for an object of class '{@link satellite.CommSubsystem <em>Comm Subsystem</em>}'. | ||
235 | * <!-- begin-user-doc --> | ||
236 | * This default implementation returns null so that we can easily ignore cases; | ||
237 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
238 | * <!-- end-user-doc --> | ||
239 | * @return the new adapter. | ||
240 | * @see satellite.CommSubsystem | ||
241 | * @generated | ||
242 | */ | ||
243 | public Adapter createCommSubsystemAdapter() { | ||
244 | return null; | ||
245 | } | ||
246 | |||
247 | /** | ||
248 | * Creates a new adapter for an object of class '{@link satellite.Payload <em>Payload</em>}'. | ||
249 | * <!-- begin-user-doc --> | ||
250 | * This default implementation returns null so that we can easily ignore cases; | ||
251 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
252 | * <!-- end-user-doc --> | ||
253 | * @return the new adapter. | ||
254 | * @see satellite.Payload | ||
255 | * @generated | ||
256 | */ | ||
257 | public Adapter createPayloadAdapter() { | ||
258 | return null; | ||
259 | } | ||
260 | |||
261 | /** | ||
262 | * Creates a new adapter for an object of class '{@link satellite.InterferometryPayload <em>Interferometry Payload</em>}'. | ||
263 | * <!-- begin-user-doc --> | ||
264 | * This default implementation returns null so that we can easily ignore cases; | ||
265 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
266 | * <!-- end-user-doc --> | ||
267 | * @return the new adapter. | ||
268 | * @see satellite.InterferometryPayload | ||
269 | * @generated | ||
270 | */ | ||
271 | public Adapter createInterferometryPayloadAdapter() { | ||
272 | return null; | ||
273 | } | ||
274 | |||
275 | /** | ||
276 | * Creates a new adapter for an object of class '{@link satellite.CubeSat3U <em>Cube Sat3 U</em>}'. | ||
277 | * <!-- begin-user-doc --> | ||
278 | * This default implementation returns null so that we can easily ignore cases; | ||
279 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
280 | * <!-- end-user-doc --> | ||
281 | * @return the new adapter. | ||
282 | * @see satellite.CubeSat3U | ||
283 | * @generated | ||
284 | */ | ||
285 | public Adapter createCubeSat3UAdapter() { | ||
286 | return null; | ||
287 | } | ||
288 | |||
289 | /** | ||
290 | * Creates a new adapter for an object of class '{@link satellite.CubeSat6U <em>Cube Sat6 U</em>}'. | ||
291 | * <!-- begin-user-doc --> | ||
292 | * This default implementation returns null so that we can easily ignore cases; | ||
293 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
294 | * <!-- end-user-doc --> | ||
295 | * @return the new adapter. | ||
296 | * @see satellite.CubeSat6U | ||
297 | * @generated | ||
298 | */ | ||
299 | public Adapter createCubeSat6UAdapter() { | ||
300 | return null; | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * Creates a new adapter for an object of class '{@link satellite.SmallSat <em>Small Sat</em>}'. | ||
305 | * <!-- begin-user-doc --> | ||
306 | * This default implementation returns null so that we can easily ignore cases; | ||
307 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
308 | * <!-- end-user-doc --> | ||
309 | * @return the new adapter. | ||
310 | * @see satellite.SmallSat | ||
311 | * @generated | ||
312 | */ | ||
313 | public Adapter createSmallSatAdapter() { | ||
314 | return null; | ||
315 | } | ||
316 | |||
317 | /** | ||
318 | * Creates a new adapter for an object of class '{@link satellite.CubeSat <em>Cube Sat</em>}'. | ||
319 | * <!-- begin-user-doc --> | ||
320 | * This default implementation returns null so that we can easily ignore cases; | ||
321 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
322 | * <!-- end-user-doc --> | ||
323 | * @return the new adapter. | ||
324 | * @see satellite.CubeSat | ||
325 | * @generated | ||
326 | */ | ||
327 | public Adapter createCubeSatAdapter() { | ||
328 | return null; | ||
329 | } | ||
330 | |||
331 | /** | ||
332 | * Creates a new adapter for an object of class '{@link satellite.UHFCommSubsystem <em>UHF Comm Subsystem</em>}'. | ||
333 | * <!-- begin-user-doc --> | ||
334 | * This default implementation returns null so that we can easily ignore cases; | ||
335 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
336 | * <!-- end-user-doc --> | ||
337 | * @return the new adapter. | ||
338 | * @see satellite.UHFCommSubsystem | ||
339 | * @generated | ||
340 | */ | ||
341 | public Adapter createUHFCommSubsystemAdapter() { | ||
342 | return null; | ||
343 | } | ||
344 | |||
345 | /** | ||
346 | * Creates a new adapter for an object of class '{@link satellite.XCommSubsystem <em>XComm Subsystem</em>}'. | ||
347 | * <!-- begin-user-doc --> | ||
348 | * This default implementation returns null so that we can easily ignore cases; | ||
349 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
350 | * <!-- end-user-doc --> | ||
351 | * @return the new adapter. | ||
352 | * @see satellite.XCommSubsystem | ||
353 | * @generated | ||
354 | */ | ||
355 | public Adapter createXCommSubsystemAdapter() { | ||
356 | return null; | ||
357 | } | ||
358 | |||
359 | /** | ||
360 | * Creates a new adapter for an object of class '{@link satellite.KaCommSubsystem <em>Ka Comm Subsystem</em>}'. | ||
361 | * <!-- begin-user-doc --> | ||
362 | * This default implementation returns null so that we can easily ignore cases; | ||
363 | * it's useful to ignore a case when inheritance will catch all the cases anyway. | ||
364 | * <!-- end-user-doc --> | ||
365 | * @return the new adapter. | ||
366 | * @see satellite.KaCommSubsystem | ||
367 | * @generated | ||
368 | */ | ||
369 | public Adapter createKaCommSubsystemAdapter() { | ||
370 | return null; | ||
371 | } | ||
372 | |||
373 | /** | ||
374 | * Creates a new adapter for the default case. | ||
375 | * <!-- begin-user-doc --> | ||
376 | * This default implementation returns null. | ||
377 | * <!-- end-user-doc --> | ||
378 | * @return the new adapter. | ||
379 | * @generated | ||
380 | */ | ||
381 | public Adapter createEObjectAdapter() { | ||
382 | return null; | ||
383 | } | ||
384 | |||
385 | } //SatelliteAdapterFactory | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java new file mode 100644 index 00000000..541d8494 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/util/SatelliteSwitch.java | |||
@@ -0,0 +1,454 @@ | |||
1 | /** | ||
2 | */ | ||
3 | package satellite.util; | ||
4 | |||
5 | import org.eclipse.emf.ecore.EObject; | ||
6 | import org.eclipse.emf.ecore.EPackage; | ||
7 | |||
8 | import org.eclipse.emf.ecore.util.Switch; | ||
9 | |||
10 | import satellite.*; | ||
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 satellite.SatellitePackage | ||
23 | * @generated | ||
24 | */ | ||
25 | public class SatelliteSwitch<T> extends Switch<T> { | ||
26 | /** | ||
27 | * The cached model package | ||
28 | * <!-- begin-user-doc --> | ||
29 | * <!-- end-user-doc --> | ||
30 | * @generated | ||
31 | */ | ||
32 | protected static SatellitePackage modelPackage; | ||
33 | |||
34 | /** | ||
35 | * Creates an instance of the switch. | ||
36 | * <!-- begin-user-doc --> | ||
37 | * <!-- end-user-doc --> | ||
38 | * @generated | ||
39 | */ | ||
40 | public SatelliteSwitch() { | ||
41 | if (modelPackage == null) { | ||
42 | modelPackage = SatellitePackage.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 SatellitePackage.CONSTELLATION_MISSION: { | ||
70 | ConstellationMission constellationMission = (ConstellationMission) theEObject; | ||
71 | T result = caseConstellationMission(constellationMission); | ||
72 | if (result == null) | ||
73 | result = defaultCase(theEObject); | ||
74 | return result; | ||
75 | } | ||
76 | case SatellitePackage.INTERFEROMETRY_MISSION: { | ||
77 | InterferometryMission interferometryMission = (InterferometryMission) theEObject; | ||
78 | T result = caseInterferometryMission(interferometryMission); | ||
79 | if (result == null) | ||
80 | result = caseConstellationMission(interferometryMission); | ||
81 | if (result == null) | ||
82 | result = defaultCase(theEObject); | ||
83 | return result; | ||
84 | } | ||
85 | case SatellitePackage.COMMUNICATING_ELEMENT: { | ||
86 | CommunicatingElement communicatingElement = (CommunicatingElement) theEObject; | ||
87 | T result = caseCommunicatingElement(communicatingElement); | ||
88 | if (result == null) | ||
89 | result = defaultCase(theEObject); | ||
90 | return result; | ||
91 | } | ||
92 | case SatellitePackage.GROUND_STATION_NETWORK: { | ||
93 | GroundStationNetwork groundStationNetwork = (GroundStationNetwork) theEObject; | ||
94 | T result = caseGroundStationNetwork(groundStationNetwork); | ||
95 | if (result == null) | ||
96 | result = caseCommunicatingElement(groundStationNetwork); | ||
97 | if (result == null) | ||
98 | result = defaultCase(theEObject); | ||
99 | return result; | ||
100 | } | ||
101 | case SatellitePackage.SPACECRAFT: { | ||
102 | Spacecraft spacecraft = (Spacecraft) theEObject; | ||
103 | T result = caseSpacecraft(spacecraft); | ||
104 | if (result == null) | ||
105 | result = caseCommunicatingElement(spacecraft); | ||
106 | if (result == null) | ||
107 | result = defaultCase(theEObject); | ||
108 | return result; | ||
109 | } | ||
110 | case SatellitePackage.COMM_SUBSYSTEM: { | ||
111 | CommSubsystem commSubsystem = (CommSubsystem) theEObject; | ||
112 | T result = caseCommSubsystem(commSubsystem); | ||
113 | if (result == null) | ||
114 | result = defaultCase(theEObject); | ||
115 | return result; | ||
116 | } | ||
117 | case SatellitePackage.PAYLOAD: { | ||
118 | Payload payload = (Payload) theEObject; | ||
119 | T result = casePayload(payload); | ||
120 | if (result == null) | ||
121 | result = defaultCase(theEObject); | ||
122 | return result; | ||
123 | } | ||
124 | case SatellitePackage.INTERFEROMETRY_PAYLOAD: { | ||
125 | InterferometryPayload interferometryPayload = (InterferometryPayload) theEObject; | ||
126 | T result = caseInterferometryPayload(interferometryPayload); | ||
127 | if (result == null) | ||
128 | result = casePayload(interferometryPayload); | ||
129 | if (result == null) | ||
130 | result = defaultCase(theEObject); | ||
131 | return result; | ||
132 | } | ||
133 | case SatellitePackage.CUBE_SAT3_U: { | ||
134 | CubeSat3U cubeSat3U = (CubeSat3U) theEObject; | ||
135 | T result = caseCubeSat3U(cubeSat3U); | ||
136 | if (result == null) | ||
137 | result = caseCubeSat(cubeSat3U); | ||
138 | if (result == null) | ||
139 | result = caseSpacecraft(cubeSat3U); | ||
140 | if (result == null) | ||
141 | result = caseCommunicatingElement(cubeSat3U); | ||
142 | if (result == null) | ||
143 | result = defaultCase(theEObject); | ||
144 | return result; | ||
145 | } | ||
146 | case SatellitePackage.CUBE_SAT6_U: { | ||
147 | CubeSat6U cubeSat6U = (CubeSat6U) theEObject; | ||
148 | T result = caseCubeSat6U(cubeSat6U); | ||
149 | if (result == null) | ||
150 | result = caseCubeSat(cubeSat6U); | ||
151 | if (result == null) | ||
152 | result = caseSpacecraft(cubeSat6U); | ||
153 | if (result == null) | ||
154 | result = caseCommunicatingElement(cubeSat6U); | ||
155 | if (result == null) | ||
156 | result = defaultCase(theEObject); | ||
157 | return result; | ||
158 | } | ||
159 | case SatellitePackage.SMALL_SAT: { | ||
160 | SmallSat smallSat = (SmallSat) theEObject; | ||
161 | T result = caseSmallSat(smallSat); | ||
162 | if (result == null) | ||
163 | result = caseSpacecraft(smallSat); | ||
164 | if (result == null) | ||
165 | result = caseCommunicatingElement(smallSat); | ||
166 | if (result == null) | ||
167 | result = defaultCase(theEObject); | ||
168 | return result; | ||
169 | } | ||
170 | case SatellitePackage.CUBE_SAT: { | ||
171 | CubeSat cubeSat = (CubeSat) theEObject; | ||
172 | T result = caseCubeSat(cubeSat); | ||
173 | if (result == null) | ||
174 | result = caseSpacecraft(cubeSat); | ||
175 | if (result == null) | ||
176 | result = caseCommunicatingElement(cubeSat); | ||
177 | if (result == null) | ||
178 | result = defaultCase(theEObject); | ||
179 | return result; | ||
180 | } | ||
181 | case SatellitePackage.UHF_COMM_SUBSYSTEM: { | ||
182 | UHFCommSubsystem uhfCommSubsystem = (UHFCommSubsystem) theEObject; | ||
183 | T result = caseUHFCommSubsystem(uhfCommSubsystem); | ||
184 | if (result == null) | ||
185 | result = caseCommSubsystem(uhfCommSubsystem); | ||
186 | if (result == null) | ||
187 | result = defaultCase(theEObject); | ||
188 | return result; | ||
189 | } | ||
190 | case SatellitePackage.XCOMM_SUBSYSTEM: { | ||
191 | XCommSubsystem xCommSubsystem = (XCommSubsystem) theEObject; | ||
192 | T result = caseXCommSubsystem(xCommSubsystem); | ||
193 | if (result == null) | ||
194 | result = caseCommSubsystem(xCommSubsystem); | ||
195 | if (result == null) | ||
196 | result = defaultCase(theEObject); | ||
197 | return result; | ||
198 | } | ||
199 | case SatellitePackage.KA_COMM_SUBSYSTEM: { | ||
200 | KaCommSubsystem kaCommSubsystem = (KaCommSubsystem) theEObject; | ||
201 | T result = caseKaCommSubsystem(kaCommSubsystem); | ||
202 | if (result == null) | ||
203 | result = caseCommSubsystem(kaCommSubsystem); | ||
204 | if (result == null) | ||
205 | result = defaultCase(theEObject); | ||
206 | return result; | ||
207 | } | ||
208 | default: | ||
209 | return defaultCase(theEObject); | ||
210 | } | ||
211 | } | ||
212 | |||
213 | /** | ||
214 | * Returns the result of interpreting the object as an instance of '<em>Constellation Mission</em>'. | ||
215 | * <!-- begin-user-doc --> | ||
216 | * This implementation returns null; | ||
217 | * returning a non-null result will terminate the switch. | ||
218 | * <!-- end-user-doc --> | ||
219 | * @param object the target of the switch. | ||
220 | * @return the result of interpreting the object as an instance of '<em>Constellation Mission</em>'. | ||
221 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
222 | * @generated | ||
223 | */ | ||
224 | public T caseConstellationMission(ConstellationMission object) { | ||
225 | return null; | ||
226 | } | ||
227 | |||
228 | /** | ||
229 | * Returns the result of interpreting the object as an instance of '<em>Interferometry Mission</em>'. | ||
230 | * <!-- begin-user-doc --> | ||
231 | * This implementation returns null; | ||
232 | * returning a non-null result will terminate the switch. | ||
233 | * <!-- end-user-doc --> | ||
234 | * @param object the target of the switch. | ||
235 | * @return the result of interpreting the object as an instance of '<em>Interferometry Mission</em>'. | ||
236 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
237 | * @generated | ||
238 | */ | ||
239 | public T caseInterferometryMission(InterferometryMission object) { | ||
240 | return null; | ||
241 | } | ||
242 | |||
243 | /** | ||
244 | * Returns the result of interpreting the object as an instance of '<em>Communicating Element</em>'. | ||
245 | * <!-- begin-user-doc --> | ||
246 | * This implementation returns null; | ||
247 | * returning a non-null result will terminate the switch. | ||
248 | * <!-- end-user-doc --> | ||
249 | * @param object the target of the switch. | ||
250 | * @return the result of interpreting the object as an instance of '<em>Communicating Element</em>'. | ||
251 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
252 | * @generated | ||
253 | */ | ||
254 | public T caseCommunicatingElement(CommunicatingElement object) { | ||
255 | return null; | ||
256 | } | ||
257 | |||
258 | /** | ||
259 | * Returns the result of interpreting the object as an instance of '<em>Ground Station Network</em>'. | ||
260 | * <!-- begin-user-doc --> | ||
261 | * This implementation returns null; | ||
262 | * returning a non-null result will terminate the switch. | ||
263 | * <!-- end-user-doc --> | ||
264 | * @param object the target of the switch. | ||
265 | * @return the result of interpreting the object as an instance of '<em>Ground Station Network</em>'. | ||
266 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
267 | * @generated | ||
268 | */ | ||
269 | public T caseGroundStationNetwork(GroundStationNetwork object) { | ||
270 | return null; | ||
271 | } | ||
272 | |||
273 | /** | ||
274 | * Returns the result of interpreting the object as an instance of '<em>Spacecraft</em>'. | ||
275 | * <!-- begin-user-doc --> | ||
276 | * This implementation returns null; | ||
277 | * returning a non-null result will terminate the switch. | ||
278 | * <!-- end-user-doc --> | ||
279 | * @param object the target of the switch. | ||
280 | * @return the result of interpreting the object as an instance of '<em>Spacecraft</em>'. | ||
281 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
282 | * @generated | ||
283 | */ | ||
284 | public T caseSpacecraft(Spacecraft object) { | ||
285 | return null; | ||
286 | } | ||
287 | |||
288 | /** | ||
289 | * Returns the result of interpreting the object as an instance of '<em>Comm Subsystem</em>'. | ||
290 | * <!-- begin-user-doc --> | ||
291 | * This implementation returns null; | ||
292 | * returning a non-null result will terminate the switch. | ||
293 | * <!-- end-user-doc --> | ||
294 | * @param object the target of the switch. | ||
295 | * @return the result of interpreting the object as an instance of '<em>Comm Subsystem</em>'. | ||
296 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
297 | * @generated | ||
298 | */ | ||
299 | public T caseCommSubsystem(CommSubsystem object) { | ||
300 | return null; | ||
301 | } | ||
302 | |||
303 | /** | ||
304 | * Returns the result of interpreting the object as an instance of '<em>Payload</em>'. | ||
305 | * <!-- begin-user-doc --> | ||
306 | * This implementation returns null; | ||
307 | * returning a non-null result will terminate the switch. | ||
308 | * <!-- end-user-doc --> | ||
309 | * @param object the target of the switch. | ||
310 | * @return the result of interpreting the object as an instance of '<em>Payload</em>'. | ||
311 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
312 | * @generated | ||
313 | */ | ||
314 | public T casePayload(Payload object) { | ||
315 | return null; | ||
316 | } | ||
317 | |||
318 | /** | ||
319 | * Returns the result of interpreting the object as an instance of '<em>Interferometry Payload</em>'. | ||
320 | * <!-- begin-user-doc --> | ||
321 | * This implementation returns null; | ||
322 | * returning a non-null result will terminate the switch. | ||
323 | * <!-- end-user-doc --> | ||
324 | * @param object the target of the switch. | ||
325 | * @return the result of interpreting the object as an instance of '<em>Interferometry Payload</em>'. | ||
326 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
327 | * @generated | ||
328 | */ | ||
329 | public T caseInterferometryPayload(InterferometryPayload object) { | ||
330 | return null; | ||
331 | } | ||
332 | |||
333 | /** | ||
334 | * Returns the result of interpreting the object as an instance of '<em>Cube Sat3 U</em>'. | ||
335 | * <!-- begin-user-doc --> | ||
336 | * This implementation returns null; | ||
337 | * returning a non-null result will terminate the switch. | ||
338 | * <!-- end-user-doc --> | ||
339 | * @param object the target of the switch. | ||
340 | * @return the result of interpreting the object as an instance of '<em>Cube Sat3 U</em>'. | ||
341 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
342 | * @generated | ||
343 | */ | ||
344 | public T caseCubeSat3U(CubeSat3U object) { | ||
345 | return null; | ||
346 | } | ||
347 | |||
348 | /** | ||
349 | * Returns the result of interpreting the object as an instance of '<em>Cube Sat6 U</em>'. | ||
350 | * <!-- begin-user-doc --> | ||
351 | * This implementation returns null; | ||
352 | * returning a non-null result will terminate the switch. | ||
353 | * <!-- end-user-doc --> | ||
354 | * @param object the target of the switch. | ||
355 | * @return the result of interpreting the object as an instance of '<em>Cube Sat6 U</em>'. | ||
356 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
357 | * @generated | ||
358 | */ | ||
359 | public T caseCubeSat6U(CubeSat6U object) { | ||
360 | return null; | ||
361 | } | ||
362 | |||
363 | /** | ||
364 | * Returns the result of interpreting the object as an instance of '<em>Small Sat</em>'. | ||
365 | * <!-- begin-user-doc --> | ||
366 | * This implementation returns null; | ||
367 | * returning a non-null result will terminate the switch. | ||
368 | * <!-- end-user-doc --> | ||
369 | * @param object the target of the switch. | ||
370 | * @return the result of interpreting the object as an instance of '<em>Small Sat</em>'. | ||
371 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
372 | * @generated | ||
373 | */ | ||
374 | public T caseSmallSat(SmallSat object) { | ||
375 | return null; | ||
376 | } | ||
377 | |||
378 | /** | ||
379 | * Returns the result of interpreting the object as an instance of '<em>Cube Sat</em>'. | ||
380 | * <!-- begin-user-doc --> | ||
381 | * This implementation returns null; | ||
382 | * returning a non-null result will terminate the switch. | ||
383 | * <!-- end-user-doc --> | ||
384 | * @param object the target of the switch. | ||
385 | * @return the result of interpreting the object as an instance of '<em>Cube Sat</em>'. | ||
386 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
387 | * @generated | ||
388 | */ | ||
389 | public T caseCubeSat(CubeSat object) { | ||
390 | return null; | ||
391 | } | ||
392 | |||
393 | /** | ||
394 | * Returns the result of interpreting the object as an instance of '<em>UHF Comm Subsystem</em>'. | ||
395 | * <!-- begin-user-doc --> | ||
396 | * This implementation returns null; | ||
397 | * returning a non-null result will terminate the switch. | ||
398 | * <!-- end-user-doc --> | ||
399 | * @param object the target of the switch. | ||
400 | * @return the result of interpreting the object as an instance of '<em>UHF Comm Subsystem</em>'. | ||
401 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
402 | * @generated | ||
403 | */ | ||
404 | public T caseUHFCommSubsystem(UHFCommSubsystem object) { | ||
405 | return null; | ||
406 | } | ||
407 | |||
408 | /** | ||
409 | * Returns the result of interpreting the object as an instance of '<em>XComm Subsystem</em>'. | ||
410 | * <!-- begin-user-doc --> | ||
411 | * This implementation returns null; | ||
412 | * returning a non-null result will terminate the switch. | ||
413 | * <!-- end-user-doc --> | ||
414 | * @param object the target of the switch. | ||
415 | * @return the result of interpreting the object as an instance of '<em>XComm Subsystem</em>'. | ||
416 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
417 | * @generated | ||
418 | */ | ||
419 | public T caseXCommSubsystem(XCommSubsystem object) { | ||
420 | return null; | ||
421 | } | ||
422 | |||
423 | /** | ||
424 | * Returns the result of interpreting the object as an instance of '<em>Ka Comm Subsystem</em>'. | ||
425 | * <!-- begin-user-doc --> | ||
426 | * This implementation returns null; | ||
427 | * returning a non-null result will terminate the switch. | ||
428 | * <!-- end-user-doc --> | ||
429 | * @param object the target of the switch. | ||
430 | * @return the result of interpreting the object as an instance of '<em>Ka Comm Subsystem</em>'. | ||
431 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject) | ||
432 | * @generated | ||
433 | */ | ||
434 | public T caseKaCommSubsystem(KaCommSubsystem object) { | ||
435 | return null; | ||
436 | } | ||
437 | |||
438 | /** | ||
439 | * Returns the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
440 | * <!-- begin-user-doc --> | ||
441 | * This implementation returns null; | ||
442 | * returning a non-null result will terminate the switch, but this is the last case anyway. | ||
443 | * <!-- end-user-doc --> | ||
444 | * @param object the target of the switch. | ||
445 | * @return the result of interpreting the object as an instance of '<em>EObject</em>'. | ||
446 | * @see #doSwitch(org.eclipse.emf.ecore.EObject) | ||
447 | * @generated | ||
448 | */ | ||
449 | @Override | ||
450 | public T defaultCase(EObject object) { | ||
451 | return null; | ||
452 | } | ||
453 | |||
454 | } //SatelliteSwitch | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/inputs/SatelliteInstance.xmi b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/inputs/SatelliteInstance.xmi new file mode 100644 index 00000000..3d07a199 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/inputs/SatelliteInstance.xmi | |||
@@ -0,0 +1,7 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <satellite:InterferometryMission | ||
3 | xmi:version="2.0" | ||
4 | xmlns:xmi="http://www.omg.org/XMI" | ||
5 | xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
6 | xmlns:satellite="http://www.example.org/satellite" | ||
7 | xsi:schemaLocation="http://www.example.org/satellite ../model/satellite.ecore"/> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore new file mode 100644 index 00000000..9f17d43c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore | |||
@@ -0,0 +1,32 @@ | |||
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" | ||
3 | xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="satellite" nsURI="http://www.example.org/satellite" nsPrefix="satellite"> | ||
4 | <eClassifiers xsi:type="ecore:EClass" name="ConstellationMission" abstract="true"> | ||
5 | <eStructuralFeatures xsi:type="ecore:EReference" name="groundStationNetwork" lowerBound="1" | ||
6 | eType="#//GroundStationNetwork" containment="true"/> | ||
7 | <eStructuralFeatures xsi:type="ecore:EReference" name="spacecraft" lowerBound="2" | ||
8 | upperBound="-1" eType="#//Spacecraft" containment="true"/> | ||
9 | </eClassifiers> | ||
10 | <eClassifiers xsi:type="ecore:EClass" name="InterferometryMission" eSuperTypes="#//ConstellationMission"/> | ||
11 | <eClassifiers xsi:type="ecore:EClass" name="CommunicatingElement" abstract="true"> | ||
12 | <eStructuralFeatures xsi:type="ecore:EReference" name="commSubsystem" lowerBound="1" | ||
13 | upperBound="2" eType="#//CommSubsystem" containment="true"/> | ||
14 | </eClassifiers> | ||
15 | <eClassifiers xsi:type="ecore:EClass" name="GroundStationNetwork" eSuperTypes="#//CommunicatingElement"/> | ||
16 | <eClassifiers xsi:type="ecore:EClass" name="Spacecraft" abstract="true" eSuperTypes="#//CommunicatingElement"> | ||
17 | <eStructuralFeatures xsi:type="ecore:EReference" name="payload" eType="#//Payload" | ||
18 | containment="true"/> | ||
19 | </eClassifiers> | ||
20 | <eClassifiers xsi:type="ecore:EClass" name="CommSubsystem" abstract="true"> | ||
21 | <eStructuralFeatures xsi:type="ecore:EReference" name="target" eType="#//CommSubsystem"/> | ||
22 | </eClassifiers> | ||
23 | <eClassifiers xsi:type="ecore:EClass" name="Payload" abstract="true"/> | ||
24 | <eClassifiers xsi:type="ecore:EClass" name="InterferometryPayload" eSuperTypes="#//Payload"/> | ||
25 | <eClassifiers xsi:type="ecore:EClass" name="CubeSat3U" eSuperTypes="#//CubeSat"/> | ||
26 | <eClassifiers xsi:type="ecore:EClass" name="CubeSat6U" eSuperTypes="#//CubeSat"/> | ||
27 | <eClassifiers xsi:type="ecore:EClass" name="SmallSat" eSuperTypes="#//Spacecraft"/> | ||
28 | <eClassifiers xsi:type="ecore:EClass" name="CubeSat" abstract="true" eSuperTypes="#//Spacecraft"/> | ||
29 | <eClassifiers xsi:type="ecore:EClass" name="UHFCommSubsystem" eSuperTypes="#//CommSubsystem"/> | ||
30 | <eClassifiers xsi:type="ecore:EClass" name="XCommSubsystem" eSuperTypes="#//CommSubsystem"/> | ||
31 | <eClassifiers xsi:type="ecore:EClass" name="KaCommSubsystem" eSuperTypes="#//CommSubsystem"/> | ||
32 | </ecore:EPackage> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel new file mode 100644 index 00000000..bc98abd6 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel | |||
@@ -0,0 +1,39 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?> | ||
2 | <genmodel:GenModel 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" xmlns:genmodel="http://www.eclipse.org/emf/2002/GenModel" | ||
4 | modelDirectory="/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen" | ||
5 | creationIcons="false" editDirectory="/hu.bme.mit.inf.dslreasoner.domains.satellite.edit/src-gen" | ||
6 | editorDirectory="/hu.bme.mit.inf.dslreasoner.domains.satellite.editor/src-gen" | ||
7 | modelPluginID="hu.bme.mit.inf.dslreasoner.domains.satellite" modelName="Satellite" | ||
8 | rootExtendsClass="org.eclipse.emf.ecore.impl.MinimalEObjectImpl$Container" codeFormatting="true" | ||
9 | importerID="org.eclipse.emf.importer.ecore" complianceLevel="8.0" copyrightFields="false" | ||
10 | operationReflection="true" importOrganizing="true"> | ||
11 | <foreignModel>satellite.ecore</foreignModel> | ||
12 | <testsDirectory xsi:nil="true"/> | ||
13 | <genPackages prefix="Satellite" disposableProviderFactory="true" ecorePackage="satellite.ecore#/"> | ||
14 | <genClasses image="false" ecoreClass="satellite.ecore#//ConstellationMission"> | ||
15 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference satellite.ecore#//ConstellationMission/groundStationNetwork"/> | ||
16 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference satellite.ecore#//ConstellationMission/spacecraft"/> | ||
17 | </genClasses> | ||
18 | <genClasses ecoreClass="satellite.ecore#//InterferometryMission"/> | ||
19 | <genClasses image="false" ecoreClass="satellite.ecore#//CommunicatingElement"> | ||
20 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference satellite.ecore#//CommunicatingElement/commSubsystem"/> | ||
21 | </genClasses> | ||
22 | <genClasses ecoreClass="satellite.ecore#//GroundStationNetwork"/> | ||
23 | <genClasses image="false" ecoreClass="satellite.ecore#//Spacecraft"> | ||
24 | <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference satellite.ecore#//Spacecraft/payload"/> | ||
25 | </genClasses> | ||
26 | <genClasses ecoreClass="satellite.ecore#//CommSubsystem"> | ||
27 | <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference satellite.ecore#//CommSubsystem/target"/> | ||
28 | </genClasses> | ||
29 | <genClasses image="false" ecoreClass="satellite.ecore#//Payload"/> | ||
30 | <genClasses ecoreClass="satellite.ecore#//InterferometryPayload"/> | ||
31 | <genClasses ecoreClass="satellite.ecore#//CubeSat3U"/> | ||
32 | <genClasses ecoreClass="satellite.ecore#//CubeSat6U"/> | ||
33 | <genClasses ecoreClass="satellite.ecore#//SmallSat"/> | ||
34 | <genClasses image="false" ecoreClass="satellite.ecore#//CubeSat"/> | ||
35 | <genClasses ecoreClass="satellite.ecore#//UHFCommSubsystem"/> | ||
36 | <genClasses ecoreClass="satellite.ecore#//XCommSubsystem"/> | ||
37 | <genClasses ecoreClass="satellite.ecore#//KaCommSubsystem"/> | ||
38 | </genPackages> | ||
39 | </genmodel:GenModel> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.properties b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.properties new file mode 100644 index 00000000..7463353c --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.properties | |||
@@ -0,0 +1,4 @@ | |||
1 | # | ||
2 | |||
3 | pluginName = hu.bme.mit.inf.dslreasoner.domains.satellite | ||
4 | providerName = www.example.org | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml new file mode 100644 index 00000000..b0b77996 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml | |||
@@ -0,0 +1,22 @@ | |||
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 satellite --> | ||
5 | <package class="satellite.SatellitePackage" genModel="model/satellite.genmodel" uri="http://www.example.org/satellite"/> | ||
6 | </extension> | ||
7 | <extension id="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.SatelliteQueries" point="org.eclipse.viatra.query.runtime.queryspecification"> | ||
8 | <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"> | ||
9 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLinkDoesNotStartAtContainingElement"/> | ||
10 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.transmittingGroundStationNetwork"/> | ||
11 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.roundStationNetworkUHF"/> | ||
12 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.notEnoughInterferometryPayloads"/> | ||
13 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noLinkToGroundStation"/> | ||
14 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.noPotentialLinkToGroundStation"/> | ||
15 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.communicationLoop"/> | ||
16 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.incompatibleSourceAndTargetBand"/> | ||
17 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.threeUCubeSatWithNonUhfCrossLink"/> | ||
18 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.cubeSatWithKaAntenna"/> | ||
19 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.satellite.queries.smallSat"/> | ||
20 | </group> | ||
21 | </extension> | ||
22 | </plugin> | ||
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 new file mode 100644 index 00000000..1f83a3b0 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | |||
@@ -0,0 +1,312 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.satellite.queries | ||
2 | |||
3 | import "http://www.example.org/satellite" | ||
4 | |||
5 | @Constraint(severity = "error", key = {Element}, | ||
6 | message = "A communicating element may not have two transmitting communication subsystems.") | ||
7 | pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) { | ||
8 | find transmittingCommSubsystem(Element, Comm1); | ||
9 | find transmittingCommSubsystem(Element, Comm2); | ||
10 | Comm1 != Comm2; | ||
11 | } | ||
12 | |||
13 | private pattern transmittingCommSubsystem(Element : CommunicatingElement, Comm : CommSubsystem) { | ||
14 | CommunicatingElement.commSubsystem(Element, Comm); | ||
15 | CommSubsystem.target(Comm, _); | ||
16 | } | ||
17 | |||
18 | @Constraint(severity = "error", key = {Station}, | ||
19 | message = "The ground station network may not have outgoing communication links.") | ||
20 | pattern transmittingGroundStationNetwork(Station : GroundStationNetwork) { | ||
21 | find transmittingCommSubsystem(Station, _); | ||
22 | } | ||
23 | |||
24 | @Constraint(severity = "error", key = {Station}, | ||
25 | message = "The ground station network may not have UHF communication subsystems.") | ||
26 | pattern roundStationNetworkUHF(Station : GroundStationNetwork) { | ||
27 | CommunicatingElement.commSubsystem(Station, Comm); | ||
28 | UHFCommSubsystem(Comm); | ||
29 | } | ||
30 | |||
31 | // At least two spacecraft must have the interferometry payload configured | ||
32 | |||
33 | @Constraint(severity = "error", key = {Mission}, | ||
34 | message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.") | ||
35 | pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) { | ||
36 | InterferometryMission(Mission); | ||
37 | neg find atLeastTwoInterferometryPayloads(Mission); | ||
38 | } | ||
39 | |||
40 | private pattern atLeastTwoInterferometryPayloads(Mission : InterferometryMission) { | ||
41 | find spacecraftWithInterferometryPayload(Mission, Spacecraft1); | ||
42 | find spacecraftWithInterferometryPayload(Mission, Spacecraft2); | ||
43 | Spacecraft1 != Spacecraft2; | ||
44 | } | ||
45 | |||
46 | private pattern spacecraftWithInterferometryPayload(Mission : ConstellationMission, Spacecraft : Spacecraft) { | ||
47 | ConstellationMission.spacecraft(Mission, Spacecraft); | ||
48 | Spacecraft.payload(Spacecraft, Payload); | ||
49 | InterferometryPayload(Payload); | ||
50 | } | ||
51 | |||
52 | // All spacecraft must have some communication path to the ground station | ||
53 | |||
54 | @Constraint(severity = "error", key = {Spacecraft}, | ||
55 | message = "Spacecraft has no communication path to the ground station.") | ||
56 | pattern noLinkToGroundStation(Spacecraft : Spacecraft) { | ||
57 | ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
58 | ConstellationMission.spacecraft(Mission, Spacecraft); | ||
59 | neg find indirectCommunicationLink(Spacecraft, GroundStation); | ||
60 | } | ||
61 | |||
62 | @Constraint(severity = "error", key = {Spacecraft}, | ||
63 | message = "Spacecraft has no potential communication path to the ground station.") | ||
64 | pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { | ||
65 | ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
66 | ConstellationMission.spacecraft(Mission, Spacecraft); | ||
67 | neg find indirectLinkAllowed(Spacecraft, GroundStation); | ||
68 | } | ||
69 | |||
70 | private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) { | ||
71 | find linkAllowed+(From, To); | ||
72 | } | ||
73 | |||
74 | private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) { | ||
75 | find matchingAntenna(From, To); | ||
76 | neg find cubeSat3U(From); | ||
77 | } or { | ||
78 | find matchingAntenna(From, To); | ||
79 | CubeSat3U(From); | ||
80 | } or { | ||
81 | find matchingAntenna(From, To); | ||
82 | CubeSat3U(From); | ||
83 | GroundStationNetwork(To); | ||
84 | } | ||
85 | |||
86 | private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement) { | ||
87 | CommunicatingElement.commSubsystem(From, FromSys); | ||
88 | CommunicatingElement.commSubsystem(To, ToSys); | ||
89 | find matchingCommSubsystem(FromSys, ToSys); | ||
90 | } | ||
91 | |||
92 | private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) { | ||
93 | UHFCommSubsystem(From); | ||
94 | UHFCommSubsystem(To); | ||
95 | } or { | ||
96 | XCommSubsystem(From); | ||
97 | XCommSubsystem(To); | ||
98 | } or { | ||
99 | KaCommSubsystem(From); | ||
100 | KaCommSubsystem(To); | ||
101 | } | ||
102 | |||
103 | private pattern cubeSat3U(Sat : CubeSat3U) { | ||
104 | CubeSat3U(Sat); | ||
105 | } | ||
106 | |||
107 | // No communication loops may exist | ||
108 | // No spacecraft may directly communicate with itself | ||
109 | |||
110 | @Constraint(severity = "error", key = {Element}, | ||
111 | message = "Communication loop.") | ||
112 | pattern communicationLoop(Element : CommunicatingElement) { | ||
113 | find indirectCommunicationLink(Element, Element); | ||
114 | } | ||
115 | |||
116 | private pattern indirectCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | ||
117 | find directCommunicationLink+(Source, Target); | ||
118 | } | ||
119 | |||
120 | private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | ||
121 | CommSubsystem.target(SourceSubsystem, TargetSubsystem); | ||
122 | CommunicatingElement.commSubsystem(Source, SourceSubsystem); | ||
123 | CommunicatingElement.commSubsystem(Target, TargetSubsystem); | ||
124 | } | ||
125 | |||
126 | // Source and target communication systems must be compatible. | ||
127 | |||
128 | @Constraint(severity = "error", key = {SourceSubsystem}, | ||
129 | message = "Two ends of a communication link must use the same band.") | ||
130 | pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { | ||
131 | CommSubsystem.target(SourceSubsystem, TargetSubsystem); | ||
132 | neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | ||
133 | } | ||
134 | |||
135 | // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter, | ||
136 | // but cross-link using UHF | ||
137 | |||
138 | @Constraint(severity = "error", key = {Sat}, | ||
139 | message = "3U CubeSats can only cross-link using UHF.") | ||
140 | pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { | ||
141 | CommunicatingElement.commSubsystem(Sat, SourceComm); | ||
142 | neg find commSubsystemBandUhf(SourceComm); | ||
143 | CommSubsystem.target(SourceComm, TargetComm); | ||
144 | CommunicatingElement.commSubsystem(Target, TargetComm); | ||
145 | neg find groundStationNetwork(Target); | ||
146 | } | ||
147 | |||
148 | private pattern commSubsystemBandUhf(Comm : UHFCommSubsystem) { | ||
149 | UHFCommSubsystem(Comm); | ||
150 | } | ||
151 | |||
152 | private pattern groundStationNetwork(Network : GroundStationNetwork) { | ||
153 | GroundStationNetwork(Network); | ||
154 | } | ||
155 | |||
156 | // Only a Small Satellite can be configured with a Ka-band communication system | ||
157 | |||
158 | @Constraint(severity = "error", key = {Spacecraft}, | ||
159 | message = "Only a Small Satellite can be configured with a Ka-band communication system.") | ||
160 | pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) { | ||
161 | CommunicatingElement.commSubsystem(Spacecraft, Comm); | ||
162 | KaCommSubsystem(Comm); | ||
163 | neg find smallSat(Spacecraft); | ||
164 | } | ||
165 | |||
166 | pattern smallSat(Sat : SmallSat) { | ||
167 | SmallSat(Sat); | ||
168 | } | ||
169 | |||
170 | //// | ||
171 | //// Metrics | ||
172 | //// | ||
173 | // | ||
174 | //// Coverage | ||
175 | // | ||
176 | //pattern coverageMetric(Coverage : java Double) { | ||
177 | // Coverage == sum find missionCoverage(_, #_); | ||
178 | //} | ||
179 | // | ||
180 | //private pattern missionCoverage(Mission : InterferometryMission, Coverage : java Double) { | ||
181 | // InterferometryMission.observationTime(Mission, ObservationTime); | ||
182 | // ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _); | ||
183 | // Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 * (1.0 / ObservationTime)) + 0.05 * ObservationTime / 3); | ||
184 | //} | ||
185 | // | ||
186 | //// Time | ||
187 | // | ||
188 | //pattern timeMetric(Time : java Double) { | ||
189 | // Time == sum find missionTime(_, #_); | ||
190 | //} | ||
191 | // | ||
192 | //private pattern missionTime(Mission : InterferometryMission, Time : java Double) { | ||
193 | // InterferometryMission.observationTime(Mission, ObservationTime); | ||
194 | // TrasmitTime == sum find transmitTime(Mission, _, #_); | ||
195 | // Time == eval(TrasmitTime + 60.0 * ObservationTime); | ||
196 | //} | ||
197 | // | ||
198 | //private pattern transmitTime(Mission : InterferometryMission, Spacecraft : Spacecraft, TransmitTime : java Double) { | ||
199 | // ConstellationMission.spacecraft(Mission, Spacecraft); | ||
200 | // find scienceData(Spacecraft, ScienceData); | ||
201 | // IncomingData == sum find incomingData(Spacecraft, _, #_); | ||
202 | // find transmitRate(Spacecraft, TransmitRate); | ||
203 | // TransmitTime == eval((ScienceData + IncomingData) / (7.5 * TransmitRate)); | ||
204 | //} | ||
205 | // | ||
206 | //private pattern incomingData(Spacecraft : Spacecraft, Source : Spacecraft, Data : java Double) { | ||
207 | // find indirectCommunicationLink(Source, Spacecraft); | ||
208 | // find scienceData(Source, Data); | ||
209 | //} | ||
210 | // | ||
211 | //private pattern scienceData(Spacecraft : Spacecraft, Data : java Double) { | ||
212 | // ConstellationMission.spacecraft(Mission, Spacecraft); | ||
213 | // InterferometryMission.observationTime(Mission, ObservationTime); | ||
214 | // Data == eval(12.0 * ObservationTime); | ||
215 | //} | ||
216 | // | ||
217 | //private pattern transmitRate(Spacecraft : Spacecraft, TransmitRate : java Double) { | ||
218 | // find spacecraftUplink(Spacecraft, Comm, Target); | ||
219 | // UHFCommSubsystem(Comm); | ||
220 | // Spacecraft(Target); | ||
221 | // TransmitRate == 5.0; | ||
222 | //} or { | ||
223 | // find spacecraftUplink(Spacecraft, Comm, Target); | ||
224 | // XCommSubsystem(Comm); | ||
225 | // Spacecraft(Target); | ||
226 | // TransmitRate == 1.6; | ||
227 | //} or { | ||
228 | // find spacecraftUplink(Spacecraft, Comm, Target); | ||
229 | // XCommSubsystem(Comm); | ||
230 | // GroundStationNetwork(Target); | ||
231 | // TransmitRate == 0.7; | ||
232 | //} or { | ||
233 | // find spacecraftUplink(Spacecraft, Comm, Target); | ||
234 | // KaCommSubsystem(Comm); | ||
235 | // Spacecraft(Target); | ||
236 | // TransmitRate == 220.0; | ||
237 | //} or { | ||
238 | // find spacecraftUplink(Spacecraft, Comm, Target); | ||
239 | // KaCommSubsystem(Comm); | ||
240 | // GroundStationNetwork(Target); | ||
241 | // TransmitRate == 80.0; | ||
242 | //} | ||
243 | // | ||
244 | //private pattern spacecraftUplink(Spacecraft : Spacecraft, TargetSubsystem : CommSubsystem, Target : CommunicatingElement) { | ||
245 | // CommunicatingElement.commSubsystem.target(Spacecraft, TargetSubsystem); | ||
246 | // CommunicatingElement.commSubsystem(Target, TargetSubsystem); | ||
247 | //} | ||
248 | // | ||
249 | //// Cost | ||
250 | // | ||
251 | //pattern costMetric(Cost : java Double) { | ||
252 | // Cost == sum find missionCost(_, #_); | ||
253 | //} | ||
254 | // | ||
255 | //private pattern missionCost(Mission : InterferometryMission, Cost : java Double) { | ||
256 | // InterferometryMission.observationTime(Mission, ObservationTime); | ||
257 | // SpacecraftCost == sum find spacecraftCost(Mission, _, #_); | ||
258 | // Cost == eval(SpacecraftCost + 100000.0 * ObservationTime); | ||
259 | //} | ||
260 | // | ||
261 | //private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) { | ||
262 | // ConstellationMission.spacecraft(Mission, Spacecraft); | ||
263 | // find spacecraftOfKindCount(Spacecraft, KindCount); | ||
264 | // find basePrice(Spacecraft, BasePrice); | ||
265 | // find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost); | ||
266 | // find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost); | ||
267 | // Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost); | ||
268 | //} | ||
269 | // | ||
270 | //private pattern spacecraftOfKindCount(Sat : Spacecraft, Count : java Integer) { | ||
271 | // CubeSat3U(Sat); | ||
272 | // Count == count find cubeSat3U(_); | ||
273 | //} or { | ||
274 | // CubeSat6U(Sat); | ||
275 | // Count == count find cubeSat6U(_); | ||
276 | //} or { | ||
277 | // SmallSat(Sat); | ||
278 | // Count == count find smallSat(_); | ||
279 | //} | ||
280 | // | ||
281 | //private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) { | ||
282 | // CubeSat3U(Spacecraft); | ||
283 | // BasePrice == 250000.0; | ||
284 | //} or { | ||
285 | // CubeSat6U(Spacecraft); | ||
286 | // BasePrice == 750000.0; | ||
287 | //} or { | ||
288 | // SmallSat(Spacecraft); | ||
289 | // BasePrice == 3000000.0; | ||
290 | //} | ||
291 | // | ||
292 | //private pattern interferometryPayloadCost(Spacecraft : Spacecraft, Cost : java Double) { | ||
293 | // find spacecraftWithInterferometryPayload(_, Spacecraft); | ||
294 | // Cost == 50000.0; | ||
295 | //} or { | ||
296 | // neg find spacecraftWithInterferometryPayload(_, Spacecraft); | ||
297 | // Cost == 0.0; | ||
298 | //} | ||
299 | // | ||
300 | //private pattern additionalCommSubsystemCost(Spacecraft : Spacecraft, Cost : java Double) { | ||
301 | // find spacecraftWithTwoCommSubsystems(Spacecraft); | ||
302 | // Cost == 100000.0; | ||
303 | //} or { | ||
304 | // neg find spacecraftWithTwoCommSubsystems(Spacecraft); | ||
305 | // Cost == 0.0; | ||
306 | //} | ||
307 | // | ||
308 | //private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) { | ||
309 | // Spacecraft.commSubsystem(Spacecraft, Subsystem1); | ||
310 | // Spacecraft.commSubsystem(Spacecraft, Subsystem2); | ||
311 | // Subsystem1 != Subsystem2; | ||
312 | //} | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend new file mode 100644 index 00000000..5e4e4ef0 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend | |||
@@ -0,0 +1,17 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.satellite.runner | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor | ||
4 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions | ||
5 | import org.eclipse.viatra.query.runtime.rete.matcher.ReteBackendFactory | ||
6 | |||
7 | final class SatelliteGeneratorMain { | ||
8 | private new() { | ||
9 | throw new IllegalStateException("This is a static utility class and should not be instantiated directly.") | ||
10 | } | ||
11 | |||
12 | public static def void main(String[] args) { | ||
13 | ViatraQueryEngineOptions.setSystemDefaultBackends(ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE, | ||
14 | ReteBackendFactory.INSTANCE) | ||
15 | println(StandaloneScriptExecutor.executeScript("configs/generation.vsconfig")) | ||
16 | } | ||
17 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/META-INF/MANIFEST.MF b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/META-INF/MANIFEST.MF index f15381b2..2666dc5e 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/META-INF/MANIFEST.MF +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/META-INF/MANIFEST.MF | |||
@@ -6,16 +6,13 @@ Bundle-Version: 1.0.0.qualifier | |||
6 | Bundle-ClassPath: . | 6 | Bundle-ClassPath: . |
7 | Bundle-Vendor: %providerName | 7 | Bundle-Vendor: %providerName |
8 | Bundle-Localization: plugin | 8 | Bundle-Localization: plugin |
9 | Export-Package: hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm, | 9 | Export-Package: hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm, |
10 | hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl, | 10 | hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.impl, |
11 | hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.util, | 11 | hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.util, |
12 | hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu, | 12 | hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu |
13 | hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated, | 13 | Require-Bundle: org.eclipse.viatra.query.runtime, |
14 | hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.util, | 14 | org.eclipse.core.runtime, |
15 | hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.util | 15 | org.eclipse.emf.ecore;visibility:=reexport, |
16 | Require-Bundle: org.eclipse.viatra.query.runtime, | ||
17 | org.eclipse.core.runtime, | ||
18 | org.eclipse.emf.ecore;visibility:=reexport, | ||
19 | com.google.guava;bundle-version="15.0.0" | 16 | com.google.guava;bundle-version="15.0.0" |
20 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 | 17 | Bundle-RequiredExecutionEnvironment: JavaSE-1.8 |
21 | Bundle-ActivationPolicy: lazy | 18 | Bundle-ActivationPolicy: lazy |
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/plugin.xml index 8069f168..7bf4a20b 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/plugin.xml +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/plugin.xml | |||
@@ -1,103 +1,41 @@ | |||
1 | <?xml version="1.0" encoding="UTF-8"?><plugin> | 1 | <?xml version="1.0" encoding="UTF-8"?><plugin> |
2 | <extension point="org.eclipse.emf.ecore.generated_package"> | 2 | <extension point="org.eclipse.emf.ecore.generated_package"> |
3 | <!-- @generated yakindu_simplified --> | 3 | <!-- @generated yakindu_simplified --> |
4 | <package class="hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummPackage" genModel="model/yakindu_simplified.genmodel" uri="hu.bme.mit.inf.yakindumm"/> | 4 | <package class="hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph.yakindumm.YakindummPackage" genModel="model/yakindu_simplified.genmodel" uri="hu.bme.mit.inf.yakindumm"/> |
5 | </extension> | 5 | </extension> |
6 | <extension id="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.Patterns" point="org.eclipse.viatra.query.runtime.queryspecification"> | 6 | <extension id="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.Patterns" point="org.eclipse.viatra.query.runtime.queryspecification"> |
7 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.Patterns" id="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.Patterns"> | 7 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.Patterns" id="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.Patterns"> |
8 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.entryInRegion"/> | 8 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.entryInRegion"/> |
9 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.noEntryInRegion"/> | 9 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.noEntryInRegion"/> |
10 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.multipleEntryInRegion"/> | 10 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.multipleEntryInRegion"/> |
11 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.transition"/> | 11 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.transition"/> |
12 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.incomingToEntry"/> | 12 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.transitionFrom"/> |
13 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.noOutgoingTransitionFromEntry"/> | 13 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.transitionTo"/> |
14 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.multipleTransitionFromEntry"/> | 14 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.incomingToEntry"/> |
15 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.outgoingFromExit"/> | 15 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.noOutgoingTransitionFromEntry"/> |
16 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.outgoingFromFinal"/> | 16 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.multipleTransitionFromEntry"/> |
17 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.noStateInRegion"/> | 17 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.outgoingFromExit"/> |
18 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.StateInRegion"/> | 18 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.outgoingFromFinal"/> |
19 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.choiceHasNoOutgoing"/> | 19 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.noStateInRegion"/> |
20 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.choiceHasNoIncoming"/> | 20 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.StateInRegion"/> |
21 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.synchHasNoOutgoing"/> | 21 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.choiceHasNoOutgoing"/> |
22 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.synchHasNoIncoming"/> | 22 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.choiceHasNoIncoming"/> |
23 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedIncomingInSameRegion"/> | 23 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.synchHasNoOutgoing"/> |
24 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.notSynchronizingStates"/> | 24 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.synchHasNoIncoming"/> |
25 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.hasMultipleOutgoingTrainsition"/> | 25 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedIncomingInSameRegion"/> |
26 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.hasMultipleIncomingTrainsition"/> | 26 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedIncomingInSameRegionHelper1"/> |
27 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedRegionsAreNotSiblings"/> | 27 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedIncomingInSameRegionHelper2"/> |
28 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.child"/> | 28 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.notSynchronizingStates"/> |
29 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedRegionDoesNotHaveMultipleRegions"/> | 29 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.hasMultipleOutgoingTrainsition"/> |
30 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.hasMultipleRegions"/> | 30 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.hasMultipleIncomingTrainsition"/> |
31 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.synchThree"/> | 31 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedRegionsAreNotSiblings"/> |
32 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.twoSynch"/> | 32 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedRegionsAreNotSiblingsHelper1"/> |
33 | </group> | 33 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedRegionsAreNotSiblingsHelper2"/> |
34 | </extension> | 34 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.child"/> |
35 | <extension id="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.Mutated" point="org.eclipse.viatra.query.runtime.queryspecification"> | 35 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.SynchronizedRegionDoesNotHaveMultipleRegions"/> |
36 | <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.Mutated" id="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.Mutated"> | 36 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.hasMultipleRegions"/> |
37 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.entryInRegion_M0"/> | 37 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.synchThree"/> |
38 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.entryInRegion_M1"/> | 38 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.twoSynch"/> |
39 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.entryInRegion_M2"/> | 39 | </group> |
40 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noEntryInRegion_M0"/> | 40 | </extension> |
41 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noEntryInRegion_M1"/> | 41 | </plugin> |
42 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noEntryInRegion_M2"/> | ||
43 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noEntryInRegion_M3"/> | ||
44 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noEntryInRegion_M4"/> | ||
45 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noEntryInRegion_M5"/> | ||
46 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleEntryInRegion_M0"/> | ||
47 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleEntryInRegion_M1"/> | ||
48 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleEntryInRegion_M2"/> | ||
49 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleEntryInRegion_M3"/> | ||
50 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleEntryInRegion_M4"/> | ||
51 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleEntryInRegion_M5"/> | ||
52 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.transition_M0"/> | ||
53 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.transition_M1"/> | ||
54 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.transition_M2"/> | ||
55 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.transition_M3"/> | ||
56 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.transition_M4"/> | ||
57 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.incomingToEntry_M0"/> | ||
58 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.incomingToEntry_1"/> | ||
59 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.incomingToEntry_2"/> | ||
60 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.incomingToEntry_3"/> | ||
61 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.incomingToEntry_4"/> | ||
62 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.incomingToEntry_5"/> | ||
63 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noOutgoingTransitionFromEntry_M0"/> | ||
64 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noOutgoingTransitionFromEntry_M1"/> | ||
65 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noOutgoingTransitionFromEntry_M2"/> | ||
66 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noOutgoingTransitionFromEntry_M3"/> | ||
67 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noOutgoingTransitionFromEntry_M4"/> | ||
68 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noOutgoingTransitionFromEntry_M5"/> | ||
69 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleTransitionFromEntry_M0"/> | ||
70 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleTransitionFromEntry_M1"/> | ||
71 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleTransitionFromEntry_M2"/> | ||
72 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleTransitionFromEntry_M3"/> | ||
73 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.multipleTransitionFromEntry_M4"/> | ||
74 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.outgoingFromExit_M0"/> | ||
75 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.outgoingFromExit_M1"/> | ||
76 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.outgoingFromExit_M2"/> | ||
77 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.outgoingFromFinal_M0"/> | ||
78 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.outgoingFromFinal_M1"/> | ||
79 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.outgoingFromFinal_M2"/> | ||
80 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noStateInRegion_M0"/> | ||
81 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noStateInRegion_M1"/> | ||
82 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noStateInRegion_M2"/> | ||
83 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.noStateInRegion_M3"/> | ||
84 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.StateInRegion_M0"/> | ||
85 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.StateInRegion_M1"/> | ||
86 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.StateInRegion_M2"/> | ||
87 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoOutgoing_M0"/> | ||
88 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoOutgoing_M1"/> | ||
89 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoOutgoing_M2"/> | ||
90 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoOutgoing_M3"/> | ||
91 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoOutgoing_M4"/> | ||
92 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoOutgoing_M5"/> | ||
93 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoOutgoing_M6"/> | ||
94 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoIncoming_M0"/> | ||
95 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoIncoming_M1"/> | ||
96 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoIncoming_M2"/> | ||
97 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoIncoming_M3"/> | ||
98 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoIncoming_M4"/> | ||
99 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoIncoming_M5"/> | ||
100 | <query-specification fqn="hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated.choiceHasNoIncoming_M6"/> | ||
101 | </group> | ||
102 | </extension> | ||
103 | </plugin> | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/mutated/mutated.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/mutated/mutated.vql deleted file mode 100644 index 58f66fe2..00000000 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/mutated/mutated.vql +++ /dev/null | |||
@@ -1,270 +0,0 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.partialsnapshot_mavo.yakindu.mutated | ||
2 | |||
3 | import epackage "hu.bme.mit.inf.yakindumm" | ||
4 | |||
5 | ///////// | ||
6 | // Entry | ||
7 | ///////// | ||
8 | |||
9 | pattern entryInRegion_M0(r1 : Region, e1 : Entry) { | ||
10 | Region.vertices(r1, e1); | ||
11 | } | ||
12 | pattern entryInRegion_M1(r1 : Region, e1) { | ||
13 | Region.vertices(r1, e1); | ||
14 | } | ||
15 | pattern entryInRegion_M2(r1 : Region, e1: Entry) { | ||
16 | // For positive constraint | ||
17 | Region(r1);Entry(e1); | ||
18 | } | ||
19 | |||
20 | |||
21 | //@Constraint(severity="error", message="error", key = {r1}) | ||
22 | pattern noEntryInRegion_M0(r1 : Region) { | ||
23 | neg find entryInRegion_M0(r1, _); | ||
24 | } | ||
25 | pattern noEntryInRegion_M1(r1 : Region) { | ||
26 | neg find entryInRegion_M1(r1, _); | ||
27 | } | ||
28 | pattern noEntryInRegion_M2(r1 : Region) { | ||
29 | neg find entryInRegion_M2(r1, _); | ||
30 | } | ||
31 | pattern noEntryInRegion_M3(r1 : Region) { | ||
32 | find entryInRegion_M0(r1, _); | ||
33 | } | ||
34 | pattern noEntryInRegion_M4(r1 : Region) { | ||
35 | find entryInRegion_M1(r1, _); | ||
36 | } | ||
37 | pattern noEntryInRegion_M5(r1 : Region) { | ||
38 | find entryInRegion_M2(r1, _); | ||
39 | } | ||
40 | |||
41 | //@Constraint(severity="error", message="error", key = {r}) | ||
42 | pattern multipleEntryInRegion_M0(r : Region) { | ||
43 | find entryInRegion_M0(r, e1); | ||
44 | find entryInRegion_M0(r, e2); | ||
45 | e1 != e2; | ||
46 | } | ||
47 | pattern multipleEntryInRegion_M1(r : Region) { | ||
48 | find entryInRegion_M1(r, e1); | ||
49 | find entryInRegion_M0(r, e2); | ||
50 | e1 != e2; | ||
51 | } | ||
52 | pattern multipleEntryInRegion_M2(r : Region) { | ||
53 | find entryInRegion_M2(r, e1); | ||
54 | find entryInRegion_M0(r, e2); | ||
55 | e1 != e2; | ||
56 | } | ||
57 | pattern multipleEntryInRegion_M3(r : Region) { | ||
58 | find entryInRegion_M0(r, e1); | ||
59 | find entryInRegion_M1(r, e2); | ||
60 | e1 != e2; | ||
61 | } | ||
62 | pattern multipleEntryInRegion_M4(r : Region) { | ||
63 | find entryInRegion_M2(r, e1); | ||
64 | find entryInRegion_M2(r, e2); | ||
65 | e1 != e2; | ||
66 | } | ||
67 | pattern multipleEntryInRegion_M5(r : Region) { | ||
68 | find entryInRegion_M0(r, e1); | ||
69 | find entryInRegion_M0(r, e2); | ||
70 | } | ||
71 | |||
72 | |||
73 | pattern transition_M0(t : Transition, src : Vertex, trg : Vertex) { | ||
74 | Transition.source(t, src); | ||
75 | Transition.target(t, trg); | ||
76 | } | ||
77 | pattern transition_M1(t : Transition, src : Vertex, trg : Vertex) { | ||
78 | Transition.source(t, src); | ||
79 | Vertex(trg); | ||
80 | } | ||
81 | pattern transition_M2(t : Transition, src : Vertex, trg : Vertex) { | ||
82 | Vertex(src); | ||
83 | Transition.target(t, trg); | ||
84 | } | ||
85 | pattern transition_M3(t : Transition, src : Vertex, trg : Vertex) { | ||
86 | Transition.source(t_x, src); | ||
87 | Transition.target(t, trg); | ||
88 | } | ||
89 | pattern transition_M4(t : Transition, src : Vertex, trg : Vertex) { | ||
90 | Transition.source(t, src); | ||
91 | Transition.target(t_x, trg); | ||
92 | } | ||
93 | |||
94 | //@Constraint(severity="error", message="error", key = {e}) | ||
95 | pattern incomingToEntry_M0(t : Transition, e : Entry) { | ||
96 | find transition_M0(t, _, e); | ||
97 | } | ||
98 | pattern incomingToEntry_1(t : Transition, e) { | ||
99 | find transition_M0(t, _, e); | ||
100 | } | ||
101 | pattern incomingToEntry_2(t : Transition, e : Entry) { | ||
102 | find transition_M1(t, _, e); | ||
103 | } | ||
104 | pattern incomingToEntry_3(t : Transition, e : Entry) { | ||
105 | find transition_M2(t, _, e); | ||
106 | } | ||
107 | pattern incomingToEntry_4(t : Transition, e : Entry) { | ||
108 | find transition_M3(t, _, e); | ||
109 | } | ||
110 | pattern incomingToEntry_5(t : Transition, e : Entry) { | ||
111 | find transition_M4(t, _, e); | ||
112 | } | ||
113 | |||
114 | pattern noOutgoingTransitionFromEntry_M0(e : Entry) { | ||
115 | neg find transition_M0(_, e, _); | ||
116 | } | ||
117 | |||
118 | pattern noOutgoingTransitionFromEntry_M1(e) { | ||
119 | Vertex(e); | ||
120 | neg find transition_M0(_, e, _); | ||
121 | } | ||
122 | pattern noOutgoingTransitionFromEntry_M2(e : Entry) { | ||
123 | neg find transition_M1(_, e, _); | ||
124 | } | ||
125 | pattern noOutgoingTransitionFromEntry_M3(e : Entry) { | ||
126 | neg find transition_M2(_, e, _); | ||
127 | } | ||
128 | pattern noOutgoingTransitionFromEntry_M4(e : Entry) { | ||
129 | neg find transition_M3(_, e, _); | ||
130 | } | ||
131 | pattern noOutgoingTransitionFromEntry_M5(e : Entry) { | ||
132 | neg find transition_M4(_, e, _); | ||
133 | } | ||
134 | |||
135 | |||
136 | //@Constraint(severity="error", message="error", key = {e}) | ||
137 | pattern multipleTransitionFromEntry_M0(e : Entry, t1 : Transition, t2: Transition) { | ||
138 | Entry.outgoingTransitions(e,t1); | ||
139 | Entry.outgoingTransitions(e,t2); | ||
140 | t1!=t2; | ||
141 | } | ||
142 | pattern multipleTransitionFromEntry_M1(e, t1 : Transition, t2: Transition) { | ||
143 | Entry.outgoingTransitions(e,t1); | ||
144 | Entry.outgoingTransitions(e,t2); | ||
145 | t1!=t2; | ||
146 | } | ||
147 | pattern multipleTransitionFromEntry_M2(e : Entry, t1 : Transition, t2: Transition) { | ||
148 | Transition(t1); | ||
149 | Entry.outgoingTransitions(e,t2); | ||
150 | t1!=t2; | ||
151 | } | ||
152 | pattern multipleTransitionFromEntry_M3(e : Entry, t1 : Transition, t2: Transition) { | ||
153 | Entry.outgoingTransitions(e,t1); | ||
154 | Transition(t2); | ||
155 | t1!=t2; | ||
156 | } | ||
157 | pattern multipleTransitionFromEntry_M4(e : Entry, t1 : Transition, t2: Transition) { | ||
158 | Entry.outgoingTransitions(e,t1); | ||
159 | Entry.outgoingTransitions(e,t2); | ||
160 | } | ||
161 | |||
162 | ///////// | ||
163 | // Exit | ||
164 | ///////// | ||
165 | |||
166 | //@Constraint(severity="error", message="error", key = {e}) | ||
167 | pattern outgoingFromExit_M0(t : Transition, e : Exit) { | ||
168 | Exit.outgoingTransitions(e,t); | ||
169 | } | ||
170 | pattern outgoingFromExit_M1(t : Transition, e) { | ||
171 | Vertex.outgoingTransitions(e,t); | ||
172 | } | ||
173 | pattern outgoingFromExit_M2(t : Transition, e : Exit) { | ||
174 | Transition(t); | ||
175 | Exit(e); | ||
176 | } | ||
177 | |||
178 | ///////// | ||
179 | // Final | ||
180 | ///////// | ||
181 | |||
182 | //@Constraint(severity="error", message="error", key = {f}) | ||
183 | pattern outgoingFromFinal_M0(t : Transition, f : FinalState) { | ||
184 | FinalState.outgoingTransitions(f,t); | ||
185 | } | ||
186 | pattern outgoingFromFinal_M1(t : Transition, f) { | ||
187 | Vertex.outgoingTransitions(f,t); | ||
188 | } | ||
189 | pattern outgoingFromFinal_M2(t : Transition, f : FinalState) { | ||
190 | Transition(t); | ||
191 | FinalState(f); | ||
192 | } | ||
193 | |||
194 | ///////// | ||
195 | // State vs Region | ||
196 | ///////// | ||
197 | |||
198 | //@Constraint(severity="error", message="error", key = {region}) | ||
199 | pattern noStateInRegion_M0(region: Region) { | ||
200 | neg find StateInRegion_M0(region,_); | ||
201 | } | ||
202 | pattern noStateInRegion_M1(region: Region) { | ||
203 | neg find StateInRegion_M1(region,_); | ||
204 | } | ||
205 | pattern noStateInRegion_M2(region: Region) { | ||
206 | neg find StateInRegion_M2(region,_); | ||
207 | } | ||
208 | pattern noStateInRegion_M3(region: Region) { | ||
209 | find StateInRegion_M0(region,_); | ||
210 | } | ||
211 | |||
212 | pattern StateInRegion_M0(region: Region, state: State) { | ||
213 | Region.vertices(region,state); | ||
214 | } | ||
215 | pattern StateInRegion_M1(region: Region, state) { | ||
216 | Region.vertices(region,state); | ||
217 | } | ||
218 | pattern StateInRegion_M2(region: Region, state:State) { | ||
219 | Region(region);State(state); | ||
220 | } | ||
221 | |||
222 | ///////// | ||
223 | // Choice | ||
224 | ///////// | ||
225 | |||
226 | @Constraint(severity="error", message="error", key = {c}) | ||
227 | pattern choiceHasNoOutgoing_M0(c : Choice) { | ||
228 | neg find transition_M0(_, c, _); | ||
229 | } | ||
230 | pattern choiceHasNoOutgoing_M1(c:Vertex) { | ||
231 | neg find transition_M0(_, c, _); | ||
232 | } | ||
233 | pattern choiceHasNoOutgoing_M2(c : Choice) { | ||
234 | neg find transition_M1(_, c, _); | ||
235 | } | ||
236 | pattern choiceHasNoOutgoing_M3(c : Choice) { | ||
237 | neg find transition_M2(_, c, _); | ||
238 | } | ||
239 | pattern choiceHasNoOutgoing_M4(c : Choice) { | ||
240 | neg find transition_M3(_, c, _); | ||
241 | } | ||
242 | pattern choiceHasNoOutgoing_M5(c : Choice) { | ||
243 | neg find transition_M4(_, c, _); | ||
244 | } | ||
245 | pattern choiceHasNoOutgoing_M6(c : Choice) { | ||
246 | find transition_M0(_, c, _); | ||
247 | } | ||
248 | |||
249 | @Constraint(severity="error", message="error", key = {c}) | ||
250 | pattern choiceHasNoIncoming_M0(c: Choice) { | ||
251 | neg find transition_M0(_, _, c); | ||
252 | } | ||
253 | pattern choiceHasNoIncoming_M1(c:Vertex) { | ||
254 | neg find transition_M0(_, _, c); | ||
255 | } | ||
256 | pattern choiceHasNoIncoming_M2(c: Choice) { | ||
257 | neg find transition_M1(_, _, c); | ||
258 | } | ||
259 | pattern choiceHasNoIncoming_M3(c: Choice) { | ||
260 | neg find transition_M2(_, _, c); | ||
261 | } | ||
262 | pattern choiceHasNoIncoming_M4(c: Choice) { | ||
263 | neg find transition_M3(_, _, c); | ||
264 | } | ||
265 | pattern choiceHasNoIncoming_M5(c: Choice) { | ||
266 | neg find transition_M4(_, _, c); | ||
267 | } | ||
268 | pattern choiceHasNoIncoming_M6(c: Choice) { | ||
269 | find transition_M0(_, _, c); | ||
270 | } | ||
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql index f4bfa3c1..98a10cde 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.yakindu.sgraph/queries/hu/bme/mit/inf/dslreasoner/partialsnapshot_mavo/yakindu/patterns.vql | |||
@@ -27,14 +27,22 @@ pattern transition(t : Transition, src : Vertex, trg : Vertex) { | |||
27 | Transition.target(t, trg); | 27 | Transition.target(t, trg); |
28 | } | 28 | } |
29 | 29 | ||
30 | pattern transitionFrom(t : Transition, src : Vertex) { | ||
31 | Transition.source(t, src); | ||
32 | } | ||
33 | |||
34 | pattern transitionTo(t : Transition, trg : Vertex) { | ||
35 | Transition.target(t, trg); | ||
36 | } | ||
37 | |||
30 | @Constraint(severity="error", message="error", key = {e}) | 38 | @Constraint(severity="error", message="error", key = {e}) |
31 | pattern incomingToEntry(t : Transition, e : Entry) { | 39 | pattern incomingToEntry(t : Transition, e : Entry) { |
32 | find transition(t, _, e); | 40 | find transitionTo(t, e); |
33 | } | 41 | } |
34 | 42 | ||
35 | @Constraint(severity="error", message="error", key = {e}) | 43 | @Constraint(severity="error", message="error", key = {e}) |
36 | pattern noOutgoingTransitionFromEntry(e : Entry) { | 44 | pattern noOutgoingTransitionFromEntry(e : Entry) { |
37 | neg find transition(_, e, _); | 45 | neg find transitionFrom(_, e); |
38 | } | 46 | } |
39 | 47 | ||
40 | @Constraint(severity="error", message="error", key = {e}) | 48 | @Constraint(severity="error", message="error", key = {e}) |
@@ -80,12 +88,12 @@ pattern StateInRegion(region: Region, state: State) { | |||
80 | 88 | ||
81 | @Constraint(severity="error", message="error", key = {c}) | 89 | @Constraint(severity="error", message="error", key = {c}) |
82 | pattern choiceHasNoOutgoing(c : Choice) { | 90 | pattern choiceHasNoOutgoing(c : Choice) { |
83 | neg find transition(_, c, _); | 91 | neg find transitionFrom(_, c); |
84 | } | 92 | } |
85 | 93 | ||
86 | @Constraint(severity="error", message="error", key = {c}) | 94 | @Constraint(severity="error", message="error", key = {c}) |
87 | pattern choiceHasNoIncoming(c: Choice) { | 95 | pattern choiceHasNoIncoming(c: Choice) { |
88 | neg find transition(_, _, c); | 96 | neg find transitionTo(_, c); |
89 | } | 97 | } |
90 | 98 | ||
91 | ///////// | 99 | ///////// |
@@ -94,27 +102,33 @@ pattern choiceHasNoIncoming(c: Choice) { | |||
94 | 102 | ||
95 | @Constraint(severity="error", message="error", key = {s}) | 103 | @Constraint(severity="error", message="error", key = {s}) |
96 | pattern synchHasNoOutgoing(s : Synchronization) { | 104 | pattern synchHasNoOutgoing(s : Synchronization) { |
97 | neg find transition(_, s, _); | 105 | neg find transitionFrom(_, s); |
98 | } | 106 | } |
99 | 107 | ||
100 | @Constraint(severity="error", message="error", key = {s}) | 108 | @Constraint(severity="error", message="error", key = {s}) |
101 | pattern synchHasNoIncoming(s : Synchronization) { | 109 | pattern synchHasNoIncoming(s : Synchronization) { |
102 | neg find transition(_, _, s); | 110 | neg find transitionTo(_, s); |
103 | } | 111 | } |
104 | 112 | ||
105 | @Constraint(severity="error", message="error", key = {s}) | 113 | @Constraint(severity="error", message="error", key = {s}) |
106 | pattern SynchronizedIncomingInSameRegion(s : Synchronization, v1 : Vertex, v2 : Vertex) { | 114 | pattern SynchronizedIncomingInSameRegion(s : Synchronization, t1 : Transition, t2 : Transition) { |
107 | find transition(t1, v1, s); | 115 | find SynchronizedIncomingInSameRegionHelper1(r, s, t1); |
108 | find transition(t2, v2, s); | 116 | find SynchronizedIncomingInSameRegionHelper1(r, s, t2); |
109 | t1!=t2; | 117 | t1!=t2; |
110 | Region.vertices(r, v1); | ||
111 | Region.vertices(r, v2); | ||
112 | } or { | 118 | } or { |
113 | find transition(t1, s, v1); | 119 | find SynchronizedIncomingInSameRegionHelper2(r, s, t1); |
114 | find transition(t2, s, v2); | 120 | find SynchronizedIncomingInSameRegionHelper2(r, s, t2); |
115 | t1!=t2; | 121 | t1!=t2; |
122 | } | ||
123 | |||
124 | pattern SynchronizedIncomingInSameRegionHelper1(r : Region, s : Synchronization, t1 : Transition) { | ||
125 | find transition(t1, v1, s); | ||
126 | Region.vertices(r, v1); | ||
127 | } | ||
128 | |||
129 | pattern SynchronizedIncomingInSameRegionHelper2(r : Region, s : Synchronization, t1 : Transition) { | ||
130 | find transition(t1, s, v1); | ||
116 | Region.vertices(r, v1); | 131 | Region.vertices(r, v1); |
117 | Region.vertices(r, v2); | ||
118 | } | 132 | } |
119 | 133 | ||
120 | @Constraint(severity="error", message="error", key = {s}) | 134 | @Constraint(severity="error", message="error", key = {s}) |
@@ -136,18 +150,24 @@ pattern hasMultipleIncomingTrainsition(v : Synchronization) { | |||
136 | } | 150 | } |
137 | 151 | ||
138 | @Constraint(severity="error", message="error", key = {s}) | 152 | @Constraint(severity="error", message="error", key = {s}) |
139 | pattern SynchronizedRegionsAreNotSiblings(s : Synchronization, v1 : Vertex, v2 : Vertex) { | 153 | pattern SynchronizedRegionsAreNotSiblings(s : Synchronization, r1 : CompositeElement, r2 : CompositeElement) { |
140 | find transition(_, v1, s); | 154 | find SynchronizedRegionsAreNotSiblingsHelper1(s, r1); |
141 | find transition(_, v2, s); | 155 | find SynchronizedRegionsAreNotSiblingsHelper1(s, r2); |
142 | CompositeElement.regions.vertices(r1, v1); | ||
143 | CompositeElement.regions.vertices(r2, v2); | ||
144 | r1 != r2; | 156 | r1 != r2; |
145 | } or { | 157 | } or { |
158 | find SynchronizedRegionsAreNotSiblingsHelper2(s, r1); | ||
159 | find SynchronizedRegionsAreNotSiblingsHelper2(s, r2); | ||
160 | r1 != r2; | ||
161 | } | ||
162 | |||
163 | pattern SynchronizedRegionsAreNotSiblingsHelper1(s : Synchronization, r1 : CompositeElement) { | ||
146 | find transition(_, s, v1); | 164 | find transition(_, s, v1); |
147 | find transition(_, s, v2); | ||
148 | CompositeElement.regions.vertices(r1, v1); | 165 | CompositeElement.regions.vertices(r1, v1); |
149 | CompositeElement.regions.vertices(r2, v2); | 166 | } |
150 | r1 != r2; | 167 | |
168 | pattern SynchronizedRegionsAreNotSiblingsHelper2(s : Synchronization, r1 : CompositeElement) { | ||
169 | find transition(_, v1, s); | ||
170 | CompositeElement.regions.vertices(r1, v1); | ||
151 | } | 171 | } |
152 | 172 | ||
153 | /////////////////////////////// | 173 | /////////////////////////////// |