From f9e6851602221e4cc2c0e4e82d7f29ce0da73fa5 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?J=C3=BCrgen=20Walter?= <juergen.walter@uni-wuerzburg.de>
Date: Thu, 4 Feb 2016 21:07:48 +0100
Subject: [PATCH] added dynamic resource allocation case study

acamar cluster at KIT
---
 .../PULL.launch                               |  16 ++
 .../PUSH.launch                               |  16 ++
 .../acamarcluster.resourcelandscape           |  47 ++++++
 .../default.adaptationpoints                  |  13 ++
 .../default.containerrepository               |  35 +++++
 .../default.resourcetype                      |   5 +
 .../metrictypes.perfdatarepo                  |   7 +
 .../pull.properties                           |   8 +
 .../push.properties                           |   8 +
 .../pushpull.adaptation                       | 138 ++++++++++++++++++
 .../pushpull.staLang                          |  64 ++++++++
 .../simucomresults.observationrepo            | 105 +++++++++++++
 12 files changed, 462 insertions(+)
 create mode 100644 DynamicResourceAllocation_Case_Study/PULL.launch
 create mode 100644 DynamicResourceAllocation_Case_Study/PUSH.launch
 create mode 100644 DynamicResourceAllocation_Case_Study/acamarcluster.resourcelandscape
 create mode 100644 DynamicResourceAllocation_Case_Study/default.adaptationpoints
 create mode 100644 DynamicResourceAllocation_Case_Study/default.containerrepository
 create mode 100644 DynamicResourceAllocation_Case_Study/default.resourcetype
 create mode 100644 DynamicResourceAllocation_Case_Study/metrictypes.perfdatarepo
 create mode 100644 DynamicResourceAllocation_Case_Study/pull.properties
 create mode 100644 DynamicResourceAllocation_Case_Study/push.properties
 create mode 100644 DynamicResourceAllocation_Case_Study/pushpull.adaptation
 create mode 100644 DynamicResourceAllocation_Case_Study/pushpull.staLang
 create mode 100644 DynamicResourceAllocation_Case_Study/simucomresults.observationrepo

