aboutsummaryrefslogtreecommitdiffstats
path: root/Domains
diff options
context:
space:
mode:
authorLibravatar Kristóf Marussy <kris7topher@gmail.com>2019-05-21 17:00:01 -0400
committerLibravatar Kristóf Marussy <kris7topher@gmail.com>2019-05-21 17:00:01 -0400
commitfd3684b5440dacca0c4bf4be15930555a79e2100 (patch)
tree24120a5c7fdae1532529fa0c4687dc1078cd1cde /Domains
parentInterval hull aggregation operator (diff)
downloadVIATRA-Generator-fd3684b5440dacca0c4bf4be15930555a79e2100.tar.gz
VIATRA-Generator-fd3684b5440dacca0c4bf4be15930555a79e2100.tar.zst
VIATRA-Generator-fd3684b5440dacca0c4bf4be15930555a79e2100.zip
VIATRA DSE and COIN-OR CBC implementations of CPS case study
Diffstat (limited to 'Domains')
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project1
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF7
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CpsPackage.java175
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/CyberPhysicalSystem.java36
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/HostInstance.java68
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CpsPackageImpl.java124
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/CyberPhysicalSystemImpl.java57
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/ecore-gen/hu/bme/mit/inf/dslreasoner/domains/cps/impl/HostInstanceImpl.java105
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird1705
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore41
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel6
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml30
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/representations.aird600
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/.gitignore10
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/Allocate.java862
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AllocationWithoutResourceRequirement.java2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java743
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java743
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeHddMetric.java4
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeMemoryMetric.java12
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CostMetric.java4
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java705
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsCost.java2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.java124
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CreateHostInstance.java553
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/GuidanceObjective.java591
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableHdd.java2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableMemory.java2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RemoveHostInstance.java (renamed from Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsHosts.java)370
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/ResourceRequirement.java829
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalHdd.java706
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java706
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/UnallocateAppInstance.java541
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/.gitignore9
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableHdd.java178
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/AvailableMemory.java178
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsApplications.java141
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsHosts.java141
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/CpsQueriesAll.java38
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeHddPercentage.java4
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/FreeMemoryPercentage.java4
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HddRequirement.java2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/HostInstanceCost.java2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/MemoryRequirement.java2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/NoHostToAllocateTo.java135
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/RequiredAppInstances.java181
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/ResourceRequirement.java168
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalHdd.java143
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/TotalMemory.java143
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/UnallocatedAppInstance.java172
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.xtend53
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.xtend171
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.xtend134
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.xtend39
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.xtend74
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.xtend7
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql82
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CbcCpsMain.xtendbinbin0 -> 5693 bytes
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbinbin0 -> 11104 bytes
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.gitignore2
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.java77
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.java505
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbinbin0 -> 7626 bytes
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsMain.xtendbinbin0 -> 5189 bytes
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsSolver.xtendbinbin0 -> 7336 bytes
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.gitignore3
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.java316
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.java46
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.java93
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbinbin0 -> 8807 bytes
-rw-r--r--Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java154
71 files changed, 7412 insertions, 6451 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project
index 69c44278..41867b27 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/.project
@@ -32,7 +32,6 @@
32 </buildCommand> 32 </buildCommand>
33 </buildSpec> 33 </buildSpec>
34 <natures> 34 <natures>
35 <nature>org.eclipse.sirius.nature.modelingproject</nature>
36 <nature>org.eclipse.jdt.core.javanature</nature> 35 <nature>org.eclipse.jdt.core.javanature</nature>
37 <nature>org.eclipse.pde.PluginNature</nature> 36 <nature>org.eclipse.pde.PluginNature</nature>
38 <nature>org.eclipse.viatra.query.projectnature</nature> 37 <nature>org.eclipse.viatra.query.projectnature</nature>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF
index 76e1eefb..c06b7112 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/META-INF/MANIFEST.MF
@@ -18,7 +18,12 @@ Require-Bundle: org.eclipse.viatra.addon.querybasedfeatures.runtime,
18 org.eclipse.emf.ecore;visibility:=reexport, 18 org.eclipse.emf.ecore;visibility:=reexport,
19 org.eclipse.core.runtime, 19 org.eclipse.core.runtime,
20 org.eclipse.xtend.lib;bundle-version="2.16.0", 20 org.eclipse.xtend.lib;bundle-version="2.16.0",
21 org.eclipse.xtend.lib.macro;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;bundle-version="0.22.0",
24 org.eclipse.viatra.dse.genetic;bundle-version="0.22.0",
25 hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner;bundle-version="1.0.0",
26 org.eclipse.emf.ecore.xmi;bundle-version="2.15.0"
22Import-Package: org.apache.log4j 27Import-Package: org.apache.log4j
23Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.domains.cps 28Automatic-Module-Name: hu.bme.mit.inf.dslreasoner.domains.cps
24Bundle-ActivationPolicy: lazy 29Bundle-ActivationPolicy: lazy
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
index 2d7e0660..b0c69786 100644
--- 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
@@ -21,7 +21,6 @@ import org.eclipse.emf.ecore.EReference;
21 * <!-- end-user-doc --> 21 * <!-- end-user-doc -->
22 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory 22 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory
23 * @model kind="package" 23 * @model kind="package"
24 * annotation="http://www.eclipse.org/emf/2002/Ecore settingDelegates='org.eclipse.viatra.query.querybasedfeature'"
25 * @generated 24 * @generated
26 */ 25 */
27public interface CpsPackage extends EPackage { 26public interface CpsPackage extends EPackage {
@@ -95,31 +94,13 @@ public interface CpsPackage extends EPackage {
95 int CYBER_PHYSICAL_SYSTEM__HOST_TYPES = 2; 94 int CYBER_PHYSICAL_SYSTEM__HOST_TYPES = 2;
96 95
97 /** 96 /**
98 * The feature id for the '<em><b>Hosts</b></em>' reference list.
99 * <!-- begin-user-doc -->
100 * <!-- end-user-doc -->
101 * @generated
102 * @ordered
103 */
104 int CYBER_PHYSICAL_SYSTEM__HOSTS = 3;
105
106 /**
107 * The feature id for the '<em><b>Applications</b></em>' reference list.
108 * <!-- begin-user-doc -->
109 * <!-- end-user-doc -->
110 * @generated
111 * @ordered
112 */
113 int CYBER_PHYSICAL_SYSTEM__APPLICATIONS = 4;
114
115 /**
116 * The number of structural features of the '<em>Cyber Physical System</em>' class. 97 * The number of structural features of the '<em>Cyber Physical System</em>' class.
117 * <!-- begin-user-doc --> 98 * <!-- begin-user-doc -->
118 * <!-- end-user-doc --> 99 * <!-- end-user-doc -->
119 * @generated 100 * @generated
120 * @ordered 101 * @ordered
121 */ 102 */
122 int CYBER_PHYSICAL_SYSTEM_FEATURE_COUNT = 5; 103 int CYBER_PHYSICAL_SYSTEM_FEATURE_COUNT = 3;
123 104
124 /** 105 /**
125 * The number of operations of the '<em>Cyber Physical System</em>' class. 106 * The number of operations of the '<em>Cyber Physical System</em>' class.
@@ -471,49 +452,13 @@ public interface CpsPackage extends EPackage {
471 int HOST_INSTANCE__TYPE = 0; 452 int HOST_INSTANCE__TYPE = 0;
472 453
473 /** 454 /**
474 * The feature id for the '<em><b>Available Memory</b></em>' attribute.
475 * <!-- begin-user-doc -->
476 * <!-- end-user-doc -->
477 * @generated
478 * @ordered
479 */
480 int HOST_INSTANCE__AVAILABLE_MEMORY = 1;
481
482 /**
483 * The feature id for the '<em><b>Available Hdd</b></em>' attribute.
484 * <!-- begin-user-doc -->
485 * <!-- end-user-doc -->
486 * @generated
487 * @ordered
488 */
489 int HOST_INSTANCE__AVAILABLE_HDD = 2;
490
491 /**
492 * The feature id for the '<em><b>Total Memory</b></em>' attribute.
493 * <!-- begin-user-doc -->
494 * <!-- end-user-doc -->
495 * @generated
496 * @ordered
497 */
498 int HOST_INSTANCE__TOTAL_MEMORY = 3;
499
500 /**
501 * The feature id for the '<em><b>Total Hdd</b></em>' attribute.
502 * <!-- begin-user-doc -->
503 * <!-- end-user-doc -->
504 * @generated
505 * @ordered
506 */
507 int HOST_INSTANCE__TOTAL_HDD = 4;
508
509 /**
510 * The feature id for the '<em><b>Applications</b></em>' reference list. 455 * The feature id for the '<em><b>Applications</b></em>' reference list.
511 * <!-- begin-user-doc --> 456 * <!-- begin-user-doc -->
512 * <!-- end-user-doc --> 457 * <!-- end-user-doc -->
513 * @generated 458 * @generated
514 * @ordered 459 * @ordered
515 */ 460 */
516 int HOST_INSTANCE__APPLICATIONS = 5; 461 int HOST_INSTANCE__APPLICATIONS = 1;
517 462
518 /** 463 /**
519 * The number of structural features of the '<em>Host Instance</em>' class. 464 * The number of structural features of the '<em>Host Instance</em>' class.
@@ -522,7 +467,7 @@ public interface CpsPackage extends EPackage {
522 * @generated 467 * @generated
523 * @ordered 468 * @ordered
524 */ 469 */
525 int HOST_INSTANCE_FEATURE_COUNT = 6; 470 int HOST_INSTANCE_FEATURE_COUNT = 2;
526 471
527 /** 472 /**
528 * The number of operations of the '<em>Host Instance</em>' class. 473 * The number of operations of the '<em>Host Instance</em>' class.
@@ -577,28 +522,6 @@ public interface CpsPackage extends EPackage {
577 EReference getCyberPhysicalSystem_HostTypes(); 522 EReference getCyberPhysicalSystem_HostTypes();
578 523
579 /** 524 /**
580 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHosts <em>Hosts</em>}'.
581 * <!-- begin-user-doc -->
582 * <!-- end-user-doc -->
583 * @return the meta object for the reference list '<em>Hosts</em>'.
584 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHosts()
585 * @see #getCyberPhysicalSystem()
586 * @generated
587 */
588 EReference getCyberPhysicalSystem_Hosts();
589
590 /**
591 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplications <em>Applications</em>}'.
592 * <!-- begin-user-doc -->
593 * <!-- end-user-doc -->
594 * @return the meta object for the reference list '<em>Applications</em>'.
595 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplications()
596 * @see #getCyberPhysicalSystem()
597 * @generated
598 */
599 EReference getCyberPhysicalSystem_Applications();
600
601 /**
602 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType <em>Application Type</em>}'. 525 * Returns the meta object for class '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType <em>Application Type</em>}'.
603 * <!-- begin-user-doc --> 526 * <!-- begin-user-doc -->
604 * <!-- end-user-doc --> 527 * <!-- end-user-doc -->
@@ -867,50 +790,6 @@ public interface CpsPackage extends EPackage {
867 EReference getHostInstance_Type(); 790 EReference getHostInstance_Type();
868 791
869 /** 792 /**
870 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableMemory <em>Available Memory</em>}'.
871 * <!-- begin-user-doc -->
872 * <!-- end-user-doc -->
873 * @return the meta object for the attribute '<em>Available Memory</em>'.
874 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableMemory()
875 * @see #getHostInstance()
876 * @generated
877 */
878 EAttribute getHostInstance_AvailableMemory();
879
880 /**
881 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableHdd <em>Available Hdd</em>}'.
882 * <!-- begin-user-doc -->
883 * <!-- end-user-doc -->
884 * @return the meta object for the attribute '<em>Available Hdd</em>'.
885 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableHdd()
886 * @see #getHostInstance()
887 * @generated
888 */
889 EAttribute getHostInstance_AvailableHdd();
890
891 /**
892 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalMemory <em>Total Memory</em>}'.
893 * <!-- begin-user-doc -->
894 * <!-- end-user-doc -->
895 * @return the meta object for the attribute '<em>Total Memory</em>'.
896 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalMemory()
897 * @see #getHostInstance()
898 * @generated
899 */
900 EAttribute getHostInstance_TotalMemory();
901
902 /**
903 * Returns the meta object for the attribute '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalHdd <em>Total Hdd</em>}'.
904 * <!-- begin-user-doc -->
905 * <!-- end-user-doc -->
906 * @return the meta object for the attribute '<em>Total Hdd</em>'.
907 * @see hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalHdd()
908 * @see #getHostInstance()
909 * @generated
910 */
911 EAttribute getHostInstance_TotalHdd();
912
913 /**
914 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}'. 793 * Returns the meta object for the reference list '{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}'.
915 * <!-- begin-user-doc --> 794 * <!-- begin-user-doc -->
916 * <!-- end-user-doc --> 795 * <!-- end-user-doc -->
@@ -979,22 +858,6 @@ public interface CpsPackage extends EPackage {
979 EReference CYBER_PHYSICAL_SYSTEM__HOST_TYPES = eINSTANCE.getCyberPhysicalSystem_HostTypes(); 858 EReference CYBER_PHYSICAL_SYSTEM__HOST_TYPES = eINSTANCE.getCyberPhysicalSystem_HostTypes();
980 859
981 /** 860 /**
982 * The meta object literal for the '<em><b>Hosts</b></em>' reference list feature.
983 * <!-- begin-user-doc -->
984 * <!-- end-user-doc -->
985 * @generated
986 */
987 EReference CYBER_PHYSICAL_SYSTEM__HOSTS = eINSTANCE.getCyberPhysicalSystem_Hosts();
988
989 /**
990 * The meta object literal for the '<em><b>Applications</b></em>' reference list feature.
991 * <!-- begin-user-doc -->
992 * <!-- end-user-doc -->
993 * @generated
994 */
995 EReference CYBER_PHYSICAL_SYSTEM__APPLICATIONS = eINSTANCE.getCyberPhysicalSystem_Applications();
996
997 /**
998 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl <em>Application Type</em>}' class. 861 * The meta object literal for the '{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.ApplicationTypeImpl <em>Application Type</em>}' class.
999 * <!-- begin-user-doc --> 862 * <!-- begin-user-doc -->
1000 * <!-- end-user-doc --> 863 * <!-- end-user-doc -->
@@ -1209,38 +1072,6 @@ public interface CpsPackage extends EPackage {
1209 EReference HOST_INSTANCE__TYPE = eINSTANCE.getHostInstance_Type(); 1072 EReference HOST_INSTANCE__TYPE = eINSTANCE.getHostInstance_Type();
1210 1073
1211 /** 1074 /**
1212 * The meta object literal for the '<em><b>Available Memory</b></em>' attribute feature.
1213 * <!-- begin-user-doc -->
1214 * <!-- end-user-doc -->
1215 * @generated
1216 */
1217 EAttribute HOST_INSTANCE__AVAILABLE_MEMORY = eINSTANCE.getHostInstance_AvailableMemory();
1218
1219 /**
1220 * The meta object literal for the '<em><b>Available Hdd</b></em>' attribute feature.
1221 * <!-- begin-user-doc -->
1222 * <!-- end-user-doc -->
1223 * @generated
1224 */
1225 EAttribute HOST_INSTANCE__AVAILABLE_HDD = eINSTANCE.getHostInstance_AvailableHdd();
1226
1227 /**
1228 * The meta object literal for the '<em><b>Total Memory</b></em>' attribute feature.
1229 * <!-- begin-user-doc -->
1230 * <!-- end-user-doc -->
1231 * @generated
1232 */
1233 EAttribute HOST_INSTANCE__TOTAL_MEMORY = eINSTANCE.getHostInstance_TotalMemory();
1234
1235 /**
1236 * The meta object literal for the '<em><b>Total Hdd</b></em>' attribute feature.
1237 * <!-- begin-user-doc -->
1238 * <!-- end-user-doc -->
1239 * @generated
1240 */
1241 EAttribute HOST_INSTANCE__TOTAL_HDD = eINSTANCE.getHostInstance_TotalHdd();
1242
1243 /**
1244 * The meta object literal for the '<em><b>Applications</b></em>' reference list feature. 1075 * The meta object literal for the '<em><b>Applications</b></em>' reference list feature.
1245 * <!-- begin-user-doc --> 1076 * <!-- begin-user-doc -->
1246 * <!-- end-user-doc --> 1077 * <!-- end-user-doc -->
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
index 541916ba..fbf4ce0d 100644
--- 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
@@ -18,8 +18,6 @@ import org.eclipse.emf.ecore.EObject;
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getRequests <em>Requests</em>}</li> 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> 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> 20 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHostTypes <em>Host Types</em>}</li>
21 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getHosts <em>Hosts</em>}</li>
22 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem#getApplications <em>Applications</em>}</li>
23 * </ul> 21 * </ul>
24 * 22 *
25 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem() 23 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem()
@@ -75,38 +73,4 @@ public interface CyberPhysicalSystem extends EObject {
75 */ 73 */
76 EList<HostType> getHostTypes(); 74 EList<HostType> getHostTypes();
77 75
78 /**
79 * Returns the value of the '<em><b>Hosts</b></em>' reference list.
80 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance}.
81 * <!-- begin-user-doc -->
82 * <p>
83 * If the meaning of the '<em>Hosts</em>' reference list isn't clear,
84 * there really should be more of a description here...
85 * </p>
86 * <!-- end-user-doc -->
87 * @return the value of the '<em>Hosts</em>' reference list.
88 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_Hosts()
89 * @model transient="true" changeable="false" volatile="true" derived="true"
90 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts'"
91 * @generated
92 */
93 EList<HostInstance> getHosts();
94
95 /**
96 * Returns the value of the '<em><b>Applications</b></em>' reference list.
97 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}.
98 * <!-- begin-user-doc -->
99 * <p>
100 * If the meaning of the '<em>Applications</em>' reference list isn't clear,
101 * there really should be more of a description here...
102 * </p>
103 * <!-- end-user-doc -->
104 * @return the value of the '<em>Applications</em>' reference list.
105 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getCyberPhysicalSystem_Applications()
106 * @model transient="true" changeable="false" volatile="true" derived="true"
107 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications'"
108 * @generated
109 */
110 EList<ApplicationInstance> getApplications();
111
112} // CyberPhysicalSystem 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
index 43379e0f..b4721842 100644
--- 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
@@ -16,10 +16,6 @@ import org.eclipse.emf.ecore.EObject;
16 * </p> 16 * </p>
17 * <ul> 17 * <ul>
18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}</li> 18 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getType <em>Type</em>}</li>
19 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableMemory <em>Available Memory</em>}</li>
20 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getAvailableHdd <em>Available Hdd</em>}</li>
21 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalMemory <em>Total Memory</em>}</li>
22 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getTotalHdd <em>Total Hdd</em>}</li>
23 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}</li> 19 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance#getApplications <em>Applications</em>}</li>
24 * </ul> 20 * </ul>
25 * 21 *
@@ -57,70 +53,6 @@ public interface HostInstance extends EObject {
57 void setType(HostType value); 53 void setType(HostType value);
58 54
59 /** 55 /**
60 * Returns the value of the '<em><b>Available Memory</b></em>' attribute.
61 * <!-- begin-user-doc -->
62 * <p>
63 * If the meaning of the '<em>Available Memory</em>' attribute isn't clear,
64 * there really should be more of a description here...
65 * </p>
66 * <!-- end-user-doc -->
67 * @return the value of the '<em>Available Memory</em>' attribute.
68 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_AvailableMemory()
69 * @model transient="true" changeable="false" volatile="true" derived="true"
70 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory'"
71 * @generated
72 */
73 int getAvailableMemory();
74
75 /**
76 * Returns the value of the '<em><b>Available Hdd</b></em>' attribute.
77 * <!-- begin-user-doc -->
78 * <p>
79 * If the meaning of the '<em>Available Hdd</em>' attribute isn't clear,
80 * there really should be more of a description here...
81 * </p>
82 * <!-- end-user-doc -->
83 * @return the value of the '<em>Available Hdd</em>' attribute.
84 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_AvailableHdd()
85 * @model transient="true" changeable="false" volatile="true" derived="true"
86 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd'"
87 * @generated
88 */
89 int getAvailableHdd();
90
91 /**
92 * Returns the value of the '<em><b>Total Memory</b></em>' attribute.
93 * <!-- begin-user-doc -->
94 * <p>
95 * If the meaning of the '<em>Total Memory</em>' attribute isn't clear,
96 * there really should be more of a description here...
97 * </p>
98 * <!-- end-user-doc -->
99 * @return the value of the '<em>Total Memory</em>' attribute.
100 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_TotalMemory()
101 * @model transient="true" changeable="false" volatile="true" derived="true"
102 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory'"
103 * @generated
104 */
105 int getTotalMemory();
106
107 /**
108 * Returns the value of the '<em><b>Total Hdd</b></em>' attribute.
109 * <!-- begin-user-doc -->
110 * <p>
111 * If the meaning of the '<em>Total Hdd</em>' attribute isn't clear,
112 * there really should be more of a description here...
113 * </p>
114 * <!-- end-user-doc -->
115 * @return the value of the '<em>Total Hdd</em>' attribute.
116 * @see hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage#getHostInstance_TotalHdd()
117 * @model transient="true" changeable="false" volatile="true" derived="true"
118 * annotation="org.eclipse.viatra.query.querybasedfeature patternFQN='hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd'"
119 * @generated
120 */
121 int getTotalHdd();
122
123 /**
124 * Returns the value of the '<em><b>Applications</b></em>' reference list. 56 * Returns the value of the '<em><b>Applications</b></em>' reference list.
125 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}. 57 * The list contents are of type {@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance}.
126 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}'. 58 * It is bidirectional and its opposite is '{@link hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance#getAllocatedTo <em>Allocated To</em>}'.
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
index 1f143a64..e29ccccd 100644
--- 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
@@ -193,26 +193,6 @@ public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
193 * @generated 193 * @generated
194 */ 194 */
195 @Override 195 @Override
196 public EReference getCyberPhysicalSystem_Hosts() {
197 return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(3);
198 }
199
200 /**
201 * <!-- begin-user-doc -->
202 * <!-- end-user-doc -->
203 * @generated
204 */
205 @Override
206 public EReference getCyberPhysicalSystem_Applications() {
207 return (EReference) cyberPhysicalSystemEClass.getEStructuralFeatures().get(4);
208 }
209
210 /**
211 * <!-- begin-user-doc -->
212 * <!-- end-user-doc -->
213 * @generated
214 */
215 @Override
216 public EClass getApplicationType() { 196 public EClass getApplicationType() {
217 return applicationTypeEClass; 197 return applicationTypeEClass;
218 } 198 }
@@ -463,48 +443,8 @@ public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
463 * @generated 443 * @generated
464 */ 444 */
465 @Override 445 @Override
466 public EAttribute getHostInstance_AvailableMemory() {
467 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(1);
468 }
469
470 /**
471 * <!-- begin-user-doc -->
472 * <!-- end-user-doc -->
473 * @generated
474 */
475 @Override
476 public EAttribute getHostInstance_AvailableHdd() {
477 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(2);
478 }
479
480 /**
481 * <!-- begin-user-doc -->
482 * <!-- end-user-doc -->
483 * @generated
484 */
485 @Override
486 public EAttribute getHostInstance_TotalMemory() {
487 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(3);
488 }
489
490 /**
491 * <!-- begin-user-doc -->
492 * <!-- end-user-doc -->
493 * @generated
494 */
495 @Override
496 public EAttribute getHostInstance_TotalHdd() {
497 return (EAttribute) hostInstanceEClass.getEStructuralFeatures().get(4);
498 }
499
500 /**
501 * <!-- begin-user-doc -->
502 * <!-- end-user-doc -->
503 * @generated
504 */
505 @Override
506 public EReference getHostInstance_Applications() { 446 public EReference getHostInstance_Applications() {
507 return (EReference) hostInstanceEClass.getEStructuralFeatures().get(5); 447 return (EReference) hostInstanceEClass.getEStructuralFeatures().get(1);
508 } 448 }
509 449
510 /** 450 /**
@@ -541,8 +481,6 @@ public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
541 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__REQUESTS); 481 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__REQUESTS);
542 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES); 482 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATION_TYPES);
543 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOST_TYPES); 483 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOST_TYPES);
544 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__HOSTS);
545 createEReference(cyberPhysicalSystemEClass, CYBER_PHYSICAL_SYSTEM__APPLICATIONS);
546 484
547 applicationTypeEClass = createEClass(APPLICATION_TYPE); 485 applicationTypeEClass = createEClass(APPLICATION_TYPE);
548 createEReference(applicationTypeEClass, APPLICATION_TYPE__INSTANCES); 486 createEReference(applicationTypeEClass, APPLICATION_TYPE__INSTANCES);
@@ -575,10 +513,6 @@ public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
575 513
576 hostInstanceEClass = createEClass(HOST_INSTANCE); 514 hostInstanceEClass = createEClass(HOST_INSTANCE);
577 createEReference(hostInstanceEClass, HOST_INSTANCE__TYPE); 515 createEReference(hostInstanceEClass, HOST_INSTANCE__TYPE);
578 createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_MEMORY);
579 createEAttribute(hostInstanceEClass, HOST_INSTANCE__AVAILABLE_HDD);
580 createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_MEMORY);
581 createEAttribute(hostInstanceEClass, HOST_INSTANCE__TOTAL_HDD);
582 createEReference(hostInstanceEClass, HOST_INSTANCE__APPLICATIONS); 516 createEReference(hostInstanceEClass, HOST_INSTANCE__APPLICATIONS);
583 } 517 }
584 518
@@ -624,12 +558,6 @@ public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
624 initEReference(getCyberPhysicalSystem_HostTypes(), this.getHostType(), null, "hostTypes", null, 0, -1, 558 initEReference(getCyberPhysicalSystem_HostTypes(), this.getHostType(), null, "hostTypes", null, 0, -1,
625 CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, 559 CyberPhysicalSystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE,
626 !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 560 !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
627 initEReference(getCyberPhysicalSystem_Hosts(), this.getHostInstance(), null, "hosts", null, 0, -1,
628 CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES,
629 !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
630 initEReference(getCyberPhysicalSystem_Applications(), this.getApplicationInstance(), null, "applications", null,
631 0, -1, CyberPhysicalSystem.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_COMPOSITE,
632 IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
633 561
634 initEClass(applicationTypeEClass, ApplicationType.class, "ApplicationType", !IS_ABSTRACT, !IS_INTERFACE, 562 initEClass(applicationTypeEClass, ApplicationType.class, "ApplicationType", !IS_ABSTRACT, !IS_INTERFACE,
635 IS_GENERATED_INSTANCE_CLASS); 563 IS_GENERATED_INSTANCE_CLASS);
@@ -703,17 +631,6 @@ public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
703 initEReference(getHostInstance_Type(), this.getHostType(), this.getHostType_Instances(), "type", null, 1, 1, 631 initEReference(getHostInstance_Type(), this.getHostType(), this.getHostType_Instances(), "type", null, 1, 1,
704 HostInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES, 632 HostInstance.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, !IS_RESOLVE_PROXIES,
705 !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); 633 !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
706 initEAttribute(getHostInstance_AvailableMemory(), ecorePackage.getEInt(), "availableMemory", null, 0, 1,
707 HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
708 IS_DERIVED, IS_ORDERED);
709 initEAttribute(getHostInstance_AvailableHdd(), ecorePackage.getEInt(), "availableHdd", null, 0, 1,
710 HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
711 IS_DERIVED, IS_ORDERED);
712 initEAttribute(getHostInstance_TotalMemory(), ecorePackage.getEInt(), "totalMemory", null, 0, 1,
713 HostInstance.class, IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE,
714 IS_DERIVED, IS_ORDERED);
715 initEAttribute(getHostInstance_TotalHdd(), ecorePackage.getEInt(), "totalHdd", null, 0, 1, HostInstance.class,
716 IS_TRANSIENT, IS_VOLATILE, !IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, IS_DERIVED, IS_ORDERED);
717 initEReference(getHostInstance_Applications(), this.getApplicationInstance(), 634 initEReference(getHostInstance_Applications(), this.getApplicationInstance(),
718 this.getApplicationInstance_AllocatedTo(), "applications", null, 0, -1, HostInstance.class, 635 this.getApplicationInstance_AllocatedTo(), "applications", null, 0, -1, HostInstance.class,
719 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, 636 !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE,
@@ -721,45 +638,6 @@ public class CpsPackageImpl extends EPackageImpl implements CpsPackage {
721 638
722 // Create resource 639 // Create resource
723 createResource(eNS_URI); 640 createResource(eNS_URI);
724
725 // Create annotations
726 // http://www.eclipse.org/emf/2002/Ecore
727 createEcoreAnnotations();
728 // org.eclipse.viatra.query.querybasedfeature
729 createOrgAnnotations();
730 }
731
732 /**
733 * Initializes the annotations for <b>http://www.eclipse.org/emf/2002/Ecore</b>.
734 * <!-- begin-user-doc -->
735 * <!-- end-user-doc -->
736 * @generated
737 */
738 protected void createEcoreAnnotations() {
739 String source = "http://www.eclipse.org/emf/2002/Ecore";
740 addAnnotation(this, source, new String[] { "settingDelegates", "org.eclipse.viatra.query.querybasedfeature" });
741 }
742
743 /**
744 * Initializes the annotations for <b>org.eclipse.viatra.query.querybasedfeature</b>.
745 * <!-- begin-user-doc -->
746 * <!-- end-user-doc -->
747 * @generated
748 */
749 protected void createOrgAnnotations() {
750 String source = "org.eclipse.viatra.query.querybasedfeature";
751 addAnnotation(getCyberPhysicalSystem_Hosts(), source,
752 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts" });
753 addAnnotation(getCyberPhysicalSystem_Applications(), source,
754 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications" });
755 addAnnotation(getHostInstance_AvailableMemory(), source,
756 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory" });
757 addAnnotation(getHostInstance_AvailableHdd(), source,
758 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd" });
759 addAnnotation(getHostInstance_TotalMemory(), source,
760 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory" });
761 addAnnotation(getHostInstance_TotalHdd(), source,
762 new String[] { "patternFQN", "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd" });
763 } 641 }
764 642
765} //CpsPackageImpl 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
index 4d254f25..3ba111af 100644
--- 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
@@ -2,11 +2,9 @@
2 */ 2 */
3package hu.bme.mit.inf.dslreasoner.domains.cps.impl; 3package hu.bme.mit.inf.dslreasoner.domains.cps.impl;
4 4
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType; 5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage; 6import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
8import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; 7import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
9import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
10import hu.bme.mit.inf.dslreasoner.domains.cps.HostType; 8import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
11import hu.bme.mit.inf.dslreasoner.domains.cps.Request; 9import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
12 10
@@ -17,7 +15,6 @@ import org.eclipse.emf.common.notify.NotificationChain;
17import org.eclipse.emf.common.util.EList; 15import org.eclipse.emf.common.util.EList;
18 16
19import org.eclipse.emf.ecore.EClass; 17import org.eclipse.emf.ecore.EClass;
20import org.eclipse.emf.ecore.EStructuralFeature;
21import org.eclipse.emf.ecore.InternalEObject; 18import org.eclipse.emf.ecore.InternalEObject;
22 19
23import org.eclipse.emf.ecore.impl.MinimalEObjectImpl; 20import org.eclipse.emf.ecore.impl.MinimalEObjectImpl;
@@ -36,8 +33,6 @@ import org.eclipse.emf.ecore.util.InternalEList;
36 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getRequests <em>Requests</em>}</li> 33 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getRequests <em>Requests</em>}</li>
37 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplicationTypes <em>Application Types</em>}</li> 34 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplicationTypes <em>Application Types</em>}</li>
38 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHostTypes <em>Host Types</em>}</li> 35 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHostTypes <em>Host Types</em>}</li>
39 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getHosts <em>Hosts</em>}</li>
40 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.CyberPhysicalSystemImpl#getApplications <em>Applications</em>}</li>
41 * </ul> 36 * </ul>
42 * 37 *
43 * @generated 38 * @generated
@@ -74,28 +69,6 @@ public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implem
74 protected EList<HostType> hostTypes; 69 protected EList<HostType> hostTypes;
75 70
76 /** 71 /**
77 * The cached setting delegate for the '{@link #getHosts() <em>Hosts</em>}' reference list.
78 * <!-- begin-user-doc -->
79 * <!-- end-user-doc -->
80 * @see #getHosts()
81 * @generated
82 * @ordered
83 */
84 protected EStructuralFeature.Internal.SettingDelegate HOSTS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__HOSTS)
85 .getSettingDelegate();
86
87 /**
88 * The cached setting delegate for the '{@link #getApplications() <em>Applications</em>}' reference list.
89 * <!-- begin-user-doc -->
90 * <!-- end-user-doc -->
91 * @see #getApplications()
92 * @generated
93 * @ordered
94 */
95 protected EStructuralFeature.Internal.SettingDelegate APPLICATIONS__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.CYBER_PHYSICAL_SYSTEM__APPLICATIONS)
96 .getSettingDelegate();
97
98 /**
99 * <!-- begin-user-doc --> 72 * <!-- begin-user-doc -->
100 * <!-- end-user-doc --> 73 * <!-- end-user-doc -->
101 * @generated 74 * @generated
@@ -161,28 +134,6 @@ public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implem
161 * <!-- end-user-doc --> 134 * <!-- end-user-doc -->
162 * @generated 135 * @generated
163 */ 136 */
164 @SuppressWarnings("unchecked")
165 @Override
166 public EList<HostInstance> getHosts() {
167 return (EList<HostInstance>) HOSTS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
168 }
169
170 /**
171 * <!-- begin-user-doc -->
172 * <!-- end-user-doc -->
173 * @generated
174 */
175 @SuppressWarnings("unchecked")
176 @Override
177 public EList<ApplicationInstance> getApplications() {
178 return (EList<ApplicationInstance>) APPLICATIONS__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
179 }
180
181 /**
182 * <!-- begin-user-doc -->
183 * <!-- end-user-doc -->
184 * @generated
185 */
186 @Override 137 @Override
187 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) { 138 public NotificationChain eInverseRemove(InternalEObject otherEnd, int featureID, NotificationChain msgs) {
188 switch (featureID) { 139 switch (featureID) {
@@ -210,10 +161,6 @@ public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implem
210 return getApplicationTypes(); 161 return getApplicationTypes();
211 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: 162 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
212 return getHostTypes(); 163 return getHostTypes();
213 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS:
214 return getHosts();
215 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS:
216 return getApplications();
217 } 164 }
218 return super.eGet(featureID, resolve, coreType); 165 return super.eGet(featureID, resolve, coreType);
219 } 166 }
@@ -278,10 +225,6 @@ public class CyberPhysicalSystemImpl extends MinimalEObjectImpl.Container implem
278 return applicationTypes != null && !applicationTypes.isEmpty(); 225 return applicationTypes != null && !applicationTypes.isEmpty();
279 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES: 226 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOST_TYPES:
280 return hostTypes != null && !hostTypes.isEmpty(); 227 return hostTypes != null && !hostTypes.isEmpty();
281 case CpsPackage.CYBER_PHYSICAL_SYSTEM__HOSTS:
282 return HOSTS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
283 case CpsPackage.CYBER_PHYSICAL_SYSTEM__APPLICATIONS:
284 return APPLICATIONS__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
285 } 228 }
286 return super.eIsSet(featureID); 229 return super.eIsSet(featureID);
287 } 230 }
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
index bbaca59c..551f2ed6 100644
--- 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
@@ -15,7 +15,6 @@ import org.eclipse.emf.common.notify.NotificationChain;
15import org.eclipse.emf.common.util.EList; 15import org.eclipse.emf.common.util.EList;
16 16
17import org.eclipse.emf.ecore.EClass; 17import org.eclipse.emf.ecore.EClass;
18import org.eclipse.emf.ecore.EStructuralFeature;
19import org.eclipse.emf.ecore.InternalEObject; 18import org.eclipse.emf.ecore.InternalEObject;
20 19
21import org.eclipse.emf.ecore.impl.ENotificationImpl; 20import org.eclipse.emf.ecore.impl.ENotificationImpl;
@@ -34,10 +33,6 @@ import org.eclipse.emf.ecore.util.InternalEList;
34 * </p> 33 * </p>
35 * <ul> 34 * <ul>
36 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getType <em>Type</em>}</li> 35 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getType <em>Type</em>}</li>
37 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableMemory <em>Available Memory</em>}</li>
38 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getAvailableHdd <em>Available Hdd</em>}</li>
39 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalMemory <em>Total Memory</em>}</li>
40 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getTotalHdd <em>Total Hdd</em>}</li>
41 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getApplications <em>Applications</em>}</li> 36 * <li>{@link hu.bme.mit.inf.dslreasoner.domains.cps.impl.HostInstanceImpl#getApplications <em>Applications</em>}</li>
42 * </ul> 37 * </ul>
43 * 38 *
@@ -45,50 +40,6 @@ import org.eclipse.emf.ecore.util.InternalEList;
45 */ 40 */
46public class HostInstanceImpl extends MinimalEObjectImpl.Container implements HostInstance { 41public class HostInstanceImpl extends MinimalEObjectImpl.Container implements HostInstance {
47 /** 42 /**
48 * The cached setting delegate for the '{@link #getAvailableMemory() <em>Available Memory</em>}' attribute.
49 * <!-- begin-user-doc -->
50 * <!-- end-user-doc -->
51 * @see #getAvailableMemory()
52 * @generated
53 * @ordered
54 */
55 protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_MEMORY)
56 .getSettingDelegate();
57
58 /**
59 * The cached setting delegate for the '{@link #getAvailableHdd() <em>Available Hdd</em>}' attribute.
60 * <!-- begin-user-doc -->
61 * <!-- end-user-doc -->
62 * @see #getAvailableHdd()
63 * @generated
64 * @ordered
65 */
66 protected EStructuralFeature.Internal.SettingDelegate AVAILABLE_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__AVAILABLE_HDD)
67 .getSettingDelegate();
68
69 /**
70 * The cached setting delegate for the '{@link #getTotalMemory() <em>Total Memory</em>}' attribute.
71 * <!-- begin-user-doc -->
72 * <!-- end-user-doc -->
73 * @see #getTotalMemory()
74 * @generated
75 * @ordered
76 */
77 protected EStructuralFeature.Internal.SettingDelegate TOTAL_MEMORY__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_MEMORY)
78 .getSettingDelegate();
79
80 /**
81 * The cached setting delegate for the '{@link #getTotalHdd() <em>Total Hdd</em>}' attribute.
82 * <!-- begin-user-doc -->
83 * <!-- end-user-doc -->
84 * @see #getTotalHdd()
85 * @generated
86 * @ordered
87 */
88 protected EStructuralFeature.Internal.SettingDelegate TOTAL_HDD__ESETTING_DELEGATE = ((EStructuralFeature.Internal) CpsPackage.Literals.HOST_INSTANCE__TOTAL_HDD)
89 .getSettingDelegate();
90
91 /**
92 * The cached value of the '{@link #getApplications() <em>Applications</em>}' reference list. 43 * The cached value of the '{@link #getApplications() <em>Applications</em>}' reference list.
93 * <!-- begin-user-doc --> 44 * <!-- begin-user-doc -->
94 * <!-- end-user-doc --> 45 * <!-- end-user-doc -->
@@ -169,46 +120,6 @@ public class HostInstanceImpl extends MinimalEObjectImpl.Container implements Ho
169 * @generated 120 * @generated
170 */ 121 */
171 @Override 122 @Override
172 public int getAvailableMemory() {
173 return (Integer) AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
174 }
175
176 /**
177 * <!-- begin-user-doc -->
178 * <!-- end-user-doc -->
179 * @generated
180 */
181 @Override
182 public int getAvailableHdd() {
183 return (Integer) AVAILABLE_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
184 }
185
186 /**
187 * <!-- begin-user-doc -->
188 * <!-- end-user-doc -->
189 * @generated
190 */
191 @Override
192 public int getTotalMemory() {
193 return (Integer) TOTAL_MEMORY__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
194 }
195
196 /**
197 * <!-- begin-user-doc -->
198 * <!-- end-user-doc -->
199 * @generated
200 */
201 @Override
202 public int getTotalHdd() {
203 return (Integer) TOTAL_HDD__ESETTING_DELEGATE.dynamicGet(this, null, 0, true, false);
204 }
205
206 /**
207 * <!-- begin-user-doc -->
208 * <!-- end-user-doc -->
209 * @generated
210 */
211 @Override
212 public EList<ApplicationInstance> getApplications() { 123 public EList<ApplicationInstance> getApplications() {
213 if (applications == null) { 124 if (applications == null) {
214 applications = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this, 125 applications = new EObjectWithInverseResolvingEList<ApplicationInstance>(ApplicationInstance.class, this,
@@ -276,14 +187,6 @@ public class HostInstanceImpl extends MinimalEObjectImpl.Container implements Ho
276 switch (featureID) { 187 switch (featureID) {
277 case CpsPackage.HOST_INSTANCE__TYPE: 188 case CpsPackage.HOST_INSTANCE__TYPE:
278 return getType(); 189 return getType();
279 case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY:
280 return getAvailableMemory();
281 case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD:
282 return getAvailableHdd();
283 case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY:
284 return getTotalMemory();
285 case CpsPackage.HOST_INSTANCE__TOTAL_HDD:
286 return getTotalHdd();
287 case CpsPackage.HOST_INSTANCE__APPLICATIONS: 190 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
288 return getApplications(); 191 return getApplications();
289 } 192 }
@@ -338,14 +241,6 @@ public class HostInstanceImpl extends MinimalEObjectImpl.Container implements Ho
338 switch (featureID) { 241 switch (featureID) {
339 case CpsPackage.HOST_INSTANCE__TYPE: 242 case CpsPackage.HOST_INSTANCE__TYPE:
340 return getType() != null; 243 return getType() != null;
341 case CpsPackage.HOST_INSTANCE__AVAILABLE_MEMORY:
342 return AVAILABLE_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
343 case CpsPackage.HOST_INSTANCE__AVAILABLE_HDD:
344 return AVAILABLE_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
345 case CpsPackage.HOST_INSTANCE__TOTAL_MEMORY:
346 return TOTAL_MEMORY__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
347 case CpsPackage.HOST_INSTANCE__TOTAL_HDD:
348 return TOTAL_HDD__ESETTING_DELEGATE.dynamicIsSet(this, null, 0);
349 case CpsPackage.HOST_INSTANCE__APPLICATIONS: 244 case CpsPackage.HOST_INSTANCE__APPLICATIONS:
350 return applications != null && !applications.isEmpty(); 245 return applications != null && !applications.isEmpty();
351 } 246 }
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird
deleted file mode 100644
index 3f1b0301..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.aird
+++ /dev/null
@@ -1,1705 +0,0 @@
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="_kQWZMFvMEemLJtrAOuDPFQ" selectedViews="_kSYZgFvMEemLJtrAOuDPFQ" version="14.1.0.201810161215">
4 <semanticResources>cps.ecore</semanticResources>
5 <semanticResources>cps.genmodel</semanticResources>
6 <semanticResources>../src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql</semanticResources>
7 <semanticResources>http://www.eclipse.org/emf/2002/Ecore</semanticResources>
8 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch</semanticResources>
9 <semanticResources>java:/Objects/java.lang.Object</semanticResources>
10 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IPatternMatch</semanticResources>
11 <semanticResources>java:/Primitives</semanticResources>
12 <semanticResources>java:/Objects/java.lang.SafeVarargs</semanticResources>
13 <semanticResources>java:/Objects/java.util.List</semanticResources>
14 <semanticResources>java:/Objects/java.lang.String</semanticResources>
15 <semanticResources>java:/Objects/java.lang.CloneNotSupportedException</semanticResources>
16 <semanticResources>java:/Objects/java.lang.Throwable</semanticResources>
17 <semanticResources>java:/Objects/java.lang.Class</semanticResources>
18 <semanticResources>java:/Objects/java.lang.InterruptedException</semanticResources>
19 <semanticResources>java:/Objects/java.lang.Exception</semanticResources>
20 <semanticResources>java:/Objects/java.io.Serializable</semanticResources>
21 <semanticResources>java:/Objects/java.io.PrintWriter</semanticResources>
22 <semanticResources>java:/Objects/java.io.PrintStream</semanticResources>
23 <semanticResources>java:/Objects/java.lang.StackTraceElement</semanticResources>
24 <semanticResources>java:/Objects/java.util.Set</semanticResources>
25 <semanticResources>java:/Objects/java.io.ObjectInputStream</semanticResources>
26 <semanticResources>java:/Objects/java.io.IOException</semanticResources>
27 <semanticResources>java:/Objects/java.lang.ClassNotFoundException</semanticResources>
28 <semanticResources>java:/Objects/java.io.ObjectOutputStream</semanticResources>
29 <semanticResources>java:/Objects/java.io.Writer</semanticResources>
30 <semanticResources>java:/Objects/java.io.OutputStream</semanticResources>
31 <semanticResources>java:/Objects/java.io.FileNotFoundException</semanticResources>
32 <semanticResources>java:/Objects/java.io.File</semanticResources>
33 <semanticResources>java:/Objects/java.nio.charset.Charset</semanticResources>
34 <semanticResources>java:/Objects/java.io.UnsupportedEncodingException</semanticResources>
35 <semanticResources>java:/Objects/java.lang.CharSequence</semanticResources>
36 <semanticResources>java:/Objects/java.util.Locale</semanticResources>
37 <semanticResources>java:/Objects/java.util.Formatter</semanticResources>
38 <semanticResources>java:/Objects/java.lang.Appendable</semanticResources>
39 <semanticResources>java:/Objects/java.io.Closeable</semanticResources>
40 <semanticResources>java:/Objects/java.io.Flushable</semanticResources>
41 <semanticResources>java:/Objects/java.lang.AutoCloseable</semanticResources>
42 <semanticResources>java:/Objects/java.lang.Comparable</semanticResources>
43 <semanticResources>java:/Objects/java.security.SecureRandom</semanticResources>
44 <semanticResources>java:/Objects/java.lang.Enum</semanticResources>
45 <semanticResources>java:/Objects/java.net.URI</semanticResources>
46 <semanticResources>java:/Objects/java.io.FilenameFilter</semanticResources>
47 <semanticResources>java:/Objects/java.io.FileFilter</semanticResources>
48 <semanticResources>java:/Objects/java.nio.file.Path</semanticResources>
49 <semanticResources>java:/Objects/java.lang.Deprecated</semanticResources>
50 <semanticResources>java:/Objects/java.net.MalformedURLException</semanticResources>
51 <semanticResources>java:/Objects/java.net.URL</semanticResources>
52 <semanticResources>java:/Objects/sun.misc.Unsafe</semanticResources>
53 <semanticResources>java:/Objects/java.io.FileSystem</semanticResources>
54 <semanticResources>java:/Objects/java.util.Random</semanticResources>
55 <semanticResources>java:/Objects/java.util.regex.Pattern</semanticResources>
56 <semanticResources>java:/Objects/java.security.SecureRandomSpi</semanticResources>
57 <semanticResources>java:/Objects/java.security.Provider</semanticResources>
58 <semanticResources>java:/Objects/java.security.NoSuchAlgorithmException</semanticResources>
59 <semanticResources>java:/Objects/java.security.NoSuchProviderException</semanticResources>
60 <semanticResources>java:/Objects/java.security.MessageDigest</semanticResources>
61 <semanticResources>java:/Objects/sun.security.util.Debug</semanticResources>
62 <semanticResources>java:/Objects/java.util.Spliterator</semanticResources>
63 <semanticResources>java:/Objects/java.util.function.DoubleConsumer</semanticResources>
64 <semanticResources>java:/Objects/java.util.function.LongConsumer</semanticResources>
65 <semanticResources>java:/Objects/java.util.function.IntConsumer</semanticResources>
66 <semanticResources>java:/Objects/java.util.stream.DoubleStream</semanticResources>
67 <semanticResources>java:/Objects/java.util.stream.IntStream</semanticResources>
68 <semanticResources>java:/Objects/java.util.stream.LongStream</semanticResources>
69 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicLong</semanticResources>
70 <semanticResources>java:/Objects/java.io.ObjectStreamField</semanticResources>
71 <semanticResources>java:/Objects/java.lang.Double</semanticResources>
72 <semanticResources>java:/Objects/java.util.function.Consumer</semanticResources>
73 <semanticResources>java:/Objects/java.lang.Long</semanticResources>
74 <semanticResources>java:/Objects/java.lang.Integer</semanticResources>
75 <semanticResources>java:/Objects/java.util.Comparator</semanticResources>
76 <semanticResources>java:/Objects/java.lang.Number</semanticResources>
77 <semanticResources>java:/Objects/java.lang.NumberFormatException</semanticResources>
78 <semanticResources>java:/Objects/java.lang.IllegalArgumentException</semanticResources>
79 <semanticResources>java:/Objects/java.lang.RuntimeException</semanticResources>
80 <semanticResources>java:/Objects/java.lang.FunctionalInterface</semanticResources>
81 <semanticResources>java:/Objects/java.lang.annotation.Target</semanticResources>
82 <semanticResources>java:/Objects/java.lang.annotation.ElementType</semanticResources>
83 <semanticResources>java:/Objects/java.lang.annotation.Retention</semanticResources>
84 <semanticResources>java:/Objects/java.lang.annotation.RetentionPolicy</semanticResources>
85 <semanticResources>java:/Objects/java.lang.annotation.Documented</semanticResources>
86 <semanticResources>java:/Objects/java.lang.annotation.Annotation</semanticResources>
87 <semanticResources>java:/Objects/java.math.BigInteger</semanticResources>
88 <semanticResources>java:/Objects/java.lang.StringBuilder</semanticResources>
89 <semanticResources>java:/Objects/java.lang.AbstractStringBuilder</semanticResources>
90 <semanticResources>java:/Objects/java.lang.StringBuffer</semanticResources>
91 <semanticResources>java:/Objects/java.util.function.Function</semanticResources>
92 <semanticResources>java:/Objects/java.util.function.ToDoubleFunction</semanticResources>
93 <semanticResources>java:/Objects/java.util.function.ToIntFunction</semanticResources>
94 <semanticResources>java:/Objects/java.util.function.ToLongFunction</semanticResources>
95 <semanticResources>java:/Objects/java.util.stream.BaseStream</semanticResources>
96 <semanticResources>java:/Objects/java.util.function.DoublePredicate</semanticResources>
97 <semanticResources>java:/Objects/java.util.OptionalDouble</semanticResources>
98 <semanticResources>java:/Objects/java.util.stream.Stream</semanticResources>
99 <semanticResources>java:/Objects/java.util.function.Supplier</semanticResources>
100 <semanticResources>java:/Objects/java.util.function.ObjDoubleConsumer</semanticResources>
101 <semanticResources>java:/Objects/java.util.function.BiConsumer</semanticResources>
102 <semanticResources>java:/Objects/java.util.function.DoubleFunction</semanticResources>
103 <semanticResources>java:/Objects/java.util.function.DoubleSupplier</semanticResources>
104 <semanticResources>java:/Objects/java.util.function.DoubleUnaryOperator</semanticResources>
105 <semanticResources>java:/Objects/java.util.PrimitiveIterator</semanticResources>
106 <semanticResources>java:/Objects/java.util.function.DoubleToIntFunction</semanticResources>
107 <semanticResources>java:/Objects/java.util.function.DoubleToLongFunction</semanticResources>
108 <semanticResources>java:/Objects/java.util.function.DoubleBinaryOperator</semanticResources>
109 <semanticResources>java:/Objects/java.util.DoubleSummaryStatistics</semanticResources>
110 <semanticResources>java:/Objects/java.util.Iterator</semanticResources>
111 <semanticResources>java:/Objects/java.lang.Runnable</semanticResources>
112 <semanticResources>java:/Objects/java.util.function.Predicate</semanticResources>
113 <semanticResources>java:/Objects/java.util.stream.Collector</semanticResources>
114 <semanticResources>java:/Objects/java.util.Optional</semanticResources>
115 <semanticResources>java:/Objects/java.util.function.UnaryOperator</semanticResources>
116 <semanticResources>java:/Objects/java.util.function.BinaryOperator</semanticResources>
117 <semanticResources>java:/Objects/java.util.function.BiFunction</semanticResources>
118 <semanticResources>java:/Objects/java.util.function.IntFunction</semanticResources>
119 <semanticResources>java:/Objects/java.util.function.IntPredicate</semanticResources>
120 <semanticResources>java:/Objects/java.util.function.ObjIntConsumer</semanticResources>
121 <semanticResources>java:/Objects/java.util.OptionalInt</semanticResources>
122 <semanticResources>java:/Objects/java.util.function.IntSupplier</semanticResources>
123 <semanticResources>java:/Objects/java.util.function.IntUnaryOperator</semanticResources>
124 <semanticResources>java:/Objects/java.util.function.IntToDoubleFunction</semanticResources>
125 <semanticResources>java:/Objects/java.util.function.IntToLongFunction</semanticResources>
126 <semanticResources>java:/Objects/java.util.function.IntBinaryOperator</semanticResources>
127 <semanticResources>java:/Objects/java.util.IntSummaryStatistics</semanticResources>
128 <semanticResources>java:/Objects/java.util.function.LongPredicate</semanticResources>
129 <semanticResources>java:/Objects/java.util.function.ObjLongConsumer</semanticResources>
130 <semanticResources>java:/Objects/java.util.OptionalLong</semanticResources>
131 <semanticResources>java:/Objects/java.util.function.LongFunction</semanticResources>
132 <semanticResources>java:/Objects/java.util.function.LongSupplier</semanticResources>
133 <semanticResources>java:/Objects/java.util.function.LongUnaryOperator</semanticResources>
134 <semanticResources>java:/Objects/java.util.function.LongToDoubleFunction</semanticResources>
135 <semanticResources>java:/Objects/java.util.function.LongToIntFunction</semanticResources>
136 <semanticResources>java:/Objects/java.util.function.LongBinaryOperator</semanticResources>
137 <semanticResources>java:/Objects/java.util.LongSummaryStatistics</semanticResources>
138 <semanticResources>java:/Objects/java.lang.reflect.Field</semanticResources>
139 <semanticResources>java:/Objects/sun.reflect.CallerSensitive</semanticResources>
140 <semanticResources>java:/Objects/java.lang.reflect.AccessibleObject</semanticResources>
141 <semanticResources>java:/Objects/java.lang.reflect.Member</semanticResources>
142 <semanticResources>java:/Objects/sun.reflect.FieldAccessor</semanticResources>
143 <semanticResources>java:/Objects/java.util.Map</semanticResources>
144 <semanticResources>java:/Objects/java.lang.IllegalAccessException</semanticResources>
145 <semanticResources>java:/Objects/java.lang.reflect.AnnotatedType</semanticResources>
146 <semanticResources>java:/Objects/sun.reflect.generics.factory.GenericsFactory</semanticResources>
147 <semanticResources>java:/Objects/sun.reflect.generics.repository.FieldRepository</semanticResources>
148 <semanticResources>java:/Objects/java.lang.reflect.Type</semanticResources>
149 <semanticResources>java:/Objects/java.lang.reflect.AnnotatedElement</semanticResources>
150 <semanticResources>java:/Objects/java.lang.SecurityException</semanticResources>
151 <semanticResources>java:/Objects/java.security.Permission</semanticResources>
152 <semanticResources>java:/Objects/sun.reflect.ReflectionFactory</semanticResources>
153 <semanticResources>java:/Objects/java.security.Guard</semanticResources>
154 <semanticResources>java:/Objects/java.security.PermissionCollection</semanticResources>
155 <semanticResources>java:/Objects/java.util.Enumeration</semanticResources>
156 <semanticResources>java:/Objects/java.security.PrivilegedAction</semanticResources>
157 <semanticResources>java:/Objects/java.lang.reflect.Constructor</semanticResources>
158 <semanticResources>java:/Objects/java.lang.reflect.Method</semanticResources>
159 <semanticResources>java:/Objects/java.lang.invoke.MethodHandle</semanticResources>
160 <semanticResources>java:/Objects/sun.reflect.ConstructorAccessor</semanticResources>
161 <semanticResources>java:/Objects/java.lang.reflect.Executable</semanticResources>
162 <semanticResources>java:/Objects/sun.reflect.MethodAccessor</semanticResources>
163 <semanticResources>java:/Objects/sun.reflect.LangReflectAccess</semanticResources>
164 <semanticResources>java:/Objects/java.io.OptionalDataException</semanticResources>
165 <semanticResources>java:/Objects/sun.reflect.generics.repository.ConstructorRepository</semanticResources>
166 <semanticResources>java:/Objects/java.lang.reflect.TypeVariable</semanticResources>
167 <semanticResources>java:/Objects/java.lang.InstantiationException</semanticResources>
168 <semanticResources>java:/Objects/java.lang.reflect.InvocationTargetException</semanticResources>
169 <semanticResources>java:/Objects/sun.reflect.generics.repository.GenericDeclRepository</semanticResources>
170 <semanticResources>java:/Objects/sun.reflect.generics.tree.MethodTypeSignature</semanticResources>
171 <semanticResources>java:/Objects/sun.reflect.generics.repository.AbstractRepository</semanticResources>
172 <semanticResources>java:/Objects/sun.reflect.generics.tree.Signature</semanticResources>
173 <semanticResources>java:/Objects/sun.reflect.generics.visitor.Reifier</semanticResources>
174 <semanticResources>java:/Objects/sun.reflect.generics.tree.Tree</semanticResources>
175 <semanticResources>java:/Objects/sun.reflect.generics.visitor.TypeTreeVisitor</semanticResources>
176 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeArgument</semanticResources>
177 <semanticResources>java:/Objects/sun.reflect.generics.tree.ArrayTypeSignature</semanticResources>
178 <semanticResources>java:/Objects/sun.reflect.generics.tree.BooleanSignature</semanticResources>
179 <semanticResources>java:/Objects/sun.reflect.generics.tree.BottomSignature</semanticResources>
180 <semanticResources>java:/Objects/sun.reflect.generics.tree.ByteSignature</semanticResources>
181 <semanticResources>java:/Objects/sun.reflect.generics.tree.CharSignature</semanticResources>
182 <semanticResources>java:/Objects/sun.reflect.generics.tree.ClassTypeSignature</semanticResources>
183 <semanticResources>java:/Objects/sun.reflect.generics.tree.DoubleSignature</semanticResources>
184 <semanticResources>java:/Objects/sun.reflect.generics.tree.FloatSignature</semanticResources>
185 <semanticResources>java:/Objects/sun.reflect.generics.tree.FormalTypeParameter</semanticResources>
186 <semanticResources>java:/Objects/sun.reflect.generics.tree.IntSignature</semanticResources>
187 <semanticResources>java:/Objects/sun.reflect.generics.tree.LongSignature</semanticResources>
188 <semanticResources>java:/Objects/sun.reflect.generics.tree.ShortSignature</semanticResources>
189 <semanticResources>java:/Objects/sun.reflect.generics.tree.SimpleClassTypeSignature</semanticResources>
190 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeVariableSignature</semanticResources>
191 <semanticResources>java:/Objects/sun.reflect.generics.tree.VoidDescriptor</semanticResources>
192 <semanticResources>java:/Objects/sun.reflect.generics.tree.Wildcard</semanticResources>
193 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeTree</semanticResources>
194 <semanticResources>java:/Objects/sun.reflect.generics.tree.FieldTypeSignature</semanticResources>
195 <semanticResources>java:/Objects/sun.reflect.generics.tree.TypeSignature</semanticResources>
196 <semanticResources>java:/Objects/sun.reflect.generics.tree.BaseType</semanticResources>
197 <semanticResources>java:/Objects/sun.reflect.generics.tree.ReturnType</semanticResources>
198 <semanticResources>java:/Objects/sun.reflect.generics.visitor.Visitor</semanticResources>
199 <semanticResources>java:/Objects/sun.reflect.generics.tree.ClassSignature</semanticResources>
200 <semanticResources>java:/Objects/java.lang.reflect.GenericDeclaration</semanticResources>
201 <semanticResources>java:/Objects/java.lang.ReflectiveOperationException</semanticResources>
202 <semanticResources>java:/Objects/sun.reflect.generics.repository.MethodRepository</semanticResources>
203 <semanticResources>java:/Objects/java.lang.invoke.MethodType</semanticResources>
204 <semanticResources>java:/Objects/java.lang.invoke.LambdaForm</semanticResources>
205 <semanticResources>java:/Objects/java.lang.invoke.BoundMethodHandle</semanticResources>
206 <semanticResources>java:/Objects/java.lang.invoke.MemberName</semanticResources>
207 <semanticResources>java:/Objects/java.lang.invoke.MethodHandleImpl</semanticResources>
208 <semanticResources>java:/Objects/java.lang.ref.WeakReference</semanticResources>
209 <semanticResources>java:/Objects/java.lang.ref.ReferenceQueue</semanticResources>
210 <semanticResources>java:/Objects/java.util.concurrent.ConcurrentMap</semanticResources>
211 <semanticResources>java:/Objects/java.lang.invoke.MethodTypeForm</semanticResources>
212 <semanticResources>java:/Objects/java.lang.ClassLoader</semanticResources>
213 <semanticResources>java:/Objects/java.lang.TypeNotPresentException</semanticResources>
214 <semanticResources>java:/Objects/java.lang.invoke.Invokers</semanticResources>
215 <semanticResources>java:/Objects/java.lang.IndexOutOfBoundsException</semanticResources>
216 <semanticResources>java:/Objects/java.lang.invoke.Stable</semanticResources>
217 <semanticResources>java:/Objects/java.lang.ref.Reference</semanticResources>
218 <semanticResources>java:/Objects/java.lang.Thread</semanticResources>
219 <semanticResources>java:/Objects/java.lang.ThreadGroup</semanticResources>
220 <semanticResources>java:/Objects/java.lang.Boolean</semanticResources>
221 <semanticResources>java:/Objects/java.security.AccessControlContext</semanticResources>
222 <semanticResources>java:/Objects/sun.nio.ch.Interruptible</semanticResources>
223 <semanticResources>java:/Objects/java.lang.RuntimePermission</semanticResources>
224 <semanticResources>java:/Objects/java.lang.ThreadLocal</semanticResources>
225 <semanticResources>java:/Objects/sun.misc.Contended</semanticResources>
226 <semanticResources>java:/Objects/java.security.ProtectionDomain</semanticResources>
227 <semanticResources>java:/Objects/java.security.DomainCombiner</semanticResources>
228 <semanticResources>java:/Objects/java.security.AccessControlException</semanticResources>
229 <semanticResources>java:/Objects/sun.misc.JavaSecurityAccess</semanticResources>
230 <semanticResources>java:/Objects/java.security.CodeSource</semanticResources>
231 <semanticResources>java:/Objects/java.security.Principal</semanticResources>
232 <semanticResources>java:/Objects/java.security.cert.Certificate</semanticResources>
233 <semanticResources>java:/Objects/java.security.CodeSigner</semanticResources>
234 <semanticResources>java:/Objects/java.security.cert.CertificateFactory</semanticResources>
235 <semanticResources>java:/Objects/java.net.SocketPermission</semanticResources>
236 <semanticResources>java:/Objects/java.io.ObjectStreamException</semanticResources>
237 <semanticResources>java:/Objects/java.security.cert.CertificateEncodingException</semanticResources>
238 <semanticResources>java:/Objects/java.security.PublicKey</semanticResources>
239 <semanticResources>java:/Objects/java.security.cert.CertificateException</semanticResources>
240 <semanticResources>java:/Objects/java.security.InvalidKeyException</semanticResources>
241 <semanticResources>java:/Objects/java.security.SignatureException</semanticResources>
242 <semanticResources>java:/Objects/java.security.Key</semanticResources>
243 <semanticResources>java:/Objects/java.security.GeneralSecurityException</semanticResources>
244 <semanticResources>java:/Objects/java.security.KeyException</semanticResources>
245 <semanticResources>java:/Objects/java.security.cert.CertPath</semanticResources>
246 <semanticResources>java:/Objects/java.security.Timestamp</semanticResources>
247 <semanticResources>java:/Objects/java.util.Date</semanticResources>
248 <semanticResources>java:/Objects/java.lang.Cloneable</semanticResources>
249 <semanticResources>java:/Objects/java.time.Instant</semanticResources>
250 <semanticResources>java:/Objects/sun.util.calendar.BaseCalendar</semanticResources>
251 <semanticResources>java:/Objects/java.time.temporal.Temporal</semanticResources>
252 <semanticResources>java:/Objects/java.time.temporal.TemporalAdjuster</semanticResources>
253 <semanticResources>java:/Objects/java.time.ZoneOffset</semanticResources>
254 <semanticResources>java:/Objects/java.time.OffsetDateTime</semanticResources>
255 <semanticResources>java:/Objects/java.time.ZoneId</semanticResources>
256 <semanticResources>java:/Objects/java.time.ZonedDateTime</semanticResources>
257 <semanticResources>java:/Objects/java.time.temporal.TemporalAccessor</semanticResources>
258 <semanticResources>java:/Objects/java.time.temporal.TemporalField</semanticResources>
259 <semanticResources>java:/Objects/java.time.temporal.TemporalUnit</semanticResources>
260 <semanticResources>java:/Objects/java.time.temporal.TemporalAmount</semanticResources>
261 <semanticResources>java:/Objects/java.time.Clock</semanticResources>
262 <semanticResources>java:/Objects/java.time.temporal.TemporalQuery</semanticResources>
263 <semanticResources>java:/Objects/java.time.temporal.ValueRange</semanticResources>
264 <semanticResources>java:/Objects/java.io.DataInput</semanticResources>
265 <semanticResources>java:/Objects/java.io.InvalidObjectException</semanticResources>
266 <semanticResources>java:/Objects/java.io.DataOutput</semanticResources>
267 <semanticResources>java:/Objects/java.time.zone.ZoneRules</semanticResources>
268 <semanticResources>java:/Objects/java.time.zone.ZoneOffsetTransition</semanticResources>
269 <semanticResources>java:/Objects/java.time.zone.ZoneOffsetTransitionRule</semanticResources>
270 <semanticResources>java:/Objects/java.time.LocalDateTime</semanticResources>
271 <semanticResources>java:/Objects/java.time.Duration</semanticResources>
272 <semanticResources>java:/Objects/java.time.Month</semanticResources>
273 <semanticResources>java:/Objects/java.time.DayOfWeek</semanticResources>
274 <semanticResources>java:/Objects/java.time.LocalTime</semanticResources>
275 <semanticResources>java:/Objects/java.time.format.TextStyle</semanticResources>
276 <semanticResources>java:/Objects/java.time.LocalDate</semanticResources>
277 <semanticResources>java:/Objects/java.time.OffsetTime</semanticResources>
278 <semanticResources>java:/Objects/java.time.format.DateTimeFormatter</semanticResources>
279 <semanticResources>java:/Objects/java.time.chrono.ChronoLocalDate</semanticResources>
280 <semanticResources>java:/Objects/java.time.chrono.IsoChronology</semanticResources>
281 <semanticResources>java:/Objects/java.time.chrono.Era</semanticResources>
282 <semanticResources>java:/Objects/java.time.Period</semanticResources>
283 <semanticResources>java:/Objects/java.time.chrono.ChronoLocalDateTime</semanticResources>
284 <semanticResources>java:/Objects/java.time.chrono.Chronology</semanticResources>
285 <semanticResources>java:/Objects/java.time.chrono.ChronoPeriod</semanticResources>
286 <semanticResources>java:/Objects/java.time.chrono.ChronoZonedDateTime</semanticResources>
287 <semanticResources>java:/Objects/java.time.temporal.ChronoField</semanticResources>
288 <semanticResources>java:/Objects/java.time.format.ResolverStyle</semanticResources>
289 <semanticResources>java:/Objects/java.time.chrono.AbstractChronology</semanticResources>
290 <semanticResources>java:/Objects/java.time.chrono.IsoEra</semanticResources>
291 <semanticResources>java:/Objects/java.util.concurrent.ConcurrentHashMap</semanticResources>
292 <semanticResources>java:/Objects/java.util.AbstractMap</semanticResources>
293 <semanticResources>java:/Objects/java.util.function.ToIntBiFunction</semanticResources>
294 <semanticResources>java:/Objects/java.util.function.ToLongBiFunction</semanticResources>
295 <semanticResources>java:/Objects/java.util.function.ToDoubleBiFunction</semanticResources>
296 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicReference</semanticResources>
297 <semanticResources>java:/Objects/java.lang.Void</semanticResources>
298 <semanticResources>java:/Objects/java.util.concurrent.CountedCompleter</semanticResources>
299 <semanticResources>java:/Objects/java.util.Collection</semanticResources>
300 <semanticResources>java:/Objects/java.util.concurrent.locks.ReentrantLock</semanticResources>
301 <semanticResources>java:/Objects/java.util.concurrent.ForkJoinTask</semanticResources>
302 <semanticResources>java:/Objects/java.util.concurrent.Future</semanticResources>
303 <semanticResources>java:/Objects/java.util.concurrent.RunnableFuture</semanticResources>
304 <semanticResources>java:/Objects/java.util.concurrent.Callable</semanticResources>
305 <semanticResources>java:/Objects/java.util.concurrent.ExecutionException</semanticResources>
306 <semanticResources>java:/Objects/java.util.concurrent.TimeUnit</semanticResources>
307 <semanticResources>java:/Objects/java.util.concurrent.TimeoutException</semanticResources>
308 <semanticResources>java:/Objects/java.util.concurrent.ForkJoinPool</semanticResources>
309 <semanticResources>java:/Objects/java.util.concurrent.AbstractExecutorService</semanticResources>
310 <semanticResources>java:/Objects/java.util.concurrent.ForkJoinWorkerThread</semanticResources>
311 <semanticResources>java:/Objects/java.util.concurrent.ExecutorService</semanticResources>
312 <semanticResources>java:/Objects/java.util.concurrent.Executor</semanticResources>
313 <semanticResources>java:/Objects/java.lang.Iterable</semanticResources>
314 <semanticResources>java:/Objects/java.util.concurrent.locks.Lock</semanticResources>
315 <semanticResources>java:/Objects/java.util.concurrent.locks.AbstractQueuedSynchronizer</semanticResources>
316 <semanticResources>java:/Objects/java.util.concurrent.locks.Condition</semanticResources>
317 <semanticResources>java:/Objects/java.util.concurrent.locks.AbstractOwnableSynchronizer</semanticResources>
318 <semanticResources>java:/Objects/java.lang.NullPointerException</semanticResources>
319 <semanticResources>java:/Objects/java.io.ObjectInput</semanticResources>
320 <semanticResources>java:/Objects/java.io.ObjectOutput</semanticResources>
321 <semanticResources>java:/Objects/java.text.Format</semanticResources>
322 <semanticResources>java:/Objects/java.text.FieldPosition</semanticResources>
323 <semanticResources>java:/Objects/java.text.ParseException</semanticResources>
324 <semanticResources>java:/Objects/java.text.ParsePosition</semanticResources>
325 <semanticResources>java:/Objects/java.time.format.DateTimeFormatterBuilder</semanticResources>
326 <semanticResources>java:/Objects/java.time.format.DecimalStyle</semanticResources>
327 <semanticResources>java:/Objects/java.time.format.DateTimeParseException</semanticResources>
328 <semanticResources>java:/Objects/java.time.format.FormatStyle</semanticResources>
329 <semanticResources>java:/Objects/java.time.format.DateTimeParseContext</semanticResources>
330 <semanticResources>java:/Objects/java.text.AttributedCharacterIterator</semanticResources>
331 <semanticResources>java:/Objects/java.text.CharacterIterator</semanticResources>
332 <semanticResources>java:/Objects/java.time.format.DateTimePrintContext</semanticResources>
333 <semanticResources>java:/Objects/java.lang.ref.SoftReference</semanticResources>
334 <semanticResources>java:/Objects/java.time.format.DateTimeTextProvider</semanticResources>
335 <semanticResources>java:/Objects/java.math.BigDecimal</semanticResources>
336 <semanticResources>java:/Objects/java.time.format.SignStyle</semanticResources>
337 <semanticResources>java:/Objects/java.lang.Character</semanticResources>
338 <semanticResources>java:/Objects/java.math.MathContext</semanticResources>
339 <semanticResources>java:/Objects/java.math.RoundingMode</semanticResources>
340 <semanticResources>java:/Objects/java.math.MutableBigInteger</semanticResources>
341 <semanticResources>java:/Objects/java.util.HashMap</semanticResources>
342 <semanticResources>java:/Objects/java.util.LinkedHashMap</semanticResources>
343 <semanticResources>java:/Objects/java.util.AbstractSet</semanticResources>
344 <semanticResources>java:/Objects/java.util.AbstractCollection</semanticResources>
345 <semanticResources>java:/Objects/java.time.DateTimeException</semanticResources>
346 <semanticResources>java:/Objects/java.time.format.Parsed</semanticResources>
347 <semanticResources>java:/Objects/java.util.ArrayList</semanticResources>
348 <semanticResources>java:/Objects/java.util.AbstractList</semanticResources>
349 <semanticResources>java:/Objects/java.util.RandomAccess</semanticResources>
350 <semanticResources>java:/Objects/java.util.ListIterator</semanticResources>
351 <semanticResources>java:/Objects/sun.util.calendar.AbstractCalendar</semanticResources>
352 <semanticResources>java:/Objects/sun.util.calendar.CalendarDate</semanticResources>
353 <semanticResources>java:/Objects/java.util.TimeZone</semanticResources>
354 <semanticResources>java:/Objects/sun.util.calendar.CalendarSystem</semanticResources>
355 <semanticResources>java:/Objects/sun.util.calendar.Era</semanticResources>
356 <semanticResources>java:/Objects/java.util.Properties</semanticResources>
357 <semanticResources>java:/Objects/sun.util.calendar.Gregorian</semanticResources>
358 <semanticResources>java:/Objects/java.util.Hashtable</semanticResources>
359 <semanticResources>java:/Objects/java.io.InputStream</semanticResources>
360 <semanticResources>java:/Objects/java.util.InvalidPropertiesFormatException</semanticResources>
361 <semanticResources>java:/Objects/sun.util.spi.XmlPropertiesProvider</semanticResources>
362 <semanticResources>java:/Objects/java.io.Reader</semanticResources>
363 <semanticResources>java:/Objects/java.io.BufferedWriter</semanticResources>
364 <semanticResources>java:/Objects/java.util.Dictionary</semanticResources>
365 <semanticResources>java:/Objects/java.io.StreamCorruptedException</semanticResources>
366 <semanticResources>java:/Objects/java.io.NotSerializableException</semanticResources>
367 <semanticResources>java:/Objects/java.lang.Readable</semanticResources>
368 <semanticResources>java:/Objects/java.nio.CharBuffer</semanticResources>
369 <semanticResources>java:/Objects/java.nio.Buffer</semanticResources>
370 <semanticResources>java:/Objects/java.nio.ByteOrder</semanticResources>
371 <semanticResources>java:/Objects/java.security.cert.CertificateFactorySpi</semanticResources>
372 <semanticResources>java:/Objects/java.security.cert.CRLException</semanticResources>
373 <semanticResources>java:/Objects/java.security.cert.CRL</semanticResources>
374 <semanticResources>java:/Objects/java.net.UnknownHostException</semanticResources>
375 <semanticResources>java:/Objects/java.net.InetAddress</semanticResources>
376 <semanticResources>java:/Objects/sun.net.spi.nameservice.NameService</semanticResources>
377 <semanticResources>java:/Objects/java.net.NetworkInterface</semanticResources>
378 <semanticResources>java:/Objects/java.net.InetAddressImpl</semanticResources>
379 <semanticResources>java:/Objects/java.net.SocketException</semanticResources>
380 <semanticResources>java:/Objects/java.net.InterfaceAddress</semanticResources>
381 <semanticResources>java:/Objects/java.net.Inet4Address</semanticResources>
382 <semanticResources>java:/Objects/javax.security.auth.Subject</semanticResources>
383 <semanticResources>java:/Objects/javax.security.auth.AuthPermission</semanticResources>
384 <semanticResources>java:/Objects/java.util.LinkedList</semanticResources>
385 <semanticResources>java:/Objects/java.security.PrivilegedExceptionAction</semanticResources>
386 <semanticResources>java:/Objects/java.security.PrivilegedActionException</semanticResources>
387 <semanticResources>java:/Objects/java.security.BasicPermission</semanticResources>
388 <semanticResources>java:/Objects/java.util.AbstractSequentialList</semanticResources>
389 <semanticResources>java:/Objects/java.util.Deque</semanticResources>
390 <semanticResources>java:/Objects/java.util.Queue</semanticResources>
391 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicInteger</semanticResources>
392 <semanticResources>java:/Objects/java.lang.ClassFormatError</semanticResources>
393 <semanticResources>java:/Objects/java.nio.ByteBuffer</semanticResources>
394 <semanticResources>java:/Objects/java.lang.Package</semanticResources>
395 <semanticResources>java:/Objects/sun.misc.URLClassPath</semanticResources>
396 <semanticResources>java:/Objects/java.lang.AssertionStatusDirectives</semanticResources>
397 <semanticResources>java:/Objects/java.util.Vector</semanticResources>
398 <semanticResources>java:/Objects/java.util.Stack</semanticResources>
399 <semanticResources>java:/Objects/java.lang.LinkageError</semanticResources>
400 <semanticResources>java:/Objects/java.lang.Error</semanticResources>
401 <semanticResources>java:/Objects/java.nio.DoubleBuffer</semanticResources>
402 <semanticResources>java:/Objects/java.nio.FloatBuffer</semanticResources>
403 <semanticResources>java:/Objects/java.nio.IntBuffer</semanticResources>
404 <semanticResources>java:/Objects/java.nio.LongBuffer</semanticResources>
405 <semanticResources>java:/Objects/java.nio.ShortBuffer</semanticResources>
406 <semanticResources>java:/Objects/java.util.jar.Manifest</semanticResources>
407 <semanticResources>java:/Objects/java.io.FilterInputStream</semanticResources>
408 <semanticResources>java:/Objects/java.util.jar.JarVerifier</semanticResources>
409 <semanticResources>java:/Objects/java.util.jar.Attributes</semanticResources>
410 <semanticResources>java:/Objects/java.util.jar.JarEntry</semanticResources>
411 <semanticResources>java:/Objects/sun.security.util.ManifestEntryVerifier</semanticResources>
412 <semanticResources>java:/Objects/java.util.jar.JarFile</semanticResources>
413 <semanticResources>java:/Objects/java.util.zip.ZipEntry</semanticResources>
414 <semanticResources>java:/Objects/java.io.ByteArrayOutputStream</semanticResources>
415 <semanticResources>java:/Objects/sun.security.util.ManifestDigester</semanticResources>
416 <semanticResources>java:/Objects/sun.security.util.SignatureFileVerifier</semanticResources>
417 <semanticResources>java:/Objects/java.util.jar.JarException</semanticResources>
418 <semanticResources>java:/Objects/java.util.zip.ZipException</semanticResources>
419 <semanticResources>java:/Objects/java.util.zip.ZipFile</semanticResources>
420 <semanticResources>java:/Objects/java.util.zip.ZipConstants</semanticResources>
421 <semanticResources>java:/Objects/java.util.zip.InflaterInputStream</semanticResources>
422 <semanticResources>java:/Objects/java.util.zip.Inflater</semanticResources>
423 <semanticResources>java:/Objects/java.util.zip.ZipCoder</semanticResources>
424 <semanticResources>java:/Objects/java.util.zip.DataFormatException</semanticResources>
425 <semanticResources>java:/Objects/java.util.zip.ZStreamRef</semanticResources>
426 <semanticResources>java:/Objects/java.nio.charset.CharsetDecoder</semanticResources>
427 <semanticResources>java:/Objects/java.nio.charset.CharsetEncoder</semanticResources>
428 <semanticResources>java:/Objects/java.nio.charset.CharacterCodingException</semanticResources>
429 <semanticResources>java:/Objects/java.nio.charset.CoderResult</semanticResources>
430 <semanticResources>java:/Objects/java.nio.charset.CodingErrorAction</semanticResources>
431 <semanticResources>java:/Objects/java.nio.file.attribute.FileTime</semanticResources>
432 <semanticResources>java:/Objects/sun.security.pkcs.SignerInfo</semanticResources>
433 <semanticResources>java:/Objects/sun.security.pkcs.PKCS7</semanticResources>
434 <semanticResources>java:/Objects/sun.security.util.DisabledAlgorithmConstraints</semanticResources>
435 <semanticResources>java:/Objects/sun.security.util.DerEncoder</semanticResources>
436 <semanticResources>java:/Objects/sun.security.util.DerInputStream</semanticResources>
437 <semanticResources>java:/Objects/sun.security.pkcs.ParsingException</semanticResources>
438 <semanticResources>java:/Objects/sun.security.x509.X500Name</semanticResources>
439 <semanticResources>java:/Objects/sun.security.x509.AlgorithmId</semanticResources>
440 <semanticResources>java:/Objects/sun.security.pkcs.PKCS9Attributes</semanticResources>
441 <semanticResources>java:/Objects/sun.security.util.DerOutputStream</semanticResources>
442 <semanticResources>java:/Objects/java.security.cert.X509Certificate</semanticResources>
443 <semanticResources>java:/Objects/sun.security.timestamp.TimestampToken</semanticResources>
444 <semanticResources>java:/Objects/java.security.CryptoPrimitive</semanticResources>
445 <semanticResources>java:/Objects/sun.security.util.DerInputBuffer</semanticResources>
446 <semanticResources>java:/Objects/sun.security.util.DerValue</semanticResources>
447 <semanticResources>java:/Objects/sun.security.util.ObjectIdentifier</semanticResources>
448 <semanticResources>java:/Objects/sun.security.util.BitArray</semanticResources>
449 <semanticResources>java:/Objects/java.io.ByteArrayInputStream</semanticResources>
450 <semanticResources>java:/Objects/java.lang.ArrayIndexOutOfBoundsException</semanticResources>
451 <semanticResources>java:/Objects/sun.security.x509.GeneralNameInterface</semanticResources>
452 <semanticResources>java:/Objects/sun.security.x509.RDN</semanticResources>
453 <semanticResources>java:/Objects/sun.security.x509.AVA</semanticResources>
454 <semanticResources>java:/Objects/javax.security.auth.x500.X500Principal</semanticResources>
455 <semanticResources>java:/Objects/java.lang.UnsupportedOperationException</semanticResources>
456 <semanticResources>java:/Objects/java.lang.Byte</semanticResources>
457 <semanticResources>java:/Objects/java.io.NotActiveException</semanticResources>
458 <semanticResources>java:/Objects/java.security.AlgorithmParameters</semanticResources>
459 <semanticResources>java:/Objects/java.security.AlgorithmParametersSpi</semanticResources>
460 <semanticResources>java:/Objects/java.security.spec.AlgorithmParameterSpec</semanticResources>
461 <semanticResources>java:/Objects/java.security.spec.InvalidParameterSpecException</semanticResources>
462 <semanticResources>java:/Objects/sun.security.pkcs.PKCS9Attribute</semanticResources>
463 <semanticResources>java:/Objects/sun.security.util.ByteArrayLexOrder</semanticResources>
464 <semanticResources>java:/Objects/sun.security.util.ByteArrayTagOrder</semanticResources>
465 <semanticResources>java:/Objects/java.security.cert.X509Extension</semanticResources>
466 <semanticResources>java:/Objects/java.security.cert.CertificateExpiredException</semanticResources>
467 <semanticResources>java:/Objects/java.security.cert.CertificateNotYetValidException</semanticResources>
468 <semanticResources>java:/Objects/java.security.cert.CertificateParsingException</semanticResources>
469 <semanticResources>java:/Objects/sun.security.pkcs.ContentInfo</semanticResources>
470 <semanticResources>java:/Objects/java.security.cert.X509CRL</semanticResources>
471 <semanticResources>java:/Objects/sun.security.timestamp.Timestamper</semanticResources>
472 <semanticResources>java:/Objects/java.security.cert.X509CRLEntry</semanticResources>
473 <semanticResources>java:/Objects/java.security.cert.CRLReason</semanticResources>
474 <semanticResources>java:/Objects/sun.security.timestamp.TSRequest</semanticResources>
475 <semanticResources>java:/Objects/sun.security.timestamp.TSResponse</semanticResources>
476 <semanticResources>java:/Objects/sun.security.util.AbstractAlgorithmConstraints</semanticResources>
477 <semanticResources>java:/Objects/sun.security.util.ConstraintsParameters</semanticResources>
478 <semanticResources>java:/Objects/java.security.cert.CertPathValidatorException</semanticResources>
479 <semanticResources>java:/Objects/java.text.SimpleDateFormat</semanticResources>
480 <semanticResources>java:/Objects/sun.security.util.AlgorithmDecomposer</semanticResources>
481 <semanticResources>java:/Objects/java.security.AlgorithmConstraints</semanticResources>
482 <semanticResources>java:/Objects/java.text.DateFormat</semanticResources>
483 <semanticResources>java:/Objects/java.text.DateFormatSymbols</semanticResources>
484 <semanticResources>java:/Objects/java.text.CalendarBuilder</semanticResources>
485 <semanticResources>java:/Objects/java.text.NumberFormat</semanticResources>
486 <semanticResources>java:/Objects/sun.util.locale.provider.LocaleProviderAdapter</semanticResources>
487 <semanticResources>java:/Objects/java.util.Calendar</semanticResources>
488 <semanticResources>java:/Objects/java.util.spi.LocaleServiceProvider</semanticResources>
489 <semanticResources>java:/Objects/java.text.spi.BreakIteratorProvider</semanticResources>
490 <semanticResources>java:/Objects/java.util.spi.CalendarDataProvider</semanticResources>
491 <semanticResources>java:/Objects/java.util.spi.CalendarNameProvider</semanticResources>
492 <semanticResources>java:/Objects/sun.util.spi.CalendarProvider</semanticResources>
493 <semanticResources>java:/Objects/java.text.spi.CollatorProvider</semanticResources>
494 <semanticResources>java:/Objects/java.util.spi.CurrencyNameProvider</semanticResources>
495 <semanticResources>java:/Objects/java.text.spi.DateFormatProvider</semanticResources>
496 <semanticResources>java:/Objects/java.text.spi.DateFormatSymbolsProvider</semanticResources>
497 <semanticResources>java:/Objects/java.text.spi.DecimalFormatSymbolsProvider</semanticResources>
498 <semanticResources>java:/Objects/java.util.spi.LocaleNameProvider</semanticResources>
499 <semanticResources>java:/Objects/sun.util.locale.provider.LocaleResources</semanticResources>
500 <semanticResources>java:/Objects/java.text.spi.NumberFormatProvider</semanticResources>
501 <semanticResources>java:/Objects/java.util.spi.TimeZoneNameProvider</semanticResources>
502 <semanticResources>java:/Objects/java.text.BreakIterator</semanticResources>
503 <semanticResources>java:/Objects/java.text.Collator</semanticResources>
504 <semanticResources>java:/Objects/java.text.CollationKey</semanticResources>
505 <semanticResources>java:/Objects/java.text.DecimalFormatSymbols</semanticResources>
506 <semanticResources>java:/Objects/java.util.Currency</semanticResources>
507 <semanticResources>java:/Objects/sun.util.locale.provider.LocaleServiceProviderPool</semanticResources>
508 <semanticResources>java:/Objects/java.io.DataInputStream</semanticResources>
509 <semanticResources>java:/Objects/java.util.HashSet</semanticResources>
510 <semanticResources>java:/Objects/sun.util.locale.provider.ResourceBundleBasedAdapter</semanticResources>
511 <semanticResources>java:/Objects/java.util.ResourceBundle</semanticResources>
512 <semanticResources>java:/Objects/sun.util.resources.LocaleData</semanticResources>
513 <semanticResources>java:/Objects/sun.util.locale.LocaleObjectCache</semanticResources>
514 <semanticResources>java:/Objects/sun.util.locale.BaseLocale</semanticResources>
515 <semanticResources>java:/Objects/java.util.spi.ResourceBundleControlProvider</semanticResources>
516 <semanticResources>java:/Objects/sun.util.resources.OpenListResourceBundle</semanticResources>
517 <semanticResources>java:/Objects/sun.util.resources.TimeZoneNamesBundle</semanticResources>
518 <semanticResources>java:/Objects/sun.util.resources.ParallelListResourceBundle</semanticResources>
519 <semanticResources>java:/Objects/java.util.concurrent.atomic.AtomicMarkableReference</semanticResources>
520 <semanticResources>java:/Objects/java.io.DataOutputStream</semanticResources>
521 <semanticResources>java:/Objects/java.io.FilterOutputStream</semanticResources>
522 <semanticResources>java:/Objects/sun.misc.Resource</semanticResources>
523 <semanticResources>java:/Objects/java.net.URLStreamHandler</semanticResources>
524 <semanticResources>java:/Objects/sun.misc.JarIndex</semanticResources>
525 <semanticResources>java:/Objects/sun.misc.MetaIndex</semanticResources>
526 <semanticResources>java:/Objects/sun.misc.JavaUtilZipFileAccess</semanticResources>
527 <semanticResources>java:/Objects/java.net.URLStreamHandlerFactory</semanticResources>
528 <semanticResources>java:/Objects/java.net.URLConnection</semanticResources>
529 <semanticResources>java:/Objects/java.net.Proxy</semanticResources>
530 <semanticResources>java:/Objects/java.net.UnknownServiceException</semanticResources>
531 <semanticResources>java:/Objects/java.net.ContentHandler</semanticResources>
532 <semanticResources>java:/Objects/java.net.FileNameMap</semanticResources>
533 <semanticResources>java:/Objects/java.net.ContentHandlerFactory</semanticResources>
534 <semanticResources>java:/Objects/sun.net.www.MessageHeader</semanticResources>
535 <semanticResources>java:/Objects/java.net.SocketAddress</semanticResources>
536 <semanticResources>java:/Objects/java.lang.invoke.ForceInline</semanticResources>
537 <semanticResources>java:/Objects/java.lang.invoke.DontInline</semanticResources>
538 <semanticResources>java:/Objects/java.lang.invoke.WrongMethodTypeException</semanticResources>
539 <semanticResources>java:/Objects/sun.invoke.util.Wrapper</semanticResources>
540 <semanticResources>java:/Objects/java.lang.invoke.LambdaFormEditor</semanticResources>
541 <semanticResources>java:/Objects/java.lang.ClassCastException</semanticResources>
542 <semanticResources>java:/Objects/java.lang.invoke.LambdaFormBuffer</semanticResources>
543 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.MethodVisitor</semanticResources>
544 <semanticResources>java:/Objects/java.lang.invoke.MethodHandles</semanticResources>
545 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.AnnotationVisitor</semanticResources>
546 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Attribute</semanticResources>
547 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.TypePath</semanticResources>
548 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Handle</semanticResources>
549 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Label</semanticResources>
550 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassWriter</semanticResources>
551 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ByteVector</semanticResources>
552 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassReader</semanticResources>
553 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.ClassVisitor</semanticResources>
554 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Item</semanticResources>
555 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.FieldVisitor</semanticResources>
556 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.AnnotationWriter</semanticResources>
557 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.FieldWriter</semanticResources>
558 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.MethodWriter</semanticResources>
559 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Frame</semanticResources>
560 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Handler</semanticResources>
561 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Type</semanticResources>
562 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Context</semanticResources>
563 <semanticResources>java:/Objects/jdk.internal.org.objectweb.asm.Edge</semanticResources>
564 <semanticResources>java:/Objects/java.lang.NoSuchMethodException</semanticResources>
565 <semanticResources>java:/Objects/java.lang.NoSuchFieldException</semanticResources>
566 <semanticResources>java:/Objects/java.lang.invoke.DirectMethodHandle</semanticResources>
567 <semanticResources>java:/Objects/java.lang.invoke.MethodHandleInfo</semanticResources>
568 <semanticResources>java:/Objects/java.lang.ClassValue</semanticResources>
569 <semanticResources>java:/Objects/java.util.WeakHashMap</semanticResources>
570 <semanticResources>java:/Objects/java.lang.invoke.DelegatingMethodHandle</semanticResources>
571 <semanticResources>java:/Objects/sun.invoke.empty.Empty</semanticResources>
572 <semanticResources>java:/Objects/java.lang.reflect.Parameter</semanticResources>
573 <semanticResources>java:/Objects/java.lang.reflect.ParameterizedType</semanticResources>
574 <semanticResources>java:/Objects/java.lang.reflect.WildcardType</semanticResources>
575 <semanticResources>java:/Objects/java.util.regex.Matcher</semanticResources>
576 <semanticResources>java:/Objects/java.util.regex.UnicodeProp</semanticResources>
577 <semanticResources>java:/Objects/java.util.regex.PatternSyntaxException</semanticResources>
578 <semanticResources>java:/Objects/java.util.regex.MatchResult</semanticResources>
579 <semanticResources>java:/Objects/java.security.MessageDigestSpi</semanticResources>
580 <semanticResources>java:/Objects/java.security.DigestException</semanticResources>
581 <semanticResources>java:/Objects/java.net.URISyntaxException</semanticResources>
582 <semanticResources>java:/Objects/java.nio.file.Watchable</semanticResources>
583 <semanticResources>java:/Objects/java.nio.file.FileSystem</semanticResources>
584 <semanticResources>java:/Objects/java.nio.file.WatchService</semanticResources>
585 <semanticResources>java:/Objects/java.nio.file.WatchEvent</semanticResources>
586 <semanticResources>java:/Objects/java.nio.file.WatchKey</semanticResources>
587 <semanticResources>java:/Objects/java.nio.file.LinkOption</semanticResources>
588 <semanticResources>java:/Objects/java.nio.file.FileStore</semanticResources>
589 <semanticResources>java:/Objects/java.nio.file.PathMatcher</semanticResources>
590 <semanticResources>java:/Objects/java.nio.file.attribute.UserPrincipalLookupService</semanticResources>
591 <semanticResources>java:/Objects/java.nio.file.spi.FileSystemProvider</semanticResources>
592 <semanticResources>java:/Objects/java.nio.file.attribute.FileStoreAttributeView</semanticResources>
593 <semanticResources>java:/Objects/java.nio.file.attribute.FileAttributeView</semanticResources>
594 <semanticResources>java:/Objects/java.nio.file.attribute.AttributeView</semanticResources>
595 <semanticResources>java:/Objects/java.nio.file.attribute.GroupPrincipal</semanticResources>
596 <semanticResources>java:/Objects/java.nio.file.attribute.UserPrincipal</semanticResources>
597 <semanticResources>java:/Objects/java.nio.file.AccessMode</semanticResources>
598 <semanticResources>java:/Objects/java.nio.file.CopyOption</semanticResources>
599 <semanticResources>java:/Objects/java.nio.file.attribute.FileAttribute</semanticResources>
600 <semanticResources>java:/Objects/java.nio.file.OpenOption</semanticResources>
601 <semanticResources>java:/Objects/java.nio.channels.AsynchronousFileChannel</semanticResources>
602 <semanticResources>java:/Objects/java.nio.channels.SeekableByteChannel</semanticResources>
603 <semanticResources>java:/Objects/java.nio.file.DirectoryStream</semanticResources>
604 <semanticResources>java:/Objects/java.nio.channels.FileChannel</semanticResources>
605 <semanticResources>java:/Objects/java.nio.file.attribute.BasicFileAttributes</semanticResources>
606 <semanticResources>java:/Objects/java.nio.channels.AsynchronousChannel</semanticResources>
607 <semanticResources>java:/Objects/java.nio.channels.FileLock</semanticResources>
608 <semanticResources>java:/Objects/java.nio.channels.CompletionHandler</semanticResources>
609 <semanticResources>java:/Objects/java.nio.channels.Channel</semanticResources>
610 <semanticResources>java:/Objects/java.nio.channels.ByteChannel</semanticResources>
611 <semanticResources>java:/Objects/java.nio.channels.ReadableByteChannel</semanticResources>
612 <semanticResources>java:/Objects/java.nio.channels.WritableByteChannel</semanticResources>
613 <semanticResources>java:/Objects/java.nio.channels.spi.AbstractInterruptibleChannel</semanticResources>
614 <semanticResources>java:/Objects/java.nio.channels.GatheringByteChannel</semanticResources>
615 <semanticResources>java:/Objects/java.nio.channels.ScatteringByteChannel</semanticResources>
616 <semanticResources>java:/Objects/java.nio.MappedByteBuffer</semanticResources>
617 <semanticResources>java:/Objects/java.nio.channels.InterruptibleChannel</semanticResources>
618 <semanticResources>java:/Objects/java.nio.channels.AsynchronousCloseException</semanticResources>
619 <semanticResources>java:/Objects/java.nio.channels.ClosedChannelException</semanticResources>
620 <semanticResources>java:/Objects/java.io.FileDescriptor</semanticResources>
621 <semanticResources>java:/Objects/java.io.SyncFailedException</semanticResources>
622 <semanticResources>java:/Objects/java.lang.SecurityManager</semanticResources>
623 <semanticResources>java:/Objects/java.net.UrlDeserializedState</semanticResources>
624 <semanticResources>java:/Objects/java.nio.charset.spi.CharsetProvider</semanticResources>
625 <semanticResources>java:/Objects/java.util.SortedMap</semanticResources>
626 <semanticResources>java:/Objects/sun.util.locale.InternalLocaleBuilder</semanticResources>
627 <semanticResources>java:/Objects/sun.util.locale.LocaleExtensions</semanticResources>
628 <semanticResources>java:/Objects/java.text.MessageFormat</semanticResources>
629 <semanticResources>java:/Objects/java.util.MissingResourceException</semanticResources>
630 <semanticResources>java:/Objects/sun.util.locale.LocaleSyntaxException</semanticResources>
631 <semanticResources>java:/Objects/sun.util.locale.LanguageTag</semanticResources>
632 <semanticResources>java:/Objects/sun.util.locale.ParseStatus</semanticResources>
633 <semanticResources>java:/Objects/sun.util.locale.StringTokenIterator</semanticResources>
634 <semanticResources>java:/Objects/sun.util.locale.Extension</semanticResources>
635 <semanticResources>java:/Objects/java.io.OutputStreamWriter</semanticResources>
636 <semanticResources>java:/Objects/sun.nio.cs.StreamEncoder</semanticResources>
637 <semanticResources>java:/Objects/java.io.ObjectStreamConstants</semanticResources>
638 <semanticResources>java:/Objects/sun.misc.ObjectInputFilter</semanticResources>
639 <semanticResources>java:/Objects/java.io.ObjectInputValidation</semanticResources>
640 <semanticResources>java:/Objects/java.io.ObjectStreamClass</semanticResources>
641 <semanticResources>java:/Objects/sun.util.logging.PlatformLogger</semanticResources>
642 <semanticResources>java:/Objects/java.io.InvalidClassException</semanticResources>
643 <semanticResources>java:/Objects/java.io.Externalizable</semanticResources>
644 <semanticResources>java:/Objects/sun.misc.ObjectStreamClassValidator</semanticResources>
645 <semanticResources>java:/Objects/java.io.SerialCallbackContext</semanticResources>
646 <semanticResources>java:/Objects/java.io.SerializablePermission</semanticResources>
647 <semanticResources>java:/Objects/sun.reflect.annotation.AnnotationType</semanticResources>
648 <semanticResources>java:/Objects/sun.reflect.ConstantPool</semanticResources>
649 <semanticResources>java:/Objects/sun.reflect.generics.repository.ClassRepository</semanticResources>
650 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IQuerySpecification</semanticResources>
651 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryMatcher</semanticResources>
652 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQueryHeader</semanticResources>
653 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PQuery</semanticResources>
654 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngine</semanticResources>
655 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.QueryScope</semanticResources>
656 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation</semanticResources>
657 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter</semanticResources>
658 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility</semanticResources>
659 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IInputKey</semanticResources>
660 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection</semanticResources>
661 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PTraceable</semanticResources>
662 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PDisjunction</semanticResources>
663 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint</semanticResources>
664 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.PProblem</semanticResources>
665 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.TypeJudgement</semanticResources>
666 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PBody</semanticResources>
667 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PVariable</semanticResources>
668 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryMetaContext</semanticResources>
669 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.PConstraint</semanticResources>
670 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter</semanticResources>
671 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.InputKeyImplication</semanticResources>
672 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IPosetComparator</semanticResources>
673 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.Tuple</semanticResources>
674 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.AbstractTuple</semanticResources>
675 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.ITuple</semanticResources>
676 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.VariableDeferredPConstraint</semanticResources>
677 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.DeferredPConstraint</semanticResources>
678 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.SubPlan</semanticResources>
679 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.BasePConstraint</semanticResources>
680 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.operations.POperation</semanticResources>
681 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.QueryHintOption</semanticResources>
682 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendFactory</semanticResources>
683 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IMatcherCapability</semanticResources>
684 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryBackendContext</semanticResources>
685 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackend</semanticResources>
686 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryBackendHintProvider</semanticResources>
687 <semanticResources>java:/Objects/org.apache.log4j.Logger</semanticResources>
688 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.analysis.QueryAnalyzer</semanticResources>
689 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryCacheContext</semanticResources>
690 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryResultProviderAccess</semanticResources>
691 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryRuntimeContext</semanticResources>
692 <semanticResources>java:/Objects/org.apache.log4j.Category</semanticResources>
693 <semanticResources>java:/Objects/org.apache.log4j.spi.LoggerFactory</semanticResources>
694 <semanticResources>java:/Objects/org.apache.log4j.spi.AppenderAttachable</semanticResources>
695 <semanticResources>java:/Objects/org.apache.log4j.Appender</semanticResources>
696 <semanticResources>java:/Objects/org.apache.log4j.spi.LoggingEvent</semanticResources>
697 <semanticResources>java:/Objects/org.apache.log4j.Priority</semanticResources>
698 <semanticResources>java:/Objects/org.apache.log4j.spi.LoggerRepository</semanticResources>
699 <semanticResources>java:/Objects/org.apache.log4j.Level</semanticResources>
700 <semanticResources>java:/Objects/org.apache.log4j.helpers.AppenderAttachableImpl</semanticResources>
701 <semanticResources>java:/Objects/org.apache.log4j.spi.Filter</semanticResources>
702 <semanticResources>java:/Objects/org.apache.log4j.spi.ErrorHandler</semanticResources>
703 <semanticResources>java:/Objects/org.apache.log4j.Layout</semanticResources>
704 <semanticResources>java:/Objects/org.apache.log4j.spi.OptionHandler</semanticResources>
705 <semanticResources>java:/Objects/org.apache.log4j.spi.ThrowableInformation</semanticResources>
706 <semanticResources>java:/Objects/org.apache.log4j.spi.LocationInfo</semanticResources>
707 <semanticResources>java:/Objects/java.io.StringWriter</semanticResources>
708 <semanticResources>java:/Objects/org.apache.log4j.spi.HierarchyEventListener</semanticResources>
709 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IQueryResultProvider</semanticResources>
710 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.backend.IUpdateable</semanticResources>
711 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.TupleMask</semanticResources>
712 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.util.Accuracy</semanticResources>
713 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.tuple.IModifiableTuple</semanticResources>
714 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IQueryRuntimeContextListener</semanticResources>
715 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.context.IndexingService</semanticResources>
716 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.planning.QueryProcessingException</semanticResources>
717 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.ViatraQueryRuntimeException</semanticResources>
718 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IBaseIndex</semanticResources>
719 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions</semanticResources>
720 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.ViatraBaseIndexChangeListener</semanticResources>
721 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IIndexingErrorListener</semanticResources>
722 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IInstanceObserver</semanticResources>
723 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.internal.apiimpl.EngineContextFactory</semanticResources>
724 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.scope.IEngineContext</semanticResources>
725 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseMatcher</semanticResources>
726 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.internal.apiimpl.QueryResultWrapper</semanticResources>
727 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification</semanticResources>
728 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseQuerySpecification</semanticResources>
729 <semanticResources>java:/Objects/java.lang.ExceptionInInitializerError</semanticResources>
730 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.exception.ViatraQueryException</semanticResources>
731 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.QueryInitializationException</semanticResources>
732 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup</semanticResources>
733 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseQueryGroup</semanticResources>
734 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IQueryGroup</semanticResources>
735 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.AdvancedViatraQueryEngine</semanticResources>
736 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryEngineLifecycleListener</semanticResources>
737 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.IMatchUpdateListener</semanticResources>
738 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.ViatraQueryModelUpdateListener</semanticResources>
739 <semanticResources>java:/Objects/java.lang.Override</semanticResources>
740 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery</semanticResources>
741 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.queries.BasePQuery</semanticResources>
742 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EClassifier</semanticResources>
743 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EEnumLiteral</semanticResources>
744 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EStructuralFeature</semanticResources>
745 <semanticResources>java:/Objects/org.eclipse.emf.ecore.ENamedElement</semanticResources>
746 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EPackage</semanticResources>
747 <semanticResources>java:/Objects/org.eclipse.emf.common.util.EList</semanticResources>
748 <semanticResources>java:/Objects/org.eclipse.emf.ecore.ETypeParameter</semanticResources>
749 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EModelElement</semanticResources>
750 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EObject</semanticResources>
751 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EAnnotation</semanticResources>
752 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Notifier</semanticResources>
753 <semanticResources>java:/Objects/org.eclipse.emf.common.util.TreeIterator</semanticResources>
754 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EClass</semanticResources>
755 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EReference</semanticResources>
756 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EOperation</semanticResources>
757 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.Resource</semanticResources>
758 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Adapter</semanticResources>
759 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.Notification</semanticResources>
760 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EAttribute</semanticResources>
761 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EGenericType</semanticResources>
762 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EDataType</semanticResources>
763 <semanticResources>java:/Objects/org.eclipse.emf.ecore.InternalEObject</semanticResources>
764 <semanticResources>java:/Objects/org.eclipse.emf.common.CommonPlugin</semanticResources>
765 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.NotificationChain</semanticResources>
766 <semanticResources>java:/Objects/org.eclipse.emf.common.util.URI</semanticResources>
767 <semanticResources>java:/Objects/org.eclipse.emf.common.util.Pool</semanticResources>
768 <semanticResources>java:/Objects/org.eclipse.emf.common.util.SegmentSequence</semanticResources>
769 <semanticResources>java:/Objects/org.eclipse.emf.common.util.CommonUtil</semanticResources>
770 <semanticResources>java:/Objects/org.eclipse.emf.common.util.WeakInterningHashSet</semanticResources>
771 <semanticResources>java:/Objects/java.util.concurrent.locks.ReentrantReadWriteLock</semanticResources>
772 <semanticResources>java:/Objects/org.eclipse.emf.common.util.InterningSet</semanticResources>
773 <semanticResources>java:/Objects/java.util.concurrent.locks.ReadWriteLock</semanticResources>
774 <semanticResources>java:/Objects/java.lang.IllegalMonitorStateException</semanticResources>
775 <semanticResources>java:/Objects/org.eclipse.emf.common.EMFPlugin</semanticResources>
776 <semanticResources>java:/Objects/org.osgi.framework.BundleActivator</semanticResources>
777 <semanticResources>java:/Objects/org.eclipse.emf.common.util.ResourceLocator</semanticResources>
778 <semanticResources>java:/Objects/org.eclipse.emf.common.util.DelegatingResourceLocator</semanticResources>
779 <semanticResources>java:/Objects/org.eclipse.emf.common.util.Logger</semanticResources>
780 <semanticResources>java:/Objects/org.eclipse.core.runtime.Plugin</semanticResources>
781 <semanticResources>java:/Objects/org.eclipse.core.runtime.IPluginDescriptor</semanticResources>
782 <semanticResources>java:/Objects/org.osgi.framework.Bundle</semanticResources>
783 <semanticResources>java:/Objects/org.eclipse.core.runtime.ILog</semanticResources>
784 <semanticResources>java:/Objects/org.osgi.framework.BundleContext</semanticResources>
785 <semanticResources>java:/Objects/org.eclipse.core.runtime.IPath</semanticResources>
786 <semanticResources>java:/Objects/org.eclipse.osgi.service.debug.DebugOptions</semanticResources>
787 <semanticResources>java:/Objects/org.eclipse.core.runtime.Preferences</semanticResources>
788 <semanticResources>java:/Objects/java.lang.IllegalStateException</semanticResources>
789 <semanticResources>java:/Objects/org.eclipse.core.runtime.CoreException</semanticResources>
790 <semanticResources>java:/Objects/org.osgi.util.tracker.ServiceTracker</semanticResources>
791 <semanticResources>java:/Objects/org.eclipse.osgi.service.debug.DebugTrace</semanticResources>
792 <semanticResources>java:/Objects/java.util.EventListener</semanticResources>
793 <semanticResources>java:/Objects/java.util.EventObject</semanticResources>
794 <semanticResources>java:/Objects/org.eclipse.core.runtime.IStatus</semanticResources>
795 <semanticResources>java:/Objects/org.eclipse.core.runtime.ListenerList</semanticResources>
796 <semanticResources>java:/Objects/org.osgi.util.tracker.ServiceTrackerCustomizer</semanticResources>
797 <semanticResources>java:/Objects/org.osgi.framework.AllServiceListener</semanticResources>
798 <semanticResources>java:/Objects/org.osgi.util.tracker.AbstractTracked</semanticResources>
799 <semanticResources>java:/Objects/org.osgi.framework.ServiceReference</semanticResources>
800 <semanticResources>java:/Objects/org.osgi.framework.ServiceEvent</semanticResources>
801 <semanticResources>java:/Objects/org.osgi.framework.ServiceListener</semanticResources>
802 <semanticResources>java:/Objects/org.osgi.framework.Filter</semanticResources>
803 <semanticResources>java:/Objects/org.osgi.framework.InvalidSyntaxException</semanticResources>
804 <semanticResources>java:/Objects/org.eclipse.core.runtime.IExtension</semanticResources>
805 <semanticResources>java:/Objects/org.eclipse.core.runtime.IExtensionPoint</semanticResources>
806 <semanticResources>java:/Objects/org.eclipse.core.runtime.IPluginPrerequisite</semanticResources>
807 <semanticResources>java:/Objects/org.eclipse.core.runtime.ILibrary</semanticResources>
808 <semanticResources>java:/Objects/org.eclipse.core.runtime.PluginVersionIdentifier</semanticResources>
809 <semanticResources>java:/Objects/org.eclipse.core.runtime.InvalidRegistryObjectException</semanticResources>
810 <semanticResources>java:/Objects/org.eclipse.core.runtime.IConfigurationElement</semanticResources>
811 <semanticResources>java:/Objects/org.eclipse.core.runtime.IContributor</semanticResources>
812 <semanticResources>java:/Objects/org.osgi.framework.Version</semanticResources>
813 <semanticResources>java:/Objects/org.osgi.framework.BundleException</semanticResources>
814 <semanticResources>java:/Objects/org.eclipse.core.runtime.ILogListener</semanticResources>
815 <semanticResources>java:/Objects/org.osgi.framework.BundleReference</semanticResources>
816 <semanticResources>java:/Objects/org.osgi.framework.BundleListener</semanticResources>
817 <semanticResources>java:/Objects/org.osgi.framework.FrameworkListener</semanticResources>
818 <semanticResources>java:/Objects/org.osgi.framework.ServiceObjects</semanticResources>
819 <semanticResources>java:/Objects/org.osgi.framework.ServiceRegistration</semanticResources>
820 <semanticResources>java:/Objects/org.osgi.framework.ServiceFactory</semanticResources>
821 <semanticResources>java:/Objects/org.osgi.framework.BundleEvent</semanticResources>
822 <semanticResources>java:/Objects/org.osgi.framework.FrameworkEvent</semanticResources>
823 <semanticResources>java:/Objects/org.eclipse.emf.ecore.ETypedElement</semanticResources>
824 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EParameter</semanticResources>
825 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.ResourceSet</semanticResources>
826 <semanticResources>java:/Objects/org.eclipse.emf.common.notify.AdapterFactory</semanticResources>
827 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.URIConverter</semanticResources>
828 <semanticResources>java:/Objects/java.io.InputStreamReader</semanticResources>
829 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.ContentHandler</semanticResources>
830 <semanticResources>java:/Objects/org.eclipse.emf.ecore.resource.URIHandler</semanticResources>
831 <semanticResources>java:/Objects/sun.nio.cs.StreamDecoder</semanticResources>
832 <semanticResources>java:/Objects/java.io.FileInputStream</semanticResources>
833 <semanticResources>java:/Objects/org.eclipse.emf.common.util.EMap</semanticResources>
834 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EFactory</semanticResources>
835 <semanticResources>java:/Objects/org.eclipse.emf.common.util.Enumerator</semanticResources>
836 <semanticResources>java:/Objects/org.eclipse.emf.ecore.EEnum</semanticResources>
837 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.FeatureMap</semanticResources>
838 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.InternalEList</semanticResources>
839 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.EContentsEList</semanticResources>
840 <semanticResources>java:/Objects/org.eclipse.emf.ecore.util.AbstractSequentialInternalEList</semanticResources>
841 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem</semanticResources>
842 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType</semanticResources>
843 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance</semanticResources>
844 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.HostType</semanticResources>
845 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance</semanticResources>
846 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.Request</semanticResources>
847 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement</semanticResources>
848 <semanticResources>java:/Objects/hu.bme.mit.inf.dslreasoner.domains.cps.Requirement</semanticResources>
849 <semanticResources>java:/Objects/java.lang.SuppressWarnings</semanticResources>
850 <semanticResources>java:/Objects/javax.annotation.Generated</semanticResources>
851 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.GenericPatternMatcher</semanticResources>
852 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.GenericPatternMatch</semanticResources>
853 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.GenericQuerySpecification</semanticResources>
854 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher</semanticResources>
855 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.aggregators.sum</semanticResources>
856 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.AggregatorType</semanticResources>
857 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.IAggregatorFactory</semanticResources>
858 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.BoundAggregator</semanticResources>
859 <semanticResources>java:/Objects/java.lang.annotation.Inherited</semanticResources>
860 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.psystem.aggregations.IMultisetAggregationOperator</semanticResources>
861 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ArrayLiterals</semanticResources>
862 <semanticResources>java:/Objects/com.google.common.annotations.GwtCompatible</semanticResources>
863 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Pure</semanticResources>
864 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Inline</semanticResources>
865 <semanticResources>java:/Objects/com.google.common.annotations.Beta</semanticResources>
866 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CollectionLiterals</semanticResources>
867 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Pair</semanticResources>
868 <semanticResources>java:/Objects/java.util.LinkedHashSet</semanticResources>
869 <semanticResources>java:/Objects/java.util.TreeMap</semanticResources>
870 <semanticResources>java:/Objects/java.util.TreeSet</semanticResources>
871 <semanticResources>java:/Objects/java.util.NavigableMap</semanticResources>
872 <semanticResources>java:/Objects/java.util.NavigableSet</semanticResources>
873 <semanticResources>java:/Objects/java.util.SortedSet</semanticResources>
874 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.InputOutput</semanticResources>
875 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ArrayExtensions</semanticResources>
876 <semanticResources>java:/Objects/com.google.common.annotations.GwtIncompatible</semanticResources>
877 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BigDecimalExtensions</semanticResources>
878 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BigIntegerExtensions</semanticResources>
879 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.BooleanExtensions</semanticResources>
880 <semanticResources>java:/Objects/com.google.common.primitives.Booleans</semanticResources>
881 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ByteExtensions</semanticResources>
882 <semanticResources>java:/Objects/java.lang.Math</semanticResources>
883 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CharacterExtensions</semanticResources>
884 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.CollectionExtensions</semanticResources>
885 <semanticResources>java:/Objects/com.google.common.collect.Iterables</semanticResources>
886 <semanticResources>java:/Objects/com.google.common.collect.ImmutableList</semanticResources>
887 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSet</semanticResources>
888 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedSet</semanticResources>
889 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMap</semanticResources>
890 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedMap</semanticResources>
891 <semanticResources>java:/Objects/java.util.Collections</semanticResources>
892 <semanticResources>java:/Objects/com.google.common.collect.FluentIterable</semanticResources>
893 <semanticResources>java:/Objects/com.google.common.base.Predicate</semanticResources>
894 <semanticResources>java:/Objects/com.google.common.base.Function</semanticResources>
895 <semanticResources>java:/Objects/com.google.common.base.Optional</semanticResources>
896 <semanticResources>java:/Objects/com.google.common.collect.ImmutableCollection</semanticResources>
897 <semanticResources>java:/Objects/com.google.common.collect.ImmutableListMultimap</semanticResources>
898 <semanticResources>java:/Objects/com.google.common.base.Joiner</semanticResources>
899 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMultiset</semanticResources>
900 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMultimap</semanticResources>
901 <semanticResources>java:/Objects/com.google.common.collect.ListMultimap</semanticResources>
902 <semanticResources>java:/Objects/com.google.common.collect.Multimap</semanticResources>
903 <semanticResources>java:/Objects/com.google.common.collect.AbstractMultimap</semanticResources>
904 <semanticResources>java:/Objects/com.google.common.collect.UnmodifiableIterator</semanticResources>
905 <semanticResources>java:/Objects/com.google.common.collect.Serialization</semanticResources>
906 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSetMultimap</semanticResources>
907 <semanticResources>java:/Objects/com.google.common.collect.Multiset</semanticResources>
908 <semanticResources>java:/Objects/com.google.common.collect.Multimaps</semanticResources>
909 <semanticResources>java:/Objects/com.google.common.collect.Maps</semanticResources>
910 <semanticResources>java:/Objects/com.google.common.collect.AbstractListMultimap</semanticResources>
911 <semanticResources>java:/Objects/com.google.common.base.Supplier</semanticResources>
912 <semanticResources>java:/Objects/com.google.common.collect.AbstractMapBasedMultimap</semanticResources>
913 <semanticResources>java:/Objects/com.google.common.collect.AbstractSetMultimap</semanticResources>
914 <semanticResources>java:/Objects/com.google.common.collect.AbstractSortedSetMultimap</semanticResources>
915 <semanticResources>java:/Objects/com.google.common.collect.AbstractMultiset</semanticResources>
916 <semanticResources>java:/Objects/com.google.common.collect.Multisets</semanticResources>
917 <semanticResources>java:/Objects/com.google.common.collect.SetMultimap</semanticResources>
918 <semanticResources>java:/Objects/com.google.common.collect.ForwardingMultimap</semanticResources>
919 <semanticResources>java:/Objects/com.google.common.collect.SortedSetMultimap</semanticResources>
920 <semanticResources>java:/Objects/com.google.common.collect.FilteredMultimap</semanticResources>
921 <semanticResources>java:/Objects/com.google.common.collect.FilteredSetMultimap</semanticResources>
922 <semanticResources>java:/Objects/java.util.EnumMap</semanticResources>
923 <semanticResources>java:/Objects/com.google.common.base.Converter</semanticResources>
924 <semanticResources>java:/Objects/com.google.common.collect.BiMap</semanticResources>
925 <semanticResources>java:/Objects/com.google.common.collect.ForwardingMap</semanticResources>
926 <semanticResources>java:/Objects/com.google.common.collect.Ordering</semanticResources>
927 <semanticResources>java:/Objects/com.google.common.collect.Sets</semanticResources>
928 <semanticResources>java:/Objects/com.google.common.collect.ForwardingSet</semanticResources>
929 <semanticResources>java:/Objects/com.google.common.collect.AbstractNavigableMap</semanticResources>
930 <semanticResources>java:/Objects/com.google.common.collect.MapDifference</semanticResources>
931 <semanticResources>java:/Objects/com.google.common.collect.SortedMapDifference</semanticResources>
932 <semanticResources>java:/Objects/com.google.common.collect.ForwardingCollection</semanticResources>
933 <semanticResources>java:/Objects/com.google.common.collect.ForwardingSortedMap</semanticResources>
934 <semanticResources>java:/Objects/com.google.common.base.Equivalence</semanticResources>
935 <semanticResources>java:/Objects/java.util.IdentityHashMap</semanticResources>
936 <semanticResources>java:/Objects/com.google.common.collect.Range</semanticResources>
937 <semanticResources>java:/Objects/com.google.common.collect.ForwardingObject</semanticResources>
938 <semanticResources>java:/Objects/com.google.common.annotations.VisibleForTesting</semanticResources>
939 <semanticResources>java:/Objects/java.util.EnumSet</semanticResources>
940 <semanticResources>java:/Objects/com.google.common.collect.CartesianList</semanticResources>
941 <semanticResources>java:/Objects/com.google.common.collect.ForwardingNavigableSet</semanticResources>
942 <semanticResources>java:/Objects/com.google.common.collect.Collections2</semanticResources>
943 <semanticResources>java:/Objects/com.google.common.collect.ForwardingSortedSet</semanticResources>
944 <semanticResources>java:/Objects/java.util.concurrent.CopyOnWriteArraySet</semanticResources>
945 <semanticResources>java:/Objects/com.google.common.collect.AbstractIterator</semanticResources>
946 <semanticResources>java:/Objects/java.util.concurrent.CopyOnWriteArrayList</semanticResources>
947 <semanticResources>java:/Objects/java.util.function.BiPredicate</semanticResources>
948 <semanticResources>java:/Objects/com.google.common.collect.Cut</semanticResources>
949 <semanticResources>java:/Objects/com.google.common.collect.DiscreteDomain</semanticResources>
950 <semanticResources>java:/Objects/com.google.common.collect.BoundType</semanticResources>
951 <semanticResources>java:/Objects/com.google.common.collect.ForwardingMultiset</semanticResources>
952 <semanticResources>java:/Objects/com.google.common.collect.SortedMultiset</semanticResources>
953 <semanticResources>java:/Objects/com.google.common.collect.SortedMultisetBridge</semanticResources>
954 <semanticResources>java:/Objects/com.google.common.collect.SortedIterable</semanticResources>
955 <semanticResources>java:/Objects/com.google.common.collect.UnmodifiableListIterator</semanticResources>
956 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedSetFauxverideShim</semanticResources>
957 <semanticResources>java:/Objects/com.google.common.collect.RegularImmutableSortedSet</semanticResources>
958 <semanticResources>java:/Objects/com.google.common.collect.ImmutableMapEntry</semanticResources>
959 <semanticResources>java:/Objects/com.google.common.collect.ImmutableEntry</semanticResources>
960 <semanticResources>java:/Objects/com.google.common.collect.AbstractMapEntry</semanticResources>
961 <semanticResources>java:/Objects/com.google.common.collect.ImmutableSortedMapFauxverideShim</semanticResources>
962 <semanticResources>java:/Objects/java.util.AbstractQueue</semanticResources>
963 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ComparableExtensions</semanticResources>
964 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.DoubleExtensions</semanticResources>
965 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.FloatExtensions</semanticResources>
966 <semanticResources>java:/Objects/java.lang.Float</semanticResources>
967 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.FunctionExtensions</semanticResources>
968 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Functions</semanticResources>
969 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.Procedures</semanticResources>
970 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IntegerExtensions</semanticResources>
971 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ExclusiveRange</semanticResources>
972 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IntegerRange</semanticResources>
973 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IterableExtensions</semanticResources>
974 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.IteratorExtensions</semanticResources>
975 <semanticResources>java:/Objects/com.google.common.collect.Iterators</semanticResources>
976 <semanticResources>java:/Objects/com.google.common.collect.MultitransformedIterator</semanticResources>
977 <semanticResources>java:/Objects/com.google.common.collect.PeekingIterator</semanticResources>
978 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ListExtensions</semanticResources>
979 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.LongExtensions</semanticResources>
980 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.MapExtensions</semanticResources>
981 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.internal.UnmodifiableMergingMapView</semanticResources>
982 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ObjectExtensions</semanticResources>
983 <semanticResources>java:/Objects/com.google.common.base.Objects</semanticResources>
984 <semanticResources>java:/Objects/com.google.common.base.ExtraObjectsMethodsForWeb</semanticResources>
985 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ProcedureExtensions</semanticResources>
986 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.ShortExtensions</semanticResources>
987 <semanticResources>java:/Objects/java.lang.Short</semanticResources>
988 <semanticResources>java:/Objects/org.eclipse.xtext.xbase.lib.StringExtensions</semanticResources>
989 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.aggregators.count</semanticResources>
990 <semanticResources>java:/Objects/org.eclipse.viatra.query.runtime.matchers.aggregators.avg</semanticResources>
991 <ownedViews xmi:type="viewpoint:DView" uid="_kSYZgFvMEemLJtrAOuDPFQ">
992 <viewpoint xmi:type="description:Viewpoint" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']"/>
993 <ownedRepresentationDescriptors xmi:type="viewpoint:DRepresentationDescriptor" uid="_kTNf8FvMEemLJtrAOuDPFQ" name="cps" repPath="#_kSw0AFvMEemLJtrAOuDPFQ">
994 <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
995 <target xmi:type="ecore:EPackage" href="cps.ecore#/"/>
996 </ownedRepresentationDescriptors>
997 </ownedViews>
998 </viewpoint:DAnalysis>
999 <diagram:DSemanticDiagram uid="_kSw0AFvMEemLJtrAOuDPFQ" name="cps">
1000 <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_kTLqwFvMEemLJtrAOuDPFQ" source="DANNOTATION_CUSTOMIZATION_KEY">
1001 <data xmi:type="diagram:ComputedStyleDescriptionRegistry" uid="_kTLqwVvMEemLJtrAOuDPFQ">
1002 <computedStyleDescriptions xmi:type="style:BundledImageDescription" xmi:id="_-5WboFvNEemLJtrAOuDPFQ" labelExpression="service:render" labelAlignment="LEFT" tooltipExpression="service:renderTooltip" sizeComputationExpression="1">
1003 <borderColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1004 <labelFormat>bold</labelFormat>
1005 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1006 <color xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1007 </computedStyleDescriptions>
1008 <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_CU6KQFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan">
1009 <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1010 <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_CU6KQVvTEemLJtrAOuDPFQ" showIcon="false" labelExpression="service:render">
1011 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1012 </centerLabelStyleDescription>
1013 <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_CU6KQlvTEemLJtrAOuDPFQ" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel">
1014 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
1015 </endLabelStyleDescription>
1016 </computedStyleDescriptions>
1017 <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_KkeMsFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan">
1018 <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1019 <beginLabelStyleDescription xmi:type="style:BeginLabelStyleDescription" xmi:id="_KkeMsVvTEemLJtrAOuDPFQ" showIcon="false" labelExpression="service:renderEOpposite">
1020 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1021 </beginLabelStyleDescription>
1022 <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_KkeMslvTEemLJtrAOuDPFQ" showIcon="false" labelExpression="service:render">
1023 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1024 </endLabelStyleDescription>
1025 </computedStyleDescriptions>
1026 <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_PIc4wFvUEemLJtrAOuDPFQ" routingStyle="manhattan">
1027 <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1028 <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_PIc4wVvUEemLJtrAOuDPFQ" showIcon="false" labelExpression="service:render">
1029 <labelFormat>bold</labelFormat>
1030 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1031 </centerLabelStyleDescription>
1032 <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_PIc4wlvUEemLJtrAOuDPFQ" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel">
1033 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
1034 </endLabelStyleDescription>
1035 </computedStyleDescriptions>
1036 <computedStyleDescriptions xmi:type="style:BundledImageDescription" xmi:id="_8rRg4lvVEemLJtrAOuDPFQ" labelExpression="service:render" labelAlignment="LEFT" tooltipExpression="service:renderTooltip" sizeComputationExpression="1">
1037 <borderColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1038 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
1039 <color xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1040 </computedStyleDescriptions>
1041 <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_QukvxlvZEemLJtrAOuDPFQ" routingStyle="manhattan">
1042 <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='blue']"/>
1043 <centerLabelStyleDescription xmi:type="style:CenterLabelStyleDescription" xmi:id="_Qukvx1vZEemLJtrAOuDPFQ" showIcon="false" labelExpression="service:render">
1044 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
1045 </centerLabelStyleDescription>
1046 <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_QukvyFvZEemLJtrAOuDPFQ" labelSize="6" showIcon="false" labelExpression="service:eKeysLabel">
1047 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='dark_blue']"/>
1048 </endLabelStyleDescription>
1049 </computedStyleDescriptions>
1050 <computedStyleDescriptions xmi:type="style:EdgeStyleDescription" xmi:id="_5GJwsHcmEemo29BzW_RHcw" sourceArrow="InputArrow" routingStyle="manhattan">
1051 <strokeColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1052 <beginLabelStyleDescription xmi:type="style:BeginLabelStyleDescription" xmi:id="_5GJwsXcmEemo29BzW_RHcw" showIcon="false" labelExpression="service:renderEOpposite">
1053 <labelFormat>bold</labelFormat>
1054 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1055 </beginLabelStyleDescription>
1056 <endLabelStyleDescription xmi:type="style:EndLabelStyleDescription" xmi:id="_5GJwsncmEemo29BzW_RHcw" showIcon="false" labelExpression="service:render">
1057 <labelFormat>bold</labelFormat>
1058 <labelColor xmi:type="description:SystemColor" href="environment:/viewpoint#//@systemColors/@entries[name='black']"/>
1059 </endLabelStyleDescription>
1060 </computedStyleDescriptions>
1061 </data>
1062 </ownedAnnotationEntries>
1063 <ownedAnnotationEntries xmi:type="description:AnnotationEntry" uid="_kTOHAFvMEemLJtrAOuDPFQ" source="GMF_DIAGRAMS">
1064 <data xmi:type="notation:Diagram" xmi:id="_kTOHAVvMEemLJtrAOuDPFQ" type="Sirius" element="_kSw0AFvMEemLJtrAOuDPFQ" measurementUnit="Pixel">
1065 <children xmi:type="notation:Node" xmi:id="_IuOrgFvNEemLJtrAOuDPFQ" type="2003" element="_Itg50FvNEemLJtrAOuDPFQ">
1066 <children xmi:type="notation:Node" xmi:id="_IuS88FvNEemLJtrAOuDPFQ" type="5007"/>
1067 <children xmi:type="notation:Node" xmi:id="_IuWnUFvNEemLJtrAOuDPFQ" type="7004">
1068 <styles xmi:type="notation:SortingStyle" xmi:id="_IuWnUVvNEemLJtrAOuDPFQ"/>
1069 <styles xmi:type="notation:FilteringStyle" xmi:id="_IuWnUlvNEemLJtrAOuDPFQ"/>
1070 </children>
1071 <styles xmi:type="notation:ShapeStyle" xmi:id="_IuOrgVvNEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1072 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_IuOrglvNEemLJtrAOuDPFQ" x="503" y="30" width="138" height="100"/>
1073 </children>
1074 <children xmi:type="notation:Node" xmi:id="_8icOoFvNEemLJtrAOuDPFQ" type="2003" element="_8iM-EFvNEemLJtrAOuDPFQ">
1075 <children xmi:type="notation:Node" xmi:id="_8idcwFvNEemLJtrAOuDPFQ" type="5007"/>
1076 <children xmi:type="notation:Node" xmi:id="_8idcwVvNEemLJtrAOuDPFQ" type="7004">
1077 <styles xmi:type="notation:SortingStyle" xmi:id="_8idcwlvNEemLJtrAOuDPFQ"/>
1078 <styles xmi:type="notation:FilteringStyle" xmi:id="_8idcw1vNEemLJtrAOuDPFQ"/>
1079 </children>
1080 <styles xmi:type="notation:ShapeStyle" xmi:id="_8icOoVvNEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1081 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_8icOolvNEemLJtrAOuDPFQ" x="270" y="210" width="120" height="100"/>
1082 </children>
1083 <children xmi:type="notation:Node" xmi:id="_FZ9o8FvOEemLJtrAOuDPFQ" type="2003" element="_FZ1GEFvOEemLJtrAOuDPFQ">
1084 <children xmi:type="notation:Node" xmi:id="_FZ9o81vOEemLJtrAOuDPFQ" type="5007"/>
1085 <children xmi:type="notation:Node" xmi:id="_FZ-QAFvOEemLJtrAOuDPFQ" type="7004">
1086 <children xmi:type="notation:Node" xmi:id="_XxoccFvREemLJtrAOuDPFQ" type="3010" element="_Xxc2QFvREemLJtrAOuDPFQ">
1087 <styles xmi:type="notation:FontStyle" xmi:id="_XxoccVvREemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1088 <layoutConstraint xmi:type="notation:Location" xmi:id="_XxocclvREemLJtrAOuDPFQ"/>
1089 </children>
1090 <children xmi:type="notation:Node" xmi:id="_bL_qgFvREemLJtrAOuDPFQ" type="3010" element="_bLzdQFvREemLJtrAOuDPFQ">
1091 <styles xmi:type="notation:FontStyle" xmi:id="_bL_qgVvREemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1092 <layoutConstraint xmi:type="notation:Location" xmi:id="_bL_qglvREemLJtrAOuDPFQ"/>
1093 </children>
1094 <children xmi:type="notation:Node" xmi:id="_4TdfwHc3Eemo29BzW_RHcw" type="3010" element="_4TQEYHc3Eemo29BzW_RHcw">
1095 <styles xmi:type="notation:FontStyle" xmi:id="_4TdfwXc3Eemo29BzW_RHcw" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1096 <layoutConstraint xmi:type="notation:Location" xmi:id="_4Tdfwnc3Eemo29BzW_RHcw"/>
1097 </children>
1098 <styles xmi:type="notation:SortingStyle" xmi:id="_FZ-QAVvOEemLJtrAOuDPFQ"/>
1099 <styles xmi:type="notation:FilteringStyle" xmi:id="_FZ-QAlvOEemLJtrAOuDPFQ"/>
1100 </children>
1101 <styles xmi:type="notation:ShapeStyle" xmi:id="_FZ9o8VvOEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1102 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_FZ9o8lvOEemLJtrAOuDPFQ" x="750" y="210" width="153" height="100"/>
1103 </children>
1104 <children xmi:type="notation:Node" xmi:id="_jfOE8FvREemLJtrAOuDPFQ" type="2003" element="_jfFiEFvREemLJtrAOuDPFQ">
1105 <children xmi:type="notation:Node" xmi:id="_jfOE81vREemLJtrAOuDPFQ" type="5007"/>
1106 <children xmi:type="notation:Node" xmi:id="_jfOE9FvREemLJtrAOuDPFQ" type="7004">
1107 <styles xmi:type="notation:SortingStyle" xmi:id="_jfOE9VvREemLJtrAOuDPFQ"/>
1108 <styles xmi:type="notation:FilteringStyle" xmi:id="_jfOE9lvREemLJtrAOuDPFQ"/>
1109 </children>
1110 <styles xmi:type="notation:ShapeStyle" xmi:id="_jfOE8VvREemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1111 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jfOE8lvREemLJtrAOuDPFQ" x="30" y="30" width="120" height="100"/>
1112 </children>
1113 <children xmi:type="notation:Node" xmi:id="_p1JFMFvREemLJtrAOuDPFQ" type="2003" element="_p05NkFvREemLJtrAOuDPFQ">
1114 <children xmi:type="notation:Node" xmi:id="_p1JsQFvREemLJtrAOuDPFQ" type="5007"/>
1115 <children xmi:type="notation:Node" xmi:id="_p1JsQVvREemLJtrAOuDPFQ" type="7004">
1116 <children xmi:type="notation:Node" xmi:id="_NsXKsFvTEemLJtrAOuDPFQ" type="3010" element="_Nr-JIFvTEemLJtrAOuDPFQ">
1117 <styles xmi:type="notation:FontStyle" xmi:id="_NsXKsVvTEemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1118 <layoutConstraint xmi:type="notation:Location" xmi:id="_NsXKslvTEemLJtrAOuDPFQ"/>
1119 </children>
1120 <styles xmi:type="notation:SortingStyle" xmi:id="_p1JsQlvREemLJtrAOuDPFQ"/>
1121 <styles xmi:type="notation:FilteringStyle" xmi:id="_p1JsQ1vREemLJtrAOuDPFQ"/>
1122 </children>
1123 <styles xmi:type="notation:ShapeStyle" xmi:id="_p1JFMVvREemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1124 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_p1JFMlvREemLJtrAOuDPFQ" x="30" y="210" width="120" height="100"/>
1125 </children>
1126 <children xmi:type="notation:Node" xmi:id="_vI6r8FvREemLJtrAOuDPFQ" type="2003" element="_vIvs0FvREemLJtrAOuDPFQ">
1127 <children xmi:type="notation:Node" xmi:id="_vI7TAFvREemLJtrAOuDPFQ" type="5007"/>
1128 <children xmi:type="notation:Node" xmi:id="_vI7TAVvREemLJtrAOuDPFQ" type="7004">
1129 <styles xmi:type="notation:SortingStyle" xmi:id="_vI7TAlvREemLJtrAOuDPFQ"/>
1130 <styles xmi:type="notation:FilteringStyle" xmi:id="_vI7TA1vREemLJtrAOuDPFQ"/>
1131 </children>
1132 <styles xmi:type="notation:ShapeStyle" xmi:id="_vI6r8VvREemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1133 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_vI6r8lvREemLJtrAOuDPFQ" x="261" y="390" width="138" height="100"/>
1134 </children>
1135 <children xmi:type="notation:Node" xmi:id="_PdzIkFvSEemLJtrAOuDPFQ" type="2003" element="_PdlGIFvSEemLJtrAOuDPFQ">
1136 <children xmi:type="notation:Node" xmi:id="_PdzvoFvSEemLJtrAOuDPFQ" type="5007"/>
1137 <children xmi:type="notation:Node" xmi:id="_PdzvoVvSEemLJtrAOuDPFQ" type="7004">
1138 <children xmi:type="notation:Node" xmi:id="_ReTnwFvSEemLJtrAOuDPFQ" type="3010" element="_ReIBkFvSEemLJtrAOuDPFQ">
1139 <styles xmi:type="notation:FontStyle" xmi:id="_ReTnwVvSEemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1140 <layoutConstraint xmi:type="notation:Location" xmi:id="_ReTnwlvSEemLJtrAOuDPFQ"/>
1141 </children>
1142 <children xmi:type="notation:Node" xmi:id="_S48ZwFvSEemLJtrAOuDPFQ" type="3010" element="_S4npoFvSEemLJtrAOuDPFQ">
1143 <styles xmi:type="notation:FontStyle" xmi:id="_S48ZwVvSEemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1144 <layoutConstraint xmi:type="notation:Location" xmi:id="_S48ZwlvSEemLJtrAOuDPFQ"/>
1145 </children>
1146 <styles xmi:type="notation:SortingStyle" xmi:id="_PdzvolvSEemLJtrAOuDPFQ"/>
1147 <styles xmi:type="notation:FilteringStyle" xmi:id="_Pdzvo1vSEemLJtrAOuDPFQ"/>
1148 </children>
1149 <styles xmi:type="notation:ShapeStyle" xmi:id="_PdzIkVvSEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1150 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PdzIklvSEemLJtrAOuDPFQ" x="495" y="210" width="153" height="100"/>
1151 </children>
1152 <children xmi:type="notation:Node" xmi:id="_UoYsMFvUEemLJtrAOuDPFQ" type="2003" element="_UoGYUFvUEemLJtrAOuDPFQ">
1153 <children xmi:type="notation:Node" xmi:id="_UoZTQFvUEemLJtrAOuDPFQ" type="5007"/>
1154 <children xmi:type="notation:Node" xmi:id="_UoZTQVvUEemLJtrAOuDPFQ" type="7004">
1155 <children xmi:type="notation:Node" xmi:id="_jPSrMFvUEemLJtrAOuDPFQ" type="3010" element="_jO97EFvUEemLJtrAOuDPFQ">
1156 <styles xmi:type="notation:FontStyle" xmi:id="_jPSrMVvUEemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1157 <layoutConstraint xmi:type="notation:Location" xmi:id="_jPSrMlvUEemLJtrAOuDPFQ"/>
1158 </children>
1159 <children xmi:type="notation:Node" xmi:id="_lZeDwFvUEemLJtrAOuDPFQ" type="3010" element="_lZB-4FvUEemLJtrAOuDPFQ">
1160 <styles xmi:type="notation:FontStyle" xmi:id="_lZeDwVvUEemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1161 <layoutConstraint xmi:type="notation:Location" xmi:id="_lZeDwlvUEemLJtrAOuDPFQ"/>
1162 </children>
1163 <children xmi:type="notation:Node" xmi:id="_n0xokFvUEemLJtrAOuDPFQ" type="3010" element="_n0acMFvUEemLJtrAOuDPFQ">
1164 <styles xmi:type="notation:FontStyle" xmi:id="_n0xokVvUEemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1165 <layoutConstraint xmi:type="notation:Location" xmi:id="_n0xoklvUEemLJtrAOuDPFQ"/>
1166 </children>
1167 <children xmi:type="notation:Node" xmi:id="_pHqMwFvUEemLJtrAOuDPFQ" type="3010" element="_pHVcoFvUEemLJtrAOuDPFQ">
1168 <styles xmi:type="notation:FontStyle" xmi:id="_pHqMwVvUEemLJtrAOuDPFQ" fontColor="2697711" fontName="Noto Sans" fontHeight="8"/>
1169 <layoutConstraint xmi:type="notation:Location" xmi:id="_pHqMwlvUEemLJtrAOuDPFQ"/>
1170 </children>
1171 <styles xmi:type="notation:SortingStyle" xmi:id="_UoZTQlvUEemLJtrAOuDPFQ"/>
1172 <styles xmi:type="notation:FilteringStyle" xmi:id="_UoZTQ1vUEemLJtrAOuDPFQ"/>
1173 </children>
1174 <styles xmi:type="notation:ShapeStyle" xmi:id="_UoYsMVvUEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1175 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_UoYsMlvUEemLJtrAOuDPFQ" x="750" y="390" width="153" height="100"/>
1176 </children>
1177 <styles xmi:type="notation:DiagramStyle" xmi:id="_kTOHAlvMEemLJtrAOuDPFQ"/>
1178 <edges xmi:type="notation:Edge" xmi:id="_CVagkFvTEemLJtrAOuDPFQ" type="4001" element="_CU3uAFvTEemLJtrAOuDPFQ" source="_IuOrgFvNEemLJtrAOuDPFQ" target="_jfOE8FvREemLJtrAOuDPFQ">
1179 <children xmi:type="notation:Node" xmi:id="_CVcVwFvTEemLJtrAOuDPFQ" type="6001">
1180 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_CVcVwVvTEemLJtrAOuDPFQ" x="-3" y="11"/>
1181 </children>
1182 <children xmi:type="notation:Node" xmi:id="_CVc80FvTEemLJtrAOuDPFQ" type="6002">
1183 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_CVc80VvTEemLJtrAOuDPFQ" x="109" y="10"/>
1184 </children>
1185 <children xmi:type="notation:Node" xmi:id="_CVdj4FvTEemLJtrAOuDPFQ" type="6003">
1186 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_CVdj4VvTEemLJtrAOuDPFQ" x="19" y="10"/>
1187 </children>
1188 <styles xmi:type="notation:ConnectorStyle" xmi:id="_CVbHoFvTEemLJtrAOuDPFQ" routing="Rectilinear"/>
1189 <styles xmi:type="notation:FontStyle" xmi:id="_CVbHoVvTEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1190 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_CVbHolvTEemLJtrAOuDPFQ" points="[0, 0, 355, 0]$[-355, 0, 0, 0]"/>
1191 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_CVicYFvTEemLJtrAOuDPFQ" id="(0.0,0.5)"/>
1192 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_CVicYVvTEemLJtrAOuDPFQ" id="(1.0,0.5)"/>
1193 </edges>
1194 <edges xmi:type="notation:Edge" xmi:id="_IODu8FvTEemLJtrAOuDPFQ" type="4001" element="_INyCIFvTEemLJtrAOuDPFQ" source="_jfOE8FvREemLJtrAOuDPFQ" target="_p1JFMFvREemLJtrAOuDPFQ">
1195 <children xmi:type="notation:Node" xmi:id="_IODu9FvTEemLJtrAOuDPFQ" type="6001">
1196 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_IODu9VvTEemLJtrAOuDPFQ" y="-10"/>
1197 </children>
1198 <children xmi:type="notation:Node" xmi:id="_IODu9lvTEemLJtrAOuDPFQ" type="6002">
1199 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_IODu91vTEemLJtrAOuDPFQ" x="3" y="-50"/>
1200 </children>
1201 <children xmi:type="notation:Node" xmi:id="_IOEWAFvTEemLJtrAOuDPFQ" type="6003">
1202 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_IOEWAVvTEemLJtrAOuDPFQ" x="-10" y="-62"/>
1203 </children>
1204 <styles xmi:type="notation:ConnectorStyle" xmi:id="_IODu8VvTEemLJtrAOuDPFQ" routing="Rectilinear"/>
1205 <styles xmi:type="notation:FontStyle" xmi:id="_IODu8lvTEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1206 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_IODu81vTEemLJtrAOuDPFQ" points="[0, 0, 0, -82]$[0, 82, 0, 0]"/>
1207 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_IOEWAlvTEemLJtrAOuDPFQ" id="(0.5,1.0)"/>
1208 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_IOEWA1vTEemLJtrAOuDPFQ" id="(0.5,0.0)"/>
1209 </edges>
1210 <edges xmi:type="notation:Edge" xmi:id="_XdMLkFvTEemLJtrAOuDPFQ" type="4001" element="_Xc3bc1vTEemLJtrAOuDPFQ" source="_p1JFMFvREemLJtrAOuDPFQ" target="_8icOoFvNEemLJtrAOuDPFQ">
1211 <children xmi:type="notation:Node" xmi:id="_XdMLlFvTEemLJtrAOuDPFQ" type="6001">
1212 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XdMLlVvTEemLJtrAOuDPFQ" x="-19" y="-11"/>
1213 </children>
1214 <children xmi:type="notation:Node" xmi:id="_XdMLllvTEemLJtrAOuDPFQ" type="6002">
1215 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XdMLl1vTEemLJtrAOuDPFQ" y="10"/>
1216 </children>
1217 <children xmi:type="notation:Node" xmi:id="_XdMyoFvTEemLJtrAOuDPFQ" type="6003">
1218 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_XdMyoVvTEemLJtrAOuDPFQ" y="10"/>
1219 </children>
1220 <styles xmi:type="notation:ConnectorStyle" xmi:id="_XdMLkVvTEemLJtrAOuDPFQ" routing="Rectilinear"/>
1221 <styles xmi:type="notation:FontStyle" xmi:id="_XdMLklvTEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1222 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_XdMLk1vTEemLJtrAOuDPFQ" points="[0, 0, -122, 0]$[122, 0, 0, 0]"/>
1223 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_XdMyolvTEemLJtrAOuDPFQ" id="(1.0,0.5)"/>
1224 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_XdMyo1vTEemLJtrAOuDPFQ" id="(0.0,0.5)"/>
1225 </edges>
1226 <edges xmi:type="notation:Edge" xmi:id="_dUiZcFvTEemLJtrAOuDPFQ" type="4001" element="_dUZ2kFvTEemLJtrAOuDPFQ" source="_p1JFMFvREemLJtrAOuDPFQ" target="_vI6r8FvREemLJtrAOuDPFQ">
1227 <children xmi:type="notation:Node" xmi:id="_dUiZdFvTEemLJtrAOuDPFQ" type="6001">
1228 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dUiZdVvTEemLJtrAOuDPFQ" y="-10"/>
1229 </children>
1230 <children xmi:type="notation:Node" xmi:id="_dUiZdlvTEemLJtrAOuDPFQ" type="6002">
1231 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dUiZd1vTEemLJtrAOuDPFQ" x="-17" y="-61"/>
1232 </children>
1233 <children xmi:type="notation:Node" xmi:id="_dUiZeFvTEemLJtrAOuDPFQ" type="6003">
1234 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dUiZeVvTEemLJtrAOuDPFQ" x="-30" y="23"/>
1235 </children>
1236 <styles xmi:type="notation:ConnectorStyle" xmi:id="_dUiZcVvTEemLJtrAOuDPFQ" routing="Rectilinear"/>
1237 <styles xmi:type="notation:FontStyle" xmi:id="_dUiZclvTEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1238 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_dUiZc1vTEemLJtrAOuDPFQ" points="[0, 0, -171, -142]$[0, 142, -171, 0]$[171, 142, 0, 0]"/>
1239 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_dUiZelvTEemLJtrAOuDPFQ" id="(0.5084745762711864,1.0)"/>
1240 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_dUiZe1vTEemLJtrAOuDPFQ" id="(0.0,0.6122448979591837)"/>
1241 </edges>
1242 <edges xmi:type="notation:Edge" xmi:id="_jGlQkFvTEemLJtrAOuDPFQ" type="4001" element="_jGSVo1vTEemLJtrAOuDPFQ" source="_8icOoFvNEemLJtrAOuDPFQ" target="_vI6r8FvREemLJtrAOuDPFQ">
1243 <children xmi:type="notation:Node" xmi:id="_jGlQlFvTEemLJtrAOuDPFQ" type="6001">
1244 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jGl3oFvTEemLJtrAOuDPFQ" y="-10"/>
1245 </children>
1246 <children xmi:type="notation:Node" xmi:id="_jGl3oVvTEemLJtrAOuDPFQ" type="6002">
1247 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jGl3olvTEemLJtrAOuDPFQ" x="3" y="-42"/>
1248 </children>
1249 <children xmi:type="notation:Node" xmi:id="_jGl3o1vTEemLJtrAOuDPFQ" type="6003">
1250 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jGl3pFvTEemLJtrAOuDPFQ" x="-10" y="-54"/>
1251 </children>
1252 <styles xmi:type="notation:ConnectorStyle" xmi:id="_jGlQkVvTEemLJtrAOuDPFQ" routing="Rectilinear"/>
1253 <styles xmi:type="notation:FontStyle" xmi:id="_jGlQklvTEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1254 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_jGlQk1vTEemLJtrAOuDPFQ" points="[0, 0, 0, -82]$[0, 82, 0, 0]"/>
1255 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_jGl3pVvTEemLJtrAOuDPFQ" id="(0.5,1.0)"/>
1256 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_jGl3plvTEemLJtrAOuDPFQ" id="(0.5,0.0)"/>
1257 </edges>
1258 <edges xmi:type="notation:Edge" xmi:id="_GOZu4FvUEemLJtrAOuDPFQ" type="4001" element="_GOOItlvUEemLJtrAOuDPFQ" source="_8icOoFvNEemLJtrAOuDPFQ" target="_PdzIkFvSEemLJtrAOuDPFQ">
1259 <children xmi:type="notation:Node" xmi:id="_GOZu5FvUEemLJtrAOuDPFQ" type="6001">
1260 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_GOZu5VvUEemLJtrAOuDPFQ" y="-10"/>
1261 </children>
1262 <children xmi:type="notation:Node" xmi:id="_GOZu5lvUEemLJtrAOuDPFQ" type="6002">
1263 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_GOZu51vUEemLJtrAOuDPFQ" y="10"/>
1264 </children>
1265 <children xmi:type="notation:Node" xmi:id="_GOZu6FvUEemLJtrAOuDPFQ" type="6003">
1266 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_GOZu6VvUEemLJtrAOuDPFQ" y="10"/>
1267 </children>
1268 <styles xmi:type="notation:ConnectorStyle" xmi:id="_GOZu4VvUEemLJtrAOuDPFQ" routing="Rectilinear"/>
1269 <styles xmi:type="notation:FontStyle" xmi:id="_GOZu4lvUEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1270 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_GOZu41vUEemLJtrAOuDPFQ" points="[0, 0, -107, 0]$[107, 0, 0, 0]"/>
1271 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_GOZu6lvUEemLJtrAOuDPFQ" id="(1.0,0.5)"/>
1272 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_GOZu61vUEemLJtrAOuDPFQ" id="(0.0,0.5)"/>
1273 </edges>
1274 <edges xmi:type="notation:Edge" xmi:id="_OKpMsFvUEemLJtrAOuDPFQ" type="4001" element="_OKZ8IFvUEemLJtrAOuDPFQ" source="_PdzIkFvSEemLJtrAOuDPFQ" target="_FZ9o8FvOEemLJtrAOuDPFQ">
1275 <children xmi:type="notation:Node" xmi:id="_OKpMtFvUEemLJtrAOuDPFQ" type="6001">
1276 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OKpMtVvUEemLJtrAOuDPFQ" y="-10"/>
1277 </children>
1278 <children xmi:type="notation:Node" xmi:id="_OKpzwFvUEemLJtrAOuDPFQ" type="6002">
1279 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OKpzwVvUEemLJtrAOuDPFQ" y="10"/>
1280 </children>
1281 <children xmi:type="notation:Node" xmi:id="_OKpzwlvUEemLJtrAOuDPFQ" type="6003">
1282 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OKpzw1vUEemLJtrAOuDPFQ" y="10"/>
1283 </children>
1284 <styles xmi:type="notation:ConnectorStyle" xmi:id="_OKpMsVvUEemLJtrAOuDPFQ" routing="Rectilinear"/>
1285 <styles xmi:type="notation:FontStyle" xmi:id="_OKpMslvUEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1286 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OKpMs1vUEemLJtrAOuDPFQ" points="[0, 0, -104, 0]$[104, 0, 0, 0]"/>
1287 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OKpzxFvUEemLJtrAOuDPFQ" id="(1.0,0.5)"/>
1288 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OKpzxVvUEemLJtrAOuDPFQ" id="(0.0,0.5)"/>
1289 </edges>
1290 <edges xmi:type="notation:Edge" xmi:id="_Ya-0EFvUEemLJtrAOuDPFQ" type="4001" element="_YawKkFvUEemLJtrAOuDPFQ" source="_FZ9o8FvOEemLJtrAOuDPFQ" target="_UoYsMFvUEemLJtrAOuDPFQ">
1291 <children xmi:type="notation:Node" xmi:id="_Ya-0FFvUEemLJtrAOuDPFQ" type="6001">
1292 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Ya_bIFvUEemLJtrAOuDPFQ" y="-10"/>
1293 </children>
1294 <children xmi:type="notation:Node" xmi:id="_Ya_bIVvUEemLJtrAOuDPFQ" type="6002">
1295 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Ya_bIlvUEemLJtrAOuDPFQ" x="3" y="-40"/>
1296 </children>
1297 <children xmi:type="notation:Node" xmi:id="_Ya_bI1vUEemLJtrAOuDPFQ" type="6003">
1298 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Ya_bJFvUEemLJtrAOuDPFQ" x="-10" y="-53"/>
1299 </children>
1300 <styles xmi:type="notation:ConnectorStyle" xmi:id="_Ya-0EVvUEemLJtrAOuDPFQ" routing="Rectilinear"/>
1301 <styles xmi:type="notation:FontStyle" xmi:id="_Ya-0ElvUEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1302 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Ya-0E1vUEemLJtrAOuDPFQ" points="[0, 0, 0, -82]$[0, 82, 0, 0]"/>
1303 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Ya_bJVvUEemLJtrAOuDPFQ" id="(0.4966887417218543,1.0)"/>
1304 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Ya_bJlvUEemLJtrAOuDPFQ" id="(0.4966887417218543,0.0)"/>
1305 </edges>
1306 <edges xmi:type="notation:Edge" xmi:id="_Zl1ywFvWEemLJtrAOuDPFQ" type="4001" element="_ZlkF81vWEemLJtrAOuDPFQ" source="_vI6r8FvREemLJtrAOuDPFQ" target="_UoYsMFvUEemLJtrAOuDPFQ">
1307 <children xmi:type="notation:Node" xmi:id="_Zl2Z0FvWEemLJtrAOuDPFQ" type="6001">
1308 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Zl2Z0VvWEemLJtrAOuDPFQ" x="9" y="-5"/>
1309 </children>
1310 <children xmi:type="notation:Node" xmi:id="_Zl3A4FvWEemLJtrAOuDPFQ" type="6002">
1311 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Zl3A4VvWEemLJtrAOuDPFQ" x="8" y="-11"/>
1312 </children>
1313 <children xmi:type="notation:Node" xmi:id="_Zl3A4lvWEemLJtrAOuDPFQ" type="6003">
1314 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Zl3A41vWEemLJtrAOuDPFQ" x="-9" y="-11"/>
1315 </children>
1316 <styles xmi:type="notation:ConnectorStyle" xmi:id="_Zl1ywVvWEemLJtrAOuDPFQ" routing="Rectilinear"/>
1317 <styles xmi:type="notation:FontStyle" xmi:id="_Zl1ywlvWEemLJtrAOuDPFQ" fontName="Noto Sans" fontHeight="8"/>
1318 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_Zl1yw1vWEemLJtrAOuDPFQ" points="[0, 11, -353, 0]$[353, 11, 0, 0]"/>
1319 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Zl3n8FvWEemLJtrAOuDPFQ" id="(1.0,0.5)"/>
1320 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Zl3n8VvWEemLJtrAOuDPFQ" id="(0.0,0.6122448979591837)"/>
1321 </edges>
1322 <edges xmi:type="notation:Edge" xmi:id="_EDBDIFvZEemLJtrAOuDPFQ" type="4001" element="_ECuvRlvZEemLJtrAOuDPFQ" source="_IuOrgFvNEemLJtrAOuDPFQ" target="_8icOoFvNEemLJtrAOuDPFQ">
1323 <children xmi:type="notation:Node" xmi:id="_EDBDJFvZEemLJtrAOuDPFQ" type="6001">
1324 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EDBDJVvZEemLJtrAOuDPFQ" x="7" y="22"/>
1325 </children>
1326 <children xmi:type="notation:Node" xmi:id="_EDBqMFvZEemLJtrAOuDPFQ" type="6002">
1327 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EDBqMVvZEemLJtrAOuDPFQ" x="-10" y="63"/>
1328 </children>
1329 <children xmi:type="notation:Node" xmi:id="_EDBqMlvZEemLJtrAOuDPFQ" type="6003">
1330 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_EDBqM1vZEemLJtrAOuDPFQ" x="-5" y="8"/>
1331 </children>
1332 <styles xmi:type="notation:ConnectorStyle" xmi:id="_EDBDIVvZEemLJtrAOuDPFQ" routing="Rectilinear"/>
1333 <styles xmi:type="notation:FontStyle" xmi:id="_EDBDIlvZEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1334 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_EDBDI1vZEemLJtrAOuDPFQ" points="[22, 38, 180, -82]$[22, 75, 180, -45]$[-143, 75, 15, -45]$[-143, 120, 15, 0]"/>
1335 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EDBqNFvZEemLJtrAOuDPFQ" id="(0.0,0.6122448979591837)"/>
1336 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_EDBqNVvZEemLJtrAOuDPFQ" id="(0.635593220338983,0.0)"/>
1337 </edges>
1338 <edges xmi:type="notation:Edge" xmi:id="_HQd2kFvZEemLJtrAOuDPFQ" type="4001" element="_HQRCT1vZEemLJtrAOuDPFQ" source="_IuOrgFvNEemLJtrAOuDPFQ" target="_FZ9o8FvOEemLJtrAOuDPFQ">
1339 <children xmi:type="notation:Node" xmi:id="_HQd2lFvZEemLJtrAOuDPFQ" type="6001">
1340 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_HQd2lVvZEemLJtrAOuDPFQ" x="10" y="-22"/>
1341 </children>
1342 <children xmi:type="notation:Node" xmi:id="_HQedoFvZEemLJtrAOuDPFQ" type="6002">
1343 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_HQedoVvZEemLJtrAOuDPFQ" x="10" y="-70"/>
1344 </children>
1345 <children xmi:type="notation:Node" xmi:id="_HQedolvZEemLJtrAOuDPFQ" type="6003">
1346 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_HQedo1vZEemLJtrAOuDPFQ" x="23" y="10"/>
1347 </children>
1348 <styles xmi:type="notation:ConnectorStyle" xmi:id="_HQd2kVvZEemLJtrAOuDPFQ" routing="Rectilinear"/>
1349 <styles xmi:type="notation:FontStyle" xmi:id="_HQd2klvZEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1350 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_HQd2k1vZEemLJtrAOuDPFQ" points="[-24, 68, -180, -82]$[-24, 105, -180, -45]$[141, 105, -15, -45]$[141, 150, -15, 0]"/>
1351 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_HQedpFvZEemLJtrAOuDPFQ" id="(1.0,0.30612244897959184)"/>
1352 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_HQedpVvZEemLJtrAOuDPFQ" id="(0.2980132450331126,0.0)"/>
1353 </edges>
1354 <edges xmi:type="notation:Edge" xmi:id="_LsBb4FvZEemLJtrAOuDPFQ" type="4001" element="_Lr45GFvZEemLJtrAOuDPFQ" source="_IuOrgFvNEemLJtrAOuDPFQ" target="_UoYsMFvUEemLJtrAOuDPFQ">
1355 <children xmi:type="notation:Node" xmi:id="_LsBb5FvZEemLJtrAOuDPFQ" type="6001">
1356 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LsBb5VvZEemLJtrAOuDPFQ" x="-65" y="135"/>
1357 </children>
1358 <children xmi:type="notation:Node" xmi:id="_LsBb5lvZEemLJtrAOuDPFQ" type="6002">
1359 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LsBb51vZEemLJtrAOuDPFQ" x="-29" y="10"/>
1360 </children>
1361 <children xmi:type="notation:Node" xmi:id="_LsBb6FvZEemLJtrAOuDPFQ" type="6003">
1362 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LsBb6VvZEemLJtrAOuDPFQ" x="-65" y="10"/>
1363 </children>
1364 <styles xmi:type="notation:ConnectorStyle" xmi:id="_LsBb4VvZEemLJtrAOuDPFQ" routing="Rectilinear"/>
1365 <styles xmi:type="notation:FontStyle" xmi:id="_LsBb4lvZEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1366 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_LsBb41vZEemLJtrAOuDPFQ" points="[54, -50, -216, -312]$[345, -50, 75, -312]$[345, 322, 75, 60]$[316, 322, 46, 60]"/>
1367 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_LsCC8FvZEemLJtrAOuDPFQ" id="(0.6029411764705882,1.0)"/>
1368 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_LsCC8VvZEemLJtrAOuDPFQ" id="(0.695364238410596,0.0)"/>
1369 </edges>
1370 <edges xmi:type="notation:Edge" xmi:id="_TAsjYFvZEemLJtrAOuDPFQ" type="4001" element="_TAeg9lvZEemLJtrAOuDPFQ" source="_IuOrgFvNEemLJtrAOuDPFQ" target="_vI6r8FvREemLJtrAOuDPFQ">
1371 <children xmi:type="notation:Node" xmi:id="_TAsjZFvZEemLJtrAOuDPFQ" type="6001">
1372 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_TAsjZVvZEemLJtrAOuDPFQ" x="-44" y="-154"/>
1373 </children>
1374 <children xmi:type="notation:Node" xmi:id="_TAsjZlvZEemLJtrAOuDPFQ" type="6002">
1375 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_TAsjZ1vZEemLJtrAOuDPFQ" x="-21" y="10"/>
1376 </children>
1377 <children xmi:type="notation:Node" xmi:id="_TAtKcFvZEemLJtrAOuDPFQ" type="6003">
1378 <layoutConstraint xmi:type="notation:Bounds" xmi:id="_TAtKcVvZEemLJtrAOuDPFQ" x="-45" y="10"/>
1379 </children>
1380 <styles xmi:type="notation:ConnectorStyle" xmi:id="_TAsjYVvZEemLJtrAOuDPFQ" routing="Rectilinear"/>
1381 <styles xmi:type="notation:FontStyle" xmi:id="_TAsjYlvZEemLJtrAOuDPFQ" fontColor="7490599" fontName="Noto Sans" fontHeight="8"/>
1382 <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_TAsjY1vZEemLJtrAOuDPFQ" points="[0, 15, 188, -285]$[-278, 15, -90, -285]$[-278, 330, -90, 30]$[-242, 330, -54, 30]"/>
1383 <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TAtKclvZEemLJtrAOuDPFQ" id="(0.0,0.6122448979591837)"/>
1384 <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_TAtKc1vZEemLJtrAOuDPFQ" id="(0.39705882352941174,0.0)"/>
1385 </edges>
1386 </data>
1387 </ownedAnnotationEntries>
1388 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_Itg50FvNEemLJtrAOuDPFQ" name="CyberPhysicalSystem" tooltipText="" outgoingEdges="_CU3uAFvTEemLJtrAOuDPFQ _ECuvRlvZEemLJtrAOuDPFQ _HQRCT1vZEemLJtrAOuDPFQ _Lr45GFvZEemLJtrAOuDPFQ _TAeg9lvZEemLJtrAOuDPFQ" width="12" height="10">
1389 <target xmi:type="ecore:EClass" href="cps.ecore#//CyberPhysicalSystem"/>
1390 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//CyberPhysicalSystem"/>
1391 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1392 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1393 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1394 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_Itr48FvNEemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1395 <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"/>
1396 </ownedStyle>
1397 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
1398 </ownedDiagramElements>
1399 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_8iM-EFvNEemLJtrAOuDPFQ" name="ApplicationType" tooltipText="" outgoingEdges="_jGSVo1vTEemLJtrAOuDPFQ _GOOItlvUEemLJtrAOuDPFQ" incomingEdges="_Xc3bc1vTEemLJtrAOuDPFQ _ECuvRlvZEemLJtrAOuDPFQ" width="12" height="10">
1400 <target xmi:type="ecore:EClass" href="cps.ecore#//ApplicationType"/>
1401 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//ApplicationType"/>
1402 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1403 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1404 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1405 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_9yN0clvNEemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1406 <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"/>
1407 </ownedStyle>
1408 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
1409 </ownedDiagramElements>
1410 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_FZ1GEFvOEemLJtrAOuDPFQ" name="HostType" tooltipText="" outgoingEdges="_YawKkFvUEemLJtrAOuDPFQ" incomingEdges="_OKZ8IFvUEemLJtrAOuDPFQ _HQRCT1vZEemLJtrAOuDPFQ" width="12" height="10">
1411 <target xmi:type="ecore:EClass" href="cps.ecore#//HostType"/>
1412 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//HostType"/>
1413 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1414 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1415 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1416 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_4ua9dXc3Eemo29BzW_RHcw" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1417 <description xmi:type="style:FlatContainerStyleDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@style"/>
1418 </ownedStyle>
1419 <actualMapping xmi:type="description_1:ContainerMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']"/>
1420 <ownedElements xmi:type="diagram:DNodeListElement" uid="_Xxc2QFvREemLJtrAOuDPFQ" name="defaultMemory : EInt" tooltipText="">
1421 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/defaultMemory"/>
1422 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/defaultMemory"/>
1423 <ownedStyle xmi:type="diagram:BundledImage" uid="_aQuVEVvREemLJtrAOuDPFQ" labelAlignment="LEFT" description="_-5WboFvNEemLJtrAOuDPFQ">
1424 <labelFormat>bold</labelFormat>
1425 </ownedStyle>
1426 <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']"/>
1427 </ownedElements>
1428 <ownedElements xmi:type="diagram:DNodeListElement" uid="_bLzdQFvREemLJtrAOuDPFQ" name="defaultHdd : EInt" tooltipText="">
1429 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/defaultHdd"/>
1430 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/defaultHdd"/>
1431 <ownedStyle xmi:type="diagram:BundledImage" uid="_ednzUVvREemLJtrAOuDPFQ" labelAlignment="LEFT" description="_-5WboFvNEemLJtrAOuDPFQ">
1432 <labelFormat>bold</labelFormat>
1433 </ownedStyle>
1434 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
1435 </ownedElements>
1436 <ownedElements xmi:type="diagram:DNodeListElement" uid="_4TQEYHc3Eemo29BzW_RHcw" name="cost : EInt" tooltipText="">
1437 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/cost"/>
1438 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostType/cost"/>
1439 <ownedStyle xmi:type="diagram:BundledImage" uid="_5G0PUnc3Eemo29BzW_RHcw" labelAlignment="LEFT" description="_-5WboFvNEemLJtrAOuDPFQ">
1440 <labelFormat>bold</labelFormat>
1441 </ownedStyle>
1442 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
1443 </ownedElements>
1444 </ownedDiagramElements>
1445 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_jfFiEFvREemLJtrAOuDPFQ" name="Request" tooltipText="" outgoingEdges="_INyCIFvTEemLJtrAOuDPFQ" incomingEdges="_CU3uAFvTEemLJtrAOuDPFQ" width="12" height="10">
1446 <target xmi:type="ecore:EClass" href="cps.ecore#//Request"/>
1447 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//Request"/>
1448 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1449 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1450 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1451 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_jfGJIFvREemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1452 <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"/>
1453 </ownedStyle>
1454 <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']"/>
1455 </ownedDiagramElements>
1456 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_p05NkFvREemLJtrAOuDPFQ" name="Requirement" tooltipText="" outgoingEdges="_Xc3bc1vTEemLJtrAOuDPFQ _dUZ2kFvTEemLJtrAOuDPFQ" incomingEdges="_INyCIFvTEemLJtrAOuDPFQ" width="12" height="10">
1457 <target xmi:type="ecore:EClass" href="cps.ecore#//Requirement"/>
1458 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//Requirement"/>
1459 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1460 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1461 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1462 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_OP1EIVvTEemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1463 <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"/>
1464 </ownedStyle>
1465 <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']"/>
1466 <ownedElements xmi:type="diagram:DNodeListElement" uid="_Nr-JIFvTEemLJtrAOuDPFQ" name="count : EInt" tooltipText="">
1467 <target xmi:type="ecore:EAttribute" href="cps.ecore#//Requirement/count"/>
1468 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//Requirement/count"/>
1469 <ownedStyle xmi:type="diagram:BundledImage" uid="_ZNL60VvZEemLJtrAOuDPFQ" labelAlignment="LEFT" description="_-5WboFvNEemLJtrAOuDPFQ">
1470 <labelFormat>bold</labelFormat>
1471 </ownedStyle>
1472 <actualMapping xmi:type="description_1:NodeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@containerMappings[name='EC%20EClass']/@subNodeMappings[name='EC%20EAttribute']"/>
1473 </ownedElements>
1474 </ownedDiagramElements>
1475 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_vIvs0FvREemLJtrAOuDPFQ" name="ApplicationInstance" tooltipText="" outgoingEdges="_ZlkF81vWEemLJtrAOuDPFQ" incomingEdges="_dUZ2kFvTEemLJtrAOuDPFQ _jGSVo1vTEemLJtrAOuDPFQ _TAeg9lvZEemLJtrAOuDPFQ" width="12" height="10">
1476 <target xmi:type="ecore:EClass" href="cps.ecore#//ApplicationInstance"/>
1477 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//ApplicationInstance"/>
1478 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1479 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1480 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1481 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_vIwT4FvREemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1482 <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"/>
1483 </ownedStyle>
1484 <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']"/>
1485 </ownedDiagramElements>
1486 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_PdlGIFvSEemLJtrAOuDPFQ" name="ResourceRequirement" tooltipText="" outgoingEdges="_OKZ8IFvUEemLJtrAOuDPFQ" incomingEdges="_GOOItlvUEemLJtrAOuDPFQ" width="12" height="10">
1487 <target xmi:type="ecore:EClass" href="cps.ecore#//ResourceRequirement"/>
1488 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//ResourceRequirement"/>
1489 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1490 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1491 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1492 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_TcKbkVvSEemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1493 <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"/>
1494 </ownedStyle>
1495 <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']"/>
1496 <ownedElements xmi:type="diagram:DNodeListElement" uid="_ReIBkFvSEemLJtrAOuDPFQ" name="requiredMemory : EInt" tooltipText="">
1497 <target xmi:type="ecore:EAttribute" href="cps.ecore#//ResourceRequirement/requiredMemory"/>
1498 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//ResourceRequirement/requiredMemory"/>
1499 <ownedStyle xmi:type="diagram:BundledImage" uid="_ShoF8VvSEemLJtrAOuDPFQ" labelAlignment="LEFT" description="_-5WboFvNEemLJtrAOuDPFQ">
1500 <labelFormat>bold</labelFormat>
1501 </ownedStyle>
1502 <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']"/>
1503 </ownedElements>
1504 <ownedElements xmi:type="diagram:DNodeListElement" uid="_S4npoFvSEemLJtrAOuDPFQ" name="requiredHdd : EInt" tooltipText="">
1505 <target xmi:type="ecore:EAttribute" href="cps.ecore#//ResourceRequirement/requiredHdd"/>
1506 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//ResourceRequirement/requiredHdd"/>
1507 <ownedStyle xmi:type="diagram:BundledImage" uid="_T0XgMFvSEemLJtrAOuDPFQ" labelAlignment="LEFT" description="_-5WboFvNEemLJtrAOuDPFQ">
1508 <labelFormat>bold</labelFormat>
1509 </ownedStyle>
1510 <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']"/>
1511 </ownedElements>
1512 </ownedDiagramElements>
1513 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_CU3uAFvTEemLJtrAOuDPFQ" name="[0..*] requests" sourceNode="_Itg50FvNEemLJtrAOuDPFQ" targetNode="_jfFiEFvREemLJtrAOuDPFQ">
1514 <target xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/requests"/>
1515 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/requests"/>
1516 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_CVAQ4FvTEemLJtrAOuDPFQ" description="_CU6KQFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
1517 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_CVBfAFvTEemLJtrAOuDPFQ" showIcon="false">
1518 <customFeatures>labelSize</customFeatures>
1519 </centerLabelStyle>
1520 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_CVA38FvTEemLJtrAOuDPFQ" showIcon="false" labelColor="39,76,114">
1521 <customFeatures>labelSize</customFeatures>
1522 </endLabelStyle>
1523 </ownedStyle>
1524 <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']"/>
1525 </ownedDiagramElements>
1526 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_INyCIFvTEemLJtrAOuDPFQ" sourceNode="_jfFiEFvREemLJtrAOuDPFQ" targetNode="_p05NkFvREemLJtrAOuDPFQ" beginLabel="[1..1] request" endLabel="[0..*] requirements">
1527 <target xmi:type="ecore:EReference" href="cps.ecore#//Request/requirements"/>
1528 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//Requirement/request"/>
1529 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//Request/requirements"/>
1530 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_KkeMs1vTEemLJtrAOuDPFQ" description="_KkeMsFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
1531 <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_KkeMtFvTEemLJtrAOuDPFQ" showIcon="false"/>
1532 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_KkeMtVvTEemLJtrAOuDPFQ" showIcon="false"/>
1533 </ownedStyle>
1534 <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']"/>
1535 </ownedDiagramElements>
1536 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_Xc3bc1vTEemLJtrAOuDPFQ" name="[0..1] type" sourceNode="_p05NkFvREemLJtrAOuDPFQ" targetNode="_8iM-EFvNEemLJtrAOuDPFQ">
1537 <target xmi:type="ecore:EReference" href="cps.ecore#//Requirement/type"/>
1538 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//Requirement/type"/>
1539 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_Xc5QoFvTEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="0,0,0">
1540 <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"/>
1541 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_Xc5QolvTEemLJtrAOuDPFQ" showIcon="false">
1542 <customFeatures>labelSize</customFeatures>
1543 </centerLabelStyle>
1544 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_Xc5QoVvTEemLJtrAOuDPFQ" showIcon="false" labelColor="39,76,114">
1545 <customFeatures>labelSize</customFeatures>
1546 </endLabelStyle>
1547 </ownedStyle>
1548 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
1549 </ownedDiagramElements>
1550 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_dUZ2kFvTEemLJtrAOuDPFQ" sourceNode="_p05NkFvREemLJtrAOuDPFQ" targetNode="_vIvs0FvREemLJtrAOuDPFQ" beginLabel="[0..1] requirement" endLabel="[0..*] instances">
1551 <target xmi:type="ecore:EReference" href="cps.ecore#//Requirement/instances"/>
1552 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//Requirement/instances"/>
1553 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/requirement"/>
1554 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_dUadoFvTEemLJtrAOuDPFQ" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0">
1555 <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"/>
1556 <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_dUadoVvTEemLJtrAOuDPFQ" showIcon="false"/>
1557 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_dUadolvTEemLJtrAOuDPFQ" showIcon="false"/>
1558 </ownedStyle>
1559 <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']"/>
1560 </ownedDiagramElements>
1561 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_jGSVo1vTEemLJtrAOuDPFQ" sourceNode="_8iM-EFvNEemLJtrAOuDPFQ" targetNode="_vIvs0FvREemLJtrAOuDPFQ" beginLabel="[1..1] type" endLabel="[0..*] instances">
1562 <target xmi:type="ecore:EReference" href="cps.ecore#//ApplicationType/instances"/>
1563 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationType/instances"/>
1564 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/type"/>
1565 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_nwVC4FvTEemLJtrAOuDPFQ" description="_KkeMsFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
1566 <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_nwVC4VvTEemLJtrAOuDPFQ" showIcon="false"/>
1567 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_nwVC4lvTEemLJtrAOuDPFQ" showIcon="false"/>
1568 </ownedStyle>
1569 <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']"/>
1570 </ownedDiagramElements>
1571 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_GOOItlvUEemLJtrAOuDPFQ" name="[0..*] requirements" sourceNode="_8iM-EFvNEemLJtrAOuDPFQ" targetNode="_PdlGIFvSEemLJtrAOuDPFQ">
1572 <target xmi:type="ecore:EReference" href="cps.ecore#//ApplicationType/requirements"/>
1573 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationType/requirements"/>
1574 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_GOPW0FvUEemLJtrAOuDPFQ" description="_CU6KQFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
1575 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_GOPW0lvUEemLJtrAOuDPFQ" showIcon="false">
1576 <customFeatures>labelSize</customFeatures>
1577 </centerLabelStyle>
1578 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_GOPW0VvUEemLJtrAOuDPFQ" showIcon="false" labelColor="39,76,114">
1579 <customFeatures>labelSize</customFeatures>
1580 </endLabelStyle>
1581 </ownedStyle>
1582 <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']"/>
1583 </ownedDiagramElements>
1584 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_OKZ8IFvUEemLJtrAOuDPFQ" name="[1..1] hostType" sourceNode="_PdlGIFvSEemLJtrAOuDPFQ" targetNode="_FZ1GEFvOEemLJtrAOuDPFQ">
1585 <target xmi:type="ecore:EReference" href="cps.ecore#//ResourceRequirement/hostType"/>
1586 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ResourceRequirement/hostType"/>
1587 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_PIc4w1vUEemLJtrAOuDPFQ" description="_PIc4wFvUEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="0,0,0">
1588 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_PIc4xVvUEemLJtrAOuDPFQ" showIcon="false">
1589 <labelFormat>bold</labelFormat>
1590 </centerLabelStyle>
1591 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_PIc4xFvUEemLJtrAOuDPFQ" labelSize="6" showIcon="false" labelColor="39,76,114"/>
1592 </ownedStyle>
1593 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
1594 </ownedDiagramElements>
1595 <ownedDiagramElements xmi:type="diagram:DNodeList" uid="_UoGYUFvUEemLJtrAOuDPFQ" name="HostInstance" tooltipText="" incomingEdges="_YawKkFvUEemLJtrAOuDPFQ _ZlkF81vWEemLJtrAOuDPFQ _Lr45GFvZEemLJtrAOuDPFQ" width="12" height="10">
1596 <target xmi:type="ecore:EClass" href="cps.ecore#//HostInstance"/>
1597 <semanticElements xmi:type="ecore:EClass" href="cps.ecore#//HostInstance"/>
1598 <arrangeConstraints>KEEP_LOCATION</arrangeConstraints>
1599 <arrangeConstraints>KEEP_SIZE</arrangeConstraints>
1600 <arrangeConstraints>KEEP_RATIO</arrangeConstraints>
1601 <ownedStyle xmi:type="diagram:FlatContainerStyle" uid="_pw7zQVvUEemLJtrAOuDPFQ" borderSize="1" borderSizeComputationExpression="1" backgroundStyle="Liquid" foregroundColor="255,252,216">
1602 <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"/>
1603 </ownedStyle>
1604 <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']"/>
1605 <ownedElements xmi:type="diagram:DNodeListElement" uid="_jO97EFvUEemLJtrAOuDPFQ" name="/availableMemory : EInt" tooltipText="">
1606 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/availableMemory"/>
1607 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/availableMemory"/>
1608 <ownedStyle xmi:type="diagram:BundledImage" uid="_8rRg5FvVEemLJtrAOuDPFQ" labelColor="39,76,114" labelAlignment="LEFT" description="_8rRg4lvVEemLJtrAOuDPFQ"/>
1609 <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']"/>
1610 </ownedElements>
1611 <ownedElements xmi:type="diagram:DNodeListElement" uid="_lZB-4FvUEemLJtrAOuDPFQ" name="/availableHdd : EInt" tooltipText="">
1612 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/availableHdd"/>
1613 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/availableHdd"/>
1614 <ownedStyle xmi:type="diagram:BundledImage" uid="_AAbe0lvWEemLJtrAOuDPFQ" labelColor="39,76,114" labelAlignment="LEFT" description="_8rRg4lvVEemLJtrAOuDPFQ"/>
1615 <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']"/>
1616 </ownedElements>
1617 <ownedElements xmi:type="diagram:DNodeListElement" uid="_n0acMFvUEemLJtrAOuDPFQ" name="/totalMemory : EInt" tooltipText="">
1618 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/totalMemory"/>
1619 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/totalMemory"/>
1620 <ownedStyle xmi:type="diagram:BundledImage" uid="_DOTwE1vWEemLJtrAOuDPFQ" labelColor="39,76,114" labelAlignment="LEFT" description="_8rRg4lvVEemLJtrAOuDPFQ"/>
1621 <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']"/>
1622 </ownedElements>
1623 <ownedElements xmi:type="diagram:DNodeListElement" uid="_pHVcoFvUEemLJtrAOuDPFQ" name="/totalHdd : EInt" tooltipText="">
1624 <target xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/totalHdd"/>
1625 <semanticElements xmi:type="ecore:EAttribute" href="cps.ecore#//HostInstance/totalHdd"/>
1626 <ownedStyle xmi:type="diagram:BundledImage" uid="_EOBgpVvWEemLJtrAOuDPFQ" labelColor="39,76,114" labelAlignment="LEFT" description="_8rRg4lvVEemLJtrAOuDPFQ"/>
1627 <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']"/>
1628 </ownedElements>
1629 </ownedDiagramElements>
1630 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_YawKkFvUEemLJtrAOuDPFQ" sourceNode="_FZ1GEFvOEemLJtrAOuDPFQ" targetNode="_UoGYUFvUEemLJtrAOuDPFQ" beginLabel="[1..1] type" endLabel="[0..*] instances">
1631 <target xmi:type="ecore:EReference" href="cps.ecore#//HostType/instances"/>
1632 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//HostType/instances"/>
1633 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//HostInstance/type"/>
1634 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_aF7S8FvUEemLJtrAOuDPFQ" description="_KkeMsFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
1635 <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_aF7S8VvUEemLJtrAOuDPFQ" showIcon="false"/>
1636 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_aF7S8lvUEemLJtrAOuDPFQ" showIcon="false"/>
1637 </ownedStyle>
1638 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/>
1639 </ownedDiagramElements>
1640 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_ZlkF81vWEemLJtrAOuDPFQ" sourceNode="_vIvs0FvREemLJtrAOuDPFQ" targetNode="_UoGYUFvUEemLJtrAOuDPFQ" beginLabel="[0..*] applications" endLabel="[1..1] allocatedTo">
1641 <target xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/allocatedTo"/>
1642 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//ApplicationInstance/allocatedTo"/>
1643 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//HostInstance/applications"/>
1644 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_5GJws3cmEemo29BzW_RHcw" description="_5GJwsHcmEemo29BzW_RHcw" sourceArrow="InputArrow" routingStyle="manhattan" strokeColor="0,0,0">
1645 <beginLabelStyle xmi:type="diagram:BeginLabelStyle" uid="_5GJwtHcmEemo29BzW_RHcw" showIcon="false">
1646 <labelFormat>bold</labelFormat>
1647 </beginLabelStyle>
1648 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_5GJwtXcmEemo29BzW_RHcw" showIcon="false">
1649 <labelFormat>bold</labelFormat>
1650 </endLabelStyle>
1651 </ownedStyle>
1652 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='Bi-directional%20EC_EReference%20']"/>
1653 </ownedDiagramElements>
1654 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_ECuvRlvZEemLJtrAOuDPFQ" name="[0..*] applicationTypes" sourceNode="_Itg50FvNEemLJtrAOuDPFQ" targetNode="_8iM-EFvNEemLJtrAOuDPFQ">
1655 <target xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/applicationTypes"/>
1656 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/applicationTypes"/>
1657 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_ECvWUFvZEemLJtrAOuDPFQ" description="_CU6KQFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
1658 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_ECvWUlvZEemLJtrAOuDPFQ" showIcon="false">
1659 <customFeatures>labelSize</customFeatures>
1660 </centerLabelStyle>
1661 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_ECvWUVvZEemLJtrAOuDPFQ" showIcon="false" labelColor="39,76,114">
1662 <customFeatures>labelSize</customFeatures>
1663 </endLabelStyle>
1664 </ownedStyle>
1665 <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']"/>
1666 </ownedDiagramElements>
1667 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_HQRCT1vZEemLJtrAOuDPFQ" name="[0..*] hostTypes" sourceNode="_Itg50FvNEemLJtrAOuDPFQ" targetNode="_FZ1GEFvOEemLJtrAOuDPFQ">
1668 <target xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/hostTypes"/>
1669 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/hostTypes"/>
1670 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_HQRpUFvZEemLJtrAOuDPFQ" description="_CU6KQFvTEemLJtrAOuDPFQ" sourceArrow="FillDiamond" routingStyle="manhattan" strokeColor="0,0,0">
1671 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_HQRpUlvZEemLJtrAOuDPFQ" showIcon="false">
1672 <customFeatures>labelSize</customFeatures>
1673 </centerLabelStyle>
1674 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_HQRpUVvZEemLJtrAOuDPFQ" showIcon="false" labelColor="39,76,114">
1675 <customFeatures>labelSize</customFeatures>
1676 </endLabelStyle>
1677 </ownedStyle>
1678 <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']"/>
1679 </ownedDiagramElements>
1680 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_Lr45GFvZEemLJtrAOuDPFQ" name="[0..*] /hosts" sourceNode="_Itg50FvNEemLJtrAOuDPFQ" targetNode="_UoGYUFvUEemLJtrAOuDPFQ">
1681 <target xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/hosts"/>
1682 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/hosts"/>
1683 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_QukvyVvZEemLJtrAOuDPFQ" description="_QukvxlvZEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="114,159,207">
1684 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_Qukvy1vZEemLJtrAOuDPFQ" showIcon="false" labelColor="39,76,114"/>
1685 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_QukvylvZEemLJtrAOuDPFQ" labelSize="6" showIcon="false" labelColor="39,76,114"/>
1686 </ownedStyle>
1687 <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']"/>
1688 </ownedDiagramElements>
1689 <ownedDiagramElements xmi:type="diagram:DEdge" uid="_TAeg9lvZEemLJtrAOuDPFQ" name="[0..*] /applications" sourceNode="_Itg50FvNEemLJtrAOuDPFQ" targetNode="_vIvs0FvREemLJtrAOuDPFQ">
1690 <target xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/applications"/>
1691 <semanticElements xmi:type="ecore:EReference" href="cps.ecore#//CyberPhysicalSystem/applications"/>
1692 <ownedStyle xmi:type="diagram:EdgeStyle" uid="_XFbkJlvZEemLJtrAOuDPFQ" description="_QukvxlvZEemLJtrAOuDPFQ" routingStyle="manhattan" strokeColor="114,159,207">
1693 <centerLabelStyle xmi:type="diagram:CenterLabelStyle" uid="_XFbkKFvZEemLJtrAOuDPFQ" showIcon="false" labelColor="39,76,114"/>
1694 <endLabelStyle xmi:type="diagram:EndLabelStyle" uid="_XFbkJ1vZEemLJtrAOuDPFQ" labelSize="6" showIcon="false" labelColor="39,76,114"/>
1695 </ownedStyle>
1696 <actualMapping xmi:type="description_1:EdgeMapping" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer/@edgeMappings[name='EC_EReference']"/>
1697 </ownedDiagramElements>
1698 <description xmi:type="description_1:DiagramDescription" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']"/>
1699 <filterVariableHistory xmi:type="diagram:FilterVariableHistory" uid="_kSzQQFvMEemLJtrAOuDPFQ"/>
1700 <activatedLayers xmi:type="description_1:Layer" href="platform:/plugin/org.eclipse.emf.ecoretools.design/description/ecore.odesign#//@ownedViewpoints[name='Design']/@ownedRepresentations[name='Entities']/@defaultLayer"/>
1701 <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']"/>
1702 <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']"/>
1703 <target xmi:type="ecore:EPackage" href="cps.ecore#/"/>
1704 </diagram:DSemanticDiagram>
1705</xmi:XMI>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore
index 36db23be..0f52d8ee 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.ecore
@@ -1,9 +1,6 @@
1<?xml version="1.0" encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 2<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3 xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="cps" nsURI="http://www.example.org/cps" nsPrefix="cps"> 3 xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="cps" nsURI="http://www.example.org/cps" nsPrefix="cps">
4 <eAnnotations source="http://www.eclipse.org/emf/2002/Ecore">
5 <details key="settingDelegates" value="org.eclipse.viatra.query.querybasedfeature"/>
6 </eAnnotations>
7 <eClassifiers xsi:type="ecore:EClass" name="CyberPhysicalSystem"> 4 <eClassifiers xsi:type="ecore:EClass" name="CyberPhysicalSystem">
8 <eStructuralFeatures xsi:type="ecore:EReference" name="requests" upperBound="-1" 5 <eStructuralFeatures xsi:type="ecore:EReference" name="requests" upperBound="-1"
9 eType="#//Request" containment="true"/> 6 eType="#//Request" containment="true"/>
@@ -11,20 +8,6 @@
11 eType="#//ApplicationType" containment="true"/> 8 eType="#//ApplicationType" containment="true"/>
12 <eStructuralFeatures xsi:type="ecore:EReference" name="hostTypes" upperBound="-1" 9 <eStructuralFeatures xsi:type="ecore:EReference" name="hostTypes" upperBound="-1"
13 eType="#//HostType" containment="true"/> 10 eType="#//HostType" containment="true"/>
14 <eStructuralFeatures xsi:type="ecore:EReference" name="hosts" upperBound="-1"
15 eType="#//HostInstance" changeable="false" volatile="true" transient="true"
16 derived="true">
17 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
18 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts"/>
19 </eAnnotations>
20 </eStructuralFeatures>
21 <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1"
22 eType="#//ApplicationInstance" changeable="false" volatile="true" transient="true"
23 derived="true">
24 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
25 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications"/>
26 </eAnnotations>
27 </eStructuralFeatures>
28 </eClassifiers> 11 </eClassifiers>
29 <eClassifiers xsi:type="ecore:EClass" name="ApplicationType"> 12 <eClassifiers xsi:type="ecore:EClass" name="ApplicationType">
30 <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1" 13 <eStructuralFeatures xsi:type="ecore:EReference" name="instances" upperBound="-1"
@@ -72,30 +55,6 @@
72 <eClassifiers xsi:type="ecore:EClass" name="HostInstance"> 55 <eClassifiers xsi:type="ecore:EClass" name="HostInstance">
73 <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//HostType" 56 <eStructuralFeatures xsi:type="ecore:EReference" name="type" lowerBound="1" eType="#//HostType"
74 eOpposite="#//HostType/instances"/> 57 eOpposite="#//HostType/instances"/>
75 <eStructuralFeatures xsi:type="ecore:EAttribute" name="availableMemory" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
76 changeable="false" volatile="true" transient="true" derived="true">
77 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
78 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory"/>
79 </eAnnotations>
80 </eStructuralFeatures>
81 <eStructuralFeatures xsi:type="ecore:EAttribute" name="availableHdd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
82 changeable="false" volatile="true" transient="true" derived="true">
83 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
84 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd"/>
85 </eAnnotations>
86 </eStructuralFeatures>
87 <eStructuralFeatures xsi:type="ecore:EAttribute" name="totalMemory" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
88 changeable="false" volatile="true" transient="true" derived="true">
89 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
90 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory"/>
91 </eAnnotations>
92 </eStructuralFeatures>
93 <eStructuralFeatures xsi:type="ecore:EAttribute" name="totalHdd" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EInt"
94 changeable="false" volatile="true" transient="true" derived="true">
95 <eAnnotations source="org.eclipse.viatra.query.querybasedfeature">
96 <details key="patternFQN" value="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd"/>
97 </eAnnotations>
98 </eStructuralFeatures>
99 <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1" 58 <eStructuralFeatures xsi:type="ecore:EReference" name="applications" upperBound="-1"
100 eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/allocatedTo"/> 59 eType="#//ApplicationInstance" eOpposite="#//ApplicationInstance/allocatedTo"/>
101 </eClassifiers> 60 </eClassifiers>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel
index a0ccec7f..09ed2e0c 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/model/cps.genmodel
@@ -15,8 +15,6 @@
15 <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//CyberPhysicalSystem/requests"/> 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"/> 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"/> 17 <genFeatures property="None" children="true" createChild="true" ecoreFeature="ecore:EReference cps.ecore#//CyberPhysicalSystem/hostTypes"/>
18 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//CyberPhysicalSystem/hosts"/>
19 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//CyberPhysicalSystem/applications"/>
20 </genClasses> 18 </genClasses>
21 <genClasses ecoreClass="cps.ecore#//ApplicationType"> 19 <genClasses ecoreClass="cps.ecore#//ApplicationType">
22 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/instances"/> 20 <genFeatures children="true" createChild="true" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//ApplicationType/instances"/>
@@ -49,10 +47,6 @@
49 </genClasses> 47 </genClasses>
50 <genClasses ecoreClass="cps.ecore#//HostInstance"> 48 <genClasses ecoreClass="cps.ecore#//HostInstance">
51 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/type"/> 49 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/type"/>
52 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/availableMemory"/>
53 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/availableHdd"/>
54 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/totalMemory"/>
55 <genFeatures createChild="false" ecoreFeature="ecore:EAttribute cps.ecore#//HostInstance/totalHdd"/>
56 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/applications"/> 50 <genFeatures notify="false" createChild="false" propertySortChoices="true" ecoreFeature="ecore:EReference cps.ecore#//HostInstance/applications"/>
57 </genClasses> 51 </genClasses>
58 </genPackages> 52 </genPackages>
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml
index a7e8c387..5a0fee8d 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/plugin.xml
@@ -4,32 +4,9 @@
4 <!-- @generated cps --> 4 <!-- @generated cps -->
5 <package class="hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage" genModel="model/cps.genmodel" uri="http://www.example.org/cps"/> 5 <package class="hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage" genModel="model/cps.genmodel" uri="http://www.example.org/cps"/>
6 </extension> 6 </extension>
7 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
8 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="availableHdd" package-nsUri="http://www.example.org/cps"/>
9 </extension>
10 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
11 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="availableMemory" package-nsUri="http://www.example.org/cps"/>
12 </extension>
13 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
14 <wellbehaving-derived-feature classifier-name="CyberPhysicalSystem" feature-name="applications" package-nsUri="http://www.example.org/cps"/>
15 </extension>
16 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
17 <wellbehaving-derived-feature classifier-name="CyberPhysicalSystem" feature-name="hosts" package-nsUri="http://www.example.org/cps"/>
18 </extension>
19 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
20 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="totalHdd" package-nsUri="http://www.example.org/cps"/>
21 </extension>
22 <extension id="extension.derived.hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory" point="org.eclipse.viatra.query.runtime.base.wellbehaving.derived.features">
23 <wellbehaving-derived-feature classifier-name="HostInstance" feature-name="totalMemory" package-nsUri="http://www.example.org/cps"/>
24 </extension>
25 <extension id="hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries" point="org.eclipse.viatra.query.runtime.queryspecification"> 7 <extension id="hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries" point="org.eclipse.viatra.query.runtime.queryspecification">
26 <group group="org.eclipse.viatra.query.runtime.extensibility.SingletonExtensionFactory:hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries" id="hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries"> 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">
27 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications"/> 9 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement"/>
28 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts"/>
29 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory"/>
30 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd"/>
31 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory"/>
32 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd"/>
33 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement"/> 10 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.allocationWithoutResourceRequirement"/>
34 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory"/> 11 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableMemory"/>
35 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd"/> 12 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.notEnoughAvailableHdd"/>
@@ -40,6 +17,11 @@
40 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric"/> 17 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.averageFreeHddMetric"/>
41 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric"/> 18 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.costMetric"/>
42 <query-specification fqn="hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsCost"/> 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"/>
43 </group> 25 </group>
44 </extension> 26 </extension>
45</plugin> 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
index b634f74b..4e059848 100644
--- 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
@@ -15,3 +15,13 @@
15/.CostMetric.java._trace 15/.CostMetric.java._trace
16/.CpsCost.java._trace 16/.CpsCost.java._trace
17/.RedundantInstancesOnSameHost.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
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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd;
9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory;
10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance;
11import java.util.Arrays;
12import java.util.Collection;
13import java.util.Collections;
14import java.util.LinkedHashSet;
15import java.util.List;
16import java.util.Objects;
17import java.util.Optional;
18import java.util.Set;
19import java.util.function.Consumer;
20import java.util.stream.Collectors;
21import java.util.stream.Stream;
22import org.apache.log4j.Logger;
23import org.eclipse.emf.ecore.EClass;
24import org.eclipse.emf.ecore.EDataType;
25import org.eclipse.viatra.query.runtime.api.IPatternMatch;
26import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
27import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
28import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
29import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
30import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
31import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
32import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
33import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
34import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
35import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
36import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
37import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
38import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
39import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
43import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
44import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
45import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
46import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
47import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
48import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
49import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
50import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
51import 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")
81public 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
index be7488b6..6da5f76d 100644
--- 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
@@ -5,7 +5,7 @@ package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance; 6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; 7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement; 8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement;
9import java.util.Arrays; 9import java.util.Arrays;
10import java.util.Collection; 10import java.util.Collection;
11import java.util.LinkedHashSet; 11import java.util.LinkedHashSet;
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java
deleted file mode 100644
index 22821c4a..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableHdd.java
+++ /dev/null
@@ -1,743 +0,0 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.emf.ecore.EClass;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
32import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
33import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
34import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
35import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
36import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
43import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
44import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
45import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
46import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
47import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
48import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
49import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
50
51/**
52 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
53 *
54 * <p>Original source:
55 * <code><pre>
56 * {@literal @}QueryBasedFeature(feature = "availableHdd")
57 * pattern availableHdd(Host : HostInstance, Hdd : java Integer) {
58 * find totalHdd(Host, TotalHdd);
59 * RequiredHdd == sum find hddRequirement(Host, _, #_);
60 * Hdd == eval(TotalHdd - RequiredHdd);
61 * }
62 * </pre></code>
63 *
64 * @see Matcher
65 * @see Match
66 *
67 */
68@SuppressWarnings("all")
69public final class AvailableHdd extends BaseGeneratedEMFQuerySpecification<AvailableHdd.Matcher> {
70 /**
71 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd pattern,
72 * to be used in conjunction with {@link Matcher}.
73 *
74 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
75 * Each instance is a (possibly partial) substitution of pattern parameters,
76 * usable to represent a match of the pattern in the result of a query,
77 * or to specify the bound (fixed) input parameters when issuing a query.
78 *
79 * @see Matcher
80 *
81 */
82 public static abstract class Match extends BasePatternMatch {
83 private HostInstance fHost;
84
85 private Integer fHdd;
86
87 private static List<String> parameterNames = makeImmutableList("Host", "Hdd");
88
89 private Match(final HostInstance pHost, final Integer pHdd) {
90 this.fHost = pHost;
91 this.fHdd = pHdd;
92 }
93
94 @Override
95 public Object get(final String parameterName) {
96 if ("Host".equals(parameterName)) return this.fHost;
97 if ("Hdd".equals(parameterName)) return this.fHdd;
98 return null;
99 }
100
101 public HostInstance getHost() {
102 return this.fHost;
103 }
104
105 public Integer getHdd() {
106 return this.fHdd;
107 }
108
109 @Override
110 public boolean set(final String parameterName, final Object newValue) {
111 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
112 if ("Host".equals(parameterName) ) {
113 this.fHost = (HostInstance) newValue;
114 return true;
115 }
116 if ("Hdd".equals(parameterName) ) {
117 this.fHdd = (Integer) newValue;
118 return true;
119 }
120 return false;
121 }
122
123 public void setHost(final HostInstance pHost) {
124 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
125 this.fHost = pHost;
126 }
127
128 public void setHdd(final Integer pHdd) {
129 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
130 this.fHdd = pHdd;
131 }
132
133 @Override
134 public String patternName() {
135 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd";
136 }
137
138 @Override
139 public List<String> parameterNames() {
140 return AvailableHdd.Match.parameterNames;
141 }
142
143 @Override
144 public Object[] toArray() {
145 return new Object[]{fHost, fHdd};
146 }
147
148 @Override
149 public AvailableHdd.Match toImmutable() {
150 return isMutable() ? newMatch(fHost, fHdd) : this;
151 }
152
153 @Override
154 public String prettyPrint() {
155 StringBuilder result = new StringBuilder();
156 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
157 result.append("\"Hdd\"=" + prettyPrintValue(fHdd));
158 return result.toString();
159 }
160
161 @Override
162 public int hashCode() {
163 return Objects.hash(fHost, fHdd);
164 }
165
166 @Override
167 public boolean equals(final Object obj) {
168 if (this == obj)
169 return true;
170 if (obj == null) {
171 return false;
172 }
173 if ((obj instanceof AvailableHdd.Match)) {
174 AvailableHdd.Match other = (AvailableHdd.Match) obj;
175 return Objects.equals(fHost, other.fHost) && Objects.equals(fHdd, other.fHdd);
176 } else {
177 // this should be infrequent
178 if (!(obj instanceof IPatternMatch)) {
179 return false;
180 }
181 IPatternMatch otherSig = (IPatternMatch) obj;
182 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
183 }
184 }
185
186 @Override
187 public AvailableHdd specification() {
188 return AvailableHdd.instance();
189 }
190
191 /**
192 * Returns an empty, mutable match.
193 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
194 *
195 * @return the empty match.
196 *
197 */
198 public static AvailableHdd.Match newEmptyMatch() {
199 return new Mutable(null, null);
200 }
201
202 /**
203 * Returns a mutable (partial) match.
204 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
205 *
206 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
207 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
208 * @return the new, mutable (partial) match object.
209 *
210 */
211 public static AvailableHdd.Match newMutableMatch(final HostInstance pHost, final Integer pHdd) {
212 return new Mutable(pHost, pHdd);
213 }
214
215 /**
216 * Returns a new (partial) match.
217 * This can be used e.g. to call the matcher with a partial match.
218 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
219 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
220 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
221 * @return the (partial) match object.
222 *
223 */
224 public static AvailableHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
225 return new Immutable(pHost, pHdd);
226 }
227
228 private static final class Mutable extends AvailableHdd.Match {
229 Mutable(final HostInstance pHost, final Integer pHdd) {
230 super(pHost, pHdd);
231 }
232
233 @Override
234 public boolean isMutable() {
235 return true;
236 }
237 }
238
239 private static final class Immutable extends AvailableHdd.Match {
240 Immutable(final HostInstance pHost, final Integer pHdd) {
241 super(pHost, pHdd);
242 }
243
244 @Override
245 public boolean isMutable() {
246 return false;
247 }
248 }
249 }
250
251 /**
252 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd pattern,
253 * providing pattern-specific query methods.
254 *
255 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
256 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
257 *
258 * <p>Matches of the pattern will be represented as {@link Match}.
259 *
260 * <p>Original source:
261 * <code><pre>
262 * {@literal @}QueryBasedFeature(feature = "availableHdd")
263 * pattern availableHdd(Host : HostInstance, Hdd : java Integer) {
264 * find totalHdd(Host, TotalHdd);
265 * RequiredHdd == sum find hddRequirement(Host, _, #_);
266 * Hdd == eval(TotalHdd - RequiredHdd);
267 * }
268 * </pre></code>
269 *
270 * @see Match
271 * @see AvailableHdd
272 *
273 */
274 public static class Matcher extends BaseMatcher<AvailableHdd.Match> {
275 /**
276 * Initializes the pattern matcher within an existing VIATRA Query engine.
277 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
278 *
279 * @param engine the existing VIATRA Query engine in which this matcher will be created.
280 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
281 *
282 */
283 public static AvailableHdd.Matcher on(final ViatraQueryEngine engine) {
284 // check if matcher already exists
285 Matcher matcher = engine.getExistingMatcher(querySpecification());
286 if (matcher == null) {
287 matcher = (Matcher)engine.getMatcher(querySpecification());
288 }
289 return matcher;
290 }
291
292 /**
293 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
294 * @return an initialized matcher
295 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
296 *
297 */
298 public static AvailableHdd.Matcher create() {
299 return new Matcher();
300 }
301
302 private static final int POSITION_HOST = 0;
303
304 private static final int POSITION_HDD = 1;
305
306 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AvailableHdd.Matcher.class);
307
308 /**
309 * Initializes the pattern matcher within an existing VIATRA Query engine.
310 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
311 *
312 * @param engine the existing VIATRA Query engine in which this matcher will be created.
313 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
314 *
315 */
316 private Matcher() {
317 super(querySpecification());
318 }
319
320 /**
321 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
322 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
323 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
324 * @return matches represented as a Match object.
325 *
326 */
327 public Collection<AvailableHdd.Match> getAllMatches(final HostInstance pHost, final Integer pHdd) {
328 return rawStreamAllMatches(new Object[]{pHost, pHdd}).collect(Collectors.toSet());
329 }
330
331 /**
332 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
333 * </p>
334 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
335 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
336 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
337 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
338 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
339 * @return a stream of matches represented as a Match object.
340 *
341 */
342 public Stream<AvailableHdd.Match> streamAllMatches(final HostInstance pHost, final Integer pHdd) {
343 return rawStreamAllMatches(new Object[]{pHost, pHdd});
344 }
345
346 /**
347 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
348 * Neither determinism nor randomness of selection is guaranteed.
349 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
350 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
351 * @return a match represented as a Match object, or null if no match is found.
352 *
353 */
354 public Optional<AvailableHdd.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pHdd) {
355 return rawGetOneArbitraryMatch(new Object[]{pHost, pHdd});
356 }
357
358 /**
359 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
360 * under any possible substitution of the unspecified parameters (if any).
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
363 * @return true if the input is a valid (partial) match of the pattern.
364 *
365 */
366 public boolean hasMatch(final HostInstance pHost, final Integer pHdd) {
367 return rawHasMatch(new Object[]{pHost, pHdd});
368 }
369
370 /**
371 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
372 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
373 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
374 * @return the number of pattern matches found.
375 *
376 */
377 public int countMatches(final HostInstance pHost, final Integer pHdd) {
378 return rawCountMatches(new Object[]{pHost, pHdd});
379 }
380
381 /**
382 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
383 * Neither determinism nor randomness of selection is guaranteed.
384 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
385 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
386 * @param processor the action that will process the selected match.
387 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
388 *
389 */
390 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pHdd, final Consumer<? super AvailableHdd.Match> processor) {
391 return rawForOneArbitraryMatch(new Object[]{pHost, pHdd}, processor);
392 }
393
394 /**
395 * Returns a new (partial) match.
396 * This can be used e.g. to call the matcher with a partial match.
397 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
398 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
399 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
400 * @return the (partial) match object.
401 *
402 */
403 public AvailableHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
404 return AvailableHdd.Match.newMatch(pHost, pHdd);
405 }
406
407 /**
408 * Retrieve the set of values that occur in matches for Host.
409 * @return the Set of all values or empty set if there are no matches
410 *
411 */
412 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
413 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
414 }
415
416 /**
417 * Retrieve the set of values that occur in matches for Host.
418 * @return the Set of all values or empty set if there are no matches
419 *
420 */
421 public Set<HostInstance> getAllValuesOfHost() {
422 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
423 }
424
425 /**
426 * Retrieve the set of values that occur in matches for Host.
427 * @return the Set of all values or empty set if there are no matches
428 *
429 */
430 public Stream<HostInstance> streamAllValuesOfHost() {
431 return rawStreamAllValuesOfHost(emptyArray());
432 }
433
434 /**
435 * Retrieve the set of values that occur in matches for Host.
436 * </p>
437 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
438 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
439 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
440 *
441 * @return the Stream of all values or empty set if there are no matches
442 *
443 */
444 public Stream<HostInstance> streamAllValuesOfHost(final AvailableHdd.Match partialMatch) {
445 return rawStreamAllValuesOfHost(partialMatch.toArray());
446 }
447
448 /**
449 * Retrieve the set of values that occur in matches for Host.
450 * </p>
451 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
452 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
453 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
454 *
455 * @return the Stream of all values or empty set if there are no matches
456 *
457 */
458 public Stream<HostInstance> streamAllValuesOfHost(final Integer pHdd) {
459 return rawStreamAllValuesOfHost(new Object[]{null, pHdd});
460 }
461
462 /**
463 * Retrieve the set of values that occur in matches for Host.
464 * @return the Set of all values or empty set if there are no matches
465 *
466 */
467 public Set<HostInstance> getAllValuesOfHost(final AvailableHdd.Match partialMatch) {
468 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
469 }
470
471 /**
472 * Retrieve the set of values that occur in matches for Host.
473 * @return the Set of all values or empty set if there are no matches
474 *
475 */
476 public Set<HostInstance> getAllValuesOfHost(final Integer pHdd) {
477 return rawStreamAllValuesOfHost(new Object[]{null, pHdd}).collect(Collectors.toSet());
478 }
479
480 /**
481 * Retrieve the set of values that occur in matches for Hdd.
482 * @return the Set of all values or empty set if there are no matches
483 *
484 */
485 protected Stream<Integer> rawStreamAllValuesOfHdd(final Object[] parameters) {
486 return rawStreamAllValues(POSITION_HDD, parameters).map(Integer.class::cast);
487 }
488
489 /**
490 * Retrieve the set of values that occur in matches for Hdd.
491 * @return the Set of all values or empty set if there are no matches
492 *
493 */
494 public Set<Integer> getAllValuesOfHdd() {
495 return rawStreamAllValuesOfHdd(emptyArray()).collect(Collectors.toSet());
496 }
497
498 /**
499 * Retrieve the set of values that occur in matches for Hdd.
500 * @return the Set of all values or empty set if there are no matches
501 *
502 */
503 public Stream<Integer> streamAllValuesOfHdd() {
504 return rawStreamAllValuesOfHdd(emptyArray());
505 }
506
507 /**
508 * Retrieve the set of values that occur in matches for Hdd.
509 * </p>
510 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
511 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
512 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
513 *
514 * @return the Stream of all values or empty set if there are no matches
515 *
516 */
517 public Stream<Integer> streamAllValuesOfHdd(final AvailableHdd.Match partialMatch) {
518 return rawStreamAllValuesOfHdd(partialMatch.toArray());
519 }
520
521 /**
522 * Retrieve the set of values that occur in matches for Hdd.
523 * </p>
524 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
525 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
526 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
527 *
528 * @return the Stream of all values or empty set if there are no matches
529 *
530 */
531 public Stream<Integer> streamAllValuesOfHdd(final HostInstance pHost) {
532 return rawStreamAllValuesOfHdd(new Object[]{pHost, null});
533 }
534
535 /**
536 * Retrieve the set of values that occur in matches for Hdd.
537 * @return the Set of all values or empty set if there are no matches
538 *
539 */
540 public Set<Integer> getAllValuesOfHdd(final AvailableHdd.Match partialMatch) {
541 return rawStreamAllValuesOfHdd(partialMatch.toArray()).collect(Collectors.toSet());
542 }
543
544 /**
545 * Retrieve the set of values that occur in matches for Hdd.
546 * @return the Set of all values or empty set if there are no matches
547 *
548 */
549 public Set<Integer> getAllValuesOfHdd(final HostInstance pHost) {
550 return rawStreamAllValuesOfHdd(new Object[]{pHost, null}).collect(Collectors.toSet());
551 }
552
553 @Override
554 protected AvailableHdd.Match tupleToMatch(final Tuple t) {
555 try {
556 return AvailableHdd.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_HDD));
557 } catch(ClassCastException e) {
558 LOGGER.error("Element(s) in tuple not properly typed!",e);
559 return null;
560 }
561 }
562
563 @Override
564 protected AvailableHdd.Match arrayToMatch(final Object[] match) {
565 try {
566 return AvailableHdd.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
567 } catch(ClassCastException e) {
568 LOGGER.error("Element(s) in array not properly typed!",e);
569 return null;
570 }
571 }
572
573 @Override
574 protected AvailableHdd.Match arrayToMatchMutable(final Object[] match) {
575 try {
576 return AvailableHdd.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
577 } catch(ClassCastException e) {
578 LOGGER.error("Element(s) in array not properly typed!",e);
579 return null;
580 }
581 }
582
583 /**
584 * @return the singleton instance of the query specification of this pattern
585 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
586 *
587 */
588 public static IQuerySpecification<AvailableHdd.Matcher> querySpecification() {
589 return AvailableHdd.instance();
590 }
591 }
592
593 private AvailableHdd() {
594 super(GeneratedPQuery.INSTANCE);
595 }
596
597 /**
598 * @return the singleton instance of the query specification
599 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
600 *
601 */
602 public static AvailableHdd instance() {
603 try{
604 return LazyHolder.INSTANCE;
605 } catch (ExceptionInInitializerError err) {
606 throw processInitializerError(err);
607 }
608 }
609
610 @Override
611 protected AvailableHdd.Matcher instantiate(final ViatraQueryEngine engine) {
612 return AvailableHdd.Matcher.on(engine);
613 }
614
615 @Override
616 public AvailableHdd.Matcher instantiate() {
617 return AvailableHdd.Matcher.create();
618 }
619
620 @Override
621 public AvailableHdd.Match newEmptyMatch() {
622 return AvailableHdd.Match.newEmptyMatch();
623 }
624
625 @Override
626 public AvailableHdd.Match newMatch(final Object... parameters) {
627 return AvailableHdd.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
628 }
629
630 /**
631 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd (visibility: PUBLIC, simpleName: AvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
632 * <b>not</b> at the class load time of the outer class,
633 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd (visibility: PUBLIC, simpleName: AvailableHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
634 *
635 * <p> This workaround is required e.g. to support recursion.
636 *
637 */
638 private static class LazyHolder {
639 private static final AvailableHdd INSTANCE = new AvailableHdd();
640
641 /**
642 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
643 * This initialization order is required to support indirect recursion.
644 *
645 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
646 *
647 */
648 private static final Object STATIC_INITIALIZER = ensureInitialized();
649
650 public static Object ensureInitialized() {
651 INSTANCE.ensureInitializedInternal();
652 return null;
653 }
654 }
655
656 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
657 private static final AvailableHdd.GeneratedPQuery INSTANCE = new GeneratedPQuery();
658
659 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
660
661 private final PParameter parameter_Hdd = new PParameter("Hdd", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT);
662
663 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Hdd);
664
665 private GeneratedPQuery() {
666 super(PVisibility.PUBLIC);
667 }
668
669 @Override
670 public String getFullyQualifiedName() {
671 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableHdd";
672 }
673
674 @Override
675 public List<String> getParameterNames() {
676 return Arrays.asList("Host","Hdd");
677 }
678
679 @Override
680 public List<PParameter> getParameters() {
681 return parameters;
682 }
683
684 @Override
685 public Set<PBody> doGetContainedBodies() {
686 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
687 Set<PBody> bodies = new LinkedHashSet<>();
688 {
689 PBody body = new PBody(this);
690 PVariable var_Host = body.getOrCreateVariableByName("Host");
691 PVariable var_Hdd = body.getOrCreateVariableByName("Hdd");
692 PVariable var_TotalHdd = body.getOrCreateVariableByName("TotalHdd");
693 PVariable var_RequiredHdd = body.getOrCreateVariableByName("RequiredHdd");
694 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
695 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
696 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
697 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Hdd), new JavaTransitiveInstancesKey(java.lang.Integer.class));
698 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
699 new ExportedParameter(body, var_Host, parameter_Host),
700 new ExportedParameter(body, var_Hdd, parameter_Hdd)
701 ));
702 // find totalHdd(Host, TotalHdd)
703 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_TotalHdd), TotalHdd.instance().getInternalQueryRepresentation());
704 // RequiredHdd == sum find hddRequirement(Host, _, #_)
705 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
706 new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var_Host, var___0_, var___1_), HddRequirement.instance().getInternalQueryRepresentation(), var__virtual_0_, 2);
707 new Equality(body, var_RequiredHdd, var__virtual_0_);
708 // Hdd == eval(TotalHdd - RequiredHdd)
709 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
710 new ExpressionEvaluation(body, new IExpressionEvaluator() {
711
712 @Override
713 public String getShortDescription() {
714 return "Expression evaluation from pattern availableHdd";
715 }
716
717 @Override
718 public Iterable<String> getInputParameterNames() {
719 return Arrays.asList("RequiredHdd", "TotalHdd");}
720
721 @Override
722 public Object evaluateExpression(IValueProvider provider) throws Exception {
723 Integer RequiredHdd = (Integer) provider.getValue("RequiredHdd");
724 Integer TotalHdd = (Integer) provider.getValue("TotalHdd");
725 return evaluateExpression_1_1(RequiredHdd, TotalHdd);
726 }
727 }, var__virtual_1_ );
728 new Equality(body, var_Hdd, var__virtual_1_);
729 bodies.add(body);
730 }
731 {
732 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
733 annotation.addAttribute("feature", "availableHdd");
734 addAnnotation(annotation);
735 }
736 return bodies;
737 }
738 }
739
740 private static int evaluateExpression_1_1(final Integer RequiredHdd, final Integer TotalHdd) {
741 return ((TotalHdd).intValue() - (RequiredHdd).intValue());
742 }
743}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java
deleted file mode 100644
index 930a24ba..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AvailableMemory.java
+++ /dev/null
@@ -1,743 +0,0 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.emf.ecore.EClass;
21import org.eclipse.viatra.query.runtime.api.IPatternMatch;
22import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
23import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
25import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
26import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
27import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
28import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
32import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
33import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
34import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
35import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
36import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
40import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
41import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
42import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
43import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
44import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
45import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
46import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
47import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
48import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
49import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
50
51/**
52 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
53 *
54 * <p>Original source:
55 * <code><pre>
56 * {@literal @}QueryBasedFeature(feature = "availableMemory")
57 * pattern availableMemory(Host : HostInstance, Memory : java Integer) {
58 * find totalMemory(Host, TotalMemory);
59 * RequiredMemory == sum find memoryRequirement(Host, _, #_);
60 * Memory == eval(TotalMemory - RequiredMemory);
61 * }
62 * </pre></code>
63 *
64 * @see Matcher
65 * @see Match
66 *
67 */
68@SuppressWarnings("all")
69public final class AvailableMemory extends BaseGeneratedEMFQuerySpecification<AvailableMemory.Matcher> {
70 /**
71 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory pattern,
72 * to be used in conjunction with {@link Matcher}.
73 *
74 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
75 * Each instance is a (possibly partial) substitution of pattern parameters,
76 * usable to represent a match of the pattern in the result of a query,
77 * or to specify the bound (fixed) input parameters when issuing a query.
78 *
79 * @see Matcher
80 *
81 */
82 public static abstract class Match extends BasePatternMatch {
83 private HostInstance fHost;
84
85 private Integer fMemory;
86
87 private static List<String> parameterNames = makeImmutableList("Host", "Memory");
88
89 private Match(final HostInstance pHost, final Integer pMemory) {
90 this.fHost = pHost;
91 this.fMemory = pMemory;
92 }
93
94 @Override
95 public Object get(final String parameterName) {
96 if ("Host".equals(parameterName)) return this.fHost;
97 if ("Memory".equals(parameterName)) return this.fMemory;
98 return null;
99 }
100
101 public HostInstance getHost() {
102 return this.fHost;
103 }
104
105 public Integer getMemory() {
106 return this.fMemory;
107 }
108
109 @Override
110 public boolean set(final String parameterName, final Object newValue) {
111 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
112 if ("Host".equals(parameterName) ) {
113 this.fHost = (HostInstance) newValue;
114 return true;
115 }
116 if ("Memory".equals(parameterName) ) {
117 this.fMemory = (Integer) newValue;
118 return true;
119 }
120 return false;
121 }
122
123 public void setHost(final HostInstance pHost) {
124 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
125 this.fHost = pHost;
126 }
127
128 public void setMemory(final Integer pMemory) {
129 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
130 this.fMemory = pMemory;
131 }
132
133 @Override
134 public String patternName() {
135 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory";
136 }
137
138 @Override
139 public List<String> parameterNames() {
140 return AvailableMemory.Match.parameterNames;
141 }
142
143 @Override
144 public Object[] toArray() {
145 return new Object[]{fHost, fMemory};
146 }
147
148 @Override
149 public AvailableMemory.Match toImmutable() {
150 return isMutable() ? newMatch(fHost, fMemory) : this;
151 }
152
153 @Override
154 public String prettyPrint() {
155 StringBuilder result = new StringBuilder();
156 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
157 result.append("\"Memory\"=" + prettyPrintValue(fMemory));
158 return result.toString();
159 }
160
161 @Override
162 public int hashCode() {
163 return Objects.hash(fHost, fMemory);
164 }
165
166 @Override
167 public boolean equals(final Object obj) {
168 if (this == obj)
169 return true;
170 if (obj == null) {
171 return false;
172 }
173 if ((obj instanceof AvailableMemory.Match)) {
174 AvailableMemory.Match other = (AvailableMemory.Match) obj;
175 return Objects.equals(fHost, other.fHost) && Objects.equals(fMemory, other.fMemory);
176 } else {
177 // this should be infrequent
178 if (!(obj instanceof IPatternMatch)) {
179 return false;
180 }
181 IPatternMatch otherSig = (IPatternMatch) obj;
182 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
183 }
184 }
185
186 @Override
187 public AvailableMemory specification() {
188 return AvailableMemory.instance();
189 }
190
191 /**
192 * Returns an empty, mutable match.
193 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
194 *
195 * @return the empty match.
196 *
197 */
198 public static AvailableMemory.Match newEmptyMatch() {
199 return new Mutable(null, null);
200 }
201
202 /**
203 * Returns a mutable (partial) match.
204 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
205 *
206 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
207 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
208 * @return the new, mutable (partial) match object.
209 *
210 */
211 public static AvailableMemory.Match newMutableMatch(final HostInstance pHost, final Integer pMemory) {
212 return new Mutable(pHost, pMemory);
213 }
214
215 /**
216 * Returns a new (partial) match.
217 * This can be used e.g. to call the matcher with a partial match.
218 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
219 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
220 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
221 * @return the (partial) match object.
222 *
223 */
224 public static AvailableMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
225 return new Immutable(pHost, pMemory);
226 }
227
228 private static final class Mutable extends AvailableMemory.Match {
229 Mutable(final HostInstance pHost, final Integer pMemory) {
230 super(pHost, pMemory);
231 }
232
233 @Override
234 public boolean isMutable() {
235 return true;
236 }
237 }
238
239 private static final class Immutable extends AvailableMemory.Match {
240 Immutable(final HostInstance pHost, final Integer pMemory) {
241 super(pHost, pMemory);
242 }
243
244 @Override
245 public boolean isMutable() {
246 return false;
247 }
248 }
249 }
250
251 /**
252 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory pattern,
253 * providing pattern-specific query methods.
254 *
255 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
256 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
257 *
258 * <p>Matches of the pattern will be represented as {@link Match}.
259 *
260 * <p>Original source:
261 * <code><pre>
262 * {@literal @}QueryBasedFeature(feature = "availableMemory")
263 * pattern availableMemory(Host : HostInstance, Memory : java Integer) {
264 * find totalMemory(Host, TotalMemory);
265 * RequiredMemory == sum find memoryRequirement(Host, _, #_);
266 * Memory == eval(TotalMemory - RequiredMemory);
267 * }
268 * </pre></code>
269 *
270 * @see Match
271 * @see AvailableMemory
272 *
273 */
274 public static class Matcher extends BaseMatcher<AvailableMemory.Match> {
275 /**
276 * Initializes the pattern matcher within an existing VIATRA Query engine.
277 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
278 *
279 * @param engine the existing VIATRA Query engine in which this matcher will be created.
280 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
281 *
282 */
283 public static AvailableMemory.Matcher on(final ViatraQueryEngine engine) {
284 // check if matcher already exists
285 Matcher matcher = engine.getExistingMatcher(querySpecification());
286 if (matcher == null) {
287 matcher = (Matcher)engine.getMatcher(querySpecification());
288 }
289 return matcher;
290 }
291
292 /**
293 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
294 * @return an initialized matcher
295 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
296 *
297 */
298 public static AvailableMemory.Matcher create() {
299 return new Matcher();
300 }
301
302 private static final int POSITION_HOST = 0;
303
304 private static final int POSITION_MEMORY = 1;
305
306 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(AvailableMemory.Matcher.class);
307
308 /**
309 * Initializes the pattern matcher within an existing VIATRA Query engine.
310 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
311 *
312 * @param engine the existing VIATRA Query engine in which this matcher will be created.
313 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
314 *
315 */
316 private Matcher() {
317 super(querySpecification());
318 }
319
320 /**
321 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
322 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
323 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
324 * @return matches represented as a Match object.
325 *
326 */
327 public Collection<AvailableMemory.Match> getAllMatches(final HostInstance pHost, final Integer pMemory) {
328 return rawStreamAllMatches(new Object[]{pHost, pMemory}).collect(Collectors.toSet());
329 }
330
331 /**
332 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
333 * </p>
334 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
335 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
336 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
337 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
338 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
339 * @return a stream of matches represented as a Match object.
340 *
341 */
342 public Stream<AvailableMemory.Match> streamAllMatches(final HostInstance pHost, final Integer pMemory) {
343 return rawStreamAllMatches(new Object[]{pHost, pMemory});
344 }
345
346 /**
347 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
348 * Neither determinism nor randomness of selection is guaranteed.
349 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
350 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
351 * @return a match represented as a Match object, or null if no match is found.
352 *
353 */
354 public Optional<AvailableMemory.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pMemory) {
355 return rawGetOneArbitraryMatch(new Object[]{pHost, pMemory});
356 }
357
358 /**
359 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
360 * under any possible substitution of the unspecified parameters (if any).
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
363 * @return true if the input is a valid (partial) match of the pattern.
364 *
365 */
366 public boolean hasMatch(final HostInstance pHost, final Integer pMemory) {
367 return rawHasMatch(new Object[]{pHost, pMemory});
368 }
369
370 /**
371 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
372 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
373 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
374 * @return the number of pattern matches found.
375 *
376 */
377 public int countMatches(final HostInstance pHost, final Integer pMemory) {
378 return rawCountMatches(new Object[]{pHost, pMemory});
379 }
380
381 /**
382 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
383 * Neither determinism nor randomness of selection is guaranteed.
384 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
385 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
386 * @param processor the action that will process the selected match.
387 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
388 *
389 */
390 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pMemory, final Consumer<? super AvailableMemory.Match> processor) {
391 return rawForOneArbitraryMatch(new Object[]{pHost, pMemory}, processor);
392 }
393
394 /**
395 * Returns a new (partial) match.
396 * This can be used e.g. to call the matcher with a partial match.
397 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
398 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
399 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
400 * @return the (partial) match object.
401 *
402 */
403 public AvailableMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
404 return AvailableMemory.Match.newMatch(pHost, pMemory);
405 }
406
407 /**
408 * Retrieve the set of values that occur in matches for Host.
409 * @return the Set of all values or empty set if there are no matches
410 *
411 */
412 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
413 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
414 }
415
416 /**
417 * Retrieve the set of values that occur in matches for Host.
418 * @return the Set of all values or empty set if there are no matches
419 *
420 */
421 public Set<HostInstance> getAllValuesOfHost() {
422 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
423 }
424
425 /**
426 * Retrieve the set of values that occur in matches for Host.
427 * @return the Set of all values or empty set if there are no matches
428 *
429 */
430 public Stream<HostInstance> streamAllValuesOfHost() {
431 return rawStreamAllValuesOfHost(emptyArray());
432 }
433
434 /**
435 * Retrieve the set of values that occur in matches for Host.
436 * </p>
437 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
438 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
439 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
440 *
441 * @return the Stream of all values or empty set if there are no matches
442 *
443 */
444 public Stream<HostInstance> streamAllValuesOfHost(final AvailableMemory.Match partialMatch) {
445 return rawStreamAllValuesOfHost(partialMatch.toArray());
446 }
447
448 /**
449 * Retrieve the set of values that occur in matches for Host.
450 * </p>
451 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
452 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
453 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
454 *
455 * @return the Stream of all values or empty set if there are no matches
456 *
457 */
458 public Stream<HostInstance> streamAllValuesOfHost(final Integer pMemory) {
459 return rawStreamAllValuesOfHost(new Object[]{null, pMemory});
460 }
461
462 /**
463 * Retrieve the set of values that occur in matches for Host.
464 * @return the Set of all values or empty set if there are no matches
465 *
466 */
467 public Set<HostInstance> getAllValuesOfHost(final AvailableMemory.Match partialMatch) {
468 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
469 }
470
471 /**
472 * Retrieve the set of values that occur in matches for Host.
473 * @return the Set of all values or empty set if there are no matches
474 *
475 */
476 public Set<HostInstance> getAllValuesOfHost(final Integer pMemory) {
477 return rawStreamAllValuesOfHost(new Object[]{null, pMemory}).collect(Collectors.toSet());
478 }
479
480 /**
481 * Retrieve the set of values that occur in matches for Memory.
482 * @return the Set of all values or empty set if there are no matches
483 *
484 */
485 protected Stream<Integer> rawStreamAllValuesOfMemory(final Object[] parameters) {
486 return rawStreamAllValues(POSITION_MEMORY, parameters).map(Integer.class::cast);
487 }
488
489 /**
490 * Retrieve the set of values that occur in matches for Memory.
491 * @return the Set of all values or empty set if there are no matches
492 *
493 */
494 public Set<Integer> getAllValuesOfMemory() {
495 return rawStreamAllValuesOfMemory(emptyArray()).collect(Collectors.toSet());
496 }
497
498 /**
499 * Retrieve the set of values that occur in matches for Memory.
500 * @return the Set of all values or empty set if there are no matches
501 *
502 */
503 public Stream<Integer> streamAllValuesOfMemory() {
504 return rawStreamAllValuesOfMemory(emptyArray());
505 }
506
507 /**
508 * Retrieve the set of values that occur in matches for Memory.
509 * </p>
510 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
511 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
512 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
513 *
514 * @return the Stream of all values or empty set if there are no matches
515 *
516 */
517 public Stream<Integer> streamAllValuesOfMemory(final AvailableMemory.Match partialMatch) {
518 return rawStreamAllValuesOfMemory(partialMatch.toArray());
519 }
520
521 /**
522 * Retrieve the set of values that occur in matches for Memory.
523 * </p>
524 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
525 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
526 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
527 *
528 * @return the Stream of all values or empty set if there are no matches
529 *
530 */
531 public Stream<Integer> streamAllValuesOfMemory(final HostInstance pHost) {
532 return rawStreamAllValuesOfMemory(new Object[]{pHost, null});
533 }
534
535 /**
536 * Retrieve the set of values that occur in matches for Memory.
537 * @return the Set of all values or empty set if there are no matches
538 *
539 */
540 public Set<Integer> getAllValuesOfMemory(final AvailableMemory.Match partialMatch) {
541 return rawStreamAllValuesOfMemory(partialMatch.toArray()).collect(Collectors.toSet());
542 }
543
544 /**
545 * Retrieve the set of values that occur in matches for Memory.
546 * @return the Set of all values or empty set if there are no matches
547 *
548 */
549 public Set<Integer> getAllValuesOfMemory(final HostInstance pHost) {
550 return rawStreamAllValuesOfMemory(new Object[]{pHost, null}).collect(Collectors.toSet());
551 }
552
553 @Override
554 protected AvailableMemory.Match tupleToMatch(final Tuple t) {
555 try {
556 return AvailableMemory.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_MEMORY));
557 } catch(ClassCastException e) {
558 LOGGER.error("Element(s) in tuple not properly typed!",e);
559 return null;
560 }
561 }
562
563 @Override
564 protected AvailableMemory.Match arrayToMatch(final Object[] match) {
565 try {
566 return AvailableMemory.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
567 } catch(ClassCastException e) {
568 LOGGER.error("Element(s) in array not properly typed!",e);
569 return null;
570 }
571 }
572
573 @Override
574 protected AvailableMemory.Match arrayToMatchMutable(final Object[] match) {
575 try {
576 return AvailableMemory.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
577 } catch(ClassCastException e) {
578 LOGGER.error("Element(s) in array not properly typed!",e);
579 return null;
580 }
581 }
582
583 /**
584 * @return the singleton instance of the query specification of this pattern
585 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
586 *
587 */
588 public static IQuerySpecification<AvailableMemory.Matcher> querySpecification() {
589 return AvailableMemory.instance();
590 }
591 }
592
593 private AvailableMemory() {
594 super(GeneratedPQuery.INSTANCE);
595 }
596
597 /**
598 * @return the singleton instance of the query specification
599 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
600 *
601 */
602 public static AvailableMemory instance() {
603 try{
604 return LazyHolder.INSTANCE;
605 } catch (ExceptionInInitializerError err) {
606 throw processInitializerError(err);
607 }
608 }
609
610 @Override
611 protected AvailableMemory.Matcher instantiate(final ViatraQueryEngine engine) {
612 return AvailableMemory.Matcher.on(engine);
613 }
614
615 @Override
616 public AvailableMemory.Matcher instantiate() {
617 return AvailableMemory.Matcher.create();
618 }
619
620 @Override
621 public AvailableMemory.Match newEmptyMatch() {
622 return AvailableMemory.Match.newEmptyMatch();
623 }
624
625 @Override
626 public AvailableMemory.Match newMatch(final Object... parameters) {
627 return AvailableMemory.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
628 }
629
630 /**
631 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory (visibility: PUBLIC, simpleName: AvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
632 * <b>not</b> at the class load time of the outer class,
633 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory (visibility: PUBLIC, simpleName: AvailableMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
634 *
635 * <p> This workaround is required e.g. to support recursion.
636 *
637 */
638 private static class LazyHolder {
639 private static final AvailableMemory INSTANCE = new AvailableMemory();
640
641 /**
642 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
643 * This initialization order is required to support indirect recursion.
644 *
645 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
646 *
647 */
648 private static final Object STATIC_INITIALIZER = ensureInitialized();
649
650 public static Object ensureInitialized() {
651 INSTANCE.ensureInitializedInternal();
652 return null;
653 }
654 }
655
656 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
657 private static final AvailableMemory.GeneratedPQuery INSTANCE = new GeneratedPQuery();
658
659 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
660
661 private final PParameter parameter_Memory = new PParameter("Memory", "java.lang.Integer", new JavaTransitiveInstancesKey(java.lang.Integer.class), PParameterDirection.INOUT);
662
663 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Memory);
664
665 private GeneratedPQuery() {
666 super(PVisibility.PUBLIC);
667 }
668
669 @Override
670 public String getFullyQualifiedName() {
671 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.availableMemory";
672 }
673
674 @Override
675 public List<String> getParameterNames() {
676 return Arrays.asList("Host","Memory");
677 }
678
679 @Override
680 public List<PParameter> getParameters() {
681 return parameters;
682 }
683
684 @Override
685 public Set<PBody> doGetContainedBodies() {
686 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
687 Set<PBody> bodies = new LinkedHashSet<>();
688 {
689 PBody body = new PBody(this);
690 PVariable var_Host = body.getOrCreateVariableByName("Host");
691 PVariable var_Memory = body.getOrCreateVariableByName("Memory");
692 PVariable var_TotalMemory = body.getOrCreateVariableByName("TotalMemory");
693 PVariable var_RequiredMemory = body.getOrCreateVariableByName("RequiredMemory");
694 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
695 PVariable var___1_ = body.getOrCreateVariableByName("_<1>");
696 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
697 new TypeFilterConstraint(body, Tuples.flatTupleOf(var_Memory), new JavaTransitiveInstancesKey(java.lang.Integer.class));
698 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
699 new ExportedParameter(body, var_Host, parameter_Host),
700 new ExportedParameter(body, var_Memory, parameter_Memory)
701 ));
702 // find totalMemory(Host, TotalMemory)
703 new PositivePatternCall(body, Tuples.flatTupleOf(var_Host, var_TotalMemory), TotalMemory.instance().getInternalQueryRepresentation());
704 // RequiredMemory == sum find memoryRequirement(Host, _, #_)
705 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
706 new AggregatorConstraint(new sum().getAggregatorLogic(Integer.class), body, Tuples.flatTupleOf(var_Host, var___0_, var___1_), MemoryRequirement.instance().getInternalQueryRepresentation(), var__virtual_0_, 2);
707 new Equality(body, var_RequiredMemory, var__virtual_0_);
708 // Memory == eval(TotalMemory - RequiredMemory)
709 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
710 new ExpressionEvaluation(body, new IExpressionEvaluator() {
711
712 @Override
713 public String getShortDescription() {
714 return "Expression evaluation from pattern availableMemory";
715 }
716
717 @Override
718 public Iterable<String> getInputParameterNames() {
719 return Arrays.asList("RequiredMemory", "TotalMemory");}
720
721 @Override
722 public Object evaluateExpression(IValueProvider provider) throws Exception {
723 Integer RequiredMemory = (Integer) provider.getValue("RequiredMemory");
724 Integer TotalMemory = (Integer) provider.getValue("TotalMemory");
725 return evaluateExpression_1_1(RequiredMemory, TotalMemory);
726 }
727 }, var__virtual_1_ );
728 new Equality(body, var_Memory, var__virtual_1_);
729 bodies.add(body);
730 }
731 {
732 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
733 annotation.addAttribute("feature", "availableMemory");
734 addAnnotation(annotation);
735 }
736 return bodies;
737 }
738 }
739
740 private static int evaluateExpression_1_1(final Integer RequiredMemory, final Integer TotalMemory) {
741 return ((TotalMemory).intValue() - (RequiredMemory).intValue());
742 }
743}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeHddMetric.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/AverageFreeHddMetric.java
index 59d4ad27..bc38b60b 100644
--- 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
@@ -43,6 +43,8 @@ import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43 * 43 *
44 * <p>Original source: 44 * <p>Original source:
45 * <code><pre> 45 * <code><pre>
46 * // Free HDD
47 *
46 * pattern averageFreeHddMetric(Average : java Double) { 48 * pattern averageFreeHddMetric(Average : java Double) {
47 * Average == avg find freeHddPercentage(_, #_); 49 * Average == avg find freeHddPercentage(_, #_);
48 * } 50 * }
@@ -226,6 +228,8 @@ public final class AverageFreeHddMetric extends BaseGeneratedEMFQuerySpecificati
226 * 228 *
227 * <p>Original source: 229 * <p>Original source:
228 * <code><pre> 230 * <code><pre>
231 * // Free HDD
232 *
229 * pattern averageFreeHddMetric(Average : java Double) { 233 * pattern averageFreeHddMetric(Average : java Double) {
230 * Average == avg find freeHddPercentage(_, #_); 234 * Average == avg find freeHddPercentage(_, #_);
231 * } 235 * }
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
index a0d087f4..98974ea5 100644
--- 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
@@ -43,6 +43,12 @@ import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43 * 43 *
44 * <p>Original source: 44 * <p>Original source:
45 * <code><pre> 45 * <code><pre>
46 * //
47 * // Metrics
48 * //
49 *
50 * // Free memory
51 *
46 * pattern averageFreeMemoryMetric(Average : java Double) { 52 * pattern averageFreeMemoryMetric(Average : java Double) {
47 * Average == avg find freeMemoryPercentage(_, #_); 53 * Average == avg find freeMemoryPercentage(_, #_);
48 * } 54 * }
@@ -226,6 +232,12 @@ public final class AverageFreeMemoryMetric extends BaseGeneratedEMFQuerySpecific
226 * 232 *
227 * <p>Original source: 233 * <p>Original source:
228 * <code><pre> 234 * <code><pre>
235 * //
236 * // Metrics
237 * //
238 *
239 * // Free memory
240 *
229 * pattern averageFreeMemoryMetric(Average : java Double) { 241 * pattern averageFreeMemoryMetric(Average : java Double) {
230 * Average == avg find freeMemoryPercentage(_, #_); 242 * Average == avg find freeMemoryPercentage(_, #_);
231 * } 243 * }
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
index 4d8ca4cc..bf886ec0 100644
--- 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
@@ -43,6 +43,8 @@ import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43 * 43 *
44 * <p>Original source: 44 * <p>Original source:
45 * <code><pre> 45 * <code><pre>
46 * // Total cost
47 *
46 * pattern costMetric(Cost : java Integer) { 48 * pattern costMetric(Cost : java Integer) {
47 * Cost == sum find cpsCost(_, #_); 49 * Cost == sum find cpsCost(_, #_);
48 * } 50 * }
@@ -226,6 +228,8 @@ public final class CostMetric extends BaseGeneratedEMFQuerySpecification<CostMet
226 * 228 *
227 * <p>Original source: 229 * <p>Original source:
228 * <code><pre> 230 * <code><pre>
231 * // Total cost
232 *
229 * pattern costMetric(Cost : java Integer) { 233 * pattern costMetric(Cost : java Integer) {
230 * Cost == sum find cpsCost(_, #_); 234 * Cost == sum find cpsCost(_, #_);
231 * } 235 * }
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java
deleted file mode 100644
index 2c20b38e..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsApplications.java
+++ /dev/null
@@ -1,705 +0,0 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
39import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
41import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
42
43/**
44 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
45 *
46 * <p>Original source:
47 * <code><pre>
48 * {@literal @}QueryBasedFeature(feature = "applications")
49 * pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) {
50 * CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance);
51 * }
52 * </pre></code>
53 *
54 * @see Matcher
55 * @see Match
56 *
57 */
58@SuppressWarnings("all")
59public final class CpsApplications extends BaseGeneratedEMFQuerySpecification<CpsApplications.Matcher> {
60 /**
61 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications pattern,
62 * to be used in conjunction with {@link Matcher}.
63 *
64 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
65 * Each instance is a (possibly partial) substitution of pattern parameters,
66 * usable to represent a match of the pattern in the result of a query,
67 * or to specify the bound (fixed) input parameters when issuing a query.
68 *
69 * @see Matcher
70 *
71 */
72 public static abstract class Match extends BasePatternMatch {
73 private CyberPhysicalSystem fCps;
74
75 private ApplicationInstance fAppInstance;
76
77 private static List<String> parameterNames = makeImmutableList("Cps", "AppInstance");
78
79 private Match(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
80 this.fCps = pCps;
81 this.fAppInstance = pAppInstance;
82 }
83
84 @Override
85 public Object get(final String parameterName) {
86 if ("Cps".equals(parameterName)) return this.fCps;
87 if ("AppInstance".equals(parameterName)) return this.fAppInstance;
88 return null;
89 }
90
91 public CyberPhysicalSystem getCps() {
92 return this.fCps;
93 }
94
95 public ApplicationInstance getAppInstance() {
96 return this.fAppInstance;
97 }
98
99 @Override
100 public boolean set(final String parameterName, final Object newValue) {
101 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
102 if ("Cps".equals(parameterName) ) {
103 this.fCps = (CyberPhysicalSystem) newValue;
104 return true;
105 }
106 if ("AppInstance".equals(parameterName) ) {
107 this.fAppInstance = (ApplicationInstance) newValue;
108 return true;
109 }
110 return false;
111 }
112
113 public void setCps(final CyberPhysicalSystem pCps) {
114 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
115 this.fCps = pCps;
116 }
117
118 public void setAppInstance(final ApplicationInstance pAppInstance) {
119 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
120 this.fAppInstance = pAppInstance;
121 }
122
123 @Override
124 public String patternName() {
125 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications";
126 }
127
128 @Override
129 public List<String> parameterNames() {
130 return CpsApplications.Match.parameterNames;
131 }
132
133 @Override
134 public Object[] toArray() {
135 return new Object[]{fCps, fAppInstance};
136 }
137
138 @Override
139 public CpsApplications.Match toImmutable() {
140 return isMutable() ? newMatch(fCps, fAppInstance) : this;
141 }
142
143 @Override
144 public String prettyPrint() {
145 StringBuilder result = new StringBuilder();
146 result.append("\"Cps\"=" + prettyPrintValue(fCps) + ", ");
147 result.append("\"AppInstance\"=" + prettyPrintValue(fAppInstance));
148 return result.toString();
149 }
150
151 @Override
152 public int hashCode() {
153 return Objects.hash(fCps, fAppInstance);
154 }
155
156 @Override
157 public boolean equals(final Object obj) {
158 if (this == obj)
159 return true;
160 if (obj == null) {
161 return false;
162 }
163 if ((obj instanceof CpsApplications.Match)) {
164 CpsApplications.Match other = (CpsApplications.Match) obj;
165 return Objects.equals(fCps, other.fCps) && Objects.equals(fAppInstance, other.fAppInstance);
166 } else {
167 // this should be infrequent
168 if (!(obj instanceof IPatternMatch)) {
169 return false;
170 }
171 IPatternMatch otherSig = (IPatternMatch) obj;
172 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
173 }
174 }
175
176 @Override
177 public CpsApplications specification() {
178 return CpsApplications.instance();
179 }
180
181 /**
182 * Returns an empty, mutable match.
183 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
184 *
185 * @return the empty match.
186 *
187 */
188 public static CpsApplications.Match newEmptyMatch() {
189 return new Mutable(null, null);
190 }
191
192 /**
193 * Returns a mutable (partial) match.
194 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
195 *
196 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
197 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
198 * @return the new, mutable (partial) match object.
199 *
200 */
201 public static CpsApplications.Match newMutableMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
202 return new Mutable(pCps, pAppInstance);
203 }
204
205 /**
206 * Returns a new (partial) match.
207 * This can be used e.g. to call the matcher with a partial match.
208 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
209 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
210 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
211 * @return the (partial) match object.
212 *
213 */
214 public static CpsApplications.Match newMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
215 return new Immutable(pCps, pAppInstance);
216 }
217
218 private static final class Mutable extends CpsApplications.Match {
219 Mutable(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
220 super(pCps, pAppInstance);
221 }
222
223 @Override
224 public boolean isMutable() {
225 return true;
226 }
227 }
228
229 private static final class Immutable extends CpsApplications.Match {
230 Immutable(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
231 super(pCps, pAppInstance);
232 }
233
234 @Override
235 public boolean isMutable() {
236 return false;
237 }
238 }
239 }
240
241 /**
242 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications pattern,
243 * providing pattern-specific query methods.
244 *
245 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
246 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
247 *
248 * <p>Matches of the pattern will be represented as {@link Match}.
249 *
250 * <p>Original source:
251 * <code><pre>
252 * {@literal @}QueryBasedFeature(feature = "applications")
253 * pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) {
254 * CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance);
255 * }
256 * </pre></code>
257 *
258 * @see Match
259 * @see CpsApplications
260 *
261 */
262 public static class Matcher extends BaseMatcher<CpsApplications.Match> {
263 /**
264 * Initializes the pattern matcher within an existing VIATRA Query engine.
265 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
266 *
267 * @param engine the existing VIATRA Query engine in which this matcher will be created.
268 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
269 *
270 */
271 public static CpsApplications.Matcher on(final ViatraQueryEngine engine) {
272 // check if matcher already exists
273 Matcher matcher = engine.getExistingMatcher(querySpecification());
274 if (matcher == null) {
275 matcher = (Matcher)engine.getMatcher(querySpecification());
276 }
277 return matcher;
278 }
279
280 /**
281 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
282 * @return an initialized matcher
283 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
284 *
285 */
286 public static CpsApplications.Matcher create() {
287 return new Matcher();
288 }
289
290 private static final int POSITION_CPS = 0;
291
292 private static final int POSITION_APPINSTANCE = 1;
293
294 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CpsApplications.Matcher.class);
295
296 /**
297 * Initializes the pattern matcher within an existing VIATRA Query engine.
298 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
299 *
300 * @param engine the existing VIATRA Query engine in which this matcher will be created.
301 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
302 *
303 */
304 private Matcher() {
305 super(querySpecification());
306 }
307
308 /**
309 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
310 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
311 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
312 * @return matches represented as a Match object.
313 *
314 */
315 public Collection<CpsApplications.Match> getAllMatches(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
316 return rawStreamAllMatches(new Object[]{pCps, pAppInstance}).collect(Collectors.toSet());
317 }
318
319 /**
320 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
321 * </p>
322 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
323 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
324 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
325 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
326 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
327 * @return a stream of matches represented as a Match object.
328 *
329 */
330 public Stream<CpsApplications.Match> streamAllMatches(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
331 return rawStreamAllMatches(new Object[]{pCps, pAppInstance});
332 }
333
334 /**
335 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
336 * Neither determinism nor randomness of selection is guaranteed.
337 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
338 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
339 * @return a match represented as a Match object, or null if no match is found.
340 *
341 */
342 public Optional<CpsApplications.Match> getOneArbitraryMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
343 return rawGetOneArbitraryMatch(new Object[]{pCps, pAppInstance});
344 }
345
346 /**
347 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
348 * under any possible substitution of the unspecified parameters (if any).
349 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
350 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
351 * @return true if the input is a valid (partial) match of the pattern.
352 *
353 */
354 public boolean hasMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
355 return rawHasMatch(new Object[]{pCps, pAppInstance});
356 }
357
358 /**
359 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
360 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
361 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
362 * @return the number of pattern matches found.
363 *
364 */
365 public int countMatches(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
366 return rawCountMatches(new Object[]{pCps, pAppInstance});
367 }
368
369 /**
370 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
371 * Neither determinism nor randomness of selection is guaranteed.
372 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
373 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
374 * @param processor the action that will process the selected match.
375 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
376 *
377 */
378 public boolean forOneArbitraryMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance, final Consumer<? super CpsApplications.Match> processor) {
379 return rawForOneArbitraryMatch(new Object[]{pCps, pAppInstance}, processor);
380 }
381
382 /**
383 * Returns a new (partial) match.
384 * This can be used e.g. to call the matcher with a partial match.
385 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
386 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
387 * @param pAppInstance the fixed value of pattern parameter AppInstance, or null if not bound.
388 * @return the (partial) match object.
389 *
390 */
391 public CpsApplications.Match newMatch(final CyberPhysicalSystem pCps, final ApplicationInstance pAppInstance) {
392 return CpsApplications.Match.newMatch(pCps, pAppInstance);
393 }
394
395 /**
396 * Retrieve the set of values that occur in matches for Cps.
397 * @return the Set of all values or empty set if there are no matches
398 *
399 */
400 protected Stream<CyberPhysicalSystem> rawStreamAllValuesOfCps(final Object[] parameters) {
401 return rawStreamAllValues(POSITION_CPS, parameters).map(CyberPhysicalSystem.class::cast);
402 }
403
404 /**
405 * Retrieve the set of values that occur in matches for Cps.
406 * @return the Set of all values or empty set if there are no matches
407 *
408 */
409 public Set<CyberPhysicalSystem> getAllValuesOfCps() {
410 return rawStreamAllValuesOfCps(emptyArray()).collect(Collectors.toSet());
411 }
412
413 /**
414 * Retrieve the set of values that occur in matches for Cps.
415 * @return the Set of all values or empty set if there are no matches
416 *
417 */
418 public Stream<CyberPhysicalSystem> streamAllValuesOfCps() {
419 return rawStreamAllValuesOfCps(emptyArray());
420 }
421
422 /**
423 * Retrieve the set of values that occur in matches for Cps.
424 * </p>
425 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
426 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
427 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
428 *
429 * @return the Stream of all values or empty set if there are no matches
430 *
431 */
432 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final CpsApplications.Match partialMatch) {
433 return rawStreamAllValuesOfCps(partialMatch.toArray());
434 }
435
436 /**
437 * Retrieve the set of values that occur in matches for Cps.
438 * </p>
439 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
440 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
441 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
442 *
443 * @return the Stream of all values or empty set if there are no matches
444 *
445 */
446 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final ApplicationInstance pAppInstance) {
447 return rawStreamAllValuesOfCps(new Object[]{null, pAppInstance});
448 }
449
450 /**
451 * Retrieve the set of values that occur in matches for Cps.
452 * @return the Set of all values or empty set if there are no matches
453 *
454 */
455 public Set<CyberPhysicalSystem> getAllValuesOfCps(final CpsApplications.Match partialMatch) {
456 return rawStreamAllValuesOfCps(partialMatch.toArray()).collect(Collectors.toSet());
457 }
458
459 /**
460 * Retrieve the set of values that occur in matches for Cps.
461 * @return the Set of all values or empty set if there are no matches
462 *
463 */
464 public Set<CyberPhysicalSystem> getAllValuesOfCps(final ApplicationInstance pAppInstance) {
465 return rawStreamAllValuesOfCps(new Object[]{null, pAppInstance}).collect(Collectors.toSet());
466 }
467
468 /**
469 * Retrieve the set of values that occur in matches for AppInstance.
470 * @return the Set of all values or empty set if there are no matches
471 *
472 */
473 protected Stream<ApplicationInstance> rawStreamAllValuesOfAppInstance(final Object[] parameters) {
474 return rawStreamAllValues(POSITION_APPINSTANCE, parameters).map(ApplicationInstance.class::cast);
475 }
476
477 /**
478 * Retrieve the set of values that occur in matches for AppInstance.
479 * @return the Set of all values or empty set if there are no matches
480 *
481 */
482 public Set<ApplicationInstance> getAllValuesOfAppInstance() {
483 return rawStreamAllValuesOfAppInstance(emptyArray()).collect(Collectors.toSet());
484 }
485
486 /**
487 * Retrieve the set of values that occur in matches for AppInstance.
488 * @return the Set of all values or empty set if there are no matches
489 *
490 */
491 public Stream<ApplicationInstance> streamAllValuesOfAppInstance() {
492 return rawStreamAllValuesOfAppInstance(emptyArray());
493 }
494
495 /**
496 * Retrieve the set of values that occur in matches for AppInstance.
497 * </p>
498 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
499 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
500 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
501 *
502 * @return the Stream of all values or empty set if there are no matches
503 *
504 */
505 public Stream<ApplicationInstance> streamAllValuesOfAppInstance(final CpsApplications.Match partialMatch) {
506 return rawStreamAllValuesOfAppInstance(partialMatch.toArray());
507 }
508
509 /**
510 * Retrieve the set of values that occur in matches for AppInstance.
511 * </p>
512 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
513 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
514 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
515 *
516 * @return the Stream of all values or empty set if there are no matches
517 *
518 */
519 public Stream<ApplicationInstance> streamAllValuesOfAppInstance(final CyberPhysicalSystem pCps) {
520 return rawStreamAllValuesOfAppInstance(new Object[]{pCps, null});
521 }
522
523 /**
524 * Retrieve the set of values that occur in matches for AppInstance.
525 * @return the Set of all values or empty set if there are no matches
526 *
527 */
528 public Set<ApplicationInstance> getAllValuesOfAppInstance(final CpsApplications.Match partialMatch) {
529 return rawStreamAllValuesOfAppInstance(partialMatch.toArray()).collect(Collectors.toSet());
530 }
531
532 /**
533 * Retrieve the set of values that occur in matches for AppInstance.
534 * @return the Set of all values or empty set if there are no matches
535 *
536 */
537 public Set<ApplicationInstance> getAllValuesOfAppInstance(final CyberPhysicalSystem pCps) {
538 return rawStreamAllValuesOfAppInstance(new Object[]{pCps, null}).collect(Collectors.toSet());
539 }
540
541 @Override
542 protected CpsApplications.Match tupleToMatch(final Tuple t) {
543 try {
544 return CpsApplications.Match.newMatch((CyberPhysicalSystem) t.get(POSITION_CPS), (ApplicationInstance) t.get(POSITION_APPINSTANCE));
545 } catch(ClassCastException e) {
546 LOGGER.error("Element(s) in tuple not properly typed!",e);
547 return null;
548 }
549 }
550
551 @Override
552 protected CpsApplications.Match arrayToMatch(final Object[] match) {
553 try {
554 return CpsApplications.Match.newMatch((CyberPhysicalSystem) match[POSITION_CPS], (ApplicationInstance) match[POSITION_APPINSTANCE]);
555 } catch(ClassCastException e) {
556 LOGGER.error("Element(s) in array not properly typed!",e);
557 return null;
558 }
559 }
560
561 @Override
562 protected CpsApplications.Match arrayToMatchMutable(final Object[] match) {
563 try {
564 return CpsApplications.Match.newMutableMatch((CyberPhysicalSystem) match[POSITION_CPS], (ApplicationInstance) match[POSITION_APPINSTANCE]);
565 } catch(ClassCastException e) {
566 LOGGER.error("Element(s) in array not properly typed!",e);
567 return null;
568 }
569 }
570
571 /**
572 * @return the singleton instance of the query specification of this pattern
573 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
574 *
575 */
576 public static IQuerySpecification<CpsApplications.Matcher> querySpecification() {
577 return CpsApplications.instance();
578 }
579 }
580
581 private CpsApplications() {
582 super(GeneratedPQuery.INSTANCE);
583 }
584
585 /**
586 * @return the singleton instance of the query specification
587 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
588 *
589 */
590 public static CpsApplications instance() {
591 try{
592 return LazyHolder.INSTANCE;
593 } catch (ExceptionInInitializerError err) {
594 throw processInitializerError(err);
595 }
596 }
597
598 @Override
599 protected CpsApplications.Matcher instantiate(final ViatraQueryEngine engine) {
600 return CpsApplications.Matcher.on(engine);
601 }
602
603 @Override
604 public CpsApplications.Matcher instantiate() {
605 return CpsApplications.Matcher.create();
606 }
607
608 @Override
609 public CpsApplications.Match newEmptyMatch() {
610 return CpsApplications.Match.newEmptyMatch();
611 }
612
613 @Override
614 public CpsApplications.Match newMatch(final Object... parameters) {
615 return CpsApplications.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance) parameters[1]);
616 }
617
618 /**
619 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications (visibility: PUBLIC, simpleName: CpsApplications, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
620 * <b>not</b> at the class load time of the outer class,
621 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications (visibility: PUBLIC, simpleName: CpsApplications, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
622 *
623 * <p> This workaround is required e.g. to support recursion.
624 *
625 */
626 private static class LazyHolder {
627 private static final CpsApplications INSTANCE = new CpsApplications();
628
629 /**
630 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
631 * This initialization order is required to support indirect recursion.
632 *
633 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
634 *
635 */
636 private static final Object STATIC_INITIALIZER = ensureInitialized();
637
638 public static Object ensureInitialized() {
639 INSTANCE.ensureInitializedInternal();
640 return null;
641 }
642 }
643
644 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
645 private static final CpsApplications.GeneratedPQuery INSTANCE = new GeneratedPQuery();
646
647 private final PParameter parameter_Cps = new PParameter("Cps", "hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "CyberPhysicalSystem")), PParameterDirection.INOUT);
648
649 private final PParameter parameter_AppInstance = new PParameter("AppInstance", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
650
651 private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_AppInstance);
652
653 private GeneratedPQuery() {
654 super(PVisibility.PUBLIC);
655 }
656
657 @Override
658 public String getFullyQualifiedName() {
659 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsApplications";
660 }
661
662 @Override
663 public List<String> getParameterNames() {
664 return Arrays.asList("Cps","AppInstance");
665 }
666
667 @Override
668 public List<PParameter> getParameters() {
669 return parameters;
670 }
671
672 @Override
673 public Set<PBody> doGetContainedBodies() {
674 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
675 Set<PBody> bodies = new LinkedHashSet<>();
676 {
677 PBody body = new PBody(this);
678 PVariable var_Cps = body.getOrCreateVariableByName("Cps");
679 PVariable var_AppInstance = body.getOrCreateVariableByName("AppInstance");
680 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
681 new TypeConstraint(body, Tuples.flatTupleOf(var_AppInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
682 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
683 new ExportedParameter(body, var_Cps, parameter_Cps),
684 new ExportedParameter(body, var_AppInstance, parameter_AppInstance)
685 ));
686 // CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance)
687 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem")));
688 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
689 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "CyberPhysicalSystem", "applicationTypes")));
690 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType")));
691 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
692 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "instances")));
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
694 new Equality(body, var__virtual_1_, var_AppInstance);
695 bodies.add(body);
696 }
697 {
698 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
699 annotation.addAttribute("feature", "applications");
700 addAnnotation(annotation);
701 }
702 return bodies;
703 }
704 }
705}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsCost.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsCost.java
index 169a30e5..fc90ef12 100644
--- 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
@@ -4,7 +4,7 @@
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem; 6import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications; 7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost; 8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost;
9import java.util.Arrays; 9import java.util.Arrays;
10import java.util.Collection; 10import java.util.Collection;
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
index 916f35f7..c889fbe0 100644
--- 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
@@ -3,22 +3,22 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate;
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement; 7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory;
9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric; 8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric;
10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric; 9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric;
11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric; 10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric;
12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications;
13import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost; 11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost;
14import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts; 12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance;
13import hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective;
15import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement; 14import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement;
16import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd; 15import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd;
17import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory; 16import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory;
18import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost; 17import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost;
18import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance;
19import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied; 19import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied;
20import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd; 20import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement;
21import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory; 21import hu.bme.mit.inf.dslreasoner.domains.cps.queries.UnallocateAppInstance;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; 22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; 23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
24 24
@@ -30,12 +30,7 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
30 * in order to achieve better performance than one-by-one on-demand matcher initialization. 30 * in order to achieve better performance than one-by-one on-demand matcher initialization.
31 * 31 *
32 * <p> From package hu.bme.mit.inf.dslreasoner.domains.cps.queries, the group contains the definition of the following patterns: <ul> 32 * <p> From package hu.bme.mit.inf.dslreasoner.domains.cps.queries, the group contains the definition of the following patterns: <ul>
33 * <li>cpsApplications</li> 33 * <li>resourceRequirement</li>
34 * <li>cpsHosts</li>
35 * <li>totalMemory</li>
36 * <li>totalHdd</li>
37 * <li>availableMemory</li>
38 * <li>availableHdd</li>
39 * <li>allocationWithoutResourceRequirement</li> 34 * <li>allocationWithoutResourceRequirement</li>
40 * <li>notEnoughAvailableMemory</li> 35 * <li>notEnoughAvailableMemory</li>
41 * <li>notEnoughAvailableHdd</li> 36 * <li>notEnoughAvailableHdd</li>
@@ -46,6 +41,11 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
46 * <li>averageFreeHddMetric</li> 41 * <li>averageFreeHddMetric</li>
47 * <li>costMetric</li> 42 * <li>costMetric</li>
48 * <li>cpsCost</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> 49 * </ul>
50 * 50 *
51 * @see IQueryGroup 51 * @see IQueryGroup
@@ -70,12 +70,7 @@ public final class CpsQueries extends BaseGeneratedPatternGroup {
70 private static CpsQueries INSTANCE; 70 private static CpsQueries INSTANCE;
71 71
72 private CpsQueries() { 72 private CpsQueries() {
73 querySpecifications.add(CpsApplications.instance()); 73 querySpecifications.add(ResourceRequirement.instance());
74 querySpecifications.add(CpsHosts.instance());
75 querySpecifications.add(TotalMemory.instance());
76 querySpecifications.add(TotalHdd.instance());
77 querySpecifications.add(AvailableMemory.instance());
78 querySpecifications.add(AvailableHdd.instance());
79 querySpecifications.add(AllocationWithoutResourceRequirement.instance()); 74 querySpecifications.add(AllocationWithoutResourceRequirement.instance());
80 querySpecifications.add(NotEnoughAvailableMemory.instance()); 75 querySpecifications.add(NotEnoughAvailableMemory.instance());
81 querySpecifications.add(NotEnoughAvailableHdd.instance()); 76 querySpecifications.add(NotEnoughAvailableHdd.instance());
@@ -86,54 +81,19 @@ public final class CpsQueries extends BaseGeneratedPatternGroup {
86 querySpecifications.add(AverageFreeHddMetric.instance()); 81 querySpecifications.add(AverageFreeHddMetric.instance());
87 querySpecifications.add(CostMetric.instance()); 82 querySpecifications.add(CostMetric.instance());
88 querySpecifications.add(CpsCost.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 } 89 }
90 90
91 public CpsApplications getCpsApplications() { 91 public ResourceRequirement getResourceRequirement() {
92 return CpsApplications.instance(); 92 return ResourceRequirement.instance();
93 } 93 }
94 94
95 public CpsApplications.Matcher getCpsApplications(final ViatraQueryEngine engine) { 95 public ResourceRequirement.Matcher getResourceRequirement(final ViatraQueryEngine engine) {
96 return CpsApplications.Matcher.on(engine); 96 return ResourceRequirement.Matcher.on(engine);
97 }
98
99 public CpsHosts getCpsHosts() {
100 return CpsHosts.instance();
101 }
102
103 public CpsHosts.Matcher getCpsHosts(final ViatraQueryEngine engine) {
104 return CpsHosts.Matcher.on(engine);
105 }
106
107 public TotalMemory getTotalMemory() {
108 return TotalMemory.instance();
109 }
110
111 public TotalMemory.Matcher getTotalMemory(final ViatraQueryEngine engine) {
112 return TotalMemory.Matcher.on(engine);
113 }
114
115 public TotalHdd getTotalHdd() {
116 return TotalHdd.instance();
117 }
118
119 public TotalHdd.Matcher getTotalHdd(final ViatraQueryEngine engine) {
120 return TotalHdd.Matcher.on(engine);
121 }
122
123 public AvailableMemory getAvailableMemory() {
124 return AvailableMemory.instance();
125 }
126
127 public AvailableMemory.Matcher getAvailableMemory(final ViatraQueryEngine engine) {
128 return AvailableMemory.Matcher.on(engine);
129 }
130
131 public AvailableHdd getAvailableHdd() {
132 return AvailableHdd.instance();
133 }
134
135 public AvailableHdd.Matcher getAvailableHdd(final ViatraQueryEngine engine) {
136 return AvailableHdd.Matcher.on(engine);
137 } 97 }
138 98
139 public AllocationWithoutResourceRequirement getAllocationWithoutResourceRequirement() { 99 public AllocationWithoutResourceRequirement getAllocationWithoutResourceRequirement() {
@@ -215,4 +175,44 @@ public final class CpsQueries extends BaseGeneratedPatternGroup {
215 public CpsCost.Matcher getCpsCost(final ViatraQueryEngine engine) { 175 public CpsCost.Matcher getCpsCost(final ViatraQueryEngine engine) {
216 return CpsCost.Matcher.on(engine); 176 return CpsCost.Matcher.on(engine);
217 } 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} 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
39import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
41import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
42
43/**
44 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
45 *
46 * <p>Original source:
47 * <code><pre>
48 * 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")
59public 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.NoHostToAllocateTo;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.RequiredAppInstances;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance;
9import java.util.Arrays;
10import java.util.Collection;
11import java.util.LinkedHashSet;
12import java.util.List;
13import java.util.Objects;
14import java.util.Optional;
15import java.util.Set;
16import java.util.function.Consumer;
17import java.util.stream.Collectors;
18import java.util.stream.Stream;
19import org.apache.log4j.Logger;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
28import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
29import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
31import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
33import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
38import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
39import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
40import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
41import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
42import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
43import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
44import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
45import 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")
65public 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/NotEnoughAvailableHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/NotEnoughAvailableHdd.java
index 41615598..0c0d57a6 100644
--- 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
@@ -4,7 +4,7 @@
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; 6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd; 7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd;
8import java.util.Arrays; 8import java.util.Arrays;
9import java.util.Collection; 9import java.util.Collection;
10import java.util.LinkedHashSet; 10import java.util.LinkedHashSet;
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
index 4803ec3a..9f091a95 100644
--- 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
@@ -4,7 +4,7 @@
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; 6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory; 7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory;
8import java.util.Arrays; 8import java.util.Arrays;
9import java.util.Collection; 9import java.util.Collection;
10import java.util.LinkedHashSet; 10import java.util.LinkedHashSet;
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsHosts.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RemoveHostInstance.java
index e1abf758..1141e898 100644
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsHosts.java
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/RemoveHostInstance.java
@@ -3,10 +3,10 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance; 6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import java.util.Arrays; 7import java.util.Arrays;
9import java.util.Collection; 8import java.util.Collection;
9import java.util.Collections;
10import java.util.LinkedHashSet; 10import java.util.LinkedHashSet;
11import java.util.List; 11import java.util.List;
12import java.util.Objects; 12import java.util.Objects;
@@ -29,9 +29,9 @@ import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; 29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; 30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; 31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; 32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; 33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; 35import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; 36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; 37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
@@ -45,9 +45,8 @@ import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
45 * 45 *
46 * <p>Original source: 46 * <p>Original source:
47 * <code><pre> 47 * <code><pre>
48 * {@literal @}QueryBasedFeature(feature = "hosts") 48 * pattern removeHostInstance(HostInstance : HostInstance) {
49 * pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) { 49 * neg HostInstance.applications(HostInstance, _);
50 * CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance);
51 * } 50 * }
52 * </pre></code> 51 * </pre></code>
53 * 52 *
@@ -56,9 +55,9 @@ import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
56 * 55 *
57 */ 56 */
58@SuppressWarnings("all") 57@SuppressWarnings("all")
59public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.Matcher> { 58public final class RemoveHostInstance extends BaseGeneratedEMFQuerySpecification<RemoveHostInstance.Matcher> {
60 /** 59 /**
61 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts pattern, 60 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance pattern,
62 * to be used in conjunction with {@link Matcher}. 61 * to be used in conjunction with {@link Matcher}.
63 * 62 *
64 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. 63 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
@@ -70,28 +69,20 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
70 * 69 *
71 */ 70 */
72 public static abstract class Match extends BasePatternMatch { 71 public static abstract class Match extends BasePatternMatch {
73 private CyberPhysicalSystem fCps;
74
75 private HostInstance fHostInstance; 72 private HostInstance fHostInstance;
76 73
77 private static List<String> parameterNames = makeImmutableList("Cps", "HostInstance"); 74 private static List<String> parameterNames = makeImmutableList("HostInstance");
78 75
79 private Match(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 76 private Match(final HostInstance pHostInstance) {
80 this.fCps = pCps;
81 this.fHostInstance = pHostInstance; 77 this.fHostInstance = pHostInstance;
82 } 78 }
83 79
84 @Override 80 @Override
85 public Object get(final String parameterName) { 81 public Object get(final String parameterName) {
86 if ("Cps".equals(parameterName)) return this.fCps;
87 if ("HostInstance".equals(parameterName)) return this.fHostInstance; 82 if ("HostInstance".equals(parameterName)) return this.fHostInstance;
88 return null; 83 return null;
89 } 84 }
90 85
91 public CyberPhysicalSystem getCps() {
92 return this.fCps;
93 }
94
95 public HostInstance getHostInstance() { 86 public HostInstance getHostInstance() {
96 return this.fHostInstance; 87 return this.fHostInstance;
97 } 88 }
@@ -99,10 +90,6 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
99 @Override 90 @Override
100 public boolean set(final String parameterName, final Object newValue) { 91 public boolean set(final String parameterName, final Object newValue) {
101 if (!isMutable()) throw new java.lang.UnsupportedOperationException(); 92 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
102 if ("Cps".equals(parameterName) ) {
103 this.fCps = (CyberPhysicalSystem) newValue;
104 return true;
105 }
106 if ("HostInstance".equals(parameterName) ) { 93 if ("HostInstance".equals(parameterName) ) {
107 this.fHostInstance = (HostInstance) newValue; 94 this.fHostInstance = (HostInstance) newValue;
108 return true; 95 return true;
@@ -110,11 +97,6 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
110 return false; 97 return false;
111 } 98 }
112 99
113 public void setCps(final CyberPhysicalSystem pCps) {
114 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
115 this.fCps = pCps;
116 }
117
118 public void setHostInstance(final HostInstance pHostInstance) { 100 public void setHostInstance(final HostInstance pHostInstance) {
119 if (!isMutable()) throw new java.lang.UnsupportedOperationException(); 101 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
120 this.fHostInstance = pHostInstance; 102 this.fHostInstance = pHostInstance;
@@ -122,35 +104,34 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
122 104
123 @Override 105 @Override
124 public String patternName() { 106 public String patternName() {
125 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts"; 107 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance";
126 } 108 }
127 109
128 @Override 110 @Override
129 public List<String> parameterNames() { 111 public List<String> parameterNames() {
130 return CpsHosts.Match.parameterNames; 112 return RemoveHostInstance.Match.parameterNames;
131 } 113 }
132 114
133 @Override 115 @Override
134 public Object[] toArray() { 116 public Object[] toArray() {
135 return new Object[]{fCps, fHostInstance}; 117 return new Object[]{fHostInstance};
136 } 118 }
137 119
138 @Override 120 @Override
139 public CpsHosts.Match toImmutable() { 121 public RemoveHostInstance.Match toImmutable() {
140 return isMutable() ? newMatch(fCps, fHostInstance) : this; 122 return isMutable() ? newMatch(fHostInstance) : this;
141 } 123 }
142 124
143 @Override 125 @Override
144 public String prettyPrint() { 126 public String prettyPrint() {
145 StringBuilder result = new StringBuilder(); 127 StringBuilder result = new StringBuilder();
146 result.append("\"Cps\"=" + prettyPrintValue(fCps) + ", ");
147 result.append("\"HostInstance\"=" + prettyPrintValue(fHostInstance)); 128 result.append("\"HostInstance\"=" + prettyPrintValue(fHostInstance));
148 return result.toString(); 129 return result.toString();
149 } 130 }
150 131
151 @Override 132 @Override
152 public int hashCode() { 133 public int hashCode() {
153 return Objects.hash(fCps, fHostInstance); 134 return Objects.hash(fHostInstance);
154 } 135 }
155 136
156 @Override 137 @Override
@@ -160,9 +141,9 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
160 if (obj == null) { 141 if (obj == null) {
161 return false; 142 return false;
162 } 143 }
163 if ((obj instanceof CpsHosts.Match)) { 144 if ((obj instanceof RemoveHostInstance.Match)) {
164 CpsHosts.Match other = (CpsHosts.Match) obj; 145 RemoveHostInstance.Match other = (RemoveHostInstance.Match) obj;
165 return Objects.equals(fCps, other.fCps) && Objects.equals(fHostInstance, other.fHostInstance); 146 return Objects.equals(fHostInstance, other.fHostInstance);
166 } else { 147 } else {
167 // this should be infrequent 148 // this should be infrequent
168 if (!(obj instanceof IPatternMatch)) { 149 if (!(obj instanceof IPatternMatch)) {
@@ -174,8 +155,8 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
174 } 155 }
175 156
176 @Override 157 @Override
177 public CpsHosts specification() { 158 public RemoveHostInstance specification() {
178 return CpsHosts.instance(); 159 return RemoveHostInstance.instance();
179 } 160 }
180 161
181 /** 162 /**
@@ -185,39 +166,37 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
185 * @return the empty match. 166 * @return the empty match.
186 * 167 *
187 */ 168 */
188 public static CpsHosts.Match newEmptyMatch() { 169 public static RemoveHostInstance.Match newEmptyMatch() {
189 return new Mutable(null, null); 170 return new Mutable(null);
190 } 171 }
191 172
192 /** 173 /**
193 * Returns a mutable (partial) match. 174 * Returns a mutable (partial) match.
194 * Fields of the mutable match can be filled to create a partial match, usable as matcher input. 175 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
195 * 176 *
196 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
197 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 177 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
198 * @return the new, mutable (partial) match object. 178 * @return the new, mutable (partial) match object.
199 * 179 *
200 */ 180 */
201 public static CpsHosts.Match newMutableMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 181 public static RemoveHostInstance.Match newMutableMatch(final HostInstance pHostInstance) {
202 return new Mutable(pCps, pHostInstance); 182 return new Mutable(pHostInstance);
203 } 183 }
204 184
205 /** 185 /**
206 * Returns a new (partial) match. 186 * Returns a new (partial) match.
207 * This can be used e.g. to call the matcher with a partial match. 187 * This can be used e.g. to call the matcher with a partial match.
208 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. 188 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
209 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
210 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 189 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
211 * @return the (partial) match object. 190 * @return the (partial) match object.
212 * 191 *
213 */ 192 */
214 public static CpsHosts.Match newMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 193 public static RemoveHostInstance.Match newMatch(final HostInstance pHostInstance) {
215 return new Immutable(pCps, pHostInstance); 194 return new Immutable(pHostInstance);
216 } 195 }
217 196
218 private static final class Mutable extends CpsHosts.Match { 197 private static final class Mutable extends RemoveHostInstance.Match {
219 Mutable(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 198 Mutable(final HostInstance pHostInstance) {
220 super(pCps, pHostInstance); 199 super(pHostInstance);
221 } 200 }
222 201
223 @Override 202 @Override
@@ -226,9 +205,9 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
226 } 205 }
227 } 206 }
228 207
229 private static final class Immutable extends CpsHosts.Match { 208 private static final class Immutable extends RemoveHostInstance.Match {
230 Immutable(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 209 Immutable(final HostInstance pHostInstance) {
231 super(pCps, pHostInstance); 210 super(pHostInstance);
232 } 211 }
233 212
234 @Override 213 @Override
@@ -239,7 +218,7 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
239 } 218 }
240 219
241 /** 220 /**
242 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts pattern, 221 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance pattern,
243 * providing pattern-specific query methods. 222 * providing pattern-specific query methods.
244 * 223 *
245 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, 224 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
@@ -249,17 +228,16 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
249 * 228 *
250 * <p>Original source: 229 * <p>Original source:
251 * <code><pre> 230 * <code><pre>
252 * {@literal @}QueryBasedFeature(feature = "hosts") 231 * pattern removeHostInstance(HostInstance : HostInstance) {
253 * pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) { 232 * neg HostInstance.applications(HostInstance, _);
254 * CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance);
255 * } 233 * }
256 * </pre></code> 234 * </pre></code>
257 * 235 *
258 * @see Match 236 * @see Match
259 * @see CpsHosts 237 * @see RemoveHostInstance
260 * 238 *
261 */ 239 */
262 public static class Matcher extends BaseMatcher<CpsHosts.Match> { 240 public static class Matcher extends BaseMatcher<RemoveHostInstance.Match> {
263 /** 241 /**
264 * Initializes the pattern matcher within an existing VIATRA Query engine. 242 * Initializes the pattern matcher within an existing VIATRA Query engine.
265 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. 243 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
@@ -268,7 +246,7 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
268 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation 246 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
269 * 247 *
270 */ 248 */
271 public static CpsHosts.Matcher on(final ViatraQueryEngine engine) { 249 public static RemoveHostInstance.Matcher on(final ViatraQueryEngine engine) {
272 // check if matcher already exists 250 // check if matcher already exists
273 Matcher matcher = engine.getExistingMatcher(querySpecification()); 251 Matcher matcher = engine.getExistingMatcher(querySpecification());
274 if (matcher == null) { 252 if (matcher == null) {
@@ -283,15 +261,13 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
283 * @noreference This method is for internal matcher initialization by the framework, do not call it manually. 261 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
284 * 262 *
285 */ 263 */
286 public static CpsHosts.Matcher create() { 264 public static RemoveHostInstance.Matcher create() {
287 return new Matcher(); 265 return new Matcher();
288 } 266 }
289 267
290 private static final int POSITION_CPS = 0; 268 private static final int POSITION_HOSTINSTANCE = 0;
291
292 private static final int POSITION_HOSTINSTANCE = 1;
293 269
294 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(CpsHosts.Matcher.class); 270 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(RemoveHostInstance.Matcher.class);
295 271
296 /** 272 /**
297 * Initializes the pattern matcher within an existing VIATRA Query engine. 273 * Initializes the pattern matcher within an existing VIATRA Query engine.
@@ -307,13 +283,12 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
307 283
308 /** 284 /**
309 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. 285 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
310 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
311 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 286 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
312 * @return matches represented as a Match object. 287 * @return matches represented as a Match object.
313 * 288 *
314 */ 289 */
315 public Collection<CpsHosts.Match> getAllMatches(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 290 public Collection<RemoveHostInstance.Match> getAllMatches(final HostInstance pHostInstance) {
316 return rawStreamAllMatches(new Object[]{pCps, pHostInstance}).collect(Collectors.toSet()); 291 return rawStreamAllMatches(new Object[]{pHostInstance}).collect(Collectors.toSet());
317 } 292 }
318 293
319 /** 294 /**
@@ -322,147 +297,68 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
322 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. 297 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
323 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. 298 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
324 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. 299 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
325 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
326 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 300 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
327 * @return a stream of matches represented as a Match object. 301 * @return a stream of matches represented as a Match object.
328 * 302 *
329 */ 303 */
330 public Stream<CpsHosts.Match> streamAllMatches(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 304 public Stream<RemoveHostInstance.Match> streamAllMatches(final HostInstance pHostInstance) {
331 return rawStreamAllMatches(new Object[]{pCps, pHostInstance}); 305 return rawStreamAllMatches(new Object[]{pHostInstance});
332 } 306 }
333 307
334 /** 308 /**
335 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. 309 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
336 * Neither determinism nor randomness of selection is guaranteed. 310 * Neither determinism nor randomness of selection is guaranteed.
337 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
338 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 311 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
339 * @return a match represented as a Match object, or null if no match is found. 312 * @return a match represented as a Match object, or null if no match is found.
340 * 313 *
341 */ 314 */
342 public Optional<CpsHosts.Match> getOneArbitraryMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 315 public Optional<RemoveHostInstance.Match> getOneArbitraryMatch(final HostInstance pHostInstance) {
343 return rawGetOneArbitraryMatch(new Object[]{pCps, pHostInstance}); 316 return rawGetOneArbitraryMatch(new Object[]{pHostInstance});
344 } 317 }
345 318
346 /** 319 /**
347 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, 320 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
348 * under any possible substitution of the unspecified parameters (if any). 321 * under any possible substitution of the unspecified parameters (if any).
349 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
350 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 322 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
351 * @return true if the input is a valid (partial) match of the pattern. 323 * @return true if the input is a valid (partial) match of the pattern.
352 * 324 *
353 */ 325 */
354 public boolean hasMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 326 public boolean hasMatch(final HostInstance pHostInstance) {
355 return rawHasMatch(new Object[]{pCps, pHostInstance}); 327 return rawHasMatch(new Object[]{pHostInstance});
356 } 328 }
357 329
358 /** 330 /**
359 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. 331 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
360 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
361 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 332 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
362 * @return the number of pattern matches found. 333 * @return the number of pattern matches found.
363 * 334 *
364 */ 335 */
365 public int countMatches(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 336 public int countMatches(final HostInstance pHostInstance) {
366 return rawCountMatches(new Object[]{pCps, pHostInstance}); 337 return rawCountMatches(new Object[]{pHostInstance});
367 } 338 }
368 339
369 /** 340 /**
370 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. 341 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
371 * Neither determinism nor randomness of selection is guaranteed. 342 * Neither determinism nor randomness of selection is guaranteed.
372 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
373 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 343 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
374 * @param processor the action that will process the selected match. 344 * @param processor the action that will process the selected match.
375 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked 345 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
376 * 346 *
377 */ 347 */
378 public boolean forOneArbitraryMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance, final Consumer<? super CpsHosts.Match> processor) { 348 public boolean forOneArbitraryMatch(final HostInstance pHostInstance, final Consumer<? super RemoveHostInstance.Match> processor) {
379 return rawForOneArbitraryMatch(new Object[]{pCps, pHostInstance}, processor); 349 return rawForOneArbitraryMatch(new Object[]{pHostInstance}, processor);
380 } 350 }
381 351
382 /** 352 /**
383 * Returns a new (partial) match. 353 * Returns a new (partial) match.
384 * This can be used e.g. to call the matcher with a partial match. 354 * This can be used e.g. to call the matcher with a partial match.
385 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. 355 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
386 * @param pCps the fixed value of pattern parameter Cps, or null if not bound.
387 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound. 356 * @param pHostInstance the fixed value of pattern parameter HostInstance, or null if not bound.
388 * @return the (partial) match object. 357 * @return the (partial) match object.
389 * 358 *
390 */ 359 */
391 public CpsHosts.Match newMatch(final CyberPhysicalSystem pCps, final HostInstance pHostInstance) { 360 public RemoveHostInstance.Match newMatch(final HostInstance pHostInstance) {
392 return CpsHosts.Match.newMatch(pCps, pHostInstance); 361 return RemoveHostInstance.Match.newMatch(pHostInstance);
393 }
394
395 /**
396 * Retrieve the set of values that occur in matches for Cps.
397 * @return the Set of all values or empty set if there are no matches
398 *
399 */
400 protected Stream<CyberPhysicalSystem> rawStreamAllValuesOfCps(final Object[] parameters) {
401 return rawStreamAllValues(POSITION_CPS, parameters).map(CyberPhysicalSystem.class::cast);
402 }
403
404 /**
405 * Retrieve the set of values that occur in matches for Cps.
406 * @return the Set of all values or empty set if there are no matches
407 *
408 */
409 public Set<CyberPhysicalSystem> getAllValuesOfCps() {
410 return rawStreamAllValuesOfCps(emptyArray()).collect(Collectors.toSet());
411 }
412
413 /**
414 * Retrieve the set of values that occur in matches for Cps.
415 * @return the Set of all values or empty set if there are no matches
416 *
417 */
418 public Stream<CyberPhysicalSystem> streamAllValuesOfCps() {
419 return rawStreamAllValuesOfCps(emptyArray());
420 }
421
422 /**
423 * Retrieve the set of values that occur in matches for Cps.
424 * </p>
425 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
426 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
427 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
428 *
429 * @return the Stream of all values or empty set if there are no matches
430 *
431 */
432 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final CpsHosts.Match partialMatch) {
433 return rawStreamAllValuesOfCps(partialMatch.toArray());
434 }
435
436 /**
437 * Retrieve the set of values that occur in matches for Cps.
438 * </p>
439 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
440 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
441 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
442 *
443 * @return the Stream of all values or empty set if there are no matches
444 *
445 */
446 public Stream<CyberPhysicalSystem> streamAllValuesOfCps(final HostInstance pHostInstance) {
447 return rawStreamAllValuesOfCps(new Object[]{null, pHostInstance});
448 }
449
450 /**
451 * Retrieve the set of values that occur in matches for Cps.
452 * @return the Set of all values or empty set if there are no matches
453 *
454 */
455 public Set<CyberPhysicalSystem> getAllValuesOfCps(final CpsHosts.Match partialMatch) {
456 return rawStreamAllValuesOfCps(partialMatch.toArray()).collect(Collectors.toSet());
457 }
458
459 /**
460 * Retrieve the set of values that occur in matches for Cps.
461 * @return the Set of all values or empty set if there are no matches
462 *
463 */
464 public Set<CyberPhysicalSystem> getAllValuesOfCps(final HostInstance pHostInstance) {
465 return rawStreamAllValuesOfCps(new Object[]{null, pHostInstance}).collect(Collectors.toSet());
466 } 362 }
467 363
468 /** 364 /**
@@ -492,56 +388,10 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
492 return rawStreamAllValuesOfHostInstance(emptyArray()); 388 return rawStreamAllValuesOfHostInstance(emptyArray());
493 } 389 }
494 390
495 /**
496 * Retrieve the set of values that occur in matches for HostInstance.
497 * </p>
498 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
499 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
500 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
501 *
502 * @return the Stream of all values or empty set if there are no matches
503 *
504 */
505 public Stream<HostInstance> streamAllValuesOfHostInstance(final CpsHosts.Match partialMatch) {
506 return rawStreamAllValuesOfHostInstance(partialMatch.toArray());
507 }
508
509 /**
510 * Retrieve the set of values that occur in matches for HostInstance.
511 * </p>
512 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
513 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
514 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
515 *
516 * @return the Stream of all values or empty set if there are no matches
517 *
518 */
519 public Stream<HostInstance> streamAllValuesOfHostInstance(final CyberPhysicalSystem pCps) {
520 return rawStreamAllValuesOfHostInstance(new Object[]{pCps, null});
521 }
522
523 /**
524 * Retrieve the set of values that occur in matches for HostInstance.
525 * @return the Set of all values or empty set if there are no matches
526 *
527 */
528 public Set<HostInstance> getAllValuesOfHostInstance(final CpsHosts.Match partialMatch) {
529 return rawStreamAllValuesOfHostInstance(partialMatch.toArray()).collect(Collectors.toSet());
530 }
531
532 /**
533 * Retrieve the set of values that occur in matches for HostInstance.
534 * @return the Set of all values or empty set if there are no matches
535 *
536 */
537 public Set<HostInstance> getAllValuesOfHostInstance(final CyberPhysicalSystem pCps) {
538 return rawStreamAllValuesOfHostInstance(new Object[]{pCps, null}).collect(Collectors.toSet());
539 }
540
541 @Override 391 @Override
542 protected CpsHosts.Match tupleToMatch(final Tuple t) { 392 protected RemoveHostInstance.Match tupleToMatch(final Tuple t) {
543 try { 393 try {
544 return CpsHosts.Match.newMatch((CyberPhysicalSystem) t.get(POSITION_CPS), (HostInstance) t.get(POSITION_HOSTINSTANCE)); 394 return RemoveHostInstance.Match.newMatch((HostInstance) t.get(POSITION_HOSTINSTANCE));
545 } catch(ClassCastException e) { 395 } catch(ClassCastException e) {
546 LOGGER.error("Element(s) in tuple not properly typed!",e); 396 LOGGER.error("Element(s) in tuple not properly typed!",e);
547 return null; 397 return null;
@@ -549,9 +399,9 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
549 } 399 }
550 400
551 @Override 401 @Override
552 protected CpsHosts.Match arrayToMatch(final Object[] match) { 402 protected RemoveHostInstance.Match arrayToMatch(final Object[] match) {
553 try { 403 try {
554 return CpsHosts.Match.newMatch((CyberPhysicalSystem) match[POSITION_CPS], (HostInstance) match[POSITION_HOSTINSTANCE]); 404 return RemoveHostInstance.Match.newMatch((HostInstance) match[POSITION_HOSTINSTANCE]);
555 } catch(ClassCastException e) { 405 } catch(ClassCastException e) {
556 LOGGER.error("Element(s) in array not properly typed!",e); 406 LOGGER.error("Element(s) in array not properly typed!",e);
557 return null; 407 return null;
@@ -559,9 +409,9 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
559 } 409 }
560 410
561 @Override 411 @Override
562 protected CpsHosts.Match arrayToMatchMutable(final Object[] match) { 412 protected RemoveHostInstance.Match arrayToMatchMutable(final Object[] match) {
563 try { 413 try {
564 return CpsHosts.Match.newMutableMatch((CyberPhysicalSystem) match[POSITION_CPS], (HostInstance) match[POSITION_HOSTINSTANCE]); 414 return RemoveHostInstance.Match.newMutableMatch((HostInstance) match[POSITION_HOSTINSTANCE]);
565 } catch(ClassCastException e) { 415 } catch(ClassCastException e) {
566 LOGGER.error("Element(s) in array not properly typed!",e); 416 LOGGER.error("Element(s) in array not properly typed!",e);
567 return null; 417 return null;
@@ -573,12 +423,12 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
573 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded 423 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
574 * 424 *
575 */ 425 */
576 public static IQuerySpecification<CpsHosts.Matcher> querySpecification() { 426 public static IQuerySpecification<RemoveHostInstance.Matcher> querySpecification() {
577 return CpsHosts.instance(); 427 return RemoveHostInstance.instance();
578 } 428 }
579 } 429 }
580 430
581 private CpsHosts() { 431 private RemoveHostInstance() {
582 super(GeneratedPQuery.INSTANCE); 432 super(GeneratedPQuery.INSTANCE);
583 } 433 }
584 434
@@ -587,7 +437,7 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
587 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded 437 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
588 * 438 *
589 */ 439 */
590 public static CpsHosts instance() { 440 public static RemoveHostInstance instance() {
591 try{ 441 try{
592 return LazyHolder.INSTANCE; 442 return LazyHolder.INSTANCE;
593 } catch (ExceptionInInitializerError err) { 443 } catch (ExceptionInInitializerError err) {
@@ -596,35 +446,35 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
596 } 446 }
597 447
598 @Override 448 @Override
599 protected CpsHosts.Matcher instantiate(final ViatraQueryEngine engine) { 449 protected RemoveHostInstance.Matcher instantiate(final ViatraQueryEngine engine) {
600 return CpsHosts.Matcher.on(engine); 450 return RemoveHostInstance.Matcher.on(engine);
601 } 451 }
602 452
603 @Override 453 @Override
604 public CpsHosts.Matcher instantiate() { 454 public RemoveHostInstance.Matcher instantiate() {
605 return CpsHosts.Matcher.create(); 455 return RemoveHostInstance.Matcher.create();
606 } 456 }
607 457
608 @Override 458 @Override
609 public CpsHosts.Match newEmptyMatch() { 459 public RemoveHostInstance.Match newEmptyMatch() {
610 return CpsHosts.Match.newEmptyMatch(); 460 return RemoveHostInstance.Match.newEmptyMatch();
611 } 461 }
612 462
613 @Override 463 @Override
614 public CpsHosts.Match newMatch(final Object... parameters) { 464 public RemoveHostInstance.Match newMatch(final Object... parameters) {
615 return CpsHosts.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem) parameters[0], (hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[1]); 465 return RemoveHostInstance.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0]);
616 } 466 }
617 467
618 /** 468 /**
619 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts (visibility: PUBLIC, simpleName: CpsHosts, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created 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
620 * <b>not</b> at the class load time of the outer class, 470 * <b>not</b> at the class load time of the outer class,
621 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts (visibility: PUBLIC, simpleName: CpsHosts, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}. 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()}.
622 * 472 *
623 * <p> This workaround is required e.g. to support recursion. 473 * <p> This workaround is required e.g. to support recursion.
624 * 474 *
625 */ 475 */
626 private static class LazyHolder { 476 private static class LazyHolder {
627 private static final CpsHosts INSTANCE = new CpsHosts(); 477 private static final RemoveHostInstance INSTANCE = new RemoveHostInstance();
628 478
629 /** 479 /**
630 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. 480 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
@@ -642,13 +492,51 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
642 } 492 }
643 493
644 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { 494 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
645 private static final CpsHosts.GeneratedPQuery INSTANCE = new GeneratedPQuery(); 495 private static final RemoveHostInstance.GeneratedPQuery INSTANCE = new GeneratedPQuery();
646
647 private final PParameter parameter_Cps = new PParameter("Cps", "hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "CyberPhysicalSystem")), PParameterDirection.INOUT);
648 496
649 private final PParameter parameter_HostInstance = new PParameter("HostInstance", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT); 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);
650 498
651 private final List<PParameter> parameters = Arrays.asList(parameter_Cps, parameter_HostInstance); 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 }
652 540
653 private GeneratedPQuery() { 541 private GeneratedPQuery() {
654 super(PVisibility.PUBLIC); 542 super(PVisibility.PUBLIC);
@@ -656,12 +544,12 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
656 544
657 @Override 545 @Override
658 public String getFullyQualifiedName() { 546 public String getFullyQualifiedName() {
659 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.cpsHosts"; 547 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.removeHostInstance";
660 } 548 }
661 549
662 @Override 550 @Override
663 public List<String> getParameterNames() { 551 public List<String> getParameterNames() {
664 return Arrays.asList("Cps","HostInstance"); 552 return Arrays.asList("HostInstance");
665 } 553 }
666 554
667 @Override 555 @Override
@@ -675,30 +563,16 @@ public final class CpsHosts extends BaseGeneratedEMFQuerySpecification<CpsHosts.
675 Set<PBody> bodies = new LinkedHashSet<>(); 563 Set<PBody> bodies = new LinkedHashSet<>();
676 { 564 {
677 PBody body = new PBody(this); 565 PBody body = new PBody(this);
678 PVariable var_Cps = body.getOrCreateVariableByName("Cps");
679 PVariable var_HostInstance = body.getOrCreateVariableByName("HostInstance"); 566 PVariable var_HostInstance = body.getOrCreateVariableByName("HostInstance");
680 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem"))); 567 PVariable var___0_ = body.getOrCreateVariableByName("_<0>");
681 new TypeConstraint(body, Tuples.flatTupleOf(var_HostInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance"))); 568 new TypeConstraint(body, Tuples.flatTupleOf(var_HostInstance), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
682 body.setSymbolicParameters(Arrays.<ExportedParameter>asList( 569 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
683 new ExportedParameter(body, var_Cps, parameter_Cps),
684 new ExportedParameter(body, var_HostInstance, parameter_HostInstance) 570 new ExportedParameter(body, var_HostInstance, parameter_HostInstance)
685 )); 571 ));
686 // CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance) 572 // neg HostInstance.applications(HostInstance, _)
687 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "CyberPhysicalSystem"))); 573 new NegativePatternCall(body, Tuples.flatTupleOf(var_HostInstance, var___0_), new RemoveHostInstance.GeneratedPQuery.Embedded_1_HostInstance_applications());
688 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
689 new TypeConstraint(body, Tuples.flatTupleOf(var_Cps, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "CyberPhysicalSystem", "hostTypes")));
690 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
691 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
692 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "instances")));
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
694 new Equality(body, var__virtual_1_, var_HostInstance);
695 bodies.add(body); 574 bodies.add(body);
696 } 575 }
697 {
698 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
699 annotation.addAttribute("feature", "hosts");
700 addAnnotation(annotation);
701 }
702 return bodies; 576 return bodies;
703 } 577 }
704 } 578 }
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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import java.util.Arrays;
9import java.util.Collection;
10import java.util.LinkedHashSet;
11import java.util.List;
12import java.util.Objects;
13import java.util.Optional;
14import java.util.Set;
15import java.util.function.Consumer;
16import java.util.stream.Collectors;
17import java.util.stream.Stream;
18import org.apache.log4j.Logger;
19import org.eclipse.emf.ecore.EClass;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
29import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
39import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
40import 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")
60public 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/TotalHdd.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalHdd.java
deleted file mode 100644
index f91853de..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalHdd.java
+++ /dev/null
@@ -1,706 +0,0 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.emf.ecore.EDataType;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
29import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
41import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
42import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43
44/**
45 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
46 *
47 * <p>Original source:
48 * <code><pre>
49 * {@literal @}QueryBasedFeature(feature = "totalHdd")
50 * pattern totalHdd(Host : HostInstance, Hdd : EInt) {
51 * HostInstance.type.defaultHdd(Host, Hdd);
52 * }
53 * </pre></code>
54 *
55 * @see Matcher
56 * @see Match
57 *
58 */
59@SuppressWarnings("all")
60public final class TotalHdd extends BaseGeneratedEMFQuerySpecification<TotalHdd.Matcher> {
61 /**
62 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd pattern,
63 * to be used in conjunction with {@link Matcher}.
64 *
65 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
66 * Each instance is a (possibly partial) substitution of pattern parameters,
67 * usable to represent a match of the pattern in the result of a query,
68 * or to specify the bound (fixed) input parameters when issuing a query.
69 *
70 * @see Matcher
71 *
72 */
73 public static abstract class Match extends BasePatternMatch {
74 private HostInstance fHost;
75
76 private Integer fHdd;
77
78 private static List<String> parameterNames = makeImmutableList("Host", "Hdd");
79
80 private Match(final HostInstance pHost, final Integer pHdd) {
81 this.fHost = pHost;
82 this.fHdd = pHdd;
83 }
84
85 @Override
86 public Object get(final String parameterName) {
87 if ("Host".equals(parameterName)) return this.fHost;
88 if ("Hdd".equals(parameterName)) return this.fHdd;
89 return null;
90 }
91
92 public HostInstance getHost() {
93 return this.fHost;
94 }
95
96 public Integer getHdd() {
97 return this.fHdd;
98 }
99
100 @Override
101 public boolean set(final String parameterName, final Object newValue) {
102 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
103 if ("Host".equals(parameterName) ) {
104 this.fHost = (HostInstance) newValue;
105 return true;
106 }
107 if ("Hdd".equals(parameterName) ) {
108 this.fHdd = (Integer) newValue;
109 return true;
110 }
111 return false;
112 }
113
114 public void setHost(final HostInstance pHost) {
115 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
116 this.fHost = pHost;
117 }
118
119 public void setHdd(final Integer pHdd) {
120 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
121 this.fHdd = pHdd;
122 }
123
124 @Override
125 public String patternName() {
126 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd";
127 }
128
129 @Override
130 public List<String> parameterNames() {
131 return TotalHdd.Match.parameterNames;
132 }
133
134 @Override
135 public Object[] toArray() {
136 return new Object[]{fHost, fHdd};
137 }
138
139 @Override
140 public TotalHdd.Match toImmutable() {
141 return isMutable() ? newMatch(fHost, fHdd) : this;
142 }
143
144 @Override
145 public String prettyPrint() {
146 StringBuilder result = new StringBuilder();
147 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
148 result.append("\"Hdd\"=" + prettyPrintValue(fHdd));
149 return result.toString();
150 }
151
152 @Override
153 public int hashCode() {
154 return Objects.hash(fHost, fHdd);
155 }
156
157 @Override
158 public boolean equals(final Object obj) {
159 if (this == obj)
160 return true;
161 if (obj == null) {
162 return false;
163 }
164 if ((obj instanceof TotalHdd.Match)) {
165 TotalHdd.Match other = (TotalHdd.Match) obj;
166 return Objects.equals(fHost, other.fHost) && Objects.equals(fHdd, other.fHdd);
167 } else {
168 // this should be infrequent
169 if (!(obj instanceof IPatternMatch)) {
170 return false;
171 }
172 IPatternMatch otherSig = (IPatternMatch) obj;
173 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
174 }
175 }
176
177 @Override
178 public TotalHdd specification() {
179 return TotalHdd.instance();
180 }
181
182 /**
183 * Returns an empty, mutable match.
184 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
185 *
186 * @return the empty match.
187 *
188 */
189 public static TotalHdd.Match newEmptyMatch() {
190 return new Mutable(null, null);
191 }
192
193 /**
194 * Returns a mutable (partial) match.
195 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
196 *
197 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
198 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
199 * @return the new, mutable (partial) match object.
200 *
201 */
202 public static TotalHdd.Match newMutableMatch(final HostInstance pHost, final Integer pHdd) {
203 return new Mutable(pHost, pHdd);
204 }
205
206 /**
207 * Returns a new (partial) match.
208 * This can be used e.g. to call the matcher with a partial match.
209 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
210 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
211 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
212 * @return the (partial) match object.
213 *
214 */
215 public static TotalHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
216 return new Immutable(pHost, pHdd);
217 }
218
219 private static final class Mutable extends TotalHdd.Match {
220 Mutable(final HostInstance pHost, final Integer pHdd) {
221 super(pHost, pHdd);
222 }
223
224 @Override
225 public boolean isMutable() {
226 return true;
227 }
228 }
229
230 private static final class Immutable extends TotalHdd.Match {
231 Immutable(final HostInstance pHost, final Integer pHdd) {
232 super(pHost, pHdd);
233 }
234
235 @Override
236 public boolean isMutable() {
237 return false;
238 }
239 }
240 }
241
242 /**
243 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd pattern,
244 * providing pattern-specific query methods.
245 *
246 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
247 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
248 *
249 * <p>Matches of the pattern will be represented as {@link Match}.
250 *
251 * <p>Original source:
252 * <code><pre>
253 * {@literal @}QueryBasedFeature(feature = "totalHdd")
254 * pattern totalHdd(Host : HostInstance, Hdd : EInt) {
255 * HostInstance.type.defaultHdd(Host, Hdd);
256 * }
257 * </pre></code>
258 *
259 * @see Match
260 * @see TotalHdd
261 *
262 */
263 public static class Matcher extends BaseMatcher<TotalHdd.Match> {
264 /**
265 * Initializes the pattern matcher within an existing VIATRA Query engine.
266 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
267 *
268 * @param engine the existing VIATRA Query engine in which this matcher will be created.
269 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
270 *
271 */
272 public static TotalHdd.Matcher on(final ViatraQueryEngine engine) {
273 // check if matcher already exists
274 Matcher matcher = engine.getExistingMatcher(querySpecification());
275 if (matcher == null) {
276 matcher = (Matcher)engine.getMatcher(querySpecification());
277 }
278 return matcher;
279 }
280
281 /**
282 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
283 * @return an initialized matcher
284 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
285 *
286 */
287 public static TotalHdd.Matcher create() {
288 return new Matcher();
289 }
290
291 private static final int POSITION_HOST = 0;
292
293 private static final int POSITION_HDD = 1;
294
295 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TotalHdd.Matcher.class);
296
297 /**
298 * Initializes the pattern matcher within an existing VIATRA Query engine.
299 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
300 *
301 * @param engine the existing VIATRA Query engine in which this matcher will be created.
302 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
303 *
304 */
305 private Matcher() {
306 super(querySpecification());
307 }
308
309 /**
310 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
311 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
312 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
313 * @return matches represented as a Match object.
314 *
315 */
316 public Collection<TotalHdd.Match> getAllMatches(final HostInstance pHost, final Integer pHdd) {
317 return rawStreamAllMatches(new Object[]{pHost, pHdd}).collect(Collectors.toSet());
318 }
319
320 /**
321 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
322 * </p>
323 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
324 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
325 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
326 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
327 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
328 * @return a stream of matches represented as a Match object.
329 *
330 */
331 public Stream<TotalHdd.Match> streamAllMatches(final HostInstance pHost, final Integer pHdd) {
332 return rawStreamAllMatches(new Object[]{pHost, pHdd});
333 }
334
335 /**
336 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
339 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
340 * @return a match represented as a Match object, or null if no match is found.
341 *
342 */
343 public Optional<TotalHdd.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pHdd) {
344 return rawGetOneArbitraryMatch(new Object[]{pHost, pHdd});
345 }
346
347 /**
348 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
349 * under any possible substitution of the unspecified parameters (if any).
350 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
351 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
352 * @return true if the input is a valid (partial) match of the pattern.
353 *
354 */
355 public boolean hasMatch(final HostInstance pHost, final Integer pHdd) {
356 return rawHasMatch(new Object[]{pHost, pHdd});
357 }
358
359 /**
360 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
363 * @return the number of pattern matches found.
364 *
365 */
366 public int countMatches(final HostInstance pHost, final Integer pHdd) {
367 return rawCountMatches(new Object[]{pHost, pHdd});
368 }
369
370 /**
371 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
372 * Neither determinism nor randomness of selection is guaranteed.
373 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
374 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
375 * @param processor the action that will process the selected match.
376 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
377 *
378 */
379 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pHdd, final Consumer<? super TotalHdd.Match> processor) {
380 return rawForOneArbitraryMatch(new Object[]{pHost, pHdd}, processor);
381 }
382
383 /**
384 * Returns a new (partial) match.
385 * This can be used e.g. to call the matcher with a partial match.
386 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
387 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
388 * @param pHdd the fixed value of pattern parameter Hdd, or null if not bound.
389 * @return the (partial) match object.
390 *
391 */
392 public TotalHdd.Match newMatch(final HostInstance pHost, final Integer pHdd) {
393 return TotalHdd.Match.newMatch(pHost, pHdd);
394 }
395
396 /**
397 * Retrieve the set of values that occur in matches for Host.
398 * @return the Set of all values or empty set if there are no matches
399 *
400 */
401 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
402 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
403 }
404
405 /**
406 * Retrieve the set of values that occur in matches for Host.
407 * @return the Set of all values or empty set if there are no matches
408 *
409 */
410 public Set<HostInstance> getAllValuesOfHost() {
411 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
412 }
413
414 /**
415 * Retrieve the set of values that occur in matches for Host.
416 * @return the Set of all values or empty set if there are no matches
417 *
418 */
419 public Stream<HostInstance> streamAllValuesOfHost() {
420 return rawStreamAllValuesOfHost(emptyArray());
421 }
422
423 /**
424 * Retrieve the set of values that occur in matches for Host.
425 * </p>
426 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
427 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
428 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
429 *
430 * @return the Stream of all values or empty set if there are no matches
431 *
432 */
433 public Stream<HostInstance> streamAllValuesOfHost(final TotalHdd.Match partialMatch) {
434 return rawStreamAllValuesOfHost(partialMatch.toArray());
435 }
436
437 /**
438 * Retrieve the set of values that occur in matches for Host.
439 * </p>
440 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
441 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
442 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
443 *
444 * @return the Stream of all values or empty set if there are no matches
445 *
446 */
447 public Stream<HostInstance> streamAllValuesOfHost(final Integer pHdd) {
448 return rawStreamAllValuesOfHost(new Object[]{null, pHdd});
449 }
450
451 /**
452 * Retrieve the set of values that occur in matches for Host.
453 * @return the Set of all values or empty set if there are no matches
454 *
455 */
456 public Set<HostInstance> getAllValuesOfHost(final TotalHdd.Match partialMatch) {
457 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
458 }
459
460 /**
461 * Retrieve the set of values that occur in matches for Host.
462 * @return the Set of all values or empty set if there are no matches
463 *
464 */
465 public Set<HostInstance> getAllValuesOfHost(final Integer pHdd) {
466 return rawStreamAllValuesOfHost(new Object[]{null, pHdd}).collect(Collectors.toSet());
467 }
468
469 /**
470 * Retrieve the set of values that occur in matches for Hdd.
471 * @return the Set of all values or empty set if there are no matches
472 *
473 */
474 protected Stream<Integer> rawStreamAllValuesOfHdd(final Object[] parameters) {
475 return rawStreamAllValues(POSITION_HDD, parameters).map(Integer.class::cast);
476 }
477
478 /**
479 * Retrieve the set of values that occur in matches for Hdd.
480 * @return the Set of all values or empty set if there are no matches
481 *
482 */
483 public Set<Integer> getAllValuesOfHdd() {
484 return rawStreamAllValuesOfHdd(emptyArray()).collect(Collectors.toSet());
485 }
486
487 /**
488 * Retrieve the set of values that occur in matches for Hdd.
489 * @return the Set of all values or empty set if there are no matches
490 *
491 */
492 public Stream<Integer> streamAllValuesOfHdd() {
493 return rawStreamAllValuesOfHdd(emptyArray());
494 }
495
496 /**
497 * Retrieve the set of values that occur in matches for Hdd.
498 * </p>
499 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
500 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
501 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
502 *
503 * @return the Stream of all values or empty set if there are no matches
504 *
505 */
506 public Stream<Integer> streamAllValuesOfHdd(final TotalHdd.Match partialMatch) {
507 return rawStreamAllValuesOfHdd(partialMatch.toArray());
508 }
509
510 /**
511 * Retrieve the set of values that occur in matches for Hdd.
512 * </p>
513 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
514 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
515 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
516 *
517 * @return the Stream of all values or empty set if there are no matches
518 *
519 */
520 public Stream<Integer> streamAllValuesOfHdd(final HostInstance pHost) {
521 return rawStreamAllValuesOfHdd(new Object[]{pHost, null});
522 }
523
524 /**
525 * Retrieve the set of values that occur in matches for Hdd.
526 * @return the Set of all values or empty set if there are no matches
527 *
528 */
529 public Set<Integer> getAllValuesOfHdd(final TotalHdd.Match partialMatch) {
530 return rawStreamAllValuesOfHdd(partialMatch.toArray()).collect(Collectors.toSet());
531 }
532
533 /**
534 * Retrieve the set of values that occur in matches for Hdd.
535 * @return the Set of all values or empty set if there are no matches
536 *
537 */
538 public Set<Integer> getAllValuesOfHdd(final HostInstance pHost) {
539 return rawStreamAllValuesOfHdd(new Object[]{pHost, null}).collect(Collectors.toSet());
540 }
541
542 @Override
543 protected TotalHdd.Match tupleToMatch(final Tuple t) {
544 try {
545 return TotalHdd.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_HDD));
546 } catch(ClassCastException e) {
547 LOGGER.error("Element(s) in tuple not properly typed!",e);
548 return null;
549 }
550 }
551
552 @Override
553 protected TotalHdd.Match arrayToMatch(final Object[] match) {
554 try {
555 return TotalHdd.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
556 } catch(ClassCastException e) {
557 LOGGER.error("Element(s) in array not properly typed!",e);
558 return null;
559 }
560 }
561
562 @Override
563 protected TotalHdd.Match arrayToMatchMutable(final Object[] match) {
564 try {
565 return TotalHdd.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_HDD]);
566 } catch(ClassCastException e) {
567 LOGGER.error("Element(s) in array not properly typed!",e);
568 return null;
569 }
570 }
571
572 /**
573 * @return the singleton instance of the query specification of this pattern
574 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
575 *
576 */
577 public static IQuerySpecification<TotalHdd.Matcher> querySpecification() {
578 return TotalHdd.instance();
579 }
580 }
581
582 private TotalHdd() {
583 super(GeneratedPQuery.INSTANCE);
584 }
585
586 /**
587 * @return the singleton instance of the query specification
588 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
589 *
590 */
591 public static TotalHdd instance() {
592 try{
593 return LazyHolder.INSTANCE;
594 } catch (ExceptionInInitializerError err) {
595 throw processInitializerError(err);
596 }
597 }
598
599 @Override
600 protected TotalHdd.Matcher instantiate(final ViatraQueryEngine engine) {
601 return TotalHdd.Matcher.on(engine);
602 }
603
604 @Override
605 public TotalHdd.Matcher instantiate() {
606 return TotalHdd.Matcher.create();
607 }
608
609 @Override
610 public TotalHdd.Match newEmptyMatch() {
611 return TotalHdd.Match.newEmptyMatch();
612 }
613
614 @Override
615 public TotalHdd.Match newMatch(final Object... parameters) {
616 return TotalHdd.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
617 }
618
619 /**
620 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd (visibility: PUBLIC, simpleName: TotalHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
621 * <b>not</b> at the class load time of the outer class,
622 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd (visibility: PUBLIC, simpleName: TotalHdd, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
623 *
624 * <p> This workaround is required e.g. to support recursion.
625 *
626 */
627 private static class LazyHolder {
628 private static final TotalHdd INSTANCE = new TotalHdd();
629
630 /**
631 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
632 * This initialization order is required to support indirect recursion.
633 *
634 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
635 *
636 */
637 private static final Object STATIC_INITIALIZER = ensureInitialized();
638
639 public static Object ensureInitialized() {
640 INSTANCE.ensureInitializedInternal();
641 return null;
642 }
643 }
644
645 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
646 private static final TotalHdd.GeneratedPQuery INSTANCE = new GeneratedPQuery();
647
648 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
649
650 private final PParameter parameter_Hdd = new PParameter("Hdd", "java.lang.Integer", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EInt")), PParameterDirection.INOUT);
651
652 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Hdd);
653
654 private GeneratedPQuery() {
655 super(PVisibility.PUBLIC);
656 }
657
658 @Override
659 public String getFullyQualifiedName() {
660 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalHdd";
661 }
662
663 @Override
664 public List<String> getParameterNames() {
665 return Arrays.asList("Host","Hdd");
666 }
667
668 @Override
669 public List<PParameter> getParameters() {
670 return parameters;
671 }
672
673 @Override
674 public Set<PBody> doGetContainedBodies() {
675 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
676 Set<PBody> bodies = new LinkedHashSet<>();
677 {
678 PBody body = new PBody(this);
679 PVariable var_Host = body.getOrCreateVariableByName("Host");
680 PVariable var_Hdd = body.getOrCreateVariableByName("Hdd");
681 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
682 new TypeConstraint(body, Tuples.flatTupleOf(var_Hdd), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
683 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
684 new ExportedParameter(body, var_Host, parameter_Host),
685 new ExportedParameter(body, var_Hdd, parameter_Hdd)
686 ));
687 // HostInstance.type.defaultHdd(Host, Hdd)
688 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
689 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
690 new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type")));
691 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
692 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "defaultHdd")));
694 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
695 new Equality(body, var__virtual_1_, var_Hdd);
696 bodies.add(body);
697 }
698 {
699 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
700 annotation.addAttribute("feature", "totalHdd");
701 addAnnotation(annotation);
702 }
703 return bodies;
704 }
705 }
706}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java
deleted file mode 100644
index e8a11e36..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/TotalMemory.java
+++ /dev/null
@@ -1,706 +0,0 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.emf.ecore.EDataType;
20import org.eclipse.viatra.query.runtime.api.IPatternMatch;
21import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
22import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
24import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
25import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
26import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
27import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
28import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
29import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
30import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
31import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
32import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
33import org.eclipse.viatra.query.runtime.matchers.psystem.annotations.PAnnotation;
34import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
35import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
36import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
37import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
38import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
39import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
40import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
41import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
42import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
43
44/**
45 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
46 *
47 * <p>Original source:
48 * <code><pre>
49 * {@literal @}QueryBasedFeature(feature = "totalMemory")
50 * pattern totalMemory(Host : HostInstance, Memory : EInt) {
51 * HostInstance.type.defaultMemory(Host, Memory);
52 * }
53 * </pre></code>
54 *
55 * @see Matcher
56 * @see Match
57 *
58 */
59@SuppressWarnings("all")
60public final class TotalMemory extends BaseGeneratedEMFQuerySpecification<TotalMemory.Matcher> {
61 /**
62 * Pattern-specific match representation of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory pattern,
63 * to be used in conjunction with {@link Matcher}.
64 *
65 * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned.
66 * Each instance is a (possibly partial) substitution of pattern parameters,
67 * usable to represent a match of the pattern in the result of a query,
68 * or to specify the bound (fixed) input parameters when issuing a query.
69 *
70 * @see Matcher
71 *
72 */
73 public static abstract class Match extends BasePatternMatch {
74 private HostInstance fHost;
75
76 private Integer fMemory;
77
78 private static List<String> parameterNames = makeImmutableList("Host", "Memory");
79
80 private Match(final HostInstance pHost, final Integer pMemory) {
81 this.fHost = pHost;
82 this.fMemory = pMemory;
83 }
84
85 @Override
86 public Object get(final String parameterName) {
87 if ("Host".equals(parameterName)) return this.fHost;
88 if ("Memory".equals(parameterName)) return this.fMemory;
89 return null;
90 }
91
92 public HostInstance getHost() {
93 return this.fHost;
94 }
95
96 public Integer getMemory() {
97 return this.fMemory;
98 }
99
100 @Override
101 public boolean set(final String parameterName, final Object newValue) {
102 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
103 if ("Host".equals(parameterName) ) {
104 this.fHost = (HostInstance) newValue;
105 return true;
106 }
107 if ("Memory".equals(parameterName) ) {
108 this.fMemory = (Integer) newValue;
109 return true;
110 }
111 return false;
112 }
113
114 public void setHost(final HostInstance pHost) {
115 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
116 this.fHost = pHost;
117 }
118
119 public void setMemory(final Integer pMemory) {
120 if (!isMutable()) throw new java.lang.UnsupportedOperationException();
121 this.fMemory = pMemory;
122 }
123
124 @Override
125 public String patternName() {
126 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory";
127 }
128
129 @Override
130 public List<String> parameterNames() {
131 return TotalMemory.Match.parameterNames;
132 }
133
134 @Override
135 public Object[] toArray() {
136 return new Object[]{fHost, fMemory};
137 }
138
139 @Override
140 public TotalMemory.Match toImmutable() {
141 return isMutable() ? newMatch(fHost, fMemory) : this;
142 }
143
144 @Override
145 public String prettyPrint() {
146 StringBuilder result = new StringBuilder();
147 result.append("\"Host\"=" + prettyPrintValue(fHost) + ", ");
148 result.append("\"Memory\"=" + prettyPrintValue(fMemory));
149 return result.toString();
150 }
151
152 @Override
153 public int hashCode() {
154 return Objects.hash(fHost, fMemory);
155 }
156
157 @Override
158 public boolean equals(final Object obj) {
159 if (this == obj)
160 return true;
161 if (obj == null) {
162 return false;
163 }
164 if ((obj instanceof TotalMemory.Match)) {
165 TotalMemory.Match other = (TotalMemory.Match) obj;
166 return Objects.equals(fHost, other.fHost) && Objects.equals(fMemory, other.fMemory);
167 } else {
168 // this should be infrequent
169 if (!(obj instanceof IPatternMatch)) {
170 return false;
171 }
172 IPatternMatch otherSig = (IPatternMatch) obj;
173 return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray());
174 }
175 }
176
177 @Override
178 public TotalMemory specification() {
179 return TotalMemory.instance();
180 }
181
182 /**
183 * Returns an empty, mutable match.
184 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
185 *
186 * @return the empty match.
187 *
188 */
189 public static TotalMemory.Match newEmptyMatch() {
190 return new Mutable(null, null);
191 }
192
193 /**
194 * Returns a mutable (partial) match.
195 * Fields of the mutable match can be filled to create a partial match, usable as matcher input.
196 *
197 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
198 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
199 * @return the new, mutable (partial) match object.
200 *
201 */
202 public static TotalMemory.Match newMutableMatch(final HostInstance pHost, final Integer pMemory) {
203 return new Mutable(pHost, pMemory);
204 }
205
206 /**
207 * Returns a new (partial) match.
208 * This can be used e.g. to call the matcher with a partial match.
209 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
210 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
211 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
212 * @return the (partial) match object.
213 *
214 */
215 public static TotalMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
216 return new Immutable(pHost, pMemory);
217 }
218
219 private static final class Mutable extends TotalMemory.Match {
220 Mutable(final HostInstance pHost, final Integer pMemory) {
221 super(pHost, pMemory);
222 }
223
224 @Override
225 public boolean isMutable() {
226 return true;
227 }
228 }
229
230 private static final class Immutable extends TotalMemory.Match {
231 Immutable(final HostInstance pHost, final Integer pMemory) {
232 super(pHost, pMemory);
233 }
234
235 @Override
236 public boolean isMutable() {
237 return false;
238 }
239 }
240 }
241
242 /**
243 * Generated pattern matcher API of the hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory pattern,
244 * providing pattern-specific query methods.
245 *
246 * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)},
247 * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}.
248 *
249 * <p>Matches of the pattern will be represented as {@link Match}.
250 *
251 * <p>Original source:
252 * <code><pre>
253 * {@literal @}QueryBasedFeature(feature = "totalMemory")
254 * pattern totalMemory(Host : HostInstance, Memory : EInt) {
255 * HostInstance.type.defaultMemory(Host, Memory);
256 * }
257 * </pre></code>
258 *
259 * @see Match
260 * @see TotalMemory
261 *
262 */
263 public static class Matcher extends BaseMatcher<TotalMemory.Match> {
264 /**
265 * Initializes the pattern matcher within an existing VIATRA Query engine.
266 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
267 *
268 * @param engine the existing VIATRA Query engine in which this matcher will be created.
269 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
270 *
271 */
272 public static TotalMemory.Matcher on(final ViatraQueryEngine engine) {
273 // check if matcher already exists
274 Matcher matcher = engine.getExistingMatcher(querySpecification());
275 if (matcher == null) {
276 matcher = (Matcher)engine.getMatcher(querySpecification());
277 }
278 return matcher;
279 }
280
281 /**
282 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
283 * @return an initialized matcher
284 * @noreference This method is for internal matcher initialization by the framework, do not call it manually.
285 *
286 */
287 public static TotalMemory.Matcher create() {
288 return new Matcher();
289 }
290
291 private static final int POSITION_HOST = 0;
292
293 private static final int POSITION_MEMORY = 1;
294
295 private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(TotalMemory.Matcher.class);
296
297 /**
298 * Initializes the pattern matcher within an existing VIATRA Query engine.
299 * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned.
300 *
301 * @param engine the existing VIATRA Query engine in which this matcher will be created.
302 * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation
303 *
304 */
305 private Matcher() {
306 super(querySpecification());
307 }
308
309 /**
310 * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters.
311 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
312 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
313 * @return matches represented as a Match object.
314 *
315 */
316 public Collection<TotalMemory.Match> getAllMatches(final HostInstance pHost, final Integer pMemory) {
317 return rawStreamAllMatches(new Object[]{pHost, pMemory}).collect(Collectors.toSet());
318 }
319
320 /**
321 * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters.
322 * </p>
323 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
324 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
325 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
326 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
327 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
328 * @return a stream of matches represented as a Match object.
329 *
330 */
331 public Stream<TotalMemory.Match> streamAllMatches(final HostInstance pHost, final Integer pMemory) {
332 return rawStreamAllMatches(new Object[]{pHost, pMemory});
333 }
334
335 /**
336 * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
337 * Neither determinism nor randomness of selection is guaranteed.
338 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
339 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
340 * @return a match represented as a Match object, or null if no match is found.
341 *
342 */
343 public Optional<TotalMemory.Match> getOneArbitraryMatch(final HostInstance pHost, final Integer pMemory) {
344 return rawGetOneArbitraryMatch(new Object[]{pHost, pMemory});
345 }
346
347 /**
348 * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match,
349 * under any possible substitution of the unspecified parameters (if any).
350 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
351 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
352 * @return true if the input is a valid (partial) match of the pattern.
353 *
354 */
355 public boolean hasMatch(final HostInstance pHost, final Integer pMemory) {
356 return rawHasMatch(new Object[]{pHost, pMemory});
357 }
358
359 /**
360 * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters.
361 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
362 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
363 * @return the number of pattern matches found.
364 *
365 */
366 public int countMatches(final HostInstance pHost, final Integer pMemory) {
367 return rawCountMatches(new Object[]{pHost, pMemory});
368 }
369
370 /**
371 * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters.
372 * Neither determinism nor randomness of selection is guaranteed.
373 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
374 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
375 * @param processor the action that will process the selected match.
376 * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked
377 *
378 */
379 public boolean forOneArbitraryMatch(final HostInstance pHost, final Integer pMemory, final Consumer<? super TotalMemory.Match> processor) {
380 return rawForOneArbitraryMatch(new Object[]{pHost, pMemory}, processor);
381 }
382
383 /**
384 * Returns a new (partial) match.
385 * This can be used e.g. to call the matcher with a partial match.
386 * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object.
387 * @param pHost the fixed value of pattern parameter Host, or null if not bound.
388 * @param pMemory the fixed value of pattern parameter Memory, or null if not bound.
389 * @return the (partial) match object.
390 *
391 */
392 public TotalMemory.Match newMatch(final HostInstance pHost, final Integer pMemory) {
393 return TotalMemory.Match.newMatch(pHost, pMemory);
394 }
395
396 /**
397 * Retrieve the set of values that occur in matches for Host.
398 * @return the Set of all values or empty set if there are no matches
399 *
400 */
401 protected Stream<HostInstance> rawStreamAllValuesOfHost(final Object[] parameters) {
402 return rawStreamAllValues(POSITION_HOST, parameters).map(HostInstance.class::cast);
403 }
404
405 /**
406 * Retrieve the set of values that occur in matches for Host.
407 * @return the Set of all values or empty set if there are no matches
408 *
409 */
410 public Set<HostInstance> getAllValuesOfHost() {
411 return rawStreamAllValuesOfHost(emptyArray()).collect(Collectors.toSet());
412 }
413
414 /**
415 * Retrieve the set of values that occur in matches for Host.
416 * @return the Set of all values or empty set if there are no matches
417 *
418 */
419 public Stream<HostInstance> streamAllValuesOfHost() {
420 return rawStreamAllValuesOfHost(emptyArray());
421 }
422
423 /**
424 * Retrieve the set of values that occur in matches for Host.
425 * </p>
426 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
427 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
428 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
429 *
430 * @return the Stream of all values or empty set if there are no matches
431 *
432 */
433 public Stream<HostInstance> streamAllValuesOfHost(final TotalMemory.Match partialMatch) {
434 return rawStreamAllValuesOfHost(partialMatch.toArray());
435 }
436
437 /**
438 * Retrieve the set of values that occur in matches for Host.
439 * </p>
440 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
441 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
442 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
443 *
444 * @return the Stream of all values or empty set if there are no matches
445 *
446 */
447 public Stream<HostInstance> streamAllValuesOfHost(final Integer pMemory) {
448 return rawStreamAllValuesOfHost(new Object[]{null, pMemory});
449 }
450
451 /**
452 * Retrieve the set of values that occur in matches for Host.
453 * @return the Set of all values or empty set if there are no matches
454 *
455 */
456 public Set<HostInstance> getAllValuesOfHost(final TotalMemory.Match partialMatch) {
457 return rawStreamAllValuesOfHost(partialMatch.toArray()).collect(Collectors.toSet());
458 }
459
460 /**
461 * Retrieve the set of values that occur in matches for Host.
462 * @return the Set of all values or empty set if there are no matches
463 *
464 */
465 public Set<HostInstance> getAllValuesOfHost(final Integer pMemory) {
466 return rawStreamAllValuesOfHost(new Object[]{null, pMemory}).collect(Collectors.toSet());
467 }
468
469 /**
470 * Retrieve the set of values that occur in matches for Memory.
471 * @return the Set of all values or empty set if there are no matches
472 *
473 */
474 protected Stream<Integer> rawStreamAllValuesOfMemory(final Object[] parameters) {
475 return rawStreamAllValues(POSITION_MEMORY, parameters).map(Integer.class::cast);
476 }
477
478 /**
479 * Retrieve the set of values that occur in matches for Memory.
480 * @return the Set of all values or empty set if there are no matches
481 *
482 */
483 public Set<Integer> getAllValuesOfMemory() {
484 return rawStreamAllValuesOfMemory(emptyArray()).collect(Collectors.toSet());
485 }
486
487 /**
488 * Retrieve the set of values that occur in matches for Memory.
489 * @return the Set of all values or empty set if there are no matches
490 *
491 */
492 public Stream<Integer> streamAllValuesOfMemory() {
493 return rawStreamAllValuesOfMemory(emptyArray());
494 }
495
496 /**
497 * Retrieve the set of values that occur in matches for Memory.
498 * </p>
499 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
500 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
501 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
502 *
503 * @return the Stream of all values or empty set if there are no matches
504 *
505 */
506 public Stream<Integer> streamAllValuesOfMemory(final TotalMemory.Match partialMatch) {
507 return rawStreamAllValuesOfMemory(partialMatch.toArray());
508 }
509
510 /**
511 * Retrieve the set of values that occur in matches for Memory.
512 * </p>
513 * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed.
514 * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>.
515 * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code.
516 *
517 * @return the Stream of all values or empty set if there are no matches
518 *
519 */
520 public Stream<Integer> streamAllValuesOfMemory(final HostInstance pHost) {
521 return rawStreamAllValuesOfMemory(new Object[]{pHost, null});
522 }
523
524 /**
525 * Retrieve the set of values that occur in matches for Memory.
526 * @return the Set of all values or empty set if there are no matches
527 *
528 */
529 public Set<Integer> getAllValuesOfMemory(final TotalMemory.Match partialMatch) {
530 return rawStreamAllValuesOfMemory(partialMatch.toArray()).collect(Collectors.toSet());
531 }
532
533 /**
534 * Retrieve the set of values that occur in matches for Memory.
535 * @return the Set of all values or empty set if there are no matches
536 *
537 */
538 public Set<Integer> getAllValuesOfMemory(final HostInstance pHost) {
539 return rawStreamAllValuesOfMemory(new Object[]{pHost, null}).collect(Collectors.toSet());
540 }
541
542 @Override
543 protected TotalMemory.Match tupleToMatch(final Tuple t) {
544 try {
545 return TotalMemory.Match.newMatch((HostInstance) t.get(POSITION_HOST), (Integer) t.get(POSITION_MEMORY));
546 } catch(ClassCastException e) {
547 LOGGER.error("Element(s) in tuple not properly typed!",e);
548 return null;
549 }
550 }
551
552 @Override
553 protected TotalMemory.Match arrayToMatch(final Object[] match) {
554 try {
555 return TotalMemory.Match.newMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
556 } catch(ClassCastException e) {
557 LOGGER.error("Element(s) in array not properly typed!",e);
558 return null;
559 }
560 }
561
562 @Override
563 protected TotalMemory.Match arrayToMatchMutable(final Object[] match) {
564 try {
565 return TotalMemory.Match.newMutableMatch((HostInstance) match[POSITION_HOST], (Integer) match[POSITION_MEMORY]);
566 } catch(ClassCastException e) {
567 LOGGER.error("Element(s) in array not properly typed!",e);
568 return null;
569 }
570 }
571
572 /**
573 * @return the singleton instance of the query specification of this pattern
574 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
575 *
576 */
577 public static IQuerySpecification<TotalMemory.Matcher> querySpecification() {
578 return TotalMemory.instance();
579 }
580 }
581
582 private TotalMemory() {
583 super(GeneratedPQuery.INSTANCE);
584 }
585
586 /**
587 * @return the singleton instance of the query specification
588 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
589 *
590 */
591 public static TotalMemory instance() {
592 try{
593 return LazyHolder.INSTANCE;
594 } catch (ExceptionInInitializerError err) {
595 throw processInitializerError(err);
596 }
597 }
598
599 @Override
600 protected TotalMemory.Matcher instantiate(final ViatraQueryEngine engine) {
601 return TotalMemory.Matcher.on(engine);
602 }
603
604 @Override
605 public TotalMemory.Matcher instantiate() {
606 return TotalMemory.Matcher.create();
607 }
608
609 @Override
610 public TotalMemory.Match newEmptyMatch() {
611 return TotalMemory.Match.newEmptyMatch();
612 }
613
614 @Override
615 public TotalMemory.Match newMatch(final Object... parameters) {
616 return TotalMemory.Match.newMatch((hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance) parameters[0], (java.lang.Integer) parameters[1]);
617 }
618
619 /**
620 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory (visibility: PUBLIC, simpleName: TotalMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
621 * <b>not</b> at the class load time of the outer class,
622 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory (visibility: PUBLIC, simpleName: TotalMemory, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
623 *
624 * <p> This workaround is required e.g. to support recursion.
625 *
626 */
627 private static class LazyHolder {
628 private static final TotalMemory INSTANCE = new TotalMemory();
629
630 /**
631 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
632 * This initialization order is required to support indirect recursion.
633 *
634 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
635 *
636 */
637 private static final Object STATIC_INITIALIZER = ensureInitialized();
638
639 public static Object ensureInitialized() {
640 INSTANCE.ensureInitializedInternal();
641 return null;
642 }
643 }
644
645 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
646 private static final TotalMemory.GeneratedPQuery INSTANCE = new GeneratedPQuery();
647
648 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
649
650 private final PParameter parameter_Memory = new PParameter("Memory", "java.lang.Integer", new EDataTypeInSlotsKey((EDataType)getClassifierLiteralSafe("http://www.eclipse.org/emf/2002/Ecore", "EInt")), PParameterDirection.INOUT);
651
652 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_Memory);
653
654 private GeneratedPQuery() {
655 super(PVisibility.PUBLIC);
656 }
657
658 @Override
659 public String getFullyQualifiedName() {
660 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.totalMemory";
661 }
662
663 @Override
664 public List<String> getParameterNames() {
665 return Arrays.asList("Host","Memory");
666 }
667
668 @Override
669 public List<PParameter> getParameters() {
670 return parameters;
671 }
672
673 @Override
674 public Set<PBody> doGetContainedBodies() {
675 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
676 Set<PBody> bodies = new LinkedHashSet<>();
677 {
678 PBody body = new PBody(this);
679 PVariable var_Host = body.getOrCreateVariableByName("Host");
680 PVariable var_Memory = body.getOrCreateVariableByName("Memory");
681 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
682 new TypeConstraint(body, Tuples.flatTupleOf(var_Memory), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
683 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
684 new ExportedParameter(body, var_Host, parameter_Host),
685 new ExportedParameter(body, var_Memory, parameter_Memory)
686 ));
687 // HostInstance.type.defaultMemory(Host, Memory)
688 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
689 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
690 new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type")));
691 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
692 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
693 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostType", "defaultMemory")));
694 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt")));
695 new Equality(body, var__virtual_1_, var_Memory);
696 bodies.add(body);
697 }
698 {
699 PAnnotation annotation = new PAnnotation("QueryBasedFeature");
700 annotation.addAttribute("feature", "totalMemory");
701 addAnnotation(annotation);
702 }
703 return bodies;
704 }
705 }
706}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
7import java.util.Arrays;
8import java.util.Collection;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Objects;
12import java.util.Optional;
13import java.util.Set;
14import java.util.function.Consumer;
15import java.util.stream.Collectors;
16import java.util.stream.Stream;
17import org.apache.log4j.Logger;
18import org.eclipse.emf.ecore.EClass;
19import org.eclipse.viatra.query.runtime.api.IPatternMatch;
20import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
21import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine;
22import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
23import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification;
24import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher;
25import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch;
26import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
27import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
28import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
29import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
30import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
31import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
32import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
33import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
34import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
35import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
36import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
37import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple;
38import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
39import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil;
40
41/**
42 * A pattern-specific query specification that can instantiate Matcher in a type-safe way.
43 *
44 * <p>Original source:
45 * <code><pre>
46 * pattern unallocateAppInstance(App : ApplicationInstance) {
47 * ApplicationInstance.allocatedTo(App, _);
48 * }
49 * </pre></code>
50 *
51 * @see Matcher
52 * @see Match
53 *
54 */
55@SuppressWarnings("all")
56public 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
index 2f593811..c903a5e9 100644
--- 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
@@ -9,3 +9,12 @@
9/.FreeHddPercentage.java._trace 9/.FreeHddPercentage.java._trace
10/.ApplicationInstance.java._trace 10/.ApplicationInstance.java._trace
11/.HostInstanceCost.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
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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd;
8import java.util.Arrays;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Set;
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
17import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
18import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
19import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
20import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
21import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
22import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
33import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
34
35/**
36 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
37 *
38 * <p>Original source:
39 * <code><pre>
40 * private pattern 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")
52public 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory;
8import java.util.Arrays;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Set;
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.aggregators.sum;
17import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
18import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
19import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
20import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
21import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
22import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
23import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.AggregatorConstraint;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
33import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
34
35/**
36 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
37 *
38 * <p>Original source:
39 * <code><pre>
40 * private pattern 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")
52public 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
13import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
14import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
18import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
21import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
24import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
25
26/**
27 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
28 *
29 * <p>Original source:
30 * <code><pre>
31 * private pattern 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")
41public 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
13import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
14import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
18import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
21import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
24import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
25
26/**
27 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
28 *
29 * <p>Original source:
30 * <code><pre>
31 * private pattern 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")
41public 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
index 58b113eb..67f75e1d 100644
--- 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
@@ -3,29 +3,37 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate;
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement; 7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AllocationWithoutResourceRequirement;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd;
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory;
9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric; 8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric;
10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric; 9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric;
11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric; 10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric;
12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsApplications;
13import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost; 11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsCost;
14import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts; 12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance;
13import hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective;
15import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement; 14import hu.bme.mit.inf.dslreasoner.domains.cps.queries.InstanceDoesNotSatisfyRequirement;
16import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd; 15import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableHdd;
17import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory; 16import hu.bme.mit.inf.dslreasoner.domains.cps.queries.NotEnoughAvailableMemory;
18import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost; 17import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RedundantInstancesOnSameHost;
18import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RemoveHostInstance;
19import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied; 19import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied;
20import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd; 20import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement;
21import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory; 21import hu.bme.mit.inf.dslreasoner.domains.cps.queries.UnallocateAppInstance;
22import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd;
23import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory;
24import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsApplications;
25import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts;
22import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage; 26import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeHddPercentage;
23import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage; 27import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.FreeMemoryPercentage;
24import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement; 28import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HddRequirement;
25import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost; 29import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.HostInstanceCost;
26import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement; 30import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.MemoryRequirement;
27import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement; 31import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.NoHostToAllocateTo;
32import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.RequiredAppInstances;
28import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance; 33import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance;
34import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd;
35import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory;
36import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance;
29import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup; 37import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
30 38
31/** 39/**
@@ -57,6 +65,14 @@ import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedPatternGroup;
57 * <li>costMetric</li> 65 * <li>costMetric</li>
58 * <li>cpsCost</li> 66 * <li>cpsCost</li>
59 * <li>hostInstanceCost</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>
60 * </ul> 76 * </ul>
61 * 77 *
62 * @see IQueryGroup 78 * @see IQueryGroup
@@ -104,5 +120,13 @@ public final class CpsQueriesAll extends BaseGeneratedPatternGroup {
104 querySpecifications.add(CostMetric.instance()); 120 querySpecifications.add(CostMetric.instance());
105 querySpecifications.add(CpsCost.instance()); 121 querySpecifications.add(CpsCost.instance());
106 querySpecifications.add(HostInstanceCost.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());
107 } 131 }
108} 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
index 366677b5..c24f46a1 100644
--- 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
@@ -3,8 +3,8 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableHdd; 6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableHdd;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalHdd; 7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalHdd;
8import java.util.Arrays; 8import java.util.Arrays;
9import java.util.LinkedHashSet; 9import java.util.LinkedHashSet;
10import java.util.List; 10import java.util.List;
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
index bd151ea6..c2bb2bb3 100644
--- 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
@@ -3,8 +3,8 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AvailableMemory; 6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.AvailableMemory;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.TotalMemory; 7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.TotalMemory;
8import java.util.Arrays; 8import java.util.Arrays;
9import java.util.LinkedHashSet; 9import java.util.LinkedHashSet;
10import java.util.List; 10import java.util.List;
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
index fbe7a46b..68448930 100644
--- 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
@@ -3,7 +3,7 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement; 6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement;
7import java.util.Arrays; 7import java.util.Arrays;
8import java.util.LinkedHashSet; 8import java.util.LinkedHashSet;
9import java.util.List; 9import java.util.List;
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
index 767ca342..db7f7021 100644
--- 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
@@ -3,7 +3,7 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsHosts; 6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.CpsHosts;
7import java.util.Arrays; 7import java.util.Arrays;
8import java.util.LinkedHashSet; 8import java.util.LinkedHashSet;
9import java.util.List; 9import java.util.List;
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
index 0a24d105..d15f9bfa 100644
--- 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
@@ -3,7 +3,7 @@
3 */ 3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal; 4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5 5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement; 6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.ResourceRequirement;
7import java.util.Arrays; 7import java.util.Arrays;
8import java.util.LinkedHashSet; 8import java.util.LinkedHashSet;
9import java.util.List; 9import java.util.List;
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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.UnallocatedAppInstance;
8import java.util.Arrays;
9import java.util.LinkedHashSet;
10import java.util.List;
11import java.util.Set;
12import org.eclipse.emf.ecore.EClass;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.PositivePatternCall;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
26import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
27
28/**
29 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
30 *
31 * <p>Original source:
32 * <code><pre>
33 * private pattern 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")
44public 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.SatisfyingInstance;
7import java.util.Arrays;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.emf.ecore.EDataType;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
14import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
15import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
16import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
17import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
18import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
19import org.eclipse.viatra.query.runtime.matchers.context.common.JavaTransitiveInstancesKey;
20import org.eclipse.viatra.query.runtime.matchers.psystem.IExpressionEvaluator;
21import org.eclipse.viatra.query.runtime.matchers.psystem.IValueProvider;
22import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
23import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
24import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
25import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
26import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExpressionEvaluation;
27import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.PatternMatchCounter;
28import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.TypeFilterConstraint;
29import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
30import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
31import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
32import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
33import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
34
35/**
36 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
37 *
38 * <p>Original source:
39 * <code><pre>
40 * private pattern 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")
52public 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/ResourceRequirement.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/ResourceRequirement.java
deleted file mode 100644
index 8c5bdefe..00000000
--- a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/ResourceRequirement.java
+++ /dev/null
@@ -1,168 +0,0 @@
1/**
2 * Generated from platform:/resource/hu.bme.mit.inf.dslreasoner.domains.cps/src/hu/bme/mit/inf/dslreasoner/domains/cps/queries/CpsQueries.vql
3 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
13import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
14import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
15import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
16import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
18import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
21import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
24import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
25
26/**
27 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
28 *
29 * <p>Original source:
30 * <code><pre>
31 * private pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) {
32 * ApplicationInstance.allocatedTo(App, Host);
33 * ApplicationInstance.type.requirements(App, Req);
34 * HostInstance.type(Host, HostType);
35 * ResourceRequirement.hostType(Req, HostType);
36 * }
37 * </pre></code>
38 *
39 * @see GenericPatternMatcher
40 * @see GenericPatternMatch
41 *
42 */
43@SuppressWarnings("all")
44public final class ResourceRequirement extends BaseGeneratedEMFQuerySpecificationWithGenericMatcher {
45 private ResourceRequirement() {
46 super(GeneratedPQuery.INSTANCE);
47 }
48
49 /**
50 * @return the singleton instance of the query specification
51 * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded
52 *
53 */
54 public static ResourceRequirement instance() {
55 try{
56 return LazyHolder.INSTANCE;
57 } catch (ExceptionInInitializerError err) {
58 throw processInitializerError(err);
59 }
60 }
61
62 /**
63 * Inner class allowing the singleton instance of {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement (visibility: PUBLIC, simpleName: ResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)} to be created
64 * <b>not</b> at the class load time of the outer class,
65 * but rather at the first call to {@link JvmGenericType: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement (visibility: PUBLIC, simpleName: ResourceRequirement, identifier: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal.ResourceRequirement, deprecated: <unset>) (abstract: false, static: false, final: true, packageName: hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal) (interface: false, strictFloatingPoint: false, anonymous: false)#instance()}.
66 *
67 * <p> This workaround is required e.g. to support recursion.
68 *
69 */
70 private static class LazyHolder {
71 private static final ResourceRequirement INSTANCE = new ResourceRequirement();
72
73 /**
74 * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned.
75 * This initialization order is required to support indirect recursion.
76 *
77 * <p> The static initializer is defined using a helper field to work around limitations of the code generator.
78 *
79 */
80 private static final Object STATIC_INITIALIZER = ensureInitialized();
81
82 public static Object ensureInitialized() {
83 INSTANCE.ensureInitializedInternal();
84 return null;
85 }
86 }
87
88 private static class GeneratedPQuery extends BaseGeneratedEMFPQuery {
89 private static final ResourceRequirement.GeneratedPQuery INSTANCE = new GeneratedPQuery();
90
91 private final PParameter parameter_Host = new PParameter("Host", "hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "HostInstance")), PParameterDirection.INOUT);
92
93 private final PParameter parameter_App = new PParameter("App", "hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ApplicationInstance")), PParameterDirection.INOUT);
94
95 private final PParameter parameter_Req = new PParameter("Req", "hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http://www.example.org/cps", "ResourceRequirement")), PParameterDirection.INOUT);
96
97 private final List<PParameter> parameters = Arrays.asList(parameter_Host, parameter_App, parameter_Req);
98
99 private GeneratedPQuery() {
100 super(PVisibility.PRIVATE);
101 }
102
103 @Override
104 public String getFullyQualifiedName() {
105 return "hu.bme.mit.inf.dslreasoner.domains.cps.queries.resourceRequirement";
106 }
107
108 @Override
109 public List<String> getParameterNames() {
110 return Arrays.asList("Host","App","Req");
111 }
112
113 @Override
114 public List<PParameter> getParameters() {
115 return parameters;
116 }
117
118 @Override
119 public Set<PBody> doGetContainedBodies() {
120 setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED));
121 Set<PBody> bodies = new LinkedHashSet<>();
122 {
123 PBody body = new PBody(this);
124 PVariable var_Host = body.getOrCreateVariableByName("Host");
125 PVariable var_App = body.getOrCreateVariableByName("App");
126 PVariable var_Req = body.getOrCreateVariableByName("Req");
127 PVariable var_HostType = body.getOrCreateVariableByName("HostType");
128 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
129 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
130 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
131 body.setSymbolicParameters(Arrays.<ExportedParameter>asList(
132 new ExportedParameter(body, var_Host, parameter_Host),
133 new ExportedParameter(body, var_App, parameter_App),
134 new ExportedParameter(body, var_Req, parameter_Req)
135 ));
136 // ApplicationInstance.allocatedTo(App, Host)
137 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
138 PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}");
139 new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "allocatedTo")));
140 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
141 new Equality(body, var__virtual_0_, var_Host);
142 // ApplicationInstance.type.requirements(App, Req)
143 new TypeConstraint(body, Tuples.flatTupleOf(var_App), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationInstance")));
144 PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}");
145 new TypeConstraint(body, Tuples.flatTupleOf(var_App, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationInstance", "type")));
146 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ApplicationType")));
147 PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}");
148 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ApplicationType", "requirements")));
149 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
150 new Equality(body, var__virtual_2_, var_Req);
151 // HostInstance.type(Host, HostType)
152 new TypeConstraint(body, Tuples.flatTupleOf(var_Host), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostInstance")));
153 PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}");
154 new TypeConstraint(body, Tuples.flatTupleOf(var_Host, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "HostInstance", "type")));
155 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
156 new Equality(body, var__virtual_3_, var_HostType);
157 // ResourceRequirement.hostType(Req, HostType)
158 new TypeConstraint(body, Tuples.flatTupleOf(var_Req), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "ResourceRequirement")));
159 PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}");
160 new TypeConstraint(body, Tuples.flatTupleOf(var_Req, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.example.org/cps", "ResourceRequirement", "hostType")));
161 new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.example.org/cps", "HostType")));
162 new Equality(body, var__virtual_4_, var_HostType);
163 bodies.add(body);
164 }
165 return bodies;
166 }
167 }
168}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/src-gen/hu/bme/mit/inf/dslreasoner/domains/cps/queries/internal/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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.emf.ecore.EDataType;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
16import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
17import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
19import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
26import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
27
28/**
29 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
30 *
31 * <p>Original source:
32 * <code><pre>
33 * private pattern 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")
43public 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.LinkedHashSet;
8import java.util.List;
9import java.util.Set;
10import org.eclipse.emf.ecore.EClass;
11import org.eclipse.emf.ecore.EDataType;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.emf.types.EDataTypeInSlotsKey;
16import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
17import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
19import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
26import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
27
28/**
29 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
30 *
31 * <p>Original source:
32 * <code><pre>
33 * private pattern 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")
43public 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 */
4package hu.bme.mit.inf.dslreasoner.domains.cps.queries.internal;
5
6import java.util.Arrays;
7import java.util.Collections;
8import java.util.LinkedHashSet;
9import java.util.List;
10import java.util.Set;
11import org.eclipse.emf.ecore.EClass;
12import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery;
13import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecificationWithGenericMatcher;
14import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey;
15import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey;
16import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint;
17import org.eclipse.viatra.query.runtime.matchers.psystem.PBody;
18import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable;
19import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality;
20import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter;
21import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.NegativePatternCall;
22import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint;
23import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter;
24import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection;
25import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility;
26import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples;
27
28/**
29 * A pattern-specific query specification that can instantiate GenericPatternMatcher in a type-safe way.
30 *
31 * <p>Original source:
32 * <code><pre>
33 * private pattern unallocatedAppInstance(App : ApplicationInstance) {
34 * neg ApplicationInstance.allocatedTo(App, _);
35 * }
36 * </pre></code>
37 *
38 * @see GenericPatternMatcher
39 * @see GenericPatternMatch
40 *
41 */
42@SuppressWarnings("all")
43public 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..7ec0f84d
--- /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,53 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.cplex
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage
4import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator
5import java.io.BufferedReader
6import java.io.BufferedWriter
7import java.io.FileReader
8import java.io.FileWriter
9import org.eclipse.emf.ecore.EPackage
10import org.eclipse.emf.ecore.resource.Resource
11import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl
12import java.util.concurrent.TimeUnit
13
14class CbcCpsMain {
15 static val PROBLEM_FILE = "problem.lp"
16 static val SOLUTION_FILE = "solution.txt"
17
18 private new() {
19 new IllegalStateException("This is a static utility class and should not be instantiated directly.")
20 }
21
22 static def void main(String[] args) {
23 Resource.Factory.Registry.INSTANCE.extensionToFactoryMap.put(Resource.Factory.Registry.DEFAULT_EXTENSION,
24 new XMIResourceFactoryImpl)
25 EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, CpsPackage.eINSTANCE)
26 val generator = new CpsGenerator(1, 4, 1)
27 val problem = generator.generateCpsProblem
28 val toLp = new CpsToLpTranslator(problem, 10, true)
29 val lp = toLp.lpProblem
30 val writer = new BufferedWriter(new FileWriter(PROBLEM_FILE))
31 try {
32 writer.append(lp)
33 } finally {
34 writer.close
35 }
36 val process = new ProcessBuilder().inheritIO.command("cbc", PROBLEM_FILE, "solve", "solu", SOLUTION_FILE).start
37 if (!process.waitFor(120, TimeUnit.SECONDS)) {
38 System.err.println("Timeout reached")
39 process.destroyForcibly
40 System.exit(-1)
41 }
42 if (process.exitValue != 0) {
43 System.err.println("Unexpected exit value " + process.exitValue)
44 System.exit(-1)
45 }
46 val reader = new BufferedReader(new FileReader(SOLUTION_FILE))
47 try {
48 reader.lines.forEach[println(it)]
49 } finally {
50 reader.close
51 }
52 }
53}
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 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.cplex
2
3import com.google.common.collect.ImmutableList
4import com.google.common.collect.ImmutableMap
5import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType
6import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostType
8import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement
9import java.util.List
10import java.util.Map
11
12class 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 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.dse
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance
4import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem
5import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostType
7import hu.bme.mit.inf.dslreasoner.domains.cps.Request
8import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement
9import org.eclipse.emf.common.notify.Notifier
10import org.eclipse.emf.ecore.resource.Resource
11import org.eclipse.emf.ecore.resource.ResourceSet
12import org.eclipse.viatra.dse.statecode.IStateCoder
13import org.eclipse.viatra.dse.statecode.IStateCoderFactory
14import org.eclipse.viatra.query.runtime.api.IPatternMatch
15import org.eclipse.xtend2.lib.StringConcatenationClient
16
17class 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..b2cc0063
--- /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 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.dse
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage
4import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator
5import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries
6import org.eclipse.emf.ecore.EPackage
7import org.eclipse.emf.ecore.EStructuralFeature
8import org.eclipse.emf.ecore.resource.Resource
9import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl
10import org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory
11import org.eclipse.viatra.addon.querybasedfeatures.runtime.handler.QueryBasedFeatures
12import org.eclipse.viatra.dse.api.DesignSpaceExplorer
13import org.eclipse.viatra.dse.api.DesignSpaceExplorer.DseLoggingLevel
14import org.eclipse.viatra.query.runtime.extensibility.SingletonQueryGroupProvider
15import org.eclipse.viatra.query.runtime.registry.QuerySpecificationRegistry
16import org.eclipse.viatra.query.runtime.registry.connector.QueryGroupProviderSourceConnector
17
18class RuleBasedCpsMain {
19 private new() {
20 new IllegalStateException("This is a static utility class and should not be instantiated directly.")
21 }
22
23 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..e4c758f0
--- /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 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.dse
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory
4import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage
5import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem
6import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric
8import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric
9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric
10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance
11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective
12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied
13import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.CompositeDirectionalThresholdObjective
14import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveKind
15import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveThreshold
16import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.QueryBasedObjective
17import org.eclipse.viatra.dse.api.DesignSpaceExplorer
18import org.eclipse.viatra.dse.evolutionary.EvolutionaryStrategyBuilder
19import org.eclipse.viatra.transformation.runtime.emf.rules.batch.BatchTransformationRuleFactory
20
21class 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(RequirementNotSatisfied.instance).action [
39 val app = createApplicationInstance
40 req.type.instances += app
41 req.instances += app
42 ].build)
43 dse.addTransformationRule(createRule(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(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
index 0a510f0f..390d13d3 100644
--- 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
@@ -5,6 +5,8 @@ import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem
5import hu.bme.mit.inf.dslreasoner.domains.cps.HostType 5import hu.bme.mit.inf.dslreasoner.domains.cps.HostType
6import java.util.Collection 6import java.util.Collection
7import java.util.Random 7import java.util.Random
8import org.eclipse.emf.common.util.URI
9import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl
8 10
9class CpsGenerator { 11class CpsGenerator {
10 extension val CpsFactory = CpsFactory.eINSTANCE 12 extension val CpsFactory = CpsFactory.eINSTANCE
@@ -28,8 +30,11 @@ class CpsGenerator {
28 } 30 }
29 31
30 def generateCpsProblem() { 32 def generateCpsProblem() {
33 val resourceSet = new ResourceSetImpl
34 val resource = resourceSet.createResource(URI.createFileURI("dummy.dummyext"))
31 createCyberPhysicalSystem => [ 35 createCyberPhysicalSystem => [
32 val cps = it 36 val cps = it
37 resource.contents += cps
33 createLowCpuHostTypes 38 createLowCpuHostTypes
34 val highCpuHostTypes = createHighCpuHostTypes 39 val highCpuHostTypes = createHighCpuHostTypes
35 for (var int i = 0; i < applicationTypeCount; i++) { 40 for (var int i = 0; i < applicationTypeCount; i++) {
@@ -58,6 +63,7 @@ class CpsGenerator {
58 val hdd = nextInt(MIN_HDD, MAX_HDD) 63 val hdd = nextInt(MIN_HDD, MAX_HDD)
59 for (hostType : allowedHostTypes) { 64 for (hostType : allowedHostTypes) {
60 appType.requirements += createResourceRequirement => [ 65 appType.requirements += createResourceRequirement => [
66 it.hostType = hostType
61 requiredMemory = memory 67 requiredMemory = memory
62 requiredHdd = hdd 68 requiredHdd = hdd
63 ] 69 ]
@@ -83,6 +89,7 @@ class CpsGenerator {
83 89
84 private def createHostType(CyberPhysicalSystem it, int cost, int memory, int hdd) { 90 private def createHostType(CyberPhysicalSystem it, int cost, int memory, int hdd) {
85 val hostType = createHostType => [ 91 val hostType = createHostType => [
92 it.cost = cost
86 defaultMemory = memory 93 defaultMemory = memory
87 defaultHdd = hdd 94 defaultHdd = hdd
88 ] 95 ]
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
index 40337443..aa78dc38 100644
--- 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
@@ -3,28 +3,23 @@ package hu.bme.mit.inf.dslreasoner.domains.cps.queries
3import "http://www.eclipse.org/emf/2002/Ecore" 3import "http://www.eclipse.org/emf/2002/Ecore"
4import "http://www.example.org/cps" 4import "http://www.example.org/cps"
5 5
6@QueryBasedFeature(feature = "applications") 6private pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) {
7pattern cpsApplications(Cps : CyberPhysicalSystem, AppInstance : ApplicationInstance) {
8 CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance); 7 CyberPhysicalSystem.applicationTypes.instances(Cps, AppInstance);
9} 8}
10 9
11@QueryBasedFeature(feature = "hosts") 10private pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) {
12pattern cpsHosts(Cps : CyberPhysicalSystem, HostInstance : HostInstance) {
13 CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance); 11 CyberPhysicalSystem.hostTypes.instances(Cps, HostInstance);
14} 12}
15 13
16@QueryBasedFeature(feature = "totalMemory") 14private pattern totalMemory(Host : HostInstance, Memory : EInt) {
17pattern totalMemory(Host : HostInstance, Memory : EInt) {
18 HostInstance.type.defaultMemory(Host, Memory); 15 HostInstance.type.defaultMemory(Host, Memory);
19} 16}
20 17
21@QueryBasedFeature(feature = "totalHdd") 18private pattern totalHdd(Host : HostInstance, Hdd : EInt) {
22pattern totalHdd(Host : HostInstance, Hdd : EInt) {
23 HostInstance.type.defaultHdd(Host, Hdd); 19 HostInstance.type.defaultHdd(Host, Hdd);
24} 20}
25 21
26@QueryBasedFeature(feature = "availableMemory") 22private pattern availableMemory(Host : HostInstance, Memory : java Integer) {
27pattern availableMemory(Host : HostInstance, Memory : java Integer) {
28 find totalMemory(Host, TotalMemory); 23 find totalMemory(Host, TotalMemory);
29 RequiredMemory == sum find memoryRequirement(Host, _, #_); 24 RequiredMemory == sum find memoryRequirement(Host, _, #_);
30 Memory == eval(TotalMemory - RequiredMemory); 25 Memory == eval(TotalMemory - RequiredMemory);
@@ -35,8 +30,7 @@ private pattern memoryRequirement(Host : HostInstance, App : ApplicationInstance
35 ResourceRequirement.requiredMemory(Req, Memory); 30 ResourceRequirement.requiredMemory(Req, Memory);
36} 31}
37 32
38@QueryBasedFeature(feature = "availableHdd") 33private pattern availableHdd(Host : HostInstance, Hdd : java Integer) {
39pattern availableHdd(Host : HostInstance, Hdd : java Integer) {
40 find totalHdd(Host, TotalHdd); 34 find totalHdd(Host, TotalHdd);
41 RequiredHdd == sum find hddRequirement(Host, _, #_); 35 RequiredHdd == sum find hddRequirement(Host, _, #_);
42 Hdd == eval(TotalHdd - RequiredHdd); 36 Hdd == eval(TotalHdd - RequiredHdd);
@@ -47,7 +41,7 @@ private pattern hddRequirement(Host : HostInstance, App : ApplicationInstance, H
47 ResourceRequirement.requiredHdd(Req, Hdd); 41 ResourceRequirement.requiredHdd(Req, Hdd);
48} 42}
49 43
50private pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) { 44pattern resourceRequirement(Host : HostInstance, App : ApplicationInstance, Req : ResourceRequirement) {
51 ApplicationInstance.allocatedTo(App, Host); 45 ApplicationInstance.allocatedTo(App, Host);
52 ApplicationInstance.type.requirements(App, Req); 46 ApplicationInstance.type.requirements(App, Req);
53 HostInstance.type(Host, HostType); 47 HostInstance.type(Host, HostType);
@@ -106,6 +100,12 @@ pattern redundantInstancesOnSameHost(Req : Requirement) {
106 ApplicationInstance.allocatedTo(App2, Host); 100 ApplicationInstance.allocatedTo(App2, Host);
107} 101}
108 102
103//
104// Metrics
105//
106
107// Free memory
108
109pattern averageFreeMemoryMetric(Average : java Double) { 109pattern averageFreeMemoryMetric(Average : java Double) {
110 Average == avg find freeMemoryPercentage(_, #_); 110 Average == avg find freeMemoryPercentage(_, #_);
111} 111}
@@ -116,6 +116,8 @@ private pattern freeMemoryPercentage(Host : HostInstance, Free : java Double) {
116 Free == eval((Available as double) / Total); 116 Free == eval((Available as double) / Total);
117} 117}
118 118
119// Free HDD
120
119pattern averageFreeHddMetric(Average : java Double) { 121pattern averageFreeHddMetric(Average : java Double) {
120 Average == avg find freeHddPercentage(_, #_); 122 Average == avg find freeHddPercentage(_, #_);
121} 123}
@@ -126,6 +128,8 @@ private pattern freeHddPercentage(Host : HostInstance, Free : java Double) {
126 Free == eval((Available as double) / Total); 128 Free == eval((Available as double) / Total);
127} 129}
128 130
131// Total cost
132
129pattern costMetric(Cost : java Integer) { 133pattern costMetric(Cost : java Integer) {
130 Cost == sum find cpsCost(_, #_); 134 Cost == sum find cpsCost(_, #_);
131} 135}
@@ -140,3 +144,55 @@ private pattern hostInstanceCost(Cps : CyberPhysicalSystem, Host : HostInstance,
140 find cpsHosts(Cps, Host); 144 find cpsHosts(Cps, Host);
141 HostInstance.type.cost(Host, Cost); 145 HostInstance.type.cost(Host, Cost);
142} 146}
147
148//
149// Transformation rule preconditions for rule-based DSE
150//
151
152pattern 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
165pattern unallocateAppInstance(App : ApplicationInstance) {
166 ApplicationInstance.allocatedTo(App, _);
167}
168
169pattern createHostInstance(HostType : HostType) {
170 find unallocatedAppInstance(App);
171 ApplicationInstance.type.requirements.hostType(App, HostType);
172}
173
174pattern removeHostInstance(HostInstance : HostInstance) {
175 neg HostInstance.applications(HostInstance, _);
176}
177
178private pattern unallocatedAppInstance(App : ApplicationInstance) {
179 neg ApplicationInstance.allocatedTo(App, _);
180}
181
182private 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
188private pattern noHostToAllocateTo(App : ApplicationInstance) {
189 find unallocatedAppInstance(App);
190 neg find allocate(App, _);
191}
192
193pattern 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.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CbcCpsMain.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CbcCpsMain.xtendbin
new file mode 100644
index 00000000..3f9e895d
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CbcCpsMain.xtendbin
Binary files differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbin
new file mode 100644
index 00000000..d8814a3b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.CpsToLpTranslator.xtendbin
Binary files differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.gitignore
new file mode 100644
index 00000000..9f908c7a
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/.gitignore
@@ -0,0 +1,2 @@
1/.CpsToLpTranslator.java._trace
2/.CbcCpsMain.java._trace
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.java
new file mode 100644
index 00000000..d36cdccd
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CbcCpsMain.java
@@ -0,0 +1,77 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.cplex;
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
4import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
5import hu.bme.mit.inf.dslreasoner.domains.cps.cplex.CpsToLpTranslator;
6import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator;
7import java.io.BufferedReader;
8import java.io.BufferedWriter;
9import java.io.FileReader;
10import java.io.FileWriter;
11import java.util.Map;
12import java.util.concurrent.TimeUnit;
13import java.util.function.Consumer;
14import org.eclipse.emf.ecore.EPackage;
15import org.eclipse.emf.ecore.resource.Resource;
16import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
17import org.eclipse.xtext.xbase.lib.Exceptions;
18import org.eclipse.xtext.xbase.lib.InputOutput;
19
20@SuppressWarnings("all")
21public class CbcCpsMain {
22 private static final String PROBLEM_FILE = "problem.lp";
23
24 private static final String SOLUTION_FILE = "solution.txt";
25
26 private CbcCpsMain() {
27 new IllegalStateException("This is a static utility class and should not be instantiated directly.");
28 }
29
30 public static void main(final String[] args) {
31 try {
32 Map<String, Object> _extensionToFactoryMap = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
33 XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl();
34 _extensionToFactoryMap.put(Resource.Factory.Registry.DEFAULT_EXTENSION, _xMIResourceFactoryImpl);
35 EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, CpsPackage.eINSTANCE);
36 final CpsGenerator generator = new CpsGenerator(1, 4, 1);
37 final CyberPhysicalSystem problem = generator.generateCpsProblem();
38 final CpsToLpTranslator toLp = new CpsToLpTranslator(problem, 10, true);
39 final CharSequence lp = toLp.getLpProblem();
40 FileWriter _fileWriter = new FileWriter(CbcCpsMain.PROBLEM_FILE);
41 final BufferedWriter writer = new BufferedWriter(_fileWriter);
42 try {
43 writer.append(lp);
44 } finally {
45 writer.close();
46 }
47 final Process process = new ProcessBuilder().inheritIO().command("cbc", CbcCpsMain.PROBLEM_FILE, "solve", "solu", CbcCpsMain.SOLUTION_FILE).start();
48 boolean _waitFor = process.waitFor(120, TimeUnit.SECONDS);
49 boolean _not = (!_waitFor);
50 if (_not) {
51 System.err.println("Timeout reached");
52 process.destroyForcibly();
53 System.exit((-1));
54 }
55 int _exitValue = process.exitValue();
56 boolean _notEquals = (_exitValue != 0);
57 if (_notEquals) {
58 int _exitValue_1 = process.exitValue();
59 String _plus = ("Unexpected exit value " + Integer.valueOf(_exitValue_1));
60 System.err.println(_plus);
61 System.exit((-1));
62 }
63 FileReader _fileReader = new FileReader(CbcCpsMain.SOLUTION_FILE);
64 final BufferedReader reader = new BufferedReader(_fileReader);
65 try {
66 final Consumer<String> _function = (String it) -> {
67 InputOutput.<String>println(it);
68 };
69 reader.lines().forEach(_function);
70 } finally {
71 reader.close();
72 }
73 } catch (Throwable _e) {
74 throw Exceptions.sneakyThrow(_e);
75 }
76 }
77}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.java
new file mode 100644
index 00000000..20afeee6
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/cplex/CpsToLpTranslator.java
@@ -0,0 +1,505 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.cplex;
2
3import com.google.common.base.Objects;
4import com.google.common.collect.ImmutableList;
5import com.google.common.collect.ImmutableMap;
6import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
8import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
9import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
10import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
11import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement;
12import java.util.Collection;
13import java.util.List;
14import java.util.Map;
15import org.eclipse.emf.common.util.EList;
16import org.eclipse.xtend2.lib.StringConcatenation;
17import org.eclipse.xtext.xbase.lib.CollectionLiterals;
18import org.eclipse.xtext.xbase.lib.ExclusiveRange;
19import org.eclipse.xtext.xbase.lib.Functions.Function1;
20import org.eclipse.xtext.xbase.lib.IterableExtensions;
21import org.eclipse.xtext.xbase.lib.ListExtensions;
22import org.eclipse.xtext.xbase.lib.Pair;
23
24@SuppressWarnings("all")
25public class CpsToLpTranslator {
26 private static final double MINIMUM_MEMORY_USAGE = 0.25;
27
28 private static final double MINIMUM_HDD_USAGE = 0.25;
29
30 private final CyberPhysicalSystem cps;
31
32 private final Map<Requirement, ? extends List<String>> appInstances;
33
34 private final Map<HostType, ? extends List<String>> hostInstances;
35
36 private final boolean breakSymmetry;
37
38 public CpsToLpTranslator(final CyberPhysicalSystem cps, final int hostInstanceCount, final boolean breakSymmetry) {
39 this.cps = cps;
40 this.appInstances = this.createAppInstances();
41 this.hostInstances = this.createHostInstances(hostInstanceCount);
42 this.breakSymmetry = breakSymmetry;
43 }
44
45 private ImmutableMap<Requirement, ImmutableList<String>> createAppInstances() {
46 ImmutableMap<Requirement, ImmutableList<String>> _xblockexpression = null;
47 {
48 final ImmutableMap.Builder<Requirement, ImmutableList<String>> builder = ImmutableMap.<Requirement, ImmutableList<String>>builder();
49 int i = 0;
50 Iterable<Requirement> _requirements = this.getRequirements();
51 for (final Requirement req : _requirements) {
52 {
53 final ImmutableList.Builder<String> listBuilder = ImmutableList.<String>builder();
54 for (int j = 0; (j < req.getCount()); j++) {
55 StringConcatenation _builder = new StringConcatenation();
56 _builder.append("r");
57 _builder.append(i);
58 _builder.append("a");
59 _builder.append(j);
60 listBuilder.add(_builder.toString());
61 }
62 builder.put(req, listBuilder.build());
63 i++;
64 }
65 }
66 _xblockexpression = builder.build();
67 }
68 return _xblockexpression;
69 }
70
71 private ImmutableMap<HostType, ImmutableList<String>> createHostInstances(final int hostInstanceCount) {
72 ImmutableMap<HostType, ImmutableList<String>> _xblockexpression = null;
73 {
74 final ImmutableMap.Builder<HostType, ImmutableList<String>> builder = ImmutableMap.<HostType, ImmutableList<String>>builder();
75 int i = 0;
76 EList<HostType> _hostTypes = this.cps.getHostTypes();
77 for (final HostType hostType : _hostTypes) {
78 {
79 final ImmutableList.Builder<String> listBuilder = ImmutableList.<String>builder();
80 for (int j = 0; (j < hostInstanceCount); j++) {
81 StringConcatenation _builder = new StringConcatenation();
82 _builder.append("h");
83 _builder.append(i);
84 _builder.append("i");
85 _builder.append(j);
86 listBuilder.add(_builder.toString());
87 }
88 builder.put(hostType, listBuilder.build());
89 i++;
90 }
91 }
92 _xblockexpression = builder.build();
93 }
94 return _xblockexpression;
95 }
96
97 public CharSequence getLpProblem() {
98 StringConcatenation _builder = new StringConcatenation();
99 _builder.append("Minimize");
100 _builder.newLine();
101 _builder.append("\t");
102 _builder.append("total_cost: ");
103 CharSequence _objective = this.getObjective();
104 _builder.append(_objective, "\t");
105 _builder.newLineIfNotEmpty();
106 _builder.append("Subject To");
107 _builder.newLine();
108 _builder.append("\t");
109 CharSequence _constraints = this.getConstraints();
110 _builder.append(_constraints, "\t");
111 _builder.newLineIfNotEmpty();
112 _builder.append("Bounds");
113 _builder.newLine();
114 _builder.append("\t");
115 CharSequence _bounds = this.getBounds();
116 _builder.append(_bounds, "\t");
117 _builder.newLineIfNotEmpty();
118 _builder.append("Binary");
119 _builder.newLine();
120 _builder.append("\t");
121 CharSequence _binaryVariables = this.getBinaryVariables();
122 _builder.append(_binaryVariables, "\t");
123 _builder.newLineIfNotEmpty();
124 _builder.append("End");
125 _builder.newLine();
126 return _builder;
127 }
128
129 private CharSequence getObjective() {
130 StringConcatenation _builder = new StringConcatenation();
131 {
132 Iterable<Pair<HostType, String>> _hostInstancesWithType = this.getHostInstancesWithType();
133 boolean _hasElements = false;
134 for(final Pair<HostType, String> pair : _hostInstancesWithType) {
135 if (!_hasElements) {
136 _hasElements = true;
137 } else {
138 _builder.appendImmediate(" + ", "");
139 }
140 int _cost = pair.getKey().getCost();
141 _builder.append(_cost);
142 _builder.append(" ");
143 CharSequence _existsVariable = this.getExistsVariable(pair.getValue());
144 _builder.append(_existsVariable);
145 }
146 }
147 return _builder;
148 }
149
150 private CharSequence getConstraints() {
151 StringConcatenation _builder = new StringConcatenation();
152 {
153 Iterable<Pair<ApplicationType, String>> _appInstancesWithType = this.getAppInstancesWithType();
154 for(final Pair<ApplicationType, String> appPair : _appInstancesWithType) {
155 String _value = appPair.getValue();
156 _builder.append(_value);
157 _builder.append("_allocated: ");
158 {
159 Iterable<String> _possibleHostInstances = this.getPossibleHostInstances(appPair.getKey());
160 boolean _hasElements = false;
161 for(final String host : _possibleHostInstances) {
162 if (!_hasElements) {
163 _hasElements = true;
164 } else {
165 _builder.appendImmediate(" + ", "");
166 }
167 CharSequence _allocatedToVariable = this.getAllocatedToVariable(appPair.getValue(), host);
168 _builder.append(_allocatedToVariable);
169 }
170 }
171 _builder.append(" = 1");
172 _builder.newLineIfNotEmpty();
173 {
174 Iterable<String> _possibleHostInstances_1 = this.getPossibleHostInstances(appPair.getKey());
175 for(final String host_1 : _possibleHostInstances_1) {
176 String _value_1 = appPair.getValue();
177 _builder.append(_value_1);
178 _builder.append("_to_");
179 _builder.append(host_1);
180 _builder.append("_exists: ");
181 CharSequence _existsVariable = this.getExistsVariable(host_1);
182 _builder.append(_existsVariable);
183 _builder.append(" - ");
184 CharSequence _allocatedToVariable_1 = this.getAllocatedToVariable(appPair.getValue(), host_1);
185 _builder.append(_allocatedToVariable_1);
186 _builder.append(" >= 0");
187 _builder.newLineIfNotEmpty();
188 }
189 }
190 }
191 }
192 {
193 Iterable<Pair<HostType, String>> _hostInstancesWithType = this.getHostInstancesWithType();
194 for(final Pair<HostType, String> hostPair : _hostInstancesWithType) {
195 String _value_2 = hostPair.getValue();
196 _builder.append(_value_2);
197 _builder.append("_mem_use: ");
198 {
199 Iterable<Pair<ResourceRequirement, String>> _possibleAppInstancesWithRequirements = this.getPossibleAppInstancesWithRequirements(hostPair.getKey());
200 boolean _hasElements_1 = false;
201 for(final Pair<ResourceRequirement, String> appPair_1 : _possibleAppInstancesWithRequirements) {
202 if (!_hasElements_1) {
203 _hasElements_1 = true;
204 } else {
205 _builder.appendImmediate(" + ", "");
206 }
207 int _requiredMemory = appPair_1.getKey().getRequiredMemory();
208 _builder.append(_requiredMemory);
209 _builder.append(" ");
210 CharSequence _allocatedToVariable_2 = this.getAllocatedToVariable(appPair_1.getValue(), hostPair.getValue());
211 _builder.append(_allocatedToVariable_2);
212 }
213 }
214 _builder.append(" - ");
215 int _defaultMemory = hostPair.getKey().getDefaultMemory();
216 _builder.append(_defaultMemory);
217 _builder.append(" ");
218 CharSequence _memoryUsageVariable = this.getMemoryUsageVariable(hostPair.getValue());
219 _builder.append(_memoryUsageVariable);
220 _builder.append(" = 0");
221 _builder.newLineIfNotEmpty();
222 String _value_3 = hostPair.getValue();
223 _builder.append(_value_3);
224 _builder.append("_hdd_use: ");
225 {
226 Iterable<Pair<ResourceRequirement, String>> _possibleAppInstancesWithRequirements_1 = this.getPossibleAppInstancesWithRequirements(hostPair.getKey());
227 boolean _hasElements_2 = false;
228 for(final Pair<ResourceRequirement, String> appPair_2 : _possibleAppInstancesWithRequirements_1) {
229 if (!_hasElements_2) {
230 _hasElements_2 = true;
231 } else {
232 _builder.appendImmediate(" + ", "");
233 }
234 int _requiredHdd = appPair_2.getKey().getRequiredHdd();
235 _builder.append(_requiredHdd);
236 _builder.append(" ");
237 CharSequence _allocatedToVariable_3 = this.getAllocatedToVariable(appPair_2.getValue(), hostPair.getValue());
238 _builder.append(_allocatedToVariable_3);
239 }
240 }
241 _builder.append(" - ");
242 int _defaultHdd = hostPair.getKey().getDefaultHdd();
243 _builder.append(_defaultHdd);
244 _builder.append(" ");
245 CharSequence _hddUsageVariable = this.getHddUsageVariable(hostPair.getValue());
246 _builder.append(_hddUsageVariable);
247 _builder.append(" = 0");
248 _builder.newLineIfNotEmpty();
249 }
250 }
251 _builder.append("average_mem: ");
252 {
253 Iterable<String> _allHostInstances = this.getAllHostInstances();
254 boolean _hasElements_3 = false;
255 for(final String host_2 : _allHostInstances) {
256 if (!_hasElements_3) {
257 _hasElements_3 = true;
258 } else {
259 _builder.appendImmediate(" + ", "");
260 }
261 CharSequence _memoryUsageVariable_1 = this.getMemoryUsageVariable(host_2);
262 _builder.append(_memoryUsageVariable_1);
263 _builder.append(" - ");
264 _builder.append(CpsToLpTranslator.MINIMUM_MEMORY_USAGE);
265 _builder.append(" ");
266 CharSequence _existsVariable_1 = this.getExistsVariable(host_2);
267 _builder.append(_existsVariable_1);
268 }
269 }
270 _builder.append(" >= 0");
271 _builder.newLineIfNotEmpty();
272 _builder.append("average_hdd: ");
273 {
274 Iterable<String> _allHostInstances_1 = this.getAllHostInstances();
275 boolean _hasElements_4 = false;
276 for(final String host_3 : _allHostInstances_1) {
277 if (!_hasElements_4) {
278 _hasElements_4 = true;
279 } else {
280 _builder.appendImmediate(" + ", "");
281 }
282 CharSequence _memoryUsageVariable_2 = this.getMemoryUsageVariable(host_3);
283 _builder.append(_memoryUsageVariable_2);
284 _builder.append(" - ");
285 _builder.append(CpsToLpTranslator.MINIMUM_HDD_USAGE);
286 _builder.append(" ");
287 CharSequence _existsVariable_2 = this.getExistsVariable(host_3);
288 _builder.append(_existsVariable_2);
289 }
290 }
291 _builder.append(" >= 0");
292 _builder.newLineIfNotEmpty();
293 {
294 final Function1<Requirement, Boolean> _function = (Requirement it) -> {
295 int _count = it.getCount();
296 return Boolean.valueOf((_count > 1));
297 };
298 Iterable<Pair<Integer, Requirement>> _indexed = IterableExtensions.<Requirement>indexed(IterableExtensions.<Requirement>filter(this.getRequirements(), _function));
299 for(final Pair<Integer, Requirement> reqPair : _indexed) {
300 {
301 final Function1<ResourceRequirement, List<String>> _function_1 = (ResourceRequirement it) -> {
302 return this.hostInstances.get(it.getHostType());
303 };
304 Iterable<String> _flatMap = IterableExtensions.<ResourceRequirement, String>flatMap(reqPair.getValue().getType().getRequirements(), _function_1);
305 for(final String host_4 : _flatMap) {
306 _builder.append("r");
307 Integer _key = reqPair.getKey();
308 _builder.append(_key);
309 _builder.append("_");
310 _builder.append(host_4);
311 _builder.append("_redundant: ");
312 {
313 List<String> _get = this.appInstances.get(reqPair.getValue());
314 boolean _hasElements_5 = false;
315 for(final String app : _get) {
316 if (!_hasElements_5) {
317 _hasElements_5 = true;
318 } else {
319 _builder.appendImmediate(" + ", "");
320 }
321 CharSequence _allocatedToVariable_4 = this.getAllocatedToVariable(app, host_4);
322 _builder.append(_allocatedToVariable_4);
323 }
324 }
325 _builder.append(" <= 1");
326 _builder.newLineIfNotEmpty();
327 }
328 }
329 }
330 }
331 {
332 if (this.breakSymmetry) {
333 {
334 Collection<? extends List<String>> _values = this.hostInstances.values();
335 for(final List<String> hosts : _values) {
336 {
337 int _size = hosts.size();
338 int _minus = (_size - 1);
339 ExclusiveRange _doubleDotLessThan = new ExclusiveRange(0, _minus, true);
340 for(final Integer i : _doubleDotLessThan) {
341 String _get_1 = hosts.get(((i).intValue() + 1));
342 _builder.append(_get_1);
343 _builder.append("_after_");
344 String _get_2 = hosts.get((i).intValue());
345 _builder.append(_get_2);
346 _builder.append(": ");
347 CharSequence _existsVariable_3 = this.getExistsVariable(hosts.get((i).intValue()));
348 _builder.append(_existsVariable_3);
349 _builder.append(" - ");
350 CharSequence _existsVariable_4 = this.getExistsVariable(hosts.get(((i).intValue() + 1)));
351 _builder.append(_existsVariable_4);
352 _builder.append(" >= 0");
353 _builder.newLineIfNotEmpty();
354 }
355 }
356 }
357 }
358 }
359 }
360 return _builder;
361 }
362
363 private CharSequence getBounds() {
364 StringConcatenation _builder = new StringConcatenation();
365 {
366 Iterable<String> _allHostInstances = this.getAllHostInstances();
367 for(final String host : _allHostInstances) {
368 _builder.append("0 <= ");
369 CharSequence _memoryUsageVariable = this.getMemoryUsageVariable(host);
370 _builder.append(_memoryUsageVariable);
371 _builder.append(" <= 1");
372 _builder.newLineIfNotEmpty();
373 _builder.append("0 <= ");
374 CharSequence _hddUsageVariable = this.getHddUsageVariable(host);
375 _builder.append(_hddUsageVariable);
376 _builder.append(" <= 1");
377 _builder.newLineIfNotEmpty();
378 }
379 }
380 return _builder;
381 }
382
383 private CharSequence getBinaryVariables() {
384 StringConcatenation _builder = new StringConcatenation();
385 {
386 Iterable<String> _allHostInstances = this.getAllHostInstances();
387 for(final String host : _allHostInstances) {
388 CharSequence _existsVariable = this.getExistsVariable(host);
389 _builder.append(_existsVariable);
390 _builder.newLineIfNotEmpty();
391 }
392 }
393 {
394 Iterable<Pair<ApplicationType, String>> _appInstancesWithType = this.getAppInstancesWithType();
395 for(final Pair<ApplicationType, String> appPair : _appInstancesWithType) {
396 {
397 Iterable<String> _possibleHostInstances = this.getPossibleHostInstances(appPair.getKey());
398 for(final String host_1 : _possibleHostInstances) {
399 CharSequence _allocatedToVariable = this.getAllocatedToVariable(appPair.getValue(), host_1);
400 _builder.append(_allocatedToVariable);
401 _builder.newLineIfNotEmpty();
402 }
403 }
404 }
405 }
406 return _builder;
407 }
408
409 private Iterable<Requirement> getRequirements() {
410 final Function1<Request, EList<Requirement>> _function = (Request it) -> {
411 return it.getRequirements();
412 };
413 return IterableExtensions.<Request, Requirement>flatMap(this.cps.getRequests(), _function);
414 }
415
416 private Iterable<String> getAllHostInstances() {
417 final Function1<List<String>, List<String>> _function = (List<String> it) -> {
418 return it;
419 };
420 return IterableExtensions.flatMap(this.hostInstances.values(), _function);
421 }
422
423 private Iterable<Pair<HostType, String>> getHostInstancesWithType() {
424 final Function1<Map.Entry<HostType, ? extends List<String>>, List<Pair<HostType, String>>> _function = (Map.Entry<HostType, ? extends List<String>> pair) -> {
425 final Function1<String, Pair<HostType, String>> _function_1 = (String it) -> {
426 HostType _key = pair.getKey();
427 return Pair.<HostType, String>of(_key, it);
428 };
429 return ListExtensions.<String, Pair<HostType, String>>map(pair.getValue(), _function_1);
430 };
431 return IterableExtensions.flatMap(this.hostInstances.entrySet(), _function);
432 }
433
434 private Iterable<Pair<ApplicationType, String>> getAppInstancesWithType() {
435 final Function1<Map.Entry<Requirement, ? extends List<String>>, List<Pair<ApplicationType, String>>> _function = (Map.Entry<Requirement, ? extends List<String>> pair) -> {
436 final Function1<String, Pair<ApplicationType, String>> _function_1 = (String it) -> {
437 ApplicationType _type = pair.getKey().getType();
438 return Pair.<ApplicationType, String>of(_type, it);
439 };
440 return ListExtensions.<String, Pair<ApplicationType, String>>map(pair.getValue(), _function_1);
441 };
442 return IterableExtensions.flatMap(this.appInstances.entrySet(), _function);
443 }
444
445 private Iterable<String> getPossibleHostInstances(final ApplicationType appType) {
446 final Function1<ResourceRequirement, List<String>> _function = (ResourceRequirement req) -> {
447 return this.hostInstances.get(req.getHostType());
448 };
449 return IterableExtensions.<ResourceRequirement, String>flatMap(appType.getRequirements(), _function);
450 }
451
452 private Iterable<Pair<ResourceRequirement, String>> getPossibleAppInstancesWithRequirements(final HostType hostType) {
453 final Function1<Map.Entry<Requirement, ? extends List<String>>, List<Pair<ResourceRequirement, String>>> _function = (Map.Entry<Requirement, ? extends List<String>> pair) -> {
454 List<Pair<ResourceRequirement, String>> _xblockexpression = null;
455 {
456 final Function1<ResourceRequirement, Boolean> _function_1 = (ResourceRequirement it) -> {
457 HostType _hostType = it.getHostType();
458 return Boolean.valueOf(Objects.equal(_hostType, hostType));
459 };
460 final ResourceRequirement resourceReq = IterableExtensions.<ResourceRequirement>findFirst(pair.getKey().getType().getRequirements(), _function_1);
461 List<Pair<ResourceRequirement, String>> _xifexpression = null;
462 if ((resourceReq == null)) {
463 _xifexpression = CollectionLiterals.<Pair<ResourceRequirement, String>>emptyList();
464 } else {
465 final Function1<String, Pair<ResourceRequirement, String>> _function_2 = (String it) -> {
466 return Pair.<ResourceRequirement, String>of(resourceReq, it);
467 };
468 _xifexpression = ListExtensions.<String, Pair<ResourceRequirement, String>>map(pair.getValue(), _function_2);
469 }
470 _xblockexpression = _xifexpression;
471 }
472 return _xblockexpression;
473 };
474 return IterableExtensions.flatMap(this.appInstances.entrySet(), _function);
475 }
476
477 private CharSequence getExistsVariable(final String hostInstance) {
478 StringConcatenation _builder = new StringConcatenation();
479 _builder.append(hostInstance);
480 _builder.append("_exists");
481 return _builder;
482 }
483
484 private CharSequence getMemoryUsageVariable(final String hostInstance) {
485 StringConcatenation _builder = new StringConcatenation();
486 _builder.append(hostInstance);
487 _builder.append("_mem");
488 return _builder;
489 }
490
491 private CharSequence getHddUsageVariable(final String hostInstance) {
492 StringConcatenation _builder = new StringConcatenation();
493 _builder.append(hostInstance);
494 _builder.append("_hdd");
495 return _builder;
496 }
497
498 private CharSequence getAllocatedToVariable(final String appInstance, final String hostInstance) {
499 StringConcatenation _builder = new StringConcatenation();
500 _builder.append(appInstance);
501 _builder.append("_to_");
502 _builder.append(hostInstance);
503 return _builder;
504 }
505}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbin
new file mode 100644
index 00000000..cdfe3921
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.CpsStateCoder.xtendbin
Binary files differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsMain.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsMain.xtendbin
new file mode 100644
index 00000000..9be64b30
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsMain.xtendbin
Binary files differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsSolver.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsSolver.xtendbin
new file mode 100644
index 00000000..02fb74ef
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.RuleBasedCpsSolver.xtendbin
Binary files differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.gitignore b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.gitignore
new file mode 100644
index 00000000..e24f10f4
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/.gitignore
@@ -0,0 +1,3 @@
1/.RuleBasedCpsSolver.java._trace
2/.RuleBasedCpsMain.java._trace
3/.CpsStateCoder.java._trace
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.java
new file mode 100644
index 00000000..3ae8e828
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/CpsStateCoder.java
@@ -0,0 +1,316 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.dse;
2
3import com.google.common.base.Objects;
4import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
5import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
8import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
9import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
10import java.util.Arrays;
11import org.eclipse.emf.common.notify.Notifier;
12import org.eclipse.emf.common.util.EList;
13import org.eclipse.emf.ecore.EObject;
14import org.eclipse.emf.ecore.resource.Resource;
15import org.eclipse.emf.ecore.resource.ResourceSet;
16import org.eclipse.viatra.dse.statecode.IStateCoder;
17import org.eclipse.viatra.dse.statecode.IStateCoderFactory;
18import org.eclipse.viatra.query.runtime.api.IPatternMatch;
19import org.eclipse.xtend2.lib.StringConcatenation;
20import org.eclipse.xtend2.lib.StringConcatenationClient;
21import org.eclipse.xtext.xbase.lib.IterableExtensions;
22
23@SuppressWarnings("all")
24public class CpsStateCoder implements IStateCoder {
25 public static class Factory implements IStateCoderFactory {
26 @Override
27 public IStateCoder createStateCoder() {
28 return new CpsStateCoder();
29 }
30 }
31
32 private CyberPhysicalSystem cps;
33
34 protected CpsStateCoder() {
35 }
36
37 @Override
38 public void init(final Notifier notifier) {
39 CyberPhysicalSystem _switchResult = null;
40 boolean _matched = false;
41 if (notifier instanceof ResourceSet) {
42 _matched=true;
43 _switchResult = this.getCpsFromResourceSet(((ResourceSet)notifier));
44 }
45 if (!_matched) {
46 if (notifier instanceof Resource) {
47 _matched=true;
48 _switchResult = this.getCpsFromResource(((Resource)notifier));
49 }
50 }
51 if (!_matched) {
52 if (notifier instanceof CyberPhysicalSystem) {
53 _matched=true;
54 _switchResult = ((CyberPhysicalSystem)notifier);
55 }
56 }
57 if (!_matched) {
58 throw new IllegalArgumentException("notifier is not a CyberPhysicalSystem");
59 }
60 this.cps = _switchResult;
61 }
62
63 private CyberPhysicalSystem getCpsFromResourceSet(final ResourceSet resourceSet) {
64 CyberPhysicalSystem _xblockexpression = null;
65 {
66 boolean _isEmpty = resourceSet.getResources().isEmpty();
67 if (_isEmpty) {
68 throw new IllegalArgumentException("No Resource in ResourceSet");
69 }
70 final Resource resource = IterableExtensions.<Resource>head(resourceSet.getResources());
71 _xblockexpression = this.getCpsFromResource(resource);
72 }
73 return _xblockexpression;
74 }
75
76 private CyberPhysicalSystem getCpsFromResource(final Resource resource) {
77 CyberPhysicalSystem _xblockexpression = null;
78 {
79 boolean _isEmpty = resource.getContents().isEmpty();
80 if (_isEmpty) {
81 throw new IllegalArgumentException("No EObject in Resource");
82 }
83 final EObject cps = IterableExtensions.<EObject>head(resource.getContents());
84 CyberPhysicalSystem _xifexpression = null;
85 if ((cps instanceof CyberPhysicalSystem)) {
86 _xifexpression = ((CyberPhysicalSystem)cps);
87 } else {
88 throw new IllegalArgumentException("EObject in Resource is not a CyberPhysicalSystem");
89 }
90 _xblockexpression = _xifexpression;
91 }
92 return _xblockexpression;
93 }
94
95 @Override
96 public String createStateCode() {
97 StringConcatenation _builder = new StringConcatenation();
98 StringConcatenationClient _createRequestsCode = this.createRequestsCode();
99 _builder.append(_createRequestsCode);
100 CharSequence _createHostTypesCode = this.createHostTypesCode();
101 _builder.append(_createHostTypesCode);
102 return _builder.toString();
103 }
104
105 private StringConcatenationClient createRequestsCode() {
106 StringConcatenationClient _client = new StringConcatenationClient() {
107 @Override
108 protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
109 {
110 EList<Request> _requests = CpsStateCoder.this.cps.getRequests();
111 for(final Request request : _requests) {
112 StringConcatenationClient _createRequestCode = CpsStateCoder.this.createRequestCode(request);
113 _builder.append(_createRequestCode);
114 }
115 }
116 }
117 };
118 return _client;
119 }
120
121 private StringConcatenationClient createRequestCode(final Request request) {
122 StringConcatenationClient _client = new StringConcatenationClient() {
123 @Override
124 protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
125 _builder.append("[");
126 {
127 EList<Requirement> _requirements = request.getRequirements();
128 for(final Requirement requirement : _requirements) {
129 StringConcatenationClient _createRequirementCode = CpsStateCoder.this.createRequirementCode(requirement);
130 _builder.append(_createRequirementCode);
131 }
132 }
133 _builder.append("]");
134 }
135 };
136 return _client;
137 }
138
139 private StringConcatenationClient createRequirementCode(final Requirement requirement) {
140 StringConcatenationClient _client = new StringConcatenationClient() {
141 @Override
142 protected void appendTo(StringConcatenationClient.TargetStringConcatenation _builder) {
143 _builder.append("[");
144 {
145 EList<ApplicationInstance> _instances = requirement.getInstances();
146 boolean _hasElements = false;
147 for(final ApplicationInstance app : _instances) {
148 if (!_hasElements) {
149 _hasElements = true;
150 } else {
151 _builder.appendImmediate(",", "");
152 }
153 String _createAppCode = CpsStateCoder.this.createAppCode(app);
154 _builder.append(_createAppCode);
155 }
156 }
157 _builder.append("]");
158 }
159 };
160 return _client;
161 }
162
163 private String createAppCode(final ApplicationInstance app) {
164 String _xifexpression = null;
165 HostInstance _allocatedTo = app.getAllocatedTo();
166 boolean _tripleEquals = (_allocatedTo == null);
167 if (_tripleEquals) {
168 _xifexpression = "-";
169 } else {
170 _xifexpression = this.createMatchArgumentCode(app.getAllocatedTo());
171 }
172 return _xifexpression;
173 }
174
175 private CharSequence createHostTypesCode() {
176 StringConcatenation _builder = new StringConcatenation();
177 _builder.append("(");
178 {
179 EList<HostType> _hostTypes = this.cps.getHostTypes();
180 boolean _hasElements = false;
181 for(final HostType hostType : _hostTypes) {
182 if (!_hasElements) {
183 _hasElements = true;
184 } else {
185 _builder.appendImmediate(",", "");
186 }
187 int _size = hostType.getInstances().size();
188 _builder.append(_size);
189 }
190 }
191 _builder.append(")");
192 return _builder;
193 }
194
195 @Override
196 public String createActivationCode(final IPatternMatch match) {
197 StringConcatenation _builder = new StringConcatenation();
198 String _simpleName = match.specification().getSimpleName();
199 _builder.append(_simpleName);
200 _builder.append("(");
201 {
202 Object[] _array = match.toArray();
203 boolean _hasElements = false;
204 for(final Object arg : _array) {
205 if (!_hasElements) {
206 _hasElements = true;
207 } else {
208 _builder.appendImmediate(",", "");
209 }
210 String _createMatchArgumentCode = this.createMatchArgumentCode(arg);
211 _builder.append(_createMatchArgumentCode);
212 }
213 }
214 _builder.append(")");
215 return _builder.toString();
216 }
217
218 protected String _createMatchArgumentCode(final Requirement requirement) {
219 String _xblockexpression = null;
220 {
221 final EObject request = requirement.eContainer();
222 String _xifexpression = null;
223 if ((request instanceof Request)) {
224 String _xblockexpression_1 = null;
225 {
226 EObject _eContainer = ((Request)request).eContainer();
227 boolean _notEquals = (!Objects.equal(_eContainer, this.cps));
228 if (_notEquals) {
229 throw new IllegalArgumentException("Request is not contained in the CPS");
230 }
231 final int requestIndex = this.cps.getRequests().indexOf(request);
232 final int requirementIndex = ((Request)request).getRequirements().indexOf(requirement);
233 String _plus = (Integer.valueOf(requestIndex) + ".");
234 _xblockexpression_1 = (_plus + Integer.valueOf(requirementIndex));
235 }
236 _xifexpression = _xblockexpression_1;
237 } else {
238 throw new IllegalArgumentException("Requirement is not contained in a request");
239 }
240 _xblockexpression = _xifexpression;
241 }
242 return _xblockexpression;
243 }
244
245 protected String _createMatchArgumentCode(final ApplicationInstance app) {
246 String _xblockexpression = null;
247 {
248 final Requirement requirement = app.getRequirement();
249 if ((requirement == null)) {
250 throw new IllegalArgumentException("Application instance is not associated with a requirement");
251 }
252 final int instanceIndex = requirement.getInstances().indexOf(app);
253 String _createMatchArgumentCode = this.createMatchArgumentCode(requirement);
254 String _plus = (_createMatchArgumentCode + ".");
255 _xblockexpression = (_plus + Integer.valueOf(instanceIndex));
256 }
257 return _xblockexpression;
258 }
259
260 protected String _createMatchArgumentCode(final HostInstance host) {
261 String _xblockexpression = null;
262 {
263 final EObject hostType = host.eContainer();
264 String _xifexpression = null;
265 if ((hostType instanceof HostType)) {
266 String _xblockexpression_1 = null;
267 {
268 final int hostIndex = ((HostType)hostType).getInstances().indexOf(host);
269 String _createMatchArgumentCode = this.createMatchArgumentCode(hostType);
270 String _plus = (_createMatchArgumentCode + ".");
271 _xblockexpression_1 = (_plus + Integer.valueOf(hostIndex));
272 }
273 _xifexpression = _xblockexpression_1;
274 } else {
275 throw new IllegalArgumentException("Host is not contained in a host type");
276 }
277 _xblockexpression = _xifexpression;
278 }
279 return _xblockexpression;
280 }
281
282 protected String _createMatchArgumentCode(final HostType hostType) {
283 String _xblockexpression = null;
284 {
285 EObject _eContainer = hostType.eContainer();
286 boolean _notEquals = (!Objects.equal(_eContainer, this.cps));
287 if (_notEquals) {
288 throw new IllegalArgumentException("Host type is not contained in the CPS");
289 }
290 final int hostTypeIndex = this.cps.getHostTypes().indexOf(hostType);
291 _xblockexpression = Integer.valueOf(hostTypeIndex).toString();
292 }
293 return _xblockexpression;
294 }
295
296 protected String _createMatchArgumentCode(final Object object) {
297 throw new IllegalArgumentException("Unknown match argument: ");
298 }
299
300 protected String createMatchArgumentCode(final Object app) {
301 if (app instanceof ApplicationInstance) {
302 return _createMatchArgumentCode((ApplicationInstance)app);
303 } else if (app instanceof HostInstance) {
304 return _createMatchArgumentCode((HostInstance)app);
305 } else if (app instanceof HostType) {
306 return _createMatchArgumentCode((HostType)app);
307 } else if (app instanceof Requirement) {
308 return _createMatchArgumentCode((Requirement)app);
309 } else if (app != null) {
310 return _createMatchArgumentCode(app);
311 } else {
312 throw new IllegalArgumentException("Unhandled parameter types: " +
313 Arrays.<Object>asList(app).toString());
314 }
315 }
316}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.java
new file mode 100644
index 00000000..7d81f84b
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsMain.java
@@ -0,0 +1,46 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.dse;
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
4import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
5import hu.bme.mit.inf.dslreasoner.domains.cps.dse.RuleBasedCpsSolver;
6import hu.bme.mit.inf.dslreasoner.domains.cps.generator.CpsGenerator;
7import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CpsQueries;
8import java.util.Map;
9import org.eclipse.emf.ecore.EPackage;
10import org.eclipse.emf.ecore.EStructuralFeature;
11import org.eclipse.emf.ecore.resource.Resource;
12import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
13import org.eclipse.viatra.addon.querybasedfeatures.runtime.QueryBasedFeatureSettingDelegateFactory;
14import org.eclipse.viatra.addon.querybasedfeatures.runtime.handler.QueryBasedFeatures;
15import org.eclipse.viatra.dse.api.DesignSpaceExplorer;
16import org.eclipse.viatra.query.runtime.extensibility.SingletonQueryGroupProvider;
17import org.eclipse.viatra.query.runtime.registry.IQuerySpecificationRegistry;
18import org.eclipse.viatra.query.runtime.registry.QuerySpecificationRegistry;
19import org.eclipse.viatra.query.runtime.registry.connector.QueryGroupProviderSourceConnector;
20
21@SuppressWarnings("all")
22public class RuleBasedCpsMain {
23 private RuleBasedCpsMain() {
24 new IllegalStateException("This is a static utility class and should not be instantiated directly.");
25 }
26
27 public static void main(final String[] args) {
28 DesignSpaceExplorer.turnOnLogging(DesignSpaceExplorer.DseLoggingLevel.VERBOSE_FULL);
29 Map<String, Object> _extensionToFactoryMap = Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap();
30 XMIResourceFactoryImpl _xMIResourceFactoryImpl = new XMIResourceFactoryImpl();
31 _extensionToFactoryMap.put(Resource.Factory.Registry.DEFAULT_EXTENSION, _xMIResourceFactoryImpl);
32 QueryBasedFeatureSettingDelegateFactory _queryBasedFeatureSettingDelegateFactory = new QueryBasedFeatureSettingDelegateFactory();
33 EStructuralFeature.Internal.SettingDelegate.Factory.Registry.INSTANCE.put(QueryBasedFeatures.ANNOTATION_SOURCE, _queryBasedFeatureSettingDelegateFactory);
34 EPackage.Registry.INSTANCE.put(CpsPackage.eNS_URI, CpsPackage.eINSTANCE);
35 IQuerySpecificationRegistry _instance = QuerySpecificationRegistry.getInstance();
36 CpsQueries _instance_1 = CpsQueries.instance();
37 SingletonQueryGroupProvider _singletonQueryGroupProvider = new SingletonQueryGroupProvider(_instance_1);
38 QueryGroupProviderSourceConnector _queryGroupProviderSourceConnector = new QueryGroupProviderSourceConnector("CpsQueries", _singletonQueryGroupProvider,
39 true);
40 _instance.addSource(_queryGroupProviderSourceConnector);
41 final CpsGenerator generator = new CpsGenerator(1, 4, 1);
42 final CyberPhysicalSystem problem = generator.generateCpsProblem();
43 final RuleBasedCpsSolver solver = new RuleBasedCpsSolver();
44 solver.solve(problem);
45 }
46}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.java
new file mode 100644
index 00000000..fd348752
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/dse/RuleBasedCpsSolver.java
@@ -0,0 +1,93 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.dse;
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationInstance;
4import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory;
5import hu.bme.mit.inf.dslreasoner.domains.cps.CpsPackage;
6import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
7import hu.bme.mit.inf.dslreasoner.domains.cps.HostInstance;
8import hu.bme.mit.inf.dslreasoner.domains.cps.dse.CpsStateCoder;
9import hu.bme.mit.inf.dslreasoner.domains.cps.queries.Allocate;
10import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeHddMetric;
11import hu.bme.mit.inf.dslreasoner.domains.cps.queries.AverageFreeMemoryMetric;
12import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CostMetric;
13import hu.bme.mit.inf.dslreasoner.domains.cps.queries.CreateHostInstance;
14import hu.bme.mit.inf.dslreasoner.domains.cps.queries.GuidanceObjective;
15import hu.bme.mit.inf.dslreasoner.domains.cps.queries.RequirementNotSatisfied;
16import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.CompositeDirectionalThresholdObjective;
17import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveKind;
18import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.ObjectiveThreshold;
19import hu.bme.mit.inf.dslreasoner.viatrasolver.reasoner.optimization.QueryBasedObjective;
20import java.util.Collection;
21import java.util.function.Consumer;
22import org.eclipse.emf.common.util.EList;
23import org.eclipse.viatra.dse.api.DesignSpaceExplorer;
24import org.eclipse.viatra.dse.api.Solution;
25import org.eclipse.viatra.dse.evolutionary.EvolutionaryStrategy;
26import org.eclipse.viatra.dse.evolutionary.EvolutionaryStrategyBuilder;
27import org.eclipse.viatra.dse.objectives.Fitness;
28import org.eclipse.viatra.transformation.runtime.emf.rules.batch.BatchTransformationRuleFactory;
29import org.eclipse.xtext.xbase.lib.Extension;
30import org.eclipse.xtext.xbase.lib.InputOutput;
31
32@SuppressWarnings("all")
33public class RuleBasedCpsSolver {
34 @Extension
35 private final BatchTransformationRuleFactory _batchTransformationRuleFactory = new BatchTransformationRuleFactory();
36
37 @Extension
38 private final CpsFactory _cpsFactory = CpsFactory.eINSTANCE;
39
40 public void solve(final CyberPhysicalSystem problem) {
41 final DesignSpaceExplorer dse = new DesignSpaceExplorer();
42 dse.addMetaModelPackage(CpsPackage.eINSTANCE);
43 dse.setInitialModel(problem.eResource().getResourceSet());
44 final Consumer<RequirementNotSatisfied.Match> _function = (RequirementNotSatisfied.Match it) -> {
45 final ApplicationInstance app = this._cpsFactory.createApplicationInstance();
46 EList<ApplicationInstance> _instances = it.getReq().getType().getInstances();
47 _instances.add(app);
48 EList<ApplicationInstance> _instances_1 = it.getReq().getInstances();
49 _instances_1.add(app);
50 };
51 dse.addTransformationRule(this._batchTransformationRuleFactory.<RequirementNotSatisfied.Match, RequirementNotSatisfied.Matcher>createRule(RequirementNotSatisfied.instance()).action(_function).build());
52 final Consumer<Allocate.Match> _function_1 = (Allocate.Match it) -> {
53 ApplicationInstance _app = it.getApp();
54 _app.setAllocatedTo(it.getHost());
55 };
56 dse.addTransformationRule(this._batchTransformationRuleFactory.<Allocate.Match, Allocate.Matcher>createRule(Allocate.instance()).action(_function_1).build());
57 final Consumer<CreateHostInstance.Match> _function_2 = (CreateHostInstance.Match it) -> {
58 EList<HostInstance> _instances = it.getHostType().getInstances();
59 HostInstance _createHostInstance = this._cpsFactory.createHostInstance();
60 _instances.add(_createHostInstance);
61 };
62 dse.addTransformationRule(this._batchTransformationRuleFactory.<CreateHostInstance.Match, CreateHostInstance.Matcher>createRule(CreateHostInstance.instance()).action(_function_2).build());
63 GuidanceObjective _instance = GuidanceObjective.instance();
64 ObjectiveThreshold.Inclusive _inclusive = new ObjectiveThreshold.Inclusive(0);
65 QueryBasedObjective _queryBasedObjective = new QueryBasedObjective(_instance, ObjectiveKind.LOWER_IS_BETTER, _inclusive, 0);
66 AverageFreeMemoryMetric _instance_1 = AverageFreeMemoryMetric.instance();
67 ObjectiveThreshold.Inclusive _inclusive_1 = new ObjectiveThreshold.Inclusive(0.75);
68 QueryBasedObjective _queryBasedObjective_1 = new QueryBasedObjective(_instance_1, ObjectiveKind.LOWER_IS_BETTER, _inclusive_1, 0);
69 AverageFreeHddMetric _instance_2 = AverageFreeHddMetric.instance();
70 ObjectiveThreshold.Inclusive _inclusive_2 = new ObjectiveThreshold.Inclusive(0.75);
71 QueryBasedObjective _queryBasedObjective_2 = new QueryBasedObjective(_instance_2, ObjectiveKind.LOWER_IS_BETTER, _inclusive_2, 0);
72 CompositeDirectionalThresholdObjective _compositeDirectionalThresholdObjective = new CompositeDirectionalThresholdObjective("Composite", _queryBasedObjective, _queryBasedObjective_1, _queryBasedObjective_2);
73 dse.addObjective(_compositeDirectionalThresholdObjective);
74 CostMetric _instance_3 = CostMetric.instance();
75 QueryBasedObjective _queryBasedObjective_3 = new QueryBasedObjective(_instance_3, ObjectiveKind.LOWER_IS_BETTER,
76 ObjectiveThreshold.NO_THRESHOLD, 0);
77 dse.addObjective(_queryBasedObjective_3);
78 dse.setMaxNumberOfThreads(1);
79 CpsStateCoder.Factory _factory = new CpsStateCoder.Factory();
80 dse.setStateCoderFactory(_factory);
81 final EvolutionaryStrategy strategy = EvolutionaryStrategyBuilder.createNsga2Strategy(25);
82 dse.startExplorationWithTimeout(strategy, ((2 * 60) * 1000));
83 Collection<Solution> _solutions = dse.getSolutions();
84 for (final Solution solution : _solutions) {
85 Object _stateCode = solution.getStateCode();
86 String _plus = ("Found solution: " + _stateCode);
87 String _plus_1 = (_plus + " ");
88 Fitness _fitness = solution.getArbitraryTrajectory().getFitness();
89 String _plus_2 = (_plus_1 + _fitness);
90 InputOutput.<String>println(_plus_2);
91 }
92 }
93}
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbin b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbin
new file mode 100644
index 00000000..d975ffab
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/.CpsGenerator.xtendbin
Binary files differ
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java
new file mode 100644
index 00000000..e59ef004
--- /dev/null
+++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.cps/xtend-gen/hu/bme/mit/inf/dslreasoner/domains/cps/generator/CpsGenerator.java
@@ -0,0 +1,154 @@
1package hu.bme.mit.inf.dslreasoner.domains.cps.generator;
2
3import hu.bme.mit.inf.dslreasoner.domains.cps.ApplicationType;
4import hu.bme.mit.inf.dslreasoner.domains.cps.CpsFactory;
5import hu.bme.mit.inf.dslreasoner.domains.cps.CyberPhysicalSystem;
6import hu.bme.mit.inf.dslreasoner.domains.cps.HostType;
7import hu.bme.mit.inf.dslreasoner.domains.cps.Request;
8import hu.bme.mit.inf.dslreasoner.domains.cps.Requirement;
9import hu.bme.mit.inf.dslreasoner.domains.cps.ResourceRequirement;
10import java.util.Collection;
11import java.util.Collections;
12import java.util.List;
13import java.util.Random;
14import org.eclipse.emf.common.util.EList;
15import org.eclipse.emf.common.util.URI;
16import org.eclipse.emf.ecore.EObject;
17import org.eclipse.emf.ecore.resource.Resource;
18import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
19import org.eclipse.xtext.xbase.lib.CollectionLiterals;
20import org.eclipse.xtext.xbase.lib.Extension;
21import org.eclipse.xtext.xbase.lib.ObjectExtensions;
22import org.eclipse.xtext.xbase.lib.Procedures.Procedure1;
23
24@SuppressWarnings("all")
25public class CpsGenerator {
26 @Extension
27 private final CpsFactory _cpsFactory = CpsFactory.eINSTANCE;
28
29 private static final int MIN_MEMORY = 1;
30
31 private static final int MAX_MEMORY = 6;
32
33 private static final int MIN_HDD = 1;
34
35 private static final int MAX_HDD = 30;
36
37 private static final int HIGH_CPU_FRACTION = 4;
38
39 private static final int MIN_REPLICAS = 1;
40
41 private static final int MAX_REPLICAS = 4;
42
43 private final Random random;
44
45 private final int applicationTypeCount;
46
47 private final int demandFactor;
48
49 public CpsGenerator(final long randomSeed, final int applicationTypeCount, final int demandFactor) {
50 Random _random = new Random(randomSeed);
51 this.random = _random;
52 this.applicationTypeCount = applicationTypeCount;
53 this.demandFactor = demandFactor;
54 }
55
56 public CyberPhysicalSystem generateCpsProblem() {
57 CyberPhysicalSystem _xblockexpression = null;
58 {
59 final ResourceSetImpl resourceSet = new ResourceSetImpl();
60 final Resource resource = resourceSet.createResource(URI.createFileURI("dummy.dummyext"));
61 CyberPhysicalSystem _createCyberPhysicalSystem = this._cpsFactory.createCyberPhysicalSystem();
62 final Procedure1<CyberPhysicalSystem> _function = (CyberPhysicalSystem it) -> {
63 final CyberPhysicalSystem cps = it;
64 EList<EObject> _contents = resource.getContents();
65 _contents.add(cps);
66 this.createLowCpuHostTypes(it);
67 final List<HostType> highCpuHostTypes = this.createHighCpuHostTypes(it);
68 for (int i = 0; (i < this.applicationTypeCount); i++) {
69 if (((i % CpsGenerator.HIGH_CPU_FRACTION) == 0)) {
70 this.createRandomApplicationType(it, highCpuHostTypes);
71 } else {
72 this.createRandomApplicationType(it, it.getHostTypes());
73 }
74 }
75 for (int i = 0; (i < this.demandFactor); i++) {
76 EList<Request> _requests = it.getRequests();
77 Request _createRequest = this._cpsFactory.createRequest();
78 final Procedure1<Request> _function_1 = (Request it_1) -> {
79 EList<ApplicationType> _applicationTypes = cps.getApplicationTypes();
80 for (final ApplicationType appType : _applicationTypes) {
81 EList<Requirement> _requirements = it_1.getRequirements();
82 Requirement _createRequirement = this._cpsFactory.createRequirement();
83 final Procedure1<Requirement> _function_2 = (Requirement it_2) -> {
84 it_2.setCount(this.nextInt(CpsGenerator.MIN_REPLICAS, CpsGenerator.MAX_REPLICAS));
85 it_2.setType(appType);
86 };
87 Requirement _doubleArrow = ObjectExtensions.<Requirement>operator_doubleArrow(_createRequirement, _function_2);
88 _requirements.add(_doubleArrow);
89 }
90 };
91 Request _doubleArrow = ObjectExtensions.<Request>operator_doubleArrow(_createRequest, _function_1);
92 _requests.add(_doubleArrow);
93 }
94 };
95 _xblockexpression = ObjectExtensions.<CyberPhysicalSystem>operator_doubleArrow(_createCyberPhysicalSystem, _function);
96 }
97 return _xblockexpression;
98 }
99
100 private void createRandomApplicationType(final CyberPhysicalSystem it, final Collection<HostType> allowedHostTypes) {
101 final ApplicationType appType = this._cpsFactory.createApplicationType();
102 final int memory = this.nextInt(CpsGenerator.MIN_MEMORY, CpsGenerator.MAX_MEMORY);
103 final int hdd = this.nextInt(CpsGenerator.MIN_HDD, CpsGenerator.MAX_HDD);
104 for (final HostType hostType : allowedHostTypes) {
105 EList<ResourceRequirement> _requirements = appType.getRequirements();
106 ResourceRequirement _createResourceRequirement = this._cpsFactory.createResourceRequirement();
107 final Procedure1<ResourceRequirement> _function = (ResourceRequirement it_1) -> {
108 it_1.setHostType(hostType);
109 it_1.setRequiredMemory(memory);
110 it_1.setRequiredHdd(hdd);
111 };
112 ResourceRequirement _doubleArrow = ObjectExtensions.<ResourceRequirement>operator_doubleArrow(_createResourceRequirement, _function);
113 _requirements.add(_doubleArrow);
114 }
115 EList<ApplicationType> _applicationTypes = it.getApplicationTypes();
116 _applicationTypes.add(appType);
117 }
118
119 private List<HostType> createLowCpuHostTypes(final CyberPhysicalSystem it) {
120 HostType _createHostType = this.createHostType(it, 2, 8, 75);
121 HostType _createHostType_1 = this.createHostType(it, 4, 16, 150);
122 HostType _createHostType_2 = this.createHostType(it, 3, 16, 75);
123 HostType _createHostType_3 = this.createHostType(it, 6, 32, 150);
124 return Collections.<HostType>unmodifiableList(CollectionLiterals.<HostType>newArrayList(_createHostType, _createHostType_1, _createHostType_2, _createHostType_3));
125 }
126
127 private List<HostType> createHighCpuHostTypes(final CyberPhysicalSystem it) {
128 HostType _createHostType = this.createHostType(it, 2, 4, 50);
129 HostType _createHostType_1 = this.createHostType(it, 4, 8, 100);
130 return Collections.<HostType>unmodifiableList(CollectionLiterals.<HostType>newArrayList(_createHostType, _createHostType_1));
131 }
132
133 private HostType createHostType(final CyberPhysicalSystem it, final int cost, final int memory, final int hdd) {
134 HostType _xblockexpression = null;
135 {
136 HostType _createHostType = this._cpsFactory.createHostType();
137 final Procedure1<HostType> _function = (HostType it_1) -> {
138 it_1.setCost(cost);
139 it_1.setDefaultMemory(memory);
140 it_1.setDefaultHdd(hdd);
141 };
142 final HostType hostType = ObjectExtensions.<HostType>operator_doubleArrow(_createHostType, _function);
143 EList<HostType> _hostTypes = it.getHostTypes();
144 _hostTypes.add(hostType);
145 _xblockexpression = hostType;
146 }
147 return _xblockexpression;
148 }
149
150 private int nextInt(final int lower, final int upper) {
151 int _nextInt = this.random.nextInt(((upper - lower) + 1));
152 return (lower + _nextInt);
153 }
154}