diff --git a/DynamicResourceAllocation_Case_Study/PULL.launch b/DynamicResourceAllocation_Case_Study/PULL.launch
new file mode 100644
index 0000000..3041898
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/PULL.launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/edu.kit.ipd.descartes.adaptation/src/edu/kit/ipd/descartes/adaptation/AdaptationControl.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.kit.ipd.descartes.adaptation.AdaptationControl"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="../Examples/DynamicResourceAllocation_Case_Study/pull.properties"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="edu.kit.ipd.descartes.adaptation"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-enableassertions"/>
+</launchConfiguration>
diff --git a/DynamicResourceAllocation_Case_Study/PUSH.launch b/DynamicResourceAllocation_Case_Study/PUSH.launch
new file mode 100644
index 0000000..bec6774
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/PUSH.launch
@@ -0,0 +1,16 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.jdt.launching.localJavaApplication">
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/edu.kit.ipd.descartes.adaptation/src/edu/kit/ipd/descartes/adaptation/AdaptationControl.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.ui.favoriteGroups">
+<listEntry value="org.eclipse.debug.ui.launchGroup.run"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="edu.kit.ipd.descartes.adaptation.AdaptationControl"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="../Examples/DynamicResourceAllocation_Case_Study/push.properties"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="edu.kit.ipd.descartes.adaptation"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-enableassertions"/>
+</launchConfiguration>
diff --git a/DynamicResourceAllocation_Case_Study/acamarcluster.resourcelandscape b/DynamicResourceAllocation_Case_Study/acamarcluster.resourcelandscape
new file mode 100644
index 0000000..1db12e9
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/acamarcluster.resourcelandscape
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="ASCII"?>
+<resourcelandscape:DistributedDataCenter xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:resourcelandscape="http://www.descartes-research.net/metamodel/resourcelandscape/0.1" id="1" name="KitDataCenters">
+  <consistsOf id="2" name="AtisDataCenter">
+    <contains xsi:type="resourcelandscape:CompositeHardwareInfrastructure" id="3" name="AcamarCluster">
+      <contains xsi:type="resourcelandscape:ComputingInfrastructure" id="4" name="ClusterNode20">
+        <contains id="10" name="XenServer">
+          <contains id="12" name="AppServerVM1" ofClass="OS VM">
+            <template href="default.containerrepository#2"/>
+          </contains>
+          <template href="default.containerrepository#11"/>
+        </contains>
+        <template href="default.containerrepository#5"/>
+      </contains>
+      <contains xsi:type="resourcelandscape:ComputingInfrastructure" id="5" name="ClusterNode19">
+        <contains id="15" name="XenServer">
+          <template href="default.containerrepository#11"/>
+        </contains>
+        <template href="default.containerrepository#5"/>
+      </contains>
+      <contains xsi:type="resourcelandscape:ComputingInfrastructure" id="6" name="ClusterNode18">
+        <contains id="25" name="XenServer">
+          <template href="default.containerrepository#11"/>
+        </contains>
+        <template href="default.containerrepository#5"/>
+      </contains>
+      <contains xsi:type="resourcelandscape:ComputingInfrastructure" id="_LklidKgfEeKjPK9oRuUP7g" name="ClusterNode17">
+        <contains id="_SI2gsKgfEeKjPK9oRuUP7g" name="XenServer">
+          <template href="default.containerrepository#11"/>
+        </contains>
+      </contains>
+      <contains xsi:type="resourcelandscape:ComputingInfrastructure" id="_Mik0tKgfEeKjPK9oRuUP7g" name="ClusterNode16">
+        <contains id="_Uuj-sKgfEeKjPK9oRuUP7g" name="XenServer">
+          <template href="default.containerrepository#5"/>
+        </contains>
+      </contains>
+      <contains xsi:type="resourcelandscape:ComputingInfrastructure" id="7" name="ClusterNode15">
+        <contains id="14" name="XenServer">
+          <contains id="33" name="DatabaseVM" ofClass="OS VM">
+            <template href="default.containerrepository#555"/>
+          </contains>
+          <template href="default.containerrepository#11"/>
+        </contains>
+        <template href="default.containerrepository#5"/>
+      </contains>
+    </contains>
+  </consistsOf>
+</resourcelandscape:DistributedDataCenter>
diff --git a/DynamicResourceAllocation_Case_Study/default.adaptationpoints b/DynamicResourceAllocation_Case_Study/default.adaptationpoints
new file mode 100644
index 0000000..366d552
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/default.adaptationpoints
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="ASCII"?>
+<adaptationpoints:AdaptationPointDescriptions xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:adaptationpoints="http://www.descartes-research.net/metamodel/adaptationpoints/0.1" xmlns:resourceconfiguration="http://www.descartes-research.net/metamodel/resourceconfiguration/0.1" xmlns:resourcelandscape="http://www.descartes-research.net/metamodel/resourcelandscape/0.1" id="1" name="DynamicResourceAllocation-AdaptationPoints">
+  <adaptationPoints xsi:type="adaptationpoints:ModelVariableConfigurationRange" id="238746123" name="AmountOfvCpus" minValue="2.0" maxValue="4.0">
+    <adaptableEntity xsi:type="resourceconfiguration:NumberOfParallelProcessingUnits" href="default.containerrepository#1341341"/>
+  </adaptationPoints>
+  <adaptationPoints xsi:type="adaptationpoints:ModelEntityConfigurationRange" id="12312412412" name="NumberOfAppServerVmInstancesPerPhysicalServer">
+    <variationPossibility xsi:type="adaptationpoints:PropertyRange">
+      <minValueConstraint oclString="self.containedIn.contains->size()>=1" name="MinValueConstraint"/>
+      <maxValueConstraint oclString="self.containedIn.contains->size()&lt;=2" name="MaxValueConstraint"/>
+    </variationPossibility>
+    <adaptableEntity xsi:type="resourcelandscape:RuntimeEnvironment" href="acamarcluster.resourcelandscape#12"/>
+  </adaptationPoints>
+</adaptationpoints:AdaptationPointDescriptions>
diff --git a/DynamicResourceAllocation_Case_Study/default.containerrepository b/DynamicResourceAllocation_Case_Study/default.containerrepository
new file mode 100644
index 0000000..a552421
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/default.containerrepository
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="ASCII"?>
+<containerrepository:ContainerRepository xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:containerrepository="http://www.descartes-research.net/metamodel/containerrepository/0.1" xmlns:resourceconfiguration="http://www.descartes-research.net/metamodel/resourceconfiguration/0.1" xmlns:resourcelandscape="http://www.descartes-research.net/metamodel/resourcelandscape/0.1" id="1" name="AcamarClusterContainerTemplates">
+  <templates id="2" name="AppServerVmTemplate">
+    <templateConfig xsi:type="resourceconfiguration:ActiveResourceSpecification" id="3xyzActiveResourceTemplate32" name="CpusAppServer">
+      <processingResourceSpecifications id="235234" name="vCpuSpec" schedulingPolicy="PROCESSOR_SHARING" processingRate="1000.0">
+        <activeResourceType href="default.resourcetype#_3ql5IJB4EeKmfoqNH_-HEA"/>
+        <nrOfParProcUnits id="1341341" name="NumberOfAppServerVmCpus" number="2"/>
+      </processingResourceSpecifications>
+    </templateConfig>
+    <referringContainers xsi:type="resourcelandscape:RuntimeEnvironment" href="acamarcluster.resourcelandscape#12"/>
+  </templates>
+  <templates id="555" name="DatabaseVmTemplate">
+    <templateConfig xsi:type="resourceconfiguration:ActiveResourceSpecification" id="1231231231" name="CpusDatabase">
+      <processingResourceSpecifications id="51241132" name="CpuSpec" schedulingPolicy="PROCESSOR_SHARING" processingRate="1000.0">
+        <activeResourceType href="default.resourcetype#_3ql5IJB4EeKmfoqNH_-HEA"/>
+        <nrOfParProcUnits id="33" name="DatabaseVirtualCpus" number="8"/>
+      </processingResourceSpecifications>
+    </templateConfig>
+  </templates>
+  <templates id="5" name="ClusterNodeTemplate">
+    <templateConfig xsi:type="resourceconfiguration:ActiveResourceSpecification" id="123123" name="CpusClusterNode">
+      <processingResourceSpecifications id="123sf" name="IntelXeonE5430-1" schedulingPolicy="PROCESSOR_SHARING" processingRate="1000.0">
+        <activeResourceType href="default.resourcetype#_3ql5IJB4EeKmfoqNH_-HEA"/>
+        <nrOfParProcUnits id="23423sad" name="quad-core" number="4"/>
+      </processingResourceSpecifications>
+      <processingResourceSpecifications id="_wYMNIagfEeKjPK9oRuUP7g" name="IntelXeonE5430-2" schedulingPolicy="PROCESSOR_SHARING" processingRate="1000.0">
+        <activeResourceType href="default.resourcetype#_3ql5IJB4EeKmfoqNH_-HEA"/>
+        <nrOfParProcUnits id="_16c70KgfEeKjPK9oRuUP7g" name="quad-core" number="4"/>
+      </processingResourceSpecifications>
+    </templateConfig>
+  </templates>
+  <templates id="11" name="XenServerTemplate">
+    <templateConfig xsi:type="resourceconfiguration:CustomConfigurationSpecification" id="12" name="XenServerConfiguration"/>
+  </templates>
+</containerrepository:ContainerRepository>
diff --git a/DynamicResourceAllocation_Case_Study/default.resourcetype b/DynamicResourceAllocation_Case_Study/default.resourcetype
new file mode 100644
index 0000000..b304da2
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/default.resourcetype
@@ -0,0 +1,5 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<resourcetype:ResourceTypeRepository xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:resourcetype="http://www.descartes-research.net/metamodel/resourcetype/0.1">
+  <resourceTypes xsi:type="resourcetype:ProcessingResourceType" id="_3ql5IJB4EeKmfoqNH_-HEA" name="CPU"/>
+  <resourceTypes xsi:type="resourcetype:ProcessingResourceType" id="_52tLYJB4EeKmfoqNH_-HEA" name="DELAY"/>
+</resourcetype:ResourceTypeRepository>
diff --git a/DynamicResourceAllocation_Case_Study/metrictypes.perfdatarepo b/DynamicResourceAllocation_Case_Study/metrictypes.perfdatarepo
new file mode 100644
index 0000000..d1a0231
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/metrictypes.perfdatarepo
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="ASCII"?>
+<perfdatarepo:PerformanceDataRepository xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:perfdatarepo="http://www.descartes-research.net/metamodel/perfdata/0.1" id="1" name="MeasuredPerformanceDataRepository">
+  <metricTypes id="2" name="Vm1Utilization"/>
+  <metricTypes id="22" name="Vm2Utilization"/>
+  <metricTypes id="3" name="CV_EJB_AvgResponseTime"/>
+  <metricTypes id="4" name="Purchase_AvgResponseTime"/>
+</perfdatarepo:PerformanceDataRepository>
diff --git a/DynamicResourceAllocation_Case_Study/pull.properties b/DynamicResourceAllocation_Case_Study/pull.properties
new file mode 100644
index 0000000..d1721df
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/pull.properties
@@ -0,0 +1,8 @@
+process.name=DynamicResourceAllocation_PushPull-v1
+adaptationprocess.instance=../Examples/DynamicResourceAllocation_Case_Study/pushpull.adaptation
+perfdatarepo.metamodel=edu.kit.ipd.descartes.ql.models.repository.ObservationRepository
+perfdatarepo.instance=../Examples/DynamicResourceAllocation_Case_Study/simucomresults.observationrepo
+process.maxiterations=3
+# The list of triggering events can be found in EventTypeEnum.java
+event.type=ScheduledOptimizationEvent
+#SlaViolatedEvent, ScheduledOptimizationEvent
\ No newline at end of file
diff --git a/DynamicResourceAllocation_Case_Study/push.properties b/DynamicResourceAllocation_Case_Study/push.properties
new file mode 100644
index 0000000..a329b26
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/push.properties
@@ -0,0 +1,8 @@
+process.name=DynamicResourceAllocation_PushPull-v1
+adaptationprocess.instance=../Examples/DynamicResourceAllocation_Case_Study/pushpull.adaptation
+perfdatarepo.metamodel=edu.kit.ipd.descartes.ql.models.repository.ObservationRepository
+perfdatarepo.instance=../Examples/DynamicResourceAllocation_Case_Study/simucomresults.observationrepo
+process.maxiterations=3
+# The list of triggering events can be found in EventTypeEnum.java
+event.type=SlaViolatedEvent
+#SlaViolatedEvent, ScheduledOptimizationEvent
\ No newline at end of file
diff --git a/DynamicResourceAllocation_Case_Study/pushpull.adaptation b/DynamicResourceAllocation_Case_Study/pushpull.adaptation
new file mode 100644
index 0000000..e6ab6a8
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/pushpull.adaptation
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="ASCII"?>
+<adaptation:AdaptationProcess xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:adaptation="http://www.descartes-research.net/metamodel/adaptation/0.1" xmlns:adaptationpoints="http://www.descartes-research.net/metamodel/adaptationpoints/0.1" xmlns:containerrepository="http://www.descartes-research.net/metamodel/containerrepository/0.1" xmlns:resourcelandscape="http://www.descartes-research.net/metamodel/resourcelandscape/0.1" id="_07SqMKaFEeKsaqdh-1smGw" name="PushPullAdaptationProcess">
+  <tactics id="2341234" name="AddResources">
+    <implementedPlan id="qweqweqwe" name="AddResourcesAdaptationPlan">
+      <steps xsi:type="adaptation:StartAction" id="_PXgN0KaHEeKsaqdh-1smGw" successor="_Qych0qaHEeKsaqdh-1smGw"/>
+      <steps xsi:type="adaptation:StopAction" id="_QNxHcaaHEeKsaqdh-1smGw" predecessor="_Qych0qaHEeKsaqdh-1smGw"/>
+      <steps xsi:type="adaptation:LoopAction" id="_Qych0qaHEeKsaqdh-1smGw" predecessor="_PXgN0KaHEeKsaqdh-1smGw" successor="_QNxHcaaHEeKsaqdh-1smGw" counter="//@parameters.0">
+        <body id="_UpH4cKaHEeKsaqdh-1smGw" name="addVCPUorAppServer">
+          <steps xsi:type="adaptation:StartAction" id="2342623434" successor="33eadsea"/>
+          <steps xsi:type="adaptation:BranchAction" id="33eadsea" predecessor="2342623434" successor="6423423423" condition="RuntimeEnvironment.allInstances()->select( re | re.template = self.template )->exists(re | re.configSpec.oclAsType(resourceconfiguration::ActiveResourceSpecification).processingResourceSpecifications->forAll(nrOfParProcUnits.number &lt; 4)) and RuntimeEnvironment.allInstances()->select( re | re.template = self.template )->forAll(re | re.template.templateConfig.oclAsType(resourceconfiguration::ActiveResourceSpecification).processingResourceSpecifications->forAll(nrOfParProcUnits.number &lt; 4))">
+            <context xsi:type="resourcelandscape:RuntimeEnvironment" href="acamarcluster.resourcelandscape#12"/>
+            <conditionTrueBranch id="efasfasd" name="addVCPU">
+              <steps xsi:type="adaptation:ActionReference" id="35634534" predecessor="321321" successor="345fdas" refersTo="2"/>
+              <steps xsi:type="adaptation:StartAction" id="321321" successor="35634534"/>
+              <steps xsi:type="adaptation:StopAction" id="345fdas" predecessor="35634534"/>
+            </conditionTrueBranch>
+            <conditionFalseBranch id="adsgsadas" name="addAppServer">
+              <steps xsi:type="adaptation:ActionReference" id="453412341241" predecessor="e123134" successor="e63412" refersTo="41123123"/>
+              <steps xsi:type="adaptation:StartAction" id="e123134" successor="453412341241"/>
+              <steps xsi:type="adaptation:StopAction" id="e63412" predecessor="453412341241"/>
+            </conditionFalseBranch>
+          </steps>
+          <steps xsi:type="adaptation:StopAction" id="6423423423" predecessor="33eadsea"/>
+        </body>
+      </steps>
+    </implementedPlan>
+  </tactics>
+  <tactics id="_zFC2EaaMEeKdn_E8M08Q_g" name="UndoPreviousAction">
+    <implementedPlan id="_1_t3cKaMEeKdn_E8M08Q_g" name="UndoPreviousActionPlan">
+      <steps xsi:type="adaptation:StartAction" id="_9awssKaMEeKdn_E8M08Q_g" successor="_-Pacw6aMEeKdn_E8M08Q_g"/>
+      <steps xsi:type="adaptation:BranchAction" id="_-Pacw6aMEeKdn_E8M08Q_g" predecessor="_9awssKaMEeKdn_E8M08Q_g" successor="_9ysEgaaMEeKdn_E8M08Q_g" condition="">
+        <context xsi:type="containerrepository:ContainerTemplate" href="default.containerrepository#2"/>
+        <conditionTrueBranch id="_KP82cKaNEeKdn_E8M08Q_g" name="conditionTrue">
+          <steps xsi:type="adaptation:StartAction" id="_UUI4MKaNEeKdn_E8M08Q_g" successor="_dl-P9KaNEeKdn_E8M08Q_g"/>
+          <steps xsi:type="adaptation:StopAction" id="_Uv0uoaaNEeKdn_E8M08Q_g" predecessor="_dl-P9KaNEeKdn_E8M08Q_g"/>
+          <steps xsi:type="adaptation:ActionReference" id="_dl-P9KaNEeKdn_E8M08Q_g" predecessor="_UUI4MKaNEeKdn_E8M08Q_g" successor="_Uv0uoaaNEeKdn_E8M08Q_g" refersTo="41123123"/>
+        </conditionTrueBranch>
+        <conditionFalseBranch id="_K4GbkaaNEeKdn_E8M08Q_g" name="conditionFalse">
+          <steps xsi:type="adaptation:StartAction" id="_VFQMEKaNEeKdn_E8M08Q_g" successor="_mMx4RKaOEeKlTfD7QKQIcw"/>
+          <steps xsi:type="adaptation:StopAction" id="_VYB-IaaNEeKdn_E8M08Q_g" predecessor="_mMx4RKaOEeKlTfD7QKQIcw"/>
+          <steps xsi:type="adaptation:ActionReference" id="_mMx4RKaOEeKlTfD7QKQIcw" predecessor="_VFQMEKaNEeKdn_E8M08Q_g" successor="_VYB-IaaNEeKdn_E8M08Q_g" refersTo="2"/>
+        </conditionFalseBranch>
+      </steps>
+      <steps xsi:type="adaptation:StopAction" id="_9ysEgaaMEeKdn_E8M08Q_g" predecessor="_-Pacw6aMEeKdn_E8M08Q_g"/>
+    </implementedPlan>
+  </tactics>
+  <tactics id="123123" name="RemoveResources">
+    <implementedPlan id="123123123" name="RemoveResourcesAdaptationPlan">
+      <steps xsi:type="adaptation:StartAction" id="_iqERYKaMEeKdn_E8M08Q_g" successor="_jqTmYqaMEeKdn_E8M08Q_g"/>
+      <steps xsi:type="adaptation:StopAction" id="_jO2ZcaaMEeKdn_E8M08Q_g" predecessor="_jqTmYqaMEeKdn_E8M08Q_g"/>
+      <steps xsi:type="adaptation:LoopAction" id="_jqTmYqaMEeKdn_E8M08Q_g" predecessor="_iqERYKaMEeKdn_E8M08Q_g" successor="_jO2ZcaaMEeKdn_E8M08Q_g" counter="//@parameters.0">
+        <body id="_oCJwYKaMEeKdn_E8M08Q_g" name="removeVCPUorAppServer">
+          <steps xsi:type="adaptation:StartAction" id="321" successor="branchDecrease"/>
+          <steps xsi:type="adaptation:BranchAction" id="branchDecrease" predecessor="321" successor="432" condition="RuntimeEnvironment.allInstances()->select( re | re.template = self.template and not re.configSpec->isEmpty())->exists(re | re.configSpec.oclAsType(resourceconfiguration::ActiveResourceSpecification).processingResourceSpecifications->forAll(nrOfParProcUnits.number > 2))">
+            <context xsi:type="resourcelandscape:RuntimeEnvironment" href="acamarcluster.resourcelandscape#12"/>
+            <conditionTrueBranch id="_k0FLAICyEeKnieBrE9C24w" name="addVCPU">
+              <steps xsi:type="adaptation:ActionReference" id="123487612497162" predecessor="_q13HQICyEeKnieBrE9C24w" successor="_rJvFgYCyEeKnieBrE9C24w" refersTo="345242342"/>
+              <steps xsi:type="adaptation:StartAction" id="_q13HQICyEeKnieBrE9C24w" successor="123487612497162"/>
+              <steps xsi:type="adaptation:StopAction" id="_rJvFgYCyEeKnieBrE9C24w" predecessor="123487612497162"/>
+            </conditionTrueBranch>
+            <conditionFalseBranch id="_nZJv1oCyEeKnieBrE9C24w" name="removeAppServer">
+              <steps xsi:type="adaptation:ActionReference" id="234983249623" predecessor="_xUQHAICyEeKnieBrE9C24w" successor="_xx9WsYCyEeKnieBrE9C24w" refersTo="1287127123"/>
+              <steps xsi:type="adaptation:StartAction" id="_xUQHAICyEeKnieBrE9C24w" successor="234983249623"/>
+              <steps xsi:type="adaptation:StopAction" id="_xx9WsYCyEeKnieBrE9C24w" predecessor="234983249623"/>
+            </conditionFalseBranch>
+          </steps>
+          <steps xsi:type="adaptation:StopAction" id="432" predecessor="branchDecrease"/>
+        </body>
+      </steps>
+    </implementedPlan>
+  </tactics>
+  <actions id="2" name="AddVCPU">
+    <referredAdaptationPoint xsi:type="adaptationpoints:ModelVariableConfigurationRange" href="default.adaptationpoints#238746123"/>
+    <adaptationActionOperation adaptationOperationScope="RANDOM" adaptationOperationDirection="INCREASE"/>
+  </actions>
+  <actions id="345242342" name="RemoveCPU">
+    <referredAdaptationPoint xsi:type="adaptationpoints:ModelVariableConfigurationRange" href="default.adaptationpoints#238746123"/>
+    <adaptationActionOperation adaptationOperationScope="RANDOM" adaptationOperationDirection="DECREASE"/>
+  </actions>
+  <actions id="41123123" name="AddAppServer">
+    <referredAdaptationPoint xsi:type="adaptationpoints:ModelEntityConfigurationRange" href="default.adaptationpoints#12312412412"/>
+    <adaptationActionOperation adaptationOperationScope="RANDOM" adaptationOperationDirection="INCREASE"/>
+  </actions>
+  <actions id="1287127123" name="RemoveAppServer">
+    <referredAdaptationPoint xsi:type="adaptationpoints:ModelEntityConfigurationRange" href="default.adaptationpoints#12312412412"/>
+    <adaptationActionOperation adaptationOperationScope="RANDOM" adaptationOperationDirection="DECREASE"/>
+  </actions>
+  <strategies id="s1" name="PUSH" objective="_GdVkoKaGEeKsaqdh-1smGw">
+    <triggeringEvents id="12345" name="SlaViolatedEvent"/>
+    <tactics id="wt1" name="AddResourcesWeightedTactic" usedTactic="2341234" defaultWeight="1.0"/>
+    <weightingFunction id="wf1" name="WeightedSum" weightingFunctionImplementation="edu.kit.ipd.descartes.adaptation.evaluation.performance.weightingfunction.WeightedSum">
+      <weightedMetrics id="_TzHMgGVXEeK4L53_AeGtGA" name="UtilizationWeight" weight="1.0">
+        <metricType href="metrictypes.perfdatarepo#2"/>
+      </weightedMetrics>
+      <weightedMetrics id="_QKf6YGllEeKYrN0mFHpJCQ" name="ResponseTimeWeight" weight="-2.0">
+        <metricType href="metrictypes.perfdatarepo#3"/>
+      </weightedMetrics>
+    </weightingFunction>
+  </strategies>
+  <strategies id="_Cg--ZYAnEeKW2vVcg5ekRw" name="PULL" objective="_G-ctoKaGEeKsaqdh-1smGw">
+    <triggeringEvents id="_H_MTgIAnEeKW2vVcg5ekRw" name="ScheduledOptimizationEvent"/>
+    <tactics id="_Tk5LUYAnEeKW2vVcg5ekRw" name="RemoveResourcesWeightedTactic" usedTactic="123123" currentWeight="1.0" defaultWeight="1.0"/>
+    <tactics id="_4j5FkaamEeKwhcuIujY6Yw" name="UndoPreviousActionWeightedTactic" usedTactic="_zFC2EaaMEeKdn_E8M08Q_g" currentWeight="0.5" defaultWeight="0.5"/>
+    <weightingFunction id="wf2" name="WeightedSum" weightingFunctionImplementation="edu.kit.ipd.descartes.adaptation.evaluation.performance.weightingfunction.WeightedSum">
+      <weightedMetrics id="_TzHMgGVXEeK4L53_AeGtGA1" name="UtilizationWeight" weight="1.0">
+        <metricType href="metrictypes.perfdatarepo#2"/>
+      </weightedMetrics>
+      <weightedMetrics id="_Fc5YUKanEeKwhcuIujY6Yw" name="ResponseTimeWeight" weight="-2.0">
+        <metricType href="metrictypes.perfdatarepo#3"/>
+      </weightedMetrics>
+    </weightingFunction>
+  </strategies>
+  <parameters name="LoopCounter" type="EInteger" value="1"/>
+  <goal description="Maintain SLAs of all serivces using resources efficiently">
+    <objectives id="_GdVkoKaGEeKsaqdh-1smGw" name="MaintainSLAs">
+      <specifications value="100.0" relationalOperator="LESS_EQUAL">
+        <metricType href="metrictypes.perfdatarepo#3"/>
+      </specifications>
+      <specifications value="300.0" relationalOperator="LESS">
+        <metricType href="metrictypes.perfdatarepo#4"/>
+      </specifications>
+    </objectives>
+    <objectives id="_G-ctoKaGEeKsaqdh-1smGw" name="OptimizeResourceEfficiency">
+      <specifications value="0.4" relationalOperator="GREATER">
+        <metricType href="metrictypes.perfdatarepo#2"/>
+      </specifications>
+      <specifications value="0.85" relationalOperator="LESS">
+        <metricType href="metrictypes.perfdatarepo#2"/>
+      </specifications>
+      <specifications value="100.0" relationalOperator="LESS_EQUAL">
+        <metricType href="metrictypes.perfdatarepo#3"/>
+      </specifications>
+      <specifications value="300.0" relationalOperator="LESS_EQUAL">
+        <metricType href="metrictypes.perfdatarepo#4"/>
+      </specifications>
+    </objectives>
+  </goal>
+</adaptation:AdaptationProcess>
diff --git a/DynamicResourceAllocation_Case_Study/pushpull.staLang b/DynamicResourceAllocation_Case_Study/pushpull.staLang
new file mode 100644
index 0000000..10488df
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/pushpull.staLang
@@ -0,0 +1,64 @@
+AdaptationProcess [id: testID1] {
+	name PushPullAdaptationProcess
+	tactics : 
+			Tactic  [id: tacticID1] {
+			name AddResources 
+			implementedPlan 
+				AdaptationPlan [id: planID1] {
+					name AddResourcesAdaptationPlan
+				}
+			}
+	actions :
+		Action [id:actionID1] {
+			name Add_vCPU
+			referredAdaptationPoint AmountOfvCpus
+			adaptationActionOperation AdaptationActionOperation {
+				adaptationOperationScope AdaptationScope
+				adaptationOperationDirection AdaptationDirection
+			}
+		}
+	strategies :
+		Strategy [id:stratID1] {
+			name PUSH
+			objective MaintainSLAs
+			triggeringEvents
+				Event [id:eventID1] {
+					name SlaViolated
+				}
+			tactics {
+				WeightedTactic [id:wtacID2] {
+					name wTacName1
+					currentWeight 1.4
+					defaultWeight 2.3
+					usedTactic AddResources
+				}
+			}
+			weightingFunction
+				WeightingFunction [id:wFunc1] {
+					name func1Name
+					weightingFunctionImplementation Tempalate
+					weightedMetrics {
+						WeightedMetric [id:metric1] {
+							name wMetric1
+							weight 1.4
+							metricType CV_EJB_AvgResponseTime
+						}
+					}
+				}
+		}
+	goal OverallGoal {
+		description "Maintain SLAs and resource efficiency"
+		objectives :
+			Objective [id:objID1] {
+				name MaintainSLAs
+				specifications :
+					Specification {
+						value 4.3
+						relationalOperator RelationalOperator
+						metricType CV_EJB_AvgResponseTime
+					}
+			}
+	}
+	ImportDeclaration "platform:/resource/Examples/DynamicResourceAllocation_Case_Study/default.adaptationpoints"
+	ImportDeclaration "platform:/resource/Examples/DynamicResourceAllocation_Case_Study/simucomresults.perfdatarepo"
+}
\ No newline at end of file
diff --git a/DynamicResourceAllocation_Case_Study/simucomresults.observationrepo b/DynamicResourceAllocation_Case_Study/simucomresults.observationrepo
new file mode 100644
index 0000000..ae4bbcb
--- /dev/null
+++ b/DynamicResourceAllocation_Case_Study/simucomresults.observationrepo
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="ASCII"?>
+<repository:ObservationRepository xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:domain="http://descartes.ipd.kit.edu/ql/models/mapping/domain/1.0" xmlns:repository="http://descartes.ipd.kit.edu/ql/models/repository/repository/1.0" identifier="SimuCom Performance Results" startTimestamp="2014-06-30T18:13:54.480+0200" latestObservation="//@observations.0" latestImpact="//@impacts.0">
+  <impacts identifier="Impact4" timestamp="2014-06-30T18:13:54.579+0200" before="//@observations.3" after="//@observations.4"/>
+  <impacts identifier="Impact1" timestamp="2014-06-30T18:13:54.580+0200" before="//@observations.0" after="//@observations.1"/>
+  <impacts identifier="Impact2" timestamp="2014-06-30T18:13:54.581+0200" before="//@observations.1" after="//@observations.2"/>
+  <impacts identifier="Impact3" timestamp="2014-06-30T18:13:54.582+0200" before="//@observations.2" after="//@observations.3"/>
+  <impacts identifier="ImpactMi1" timestamp="2014-06-30T18:13:54.584+0200" before="//@observations.5" after="//@observations.6"/>
+  <observations identifier="DefaultSystemState" timestamp="2014-06-30T18:13:54.496+0200">
+    <observation modelLocation="./files/metricObservation.repo" doFModelLocation="">
+      <resources identifier="2" alias="Vm1Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm1Utilization" valid="true" value="0.7" accuracy="1"/>
+      </resources>
+      <services identifier="3" alias="CV_EJB_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="CV_EJB_AvgResponseTime" valid="true" value="150.0" accuracy="1"/>
+      </services>
+      <services identifier="4" alias="Purchase_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="Purchase_AvgResponseTime" valid="true" value="340.0" accuracy="1"/>
+      </services>
+    </observation>
+  </observations>
+  <observations identifier="ResultTactic1" timestamp="2014-06-30T18:13:54.577+0200">
+    <observation modelLocation="./files/metricObservation.repo" doFModelLocation="">
+      <resources identifier="2" alias="Vm1Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm1Utilization" valid="true" value="0.65" accuracy="1"/>
+      </resources>
+      <services identifier="3" alias="CV_EJB_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="CV_EJB_AvgResponseTime" valid="true" value="145.0" accuracy="1"/>
+      </services>
+      <services identifier="4" alias="Purchase_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="Purchase_AvgResponseTime" valid="true" value="330.0" accuracy="1"/>
+      </services>
+    </observation>
+  </observations>
+  <observations identifier="ResultTactic2" timestamp="2014-06-30T18:13:54.579+0200">
+    <observation modelLocation="./files/metricObservation.repo" doFModelLocation="">
+      <resources identifier="2" alias="Vm1Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm1Utilization" valid="true" value="0.6" accuracy="1"/>
+      </resources>
+      <services identifier="3" alias="CV_EJB_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="CV_EJB_AvgResponseTime" valid="true" value="140.0" accuracy="1"/>
+      </services>
+      <services identifier="4" alias="Purchase_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="Purchase_AvgResponseTime" valid="true" value="320.0" accuracy="1"/>
+      </services>
+    </observation>
+  </observations>
+  <observations identifier="ResultTactic3" timestamp="2014-06-30T18:13:54.580+0200">
+    <observation modelLocation="./files/metricObservation.repo" doFModelLocation="">
+      <resources identifier="2" alias="Vm1Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm1Utilization" valid="true" value="0.3" accuracy="1"/>
+      </resources>
+      <services identifier="3" alias="CV_EJB_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="CV_EJB_AvgResponseTime" valid="true" value="100.0" accuracy="1"/>
+      </services>
+      <services identifier="4" alias="Purchase_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="Purchase_AvgResponseTime" valid="true" value="280.0" accuracy="1"/>
+      </services>
+    </observation>
+  </observations>
+  <observations identifier="ResultTactic4" timestamp="2014-06-30T18:13:54.581+0200">
+    <observation modelLocation="./files/metricObservation.repo" doFModelLocation="">
+      <resources identifier="2" alias="Vm1Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm1Utilization" valid="true" value="0.25" accuracy="1"/>
+      </resources>
+      <services identifier="3" alias="CV_EJB_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="CV_EJB_AvgResponseTime" valid="true" value="90.0" accuracy="1"/>
+      </services>
+      <services identifier="4" alias="Purchase_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="Purchase_AvgResponseTime" valid="true" value="260.0" accuracy="1"/>
+      </services>
+    </observation>
+  </observations>
+  <observations identifier="ResultMigration1-1" timestamp="2014-06-30T18:13:54.582+0200">
+    <observation modelLocation="./files/metricObservation.repo" doFModelLocation="">
+      <resources identifier="2" alias="Vm1Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm1Utilization" valid="true" value="0.2" accuracy="1"/>
+      </resources>
+      <resources identifier="22" alias="Vm2Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm2Utilization" valid="true" value="0.2" accuracy="1"/>
+      </resources>
+      <services identifier="3" alias="CV_EJB_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="CV_EJB_AvgResponseTime" valid="true" value="80.0" accuracy="1"/>
+      </services>
+      <services identifier="4" alias="Purchase_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="Purchase_AvgResponseTime" valid="true" value="250.0" accuracy="1"/>
+      </services>
+    </observation>
+  </observations>
+  <observations identifier="ResultMigration1-2" timestamp="2014-06-30T18:13:54.583+0200">
+    <observation modelLocation="./files/metricObservation.repo" doFModelLocation="">
+      <resources identifier="2" alias="Vm1Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm1Utilization" valid="true" value="0.5" accuracy="1"/>
+      </resources>
+      <resources identifier="22" alias="Vm2Utilization">
+        <probes xsi:type="domain:DecimalResult" metricName="Vm2Utilization" valid="true" value="0.0" accuracy="1"/>
+      </resources>
+      <services identifier="3" alias="CV_EJB_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="CV_EJB_AvgResponseTime" valid="true" value="100.0" accuracy="1"/>
+      </services>
+      <services identifier="4" alias="Purchase_AvgResponseTime">
+        <probes xsi:type="domain:DecimalResult" metricName="Purchase_AvgResponseTime" valid="true" value="290.0" accuracy="1"/>
+      </services>
+    </observation>
+  </observations>
+</repository:ObservationRepository>
-- 
GitLab