<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:PSCS.Semantics.StructuredClassifiers="http:///PSCS/Semantics/StructuredClassifiers.ecore" xmlns:UML4CPPProfile="http://www.tu-ilmenau.de/sse/UML4CPPProfile" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///PSCS/Semantics/StructuredClassifiers.ecore ../../../../common/PSCSStrategiesProfile/model/PSCSStrategiesProfile.uml#_LGsZjQV9EeyhaZlTpg_vvA http://www.tu-ilmenau.de/sse/UML4CPPProfile ../../../../common/UML4CPPProfile/model/UML4CPPProfile.uml#_v75nIfp7EeuavpF89IQaUg">
  <uml:Model xmi:id="_v_ZkcB0UEeyVwfCVnFKaMw" name="LoadBalance">
    <packageImport xmi:id="_PHjl4B0uEeyVwfCVnFKaMw">
      <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
    </packageImport>
    <packagedElement xmi:type="uml:Class" xmi:id="_1WXpIB0UEeyVwfCVnFKaMw" name="System" visibility="public">
      <ownedAttribute xmi:id="_74ys8h0XEeyVwfCVnFKaMw" name="client" visibility="private" type="_UyVgwB0VEeyVwfCVnFKaMw" aggregation="composite" association="_74xe0B0XEeyVwfCVnFKaMw"/>
      <ownedAttribute xmi:id="_ukyDwB0YEeyVwfCVnFKaMw" name="server" visibility="private" type="_dbZBQB0VEeyVwfCVnFKaMw" aggregation="composite" association="_YC-qwB0YEeyVwfCVnFKaMw"/>
      <ownedAttribute xmi:id="_xlzkwB0YEeyVwfCVnFKaMw" name="services" visibility="private" type="_jaO-QB0VEeyVwfCVnFKaMw" aggregation="composite" association="_gNTA0B0YEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_XqZZYB0dEeyVwfCVnFKaMw" value="50"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_YLf7UB0dEeyVwfCVnFKaMw" value="*"/>
      </ownedAttribute>
      <ownedConnector xmi:id="_mORH8B0cEeyVwfCVnFKaMw" name="serverOutPort_clientInPort_connector" type="_4L_cUB0dEeyVwfCVnFKaMw">
        <end xmi:id="_mORvAB0cEeyVwfCVnFKaMw" partWithPort="_74ys8h0XEeyVwfCVnFKaMw" role="_uHmRIB0bEeyVwfCVnFKaMw">
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_Pgi1EB7YEey0lspuV7FEyA" value="1"/>
        </end>
        <end xmi:id="_mORvAR0cEeyVwfCVnFKaMw" partWithPort="_ukyDwB0YEeyVwfCVnFKaMw" role="_QHfeEB0cEeyVwfCVnFKaMw"/>
      </ownedConnector>
      <ownedConnector xmi:id="_Rm8-UB0fEeyVwfCVnFKaMw" name="serverOutPort_serviceInPort_connector" type="_L6xCIB0gEeyVwfCVnFKaMw">
        <end xmi:id="_Rm8-UR0fEeyVwfCVnFKaMw" partWithPort="_ukyDwB0YEeyVwfCVnFKaMw" role="_KjCPoB0fEeyVwfCVnFKaMw">
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_NZo-cB0hEeyVwfCVnFKaMw" value="1"/>
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_NCS1cB0hEeyVwfCVnFKaMw" value="1"/>
        </end>
        <end xmi:id="_Rm8-Uh0fEeyVwfCVnFKaMw" partWithPort="_xlzkwB0YEeyVwfCVnFKaMw" role="_zrGIMB0WEeyVwfCVnFKaMw">
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_cKbd8B08EeyVwfCVnFKaMw" value="50"/>
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_cZ75kB08EeyVwfCVnFKaMw" value="*"/>
        </end>
      </ownedConnector>
    </packagedElement>
    <packagedElement xmi:type="uml:Class" xmi:id="_UyVgwB0VEeyVwfCVnFKaMw" name="Client" visibility="public">
      <ownedAttribute xmi:type="uml:Port" xmi:id="_uHmRIB0bEeyVwfCVnFKaMw" name="toServer" visibility="private" type="_FxqIIB0bEeyVwfCVnFKaMw" aggregation="composite" association="__0HysB0aEeyVwfCVnFKaMw"/>
      <ownedAttribute xmi:id="_K06zYB0rEeyVwfCVnFKaMw" name="requestRate" visibility="private">
        <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
        <defaultValue xmi:type="uml:LiteralReal" xmi:id="_21JsYB9mEey1n4qdAQDPqA" visibility="private" value="10.0"/>
      </ownedAttribute>
      <ownedAttribute xmi:id="_vc3tEB0-EeyVwfCVnFKaMw" name="active" visibility="private">
        <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        <defaultValue xmi:type="uml:LiteralBoolean" xmi:id="_-YC2EB9mEey1n4qdAQDPqA"/>
      </ownedAttribute>
      <ownedAttribute xmi:id="_DrvPwDDrEey7TNnLgCvVMg" name="requestCounter" visibility="private">
        <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
        <defaultValue xmi:type="uml:LiteralInteger" xmi:id="_J_EPADDrEey7TNnLgCvVMg"/>
      </ownedAttribute>
      <ownedBehavior xmi:type="uml:Activity" xmi:id="_ocnM0B0yEeyVwfCVnFKaMw" name="act_work" specification="_uBI3QB0wEeyVwfCVnFKaMw" node="_qG4WQB0yEeyVwfCVnFKaMw _2T4doB09EeyVwfCVnFKaMw _EEBzwB0-EeyVwfCVnFKaMw _KWIrAB0-EeyVwfCVnFKaMw _4Ai-UB0-EeyVwfCVnFKaMw _DI_SYB0_EeyVwfCVnFKaMw _MvOM0B0_EeyVwfCVnFKaMw">
        <edge xmi:type="uml:ControlFlow" xmi:id="_FpzewB0-EeyVwfCVnFKaMw" target="_EEBzwB0-EeyVwfCVnFKaMw" source="_qG4WQB0yEeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_Fp0s4B0-EeyVwfCVnFKaMw" name="Initial1_To_Merge1_guard" value="true"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_Fp1T8B0-EeyVwfCVnFKaMw" name="Initial1_To_Merge1_weight"/>
        </edge>
        <edge xmi:type="uml:ControlFlow" xmi:id="_Gp30oB0-EeyVwfCVnFKaMw" target="_2T4doB09EeyVwfCVnFKaMw" source="_EEBzwB0-EeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_Gp4bsB0-EeyVwfCVnFKaMw" name="Merge1_To_wait_guard" value="true"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_Gp4bsR0-EeyVwfCVnFKaMw" name="Merge1_To_wait_weight"/>
        </edge>
        <edge xmi:type="uml:ControlFlow" xmi:id="_a36bQB0-EeyVwfCVnFKaMw" target="_KWIrAB0-EeyVwfCVnFKaMw" source="_2T4doB09EeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_a36bQR0-EeyVwfCVnFKaMw" name="wait_To_request_guard" value="true"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_a37CUB0-EeyVwfCVnFKaMw" name="wait_To_request_weight"/>
        </edge>
        <edge xmi:type="uml:ControlFlow" xmi:id="_CKFaIB0_EeyVwfCVnFKaMw" target="_4Ai-UB0-EeyVwfCVnFKaMw" source="_KWIrAB0-EeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_CKFaIR0_EeyVwfCVnFKaMw" name="request_To_ReadStructuralFeatureAction1_guard" value="true"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_CKGBMB0_EeyVwfCVnFKaMw" name="request_To_ReadStructuralFeatureAction1_weight"/>
        </edge>
        <edge xmi:type="uml:ObjectFlow" xmi:id="_FGF4QB0_EeyVwfCVnFKaMw" target="_DI_SYB0_EeyVwfCVnFKaMw" source="_4AjlYR0-EeyVwfCVnFKaMw"/>
        <edge xmi:type="uml:ControlFlow" xmi:id="_HlJ7sB0_EeyVwfCVnFKaMw" target="_EEBzwB0-EeyVwfCVnFKaMw" source="_DI_SYB0_EeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_HlJ7sR0_EeyVwfCVnFKaMw" name="Decision1_To_Merge1_guard" value="true"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_HlJ7sh0_EeyVwfCVnFKaMw" name="Decision1_To_Merge1_weight"/>
        </edge>
        <edge xmi:type="uml:ControlFlow" xmi:id="_Q4KYIB0_EeyVwfCVnFKaMw" target="_MvOM0B0_EeyVwfCVnFKaMw" source="_DI_SYB0_EeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_Q4KYIR0_EeyVwfCVnFKaMw" name="Decision1_To_ActivityFinal1_guard"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_Q4KYIh0_EeyVwfCVnFKaMw" name="Decision1_To_ActivityFinal1_weight"/>
        </edge>
        <node xmi:type="uml:InitialNode" xmi:id="_qG4WQB0yEeyVwfCVnFKaMw" name="Initial1" outgoing="_FpzewB0-EeyVwfCVnFKaMw"/>
        <node xmi:type="uml:CallOperationAction" xmi:id="_2T4doB09EeyVwfCVnFKaMw" name="call_Wait" incoming="_Gp30oB0-EeyVwfCVnFKaMw" outgoing="_a36bQB0-EeyVwfCVnFKaMw" operation="_9wbuwB09EeyVwfCVnFKaMw">
          <target xmi:id="_2T5EsB09EeyVwfCVnFKaMw" name="self" type="_UyVgwB0VEeyVwfCVnFKaMw"/>
        </node>
        <node xmi:type="uml:MergeNode" xmi:id="_EEBzwB0-EeyVwfCVnFKaMw" name="Merge1" incoming="_FpzewB0-EeyVwfCVnFKaMw _HlJ7sB0_EeyVwfCVnFKaMw" outgoing="_Gp30oB0-EeyVwfCVnFKaMw"/>
        <node xmi:type="uml:CallOperationAction" xmi:id="_KWIrAB0-EeyVwfCVnFKaMw" name="call_request" incoming="_a36bQB0-EeyVwfCVnFKaMw" outgoing="_CKFaIB0_EeyVwfCVnFKaMw" onPort="_uHmRIB0bEeyVwfCVnFKaMw" operation="_BVpN0B0xEeyVwfCVnFKaMw">
          <target xmi:id="_KWJSEB0-EeyVwfCVnFKaMw" name="self" type="_UyVgwB0VEeyVwfCVnFKaMw"/>
        </node>
        <node xmi:type="uml:ReadStructuralFeatureAction" xmi:id="_4Ai-UB0-EeyVwfCVnFKaMw" name="isActive" incoming="_CKFaIB0_EeyVwfCVnFKaMw" structuralFeature="_vc3tEB0-EeyVwfCVnFKaMw">
          <object xmi:id="_4AjlYB0-EeyVwfCVnFKaMw" name="self"/>
          <result xmi:id="_4AjlYR0-EeyVwfCVnFKaMw" name="active" outgoing="_FGF4QB0_EeyVwfCVnFKaMw">
            <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
          </result>
        </node>
        <node xmi:type="uml:DecisionNode" xmi:id="_DI_SYB0_EeyVwfCVnFKaMw" name="Decision1" incoming="_FGF4QB0_EeyVwfCVnFKaMw" outgoing="_HlJ7sB0_EeyVwfCVnFKaMw _Q4KYIB0_EeyVwfCVnFKaMw"/>
        <node xmi:type="uml:ActivityFinalNode" xmi:id="_MvOM0B0_EeyVwfCVnFKaMw" name="ActivityFinal1" incoming="_Q4KYIB0_EeyVwfCVnFKaMw"/>
      </ownedBehavior>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_EmbXMB0zEeyVwfCVnFKaMw" name="ob_wait" specification="_9wbuwB09EeyVwfCVnFKaMw">
        <language>INCLUDE</language>
        <language>CPP</language>
        <body>#include &lt;random>&#xD;
#include &lt;thread>&#xD;
#include &lt;chrono></body>
        <body>std::mt19937 generator(std::chrono::high_resolution_clock::now().time_since_epoch().count());&#xD;
std::exponential_distribution&lt;> dist(this->getRequestRate());&#xD;
&#xD;
unsigned int waitTime = dist(generator) * 1000;	//*1000 for milliseconds&#xD;
//std::cout&lt;&lt;waitTime&lt;&lt;std::endl;&#xD;
std::this_thread::sleep_for(std::chrono::milliseconds(waitTime));&#xD;
&#xD;
m_requestCounter++;&#xD;
</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_uBI3QB0wEeyVwfCVnFKaMw" name="work" visibility="public" method="_ocnM0B0yEeyVwfCVnFKaMw"/>
      <ownedOperation xmi:id="_BVpN0B0xEeyVwfCVnFKaMw" name="request" visibility="public"/>
      <ownedOperation xmi:id="_9wbuwB09EeyVwfCVnFKaMw" name="wait" visibility="public" method="_EmbXMB0zEeyVwfCVnFKaMw"/>
    </packagedElement>
    <packagedElement xmi:type="uml:Class" xmi:id="_dbZBQB0VEeyVwfCVnFKaMw" name="Server" visibility="public">
      <ownedAttribute xmi:type="uml:Port" xmi:id="_QHfeEB0cEeyVwfCVnFKaMw" name="fromClient" visibility="private" type="_bUJ1sB0aEeyVwfCVnFKaMw" aggregation="composite" association="_eQpmkB0bEeyVwfCVnFKaMw" isBehavior="true"/>
      <ownedAttribute xmi:type="uml:Port" xmi:id="_KjCPoB0fEeyVwfCVnFKaMw" name="toService" visibility="private" type="_e5wGkB0eEeyVwfCVnFKaMw" aggregation="composite" association="_xCueIB0eEeyVwfCVnFKaMw"/>
      <ownedBehavior xmi:type="uml:Activity" xmi:id="_ht3UgB1AEeyVwfCVnFKaMw" name="act_request" specification="_FsDp4B0wEeyVwfCVnFKaMw" node="_kDmc0B1AEeyVwfCVnFKaMw _l-n_EB1AEeyVwfCVnFKaMw _va8vkB1AEeyVwfCVnFKaMw">
        <edge xmi:type="uml:ControlFlow" xmi:id="_uXl1IB1AEeyVwfCVnFKaMw" target="_l-n_EB1AEeyVwfCVnFKaMw" source="_kDmc0B1AEeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_uXmcMB1AEeyVwfCVnFKaMw" name="Initial1_To_call_do_guard" value="true"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_uXmcMR1AEeyVwfCVnFKaMw" name="Initial1_To_call_do_weight"/>
        </edge>
        <edge xmi:type="uml:ControlFlow" xmi:id="_wftYMB1AEeyVwfCVnFKaMw" target="_va8vkB1AEeyVwfCVnFKaMw" source="_l-n_EB1AEeyVwfCVnFKaMw">
          <guard xmi:type="uml:LiteralBoolean" xmi:id="_wft_QB1AEeyVwfCVnFKaMw" name="call_do_To_ActivityFinal1_guard" value="true"/>
          <weight xmi:type="uml:LiteralInteger" xmi:id="_wft_QR1AEeyVwfCVnFKaMw" name="call_do_To_ActivityFinal1_weight"/>
        </edge>
        <node xmi:type="uml:InitialNode" xmi:id="_kDmc0B1AEeyVwfCVnFKaMw" name="Initial1" outgoing="_uXl1IB1AEeyVwfCVnFKaMw"/>
        <node xmi:type="uml:CallOperationAction" xmi:id="_l-n_EB1AEeyVwfCVnFKaMw" name="call_process" incoming="_uXl1IB1AEeyVwfCVnFKaMw" outgoing="_wftYMB1AEeyVwfCVnFKaMw" onPort="_KjCPoB0fEeyVwfCVnFKaMw" operation="_D6H8wB0xEeyVwfCVnFKaMw">
          <target xmi:id="_l-n_ER1AEeyVwfCVnFKaMw" name="self" type="_dbZBQB0VEeyVwfCVnFKaMw"/>
        </node>
        <node xmi:type="uml:ActivityFinalNode" xmi:id="_va8vkB1AEeyVwfCVnFKaMw" name="ActivityFinal1" incoming="_wftYMB1AEeyVwfCVnFKaMw"/>
      </ownedBehavior>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_VGn1QB1CEeyVwfCVnFKaMw" name="ob_getLoad" specification="_1_LcIB1BEeyVwfCVnFKaMw">
        <ownedParameter xmi:id="_v45k8B1CEeyVwfCVnFKaMw" name="load" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
        </ownedParameter>
        <language>INCLUDE</language>
        <language>CPP</language>
        <body>#include &quot;LoadBalance/ServiceResponsePort.hpp&quot;</body>
        <body>unsigned int numberOfServices = this->getToService()->getServicePorts()->size();&#xD;
unsigned int numberOfBusyServices = 0;&#xD;
&#xD;
for(unsigned int i = 0; i &lt; numberOfServices; i++)&#xD;
{&#xD;
	if( this->getToService()->getServicePorts()->at(i)->isBusy()) numberOfBusyServices++;&#xD;
}&#xD;
&#xD;
load = ((float)numberOfBusyServices/numberOfServices) * 100;</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_FsDp4B0wEeyVwfCVnFKaMw" name="request" visibility="public" method="_ht3UgB1AEeyVwfCVnFKaMw"/>
      <ownedOperation xmi:id="_D6H8wB0xEeyVwfCVnFKaMw" name="process" visibility="public"/>
      <ownedOperation xmi:id="_1_LcIB1BEeyVwfCVnFKaMw" name="getLoad" visibility="public" method="_VGn1QB1CEeyVwfCVnFKaMw">
        <ownedParameter xmi:id="_GMZRoB1CEeyVwfCVnFKaMw" name="load" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
        </ownedParameter>
      </ownedOperation>
    </packagedElement>
    <packagedElement xmi:type="uml:Class" xmi:id="_jaO-QB0VEeyVwfCVnFKaMw" name="Service" visibility="public">
      <ownedAttribute xmi:type="uml:Port" xmi:id="_zrGIMB0WEeyVwfCVnFKaMw" name="fromServer" visibility="private" type="_2TyIEB0eEeyVwfCVnFKaMw" aggregation="composite" association="_BG8IoB0fEeyVwfCVnFKaMw" isBehavior="true">
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_kWXkoB08EeyVwfCVnFKaMw" value="*"/>
      </ownedAttribute>
      <ownedAttribute xmi:id="_q0u-8B0rEeyVwfCVnFKaMw" name="serviceRate" visibility="private">
        <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
        <defaultValue xmi:type="uml:LiteralReal" xmi:id="_rZi00B0uEeyVwfCVnFKaMw" value="1.0"/>
      </ownedAttribute>
      <ownedAttribute xmi:id="_JjQP0B0uEeyVwfCVnFKaMw" name="busy" visibility="private">
        <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        <defaultValue xmi:type="uml:LiteralBoolean" xmi:id="_KFeV0DDnEey7TNnLgCvVMg"/>
      </ownedAttribute>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_VHB6YB1BEeyVwfCVnFKaMw" name="ob_process" specification="_alXtAB0uEeyVwfCVnFKaMw">
        <language>CPP</language>
        <body>this->setBusy(true);&#xD;
std::thread t(&amp;Service::wait, this);&#xD;
t.detach();&#xD;
</body>
      </ownedBehavior>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_nvFesB7CEey0lspuV7FEyA" name="ob_wait" specification="_mQKCkB7CEey0lspuV7FEyA">
        <language>INCLUDE</language>
        <language>CPP</language>
        <body>#include &lt;random>&#xD;
#include &lt;thread>&#xD;
#include &lt;chrono></body>
        <body>std::mt19937 generator(std::chrono::high_resolution_clock::now().time_since_epoch().count());&#xD;
std::exponential_distribution&lt;> dist(this->getServiceRate());&#xD;
&#xD;
unsigned int waitTime = dist(generator) * 1000;	//*1000 for milliseconds&#xD;
&#xD;
std::this_thread::sleep_for(std::chrono::milliseconds(waitTime));&#xD;
&#xD;
this->setBusy(false);</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_alXtAB0uEeyVwfCVnFKaMw" name="process" visibility="public" method="_VHB6YB1BEeyVwfCVnFKaMw"/>
      <ownedOperation xmi:id="_mQKCkB7CEey0lspuV7FEyA" name="wait" visibility="public" method="_nvFesB7CEey0lspuV7FEyA"/>
    </packagedElement>
    <packagedElement xmi:type="uml:Interface" xmi:id="_zJ1pwB7NEey0lspuV7FEyA" name="GenericPortInterface" visibility="public">
      <ownedOperation xmi:id="_MtsegB7OEey0lspuV7FEyA" name="isBusy" visibility="public" isAbstract="true">
        <ownedParameter xmi:id="_QBzTkB7OEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
      </ownedOperation>
    </packagedElement>
    <packagedElement xmi:type="uml:Class" xmi:id="_FxqIIB0bEeyVwfCVnFKaMw" name="ClientRequestPort" visibility="public">
      <ownedAttribute xmi:id="_4L_cVB0dEeyVwfCVnFKaMw" name="serverResponsePort" visibility="private" type="_bUJ1sB0aEeyVwfCVnFKaMw" association="_4L_cUB0dEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_4L_cVR0dEeyVwfCVnFKaMw" value="1"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_4L_cVh0dEeyVwfCVnFKaMw" value="1"/>
      </ownedAttribute>
      <ownedAttribute xmi:id="__0IZwB0aEeyVwfCVnFKaMw" name="client" visibility="private" type="_UyVgwB0VEeyVwfCVnFKaMw" association="__0HysB0aEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="__0IZwR0aEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__0IZwh0aEeyVwfCVnFKaMw" value="1"/>
      </ownedAttribute>
      <interfaceRealization xmi:id="_CZwwkB7OEey0lspuV7FEyA" client="_FxqIIB0bEeyVwfCVnFKaMw" supplier="_zJ1pwB7NEey0lspuV7FEyA" contract="_zJ1pwB7NEey0lspuV7FEyA"/>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_CoJjIB7UEey0lspuV7FEyA" name="ob_isBusy" specification="_cGPV0B7OEey0lspuV7FEyA">
        <ownedParameter xmi:id="_CoJjIR7UEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
        <language>CPP</language>
        <body>busy = false;</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_cGPV0B7OEey0lspuV7FEyA" name="isBusy" visibility="public" method="_CoJjIB7UEey0lspuV7FEyA">
        <ownedParameter xmi:id="_cGPV0R7OEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
      </ownedOperation>
    </packagedElement>
    <packagedElement xmi:type="uml:Interface" xmi:id="_2E1cMB0VEeyVwfCVnFKaMw" name="ClientServerInterface" visibility="public">
      <ownedOperation xmi:id="_YQBw0B0vEeyVwfCVnFKaMw" name="request" visibility="public" isAbstract="true"/>
    </packagedElement>
    <packagedElement xmi:type="uml:Class" xmi:id="_bUJ1sB0aEeyVwfCVnFKaMw" name="ServerResponsePort" visibility="public">
      <ownedAttribute xmi:id="_4L_cUR0dEeyVwfCVnFKaMw" name="clientRequestPort" visibility="private" type="_FxqIIB0bEeyVwfCVnFKaMw" association="_4L_cUB0dEeyVwfCVnFKaMw"/>
      <ownedAttribute xmi:id="_eQqNoB0bEeyVwfCVnFKaMw" name="server" visibility="private" type="_dbZBQB0VEeyVwfCVnFKaMw" association="_eQpmkB0bEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_eQrbwB0bEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_eQsC0B0bEeyVwfCVnFKaMw" value="1"/>
      </ownedAttribute>
      <interfaceRealization xmi:id="_jStnsB0aEeyVwfCVnFKaMw" client="_bUJ1sB0aEeyVwfCVnFKaMw" supplier="_2E1cMB0VEeyVwfCVnFKaMw" contract="_2E1cMB0VEeyVwfCVnFKaMw"/>
      <interfaceRealization xmi:id="_GqrzMB7OEey0lspuV7FEyA" client="_bUJ1sB0aEeyVwfCVnFKaMw" supplier="_zJ1pwB7NEey0lspuV7FEyA" contract="_zJ1pwB7NEey0lspuV7FEyA"/>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_hD2fUB7OEey0lspuV7FEyA" name="ob_isBusy" specification="_eoNjUB7OEey0lspuV7FEyA">
        <ownedParameter xmi:id="_i2lBMB7OEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
        <language>CPP</language>
        <body>busy = false;</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_buNH4B0vEeyVwfCVnFKaMw" name="request" visibility="public"/>
      <ownedOperation xmi:id="_eoNjUB7OEey0lspuV7FEyA" name="isBusy" visibility="public" method="_hD2fUB7OEey0lspuV7FEyA">
        <ownedParameter xmi:id="_eoNjUR7OEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
      </ownedOperation>
    </packagedElement>
    <packagedElement xmi:type="uml:Class" xmi:id="_e5wGkB0eEeyVwfCVnFKaMw" name="ServerRequestPort" visibility="public">
      <ownedAttribute xmi:id="_L6xCJB0gEeyVwfCVnFKaMw" name="servicePorts" visibility="private" type="_2TyIEB0eEeyVwfCVnFKaMw" association="_L6xCIB0gEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_L6xCJR0gEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_L6xCJh0gEeyVwfCVnFKaMw" value="*"/>
      </ownedAttribute>
      <ownedAttribute xmi:id="_xCvFMB0eEeyVwfCVnFKaMw" name="server" visibility="private" type="_dbZBQB0VEeyVwfCVnFKaMw" association="_xCueIB0eEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_xCvFMR0eEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_xCvFMh0eEeyVwfCVnFKaMw" value="1"/>
      </ownedAttribute>
      <interfaceRealization xmi:id="_HkJx0B7OEey0lspuV7FEyA" client="_e5wGkB0eEeyVwfCVnFKaMw" supplier="_zJ1pwB7NEey0lspuV7FEyA" contract="_zJ1pwB7NEey0lspuV7FEyA"/>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_8ce1oB7UEey0lspuV7FEyA" name="ob_isBusy" specification="_oaIJUh7OEey0lspuV7FEyA">
        <ownedParameter xmi:id="_8ce1oR7UEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
        <language>CPP</language>
        <body>busy = false;</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_oaIJUh7OEey0lspuV7FEyA" name="isBusy" visibility="public" method="_8ce1oB7UEey0lspuV7FEyA">
        <ownedParameter xmi:id="_oaIJUx7OEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
      </ownedOperation>
    </packagedElement>
    <packagedElement xmi:type="uml:Interface" xmi:id="_yKIEsB0WEeyVwfCVnFKaMw" name="ServerServiceInterface" visibility="public">
      <ownedOperation xmi:id="_L06T8B0vEeyVwfCVnFKaMw" name="process" visibility="public" isAbstract="true"/>
    </packagedElement>
    <packagedElement xmi:type="uml:Class" xmi:id="_2TyIEB0eEeyVwfCVnFKaMw" name="ServiceResponsePort" visibility="public">
      <ownedAttribute xmi:id="_L6xCIR0gEeyVwfCVnFKaMw" name="serverRequestPort" visibility="private" type="_e5wGkB0eEeyVwfCVnFKaMw" association="_L6xCIB0gEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_L6xCIh0gEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_L6xCIx0gEeyVwfCVnFKaMw" value="1"/>
      </ownedAttribute>
      <ownedAttribute xmi:id="_BG8IoR0fEeyVwfCVnFKaMw" name="service" visibility="private" type="_jaO-QB0VEeyVwfCVnFKaMw" association="_BG8IoB0fEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_BG8Ioh0fEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_BG8Iox0fEeyVwfCVnFKaMw" value="1"/>
      </ownedAttribute>
      <interfaceRealization xmi:id="_8HUM8B0eEeyVwfCVnFKaMw" client="_2TyIEB0eEeyVwfCVnFKaMw" supplier="_yKIEsB0WEeyVwfCVnFKaMw" contract="_yKIEsB0WEeyVwfCVnFKaMw"/>
      <interfaceRealization xmi:id="_MLzSYB7OEey0lspuV7FEyA" client="_2TyIEB0eEeyVwfCVnFKaMw" supplier="_zJ1pwB7NEey0lspuV7FEyA" contract="_zJ1pwB7NEey0lspuV7FEyA"/>
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_qert8B7BEey0lspuV7FEyA" name="ob_isBusy" specification="_lsdVEB7BEey0lspuV7FEyA">
        <ownedParameter xmi:id="_r5opAB7BEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
        <language>CPP</language>
        <body>busy = this->m_service.lock()->isBusy();</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_NMd8wB0vEeyVwfCVnFKaMw" name="process" visibility="public"/>
      <ownedOperation xmi:id="_lsdVEB7BEey0lspuV7FEyA" name="isBusy" visibility="public" method="_qert8B7BEey0lspuV7FEyA">
        <ownedParameter xmi:id="_m6OvwB7BEey0lspuV7FEyA" name="busy" direction="return">
          <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
        </ownedParameter>
      </ownedOperation>
    </packagedElement>
    <packagedElement xmi:type="uml:Association" xmi:id="_74xe0B0XEeyVwfCVnFKaMw" memberEnd="_74yF4B0XEeyVwfCVnFKaMw _74ys8h0XEeyVwfCVnFKaMw">
      <ownedEnd xmi:id="_74yF4B0XEeyVwfCVnFKaMw" name="system" type="_1WXpIB0UEeyVwfCVnFKaMw" association="_74xe0B0XEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_74ys8B0XEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_74ys8R0XEeyVwfCVnFKaMw" value="1"/>
      </ownedEnd>
    </packagedElement>
    <packagedElement xmi:type="uml:Association" xmi:id="_YC-qwB0YEeyVwfCVnFKaMw" name="" memberEnd="_YC-qwR0YEeyVwfCVnFKaMw _ukyDwB0YEeyVwfCVnFKaMw">
      <ownedEnd xmi:id="_YC-qwR0YEeyVwfCVnFKaMw" name="system" type="_1WXpIB0UEeyVwfCVnFKaMw" association="_YC-qwB0YEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_YC_R0B0YEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_YC_R0R0YEeyVwfCVnFKaMw" value="1"/>
      </ownedEnd>
    </packagedElement>
    <packagedElement xmi:type="uml:Association" xmi:id="_gNTA0B0YEeyVwfCVnFKaMw" name="" memberEnd="_gNTA0R0YEeyVwfCVnFKaMw _xlzkwB0YEeyVwfCVnFKaMw">
      <ownedEnd xmi:id="_gNTA0R0YEeyVwfCVnFKaMw" name="system" type="_1WXpIB0UEeyVwfCVnFKaMw" association="_gNTA0B0YEeyVwfCVnFKaMw">
        <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_gNTA0h0YEeyVwfCVnFKaMw"/>
        <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_gNTn4B0YEeyVwfCVnFKaMw" value="1"/>
      </ownedEnd>
    </packagedElement>
    <packagedElement xmi:type="uml:Association" xmi:id="__0HysB0aEeyVwfCVnFKaMw" memberEnd="__0IZwB0aEeyVwfCVnFKaMw _uHmRIB0bEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Usage" xmi:id="_Ms8fQB0bEeyVwfCVnFKaMw" client="_FxqIIB0bEeyVwfCVnFKaMw" supplier="_2E1cMB0VEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Association" xmi:id="_eQpmkB0bEeyVwfCVnFKaMw" memberEnd="_eQqNoB0bEeyVwfCVnFKaMw _QHfeEB0cEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Association" xmi:id="_4L_cUB0dEeyVwfCVnFKaMw" name="clientPortToClientServerPort" memberEnd="_4L_cUR0dEeyVwfCVnFKaMw _4L_cVB0dEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Usage" xmi:id="_vFnRMB0eEeyVwfCVnFKaMw" client="_e5wGkB0eEeyVwfCVnFKaMw" supplier="_yKIEsB0WEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Association" xmi:id="_xCueIB0eEeyVwfCVnFKaMw" name="" memberEnd="_xCvFMB0eEeyVwfCVnFKaMw _KjCPoB0fEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Association" xmi:id="_BG8IoB0fEeyVwfCVnFKaMw" memberEnd="_BG8IoR0fEeyVwfCVnFKaMw _zrGIMB0WEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Association" xmi:id="_L6xCIB0gEeyVwfCVnFKaMw" name="serverPortToServerServicePort" memberEnd="_L6xCIR0gEeyVwfCVnFKaMw _L6xCJB0gEeyVwfCVnFKaMw"/>
    <packagedElement xmi:type="uml:Class" xmi:id="_UlRJwB1EEeyVwfCVnFKaMw" name="OrderedRequestPropagationStategy">
      <ownedBehavior xmi:type="uml:OpaqueBehavior" xmi:id="_9C09sB1EEeyVwfCVnFKaMw" name="ob_select" specification="_3wp5cB1EEeyVwfCVnFKaMw">
        <ownedParameter xmi:id="__ZU7AB1EEeyVwfCVnFKaMw" name="potentialTargets">
          <type xmi:type="uml:Class" href="../../../../common/fUMLStrategiesProfile/model/fUMLStrategiesProfile.uml#_Q9EbIAV2EeyhaZlTpg_vvA"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="__ZU7AR1EEeyVwfCVnFKaMw"/>
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__ZU7Ah1EEeyVwfCVnFKaMw" value="*"/>
        </ownedParameter>
        <ownedParameter xmi:id="__ZViEB1EEeyVwfCVnFKaMw" name="context">
          <type xmi:type="uml:Class" href="../../../../common/fUMLStrategiesProfile/model/fUMLStrategiesProfile.uml#_UwwvMAV2EeyhaZlTpg_vvA"/>
        </ownedParameter>
        <ownedParameter xmi:id="__ZViER1EEeyVwfCVnFKaMw" name="selectedTargets" direction="return">
          <type xmi:type="uml:Class" href="../../../../common/fUMLStrategiesProfile/model/fUMLStrategiesProfile.uml#_Q9EbIAV2EeyhaZlTpg_vvA"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="__ZViEh1EEeyVwfCVnFKaMw"/>
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="__ZViEx1EEeyVwfCVnFKaMw" value="*"/>
        </ownedParameter>
        <language>INCLUDE</language>
        <language>CPP</language>
        <body>#include &quot;LoadBalance/GenericPortInterface.hpp&quot;&#xD;
#include &quot;LoadBalanceExec/GenericPortInterfaceObject.hpp&quot;</body>
        <body>bool targetSelected = false;&#xD;
unsigned int index = 0;&#xD;
&#xD;
Bag&lt;fUML::Semantics::StructuredClassifiers::Reference>::iterator iter = potentialTargets->begin();&#xD;
Bag&lt;fUML::Semantics::StructuredClassifiers::Reference>::iterator end = potentialTargets->end();&#xD;
while (iter != end &amp;&amp; !targetSelected)&#xD;
{&#xD;
	std::shared_ptr&lt;LoadBalance::GenericPortInterfaceObject> genericPortObject = &#xD;
		std::dynamic_pointer_cast&lt;LoadBalance::GenericPortInterfaceObject>((*iter)->getReferent());&#xD;
		&#xD;
	if(genericPortObject)&#xD;
	{&#xD;
		if(!genericPortObject->getGenericPortInterfaceValue()->isBusy())&#xD;
		{&#xD;
			selectedTargets->add(*iter);&#xD;
			targetSelected = true;&#xD;
		}&#xD;
	}&#xD;
	iter++;&#xD;
	index++;&#xD;
}</body>
      </ownedBehavior>
      <ownedOperation xmi:id="_3wp5cB1EEeyVwfCVnFKaMw" name="select" method="_9C09sB1EEeyVwfCVnFKaMw">
        <ownedParameter xmi:id="_3wp5cR1EEeyVwfCVnFKaMw" name="potentialTargets">
          <type xmi:type="uml:Class" href="../../../../common/fUMLStrategiesProfile/model/fUMLStrategiesProfile.uml#_Q9EbIAV2EeyhaZlTpg_vvA"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_3wp5ch1EEeyVwfCVnFKaMw"/>
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_3wp5cx1EEeyVwfCVnFKaMw" value="*"/>
        </ownedParameter>
        <ownedParameter xmi:id="_3wp5dB1EEeyVwfCVnFKaMw" name="context">
          <type xmi:type="uml:Class" href="../../../../common/fUMLStrategiesProfile/model/fUMLStrategiesProfile.uml#_UwwvMAV2EeyhaZlTpg_vvA"/>
        </ownedParameter>
        <ownedParameter xmi:id="_3wp5dR1EEeyVwfCVnFKaMw" name="selectedTargets" direction="return">
          <type xmi:type="uml:Class" href="../../../../common/fUMLStrategiesProfile/model/fUMLStrategiesProfile.uml#_Q9EbIAV2EeyhaZlTpg_vvA"/>
          <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_3wp5dh1EEeyVwfCVnFKaMw"/>
          <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_3wp5dx1EEeyVwfCVnFKaMw" value="*"/>
        </ownedParameter>
      </ownedOperation>
    </packagedElement>
    <packagedElement xmi:type="uml:OpaqueBehavior" xmi:id="_44-lsB0_EeyVwfCVnFKaMw" name="main">
      <language>INCLUDE</language>
      <language>CPP</language>
      <body>#include &lt;string>&#xD;
#include &lt;sstream>&#xD;
#include &lt;chrono>&#xD;
#include &lt;thread>&#xD;
#include &lt;list>&#xD;
#include &lt;fstream></body>
      <body>std::cout&lt;&lt;&quot;----------------------------------------\n&quot;;&#xD;
std::cout&lt;&lt;&quot;| Running PSCS Load Balance simulation |\n&quot;;&#xD;
std::cout&lt;&lt;&quot;----------------------------------------\n&quot;;&#xD;
std::cout&lt;&lt;&quot;#Clients: 1\n&quot;;&#xD;
std::cout&lt;&lt;&quot;#Services: 50\n&quot;;&#xD;
&#xD;
/*&#xD;
 * Read in request rate and service rate&#xD;
 */&#xD;
std::string input;&#xD;
double requestRate = 10, serviceRate = 1, requestRateOffset = 0.0;&#xD;
std::cout&lt;&lt;&quot;Please provide initial request rate per second [default = &quot;&lt;&lt;requestRate&lt;&lt;&quot;] : &quot;;&#xD;
std::getline(std::cin, input);&#xD;
if (!input.empty()) &#xD;
{&#xD;
	std::istringstream stream(input);&#xD;
	stream >> requestRate;&#xD;
}&#xD;
&#xD;
std::cout&lt;&lt;&quot;Please provide the request rate offset per simulation [default = &quot;&lt;&lt;requestRateOffset&lt;&lt;&quot;] : &quot;;&#xD;
std::getline(std::cin, input);&#xD;
if (!input.empty()) &#xD;
{&#xD;
	std::istringstream stream(input);&#xD;
	stream >> requestRateOffset;&#xD;
}&#xD;
&#xD;
std::cout&lt;&lt;&quot;Please provide service rate per second [default = &quot;&lt;&lt;serviceRate&lt;&lt;&quot;] : &quot;;&#xD;
std::getline(std::cin, input);&#xD;
if (!input.empty()) &#xD;
{&#xD;
	std::istringstream stream(input);&#xD;
	stream >> serviceRate;&#xD;
}&#xD;
&#xD;
/*&#xD;
 * Read in interval for load checking, simulation time and number of simulations&#xD;
 */&#xD;
unsigned int loadCheckInterval = 10;		//in ms&#xD;
unsigned int simulationTime = 60;			//in s&#xD;
unsigned int numberOfSimulations = 1;&#xD;
std::cout&lt;&lt;&quot;Please provide the interval in which the system load should be checked (in ms) [default = &quot;&lt;&lt;loadCheckInterval&lt;&lt;&quot;ms] : &quot;;&#xD;
std::getline(std::cin, input);&#xD;
if (!input.empty()) &#xD;
{&#xD;
	std::istringstream stream(input);&#xD;
	stream >> loadCheckInterval;&#xD;
}&#xD;
&#xD;
std::cout&lt;&lt;&quot;Please provide the simulation time (in s) [default = &quot;&lt;&lt;simulationTime&lt;&lt;&quot;s] : &quot;;&#xD;
std::getline(std::cin, input);&#xD;
if (!input.empty()) &#xD;
{&#xD;
	std::istringstream stream(input);&#xD;
	stream >> simulationTime;&#xD;
}&#xD;
&#xD;
std::cout&lt;&lt;&quot;Please provide the inumber of simulations [default = &quot;&lt;&lt;numberOfSimulations&lt;&lt;&quot;] : &quot;;&#xD;
std::getline(std::cin, input);&#xD;
if (!input.empty()) &#xD;
{&#xD;
	std::istringstream stream(input);&#xD;
	stream >> numberOfSimulations;&#xD;
}&#xD;
&#xD;
for(unsigned int simulation = 1; simulation &lt;= numberOfSimulations; simulation++)&#xD;
{&#xD;
	std::cout&lt;&lt;&quot;--------------\nRunning simulation with [request rate = &quot;&lt;&lt;requestRate&lt;&lt;&quot;] and [serviceRate = &quot;&lt;&lt;serviceRate&lt;&lt;&quot;]...\n&quot;;&#xD;
	//std::cout&lt;&lt;&quot;System load will be checked every &quot;&lt;&lt;loadCheckInterval&lt;&lt;&quot;ms and simulation runs &quot;&lt;&lt;simulationTime&lt;&lt;&quot;s\n&quot;;&#xD;
	//std::cout&lt;&lt;&quot;Press Enter to start simulation...&quot;&lt;&lt;std::endl;&#xD;
	//std::cin.get();&#xD;
	&#xD;
	std::list&lt;float>* loads = new std::list&lt;float>();&#xD;
	unsigned long numberOfRequests = 0;&#xD;
	{&#xD;
		/*&#xD;
		 * Configure Simulation&#xD;
		 */&#xD;
		std::shared_ptr&lt;LoadBalance::System> system = factory->createSystem();&#xD;
		 &#xD;
		unsigned int numberOfServices = system->getServices()->size();&#xD;
		for(unsigned int i = 0; i &lt; numberOfServices; i++)&#xD;
		{&#xD;
			system->getServices()->at(i)->setServiceRate(serviceRate);&#xD;
		}&#xD;
		system->getClient()->setRequestRate(requestRate);&#xD;
		system->getClient()->setActive(true);&#xD;
&#xD;
		/*&#xD;
		 * Run Simultion&#xD;
		 */&#xD;
		std::thread t(&amp;Client::work, system->getClient());&#xD;
		&#xD;
		std::chrono::steady_clock::time_point end = std::chrono::steady_clock::now() + std::chrono::seconds(simulationTime);&#xD;
		&#xD;
		while(std::chrono::steady_clock::now() &lt;= end)&#xD;
		{&#xD;
			std::this_thread::sleep_for(std::chrono::milliseconds(loadCheckInterval));&#xD;
			float currentLoad = system->getServer()->getLoad();&#xD;
			loads->push_back(currentLoad);&#xD;
			//std::cout&lt;&lt;&quot;Current load of system: &quot;&lt;&lt;currentLoad&lt;&lt;&quot;%&quot;&lt;&lt;std::endl;&#xD;
		}&#xD;
&#xD;
		system->getClient()->setActive(false);&#xD;
		t.join();&#xD;
		&#xD;
		std::cout&lt;&lt;&quot;Waiting for services to finish...&quot;&lt;&lt;std::endl;&#xD;
		while(system->getServer()->getLoad() != 0)&#xD;
		{	&#xD;
			std::this_thread::sleep_for(std::chrono::milliseconds(100));&#xD;
		}&#xD;
		&#xD;
		numberOfRequests = system->getClient()->getRequestCounter();&#xD;
&#xD;
		system->destroy();&#xD;
	}&#xD;
&#xD;
	/*&#xD;
	 * Write all mean values to file&#xD;
	 */&#xD;
	std::ofstream myfile;&#xD;
	std::string filename = std::to_string(requestRate) + &quot;_&quot; + std::to_string(serviceRate) + &quot;_&quot; + std::to_string(loadCheckInterval) + &quot;_&quot; + std::to_string(simulationTime) + &quot;.csv&quot;;&#xD;
	myfile.open(filename);&#xD;
&#xD;
	myfile &lt;&lt;&quot;RequestRate;ServiceRate;LoadCheckInterval;SimulationTime;RequestCounter\n&quot;;&#xD;
	myfile &lt;&lt;requestRate&lt;&lt;&quot;;&quot;&lt;&lt;serviceRate&lt;&lt;&quot;;&quot;&lt;&lt;loadCheckInterval&lt;&lt;&quot;;&quot;&lt;&lt;simulationTime&lt;&lt;&quot;;&quot;&lt;&lt;numberOfRequests&lt;&lt;&quot;\n&quot;;&#xD;
&#xD;
	for(float load : *loads)&#xD;
	{&#xD;
		myfile &lt;&lt; load &lt;&lt; &quot;\n&quot;;&#xD;
	}&#xD;
&#xD;
	myfile.close();&#xD;
	&#xD;
	delete loads;&#xD;
&#xD;
	requestRate += requestRateOffset;&#xD;
	&#xD;
}</body>
    </packagedElement>
    <profileApplication xmi:id="_w9upkB1DEeyVwfCVnFKaMw">
      <eAnnotations xmi:id="_w-NxwB1DEeyVwfCVnFKaMw" source="http://www.eclipse.org/uml2/2.0.0/UML">
        <references xmi:type="ecore:EPackage" href="../../../../common/UML4CPPProfile/model/UML4CPPProfile.uml#_v75nIfp7EeuavpF89IQaUg"/>
      </eAnnotations>
      <appliedProfile href="../../../../common/UML4CPPProfile/model/UML4CPPProfile.uml#_0"/>
    </profileApplication>
    <profileApplication xmi:id="_r2oXcB1EEeyVwfCVnFKaMw">
      <eAnnotations xmi:id="_r2o-gB1EEeyVwfCVnFKaMw" source="http://www.eclipse.org/uml2/2.0.0/UML">
        <references xmi:type="ecore:EPackage" href="../../../../common/PSCSStrategiesProfile/model/PSCSStrategiesProfile.uml#_LGsZcQV9EeyhaZlTpg_vvA"/>
      </eAnnotations>
      <appliedProfile href="../../../../common/PSCSStrategiesProfile/model/PSCSStrategiesProfile.uml#_0"/>
    </profileApplication>
  </uml:Model>
  <UML4CPPProfile:MainBehavior xmi:id="_2RDkYB1DEeyVwfCVnFKaMw" base_Behavior="_44-lsB0_EeyVwfCVnFKaMw"/>
  <UML4CPPProfile:NonExecutable xmi:id="_2RDkYR1DEeyVwfCVnFKaMw" base_NamedElement="_44-lsB0_EeyVwfCVnFKaMw"/>
  <UML4CPPProfile:NonExecutable xmi:id="_ADAmoB1EEeyVwfCVnFKaMw" base_NamedElement="_EmbXMB0zEeyVwfCVnFKaMw"/>
  <UML4CPPProfile:NonExecutable xmi:id="_CvsPUB1EEeyVwfCVnFKaMw" base_NamedElement="_VGn1QB1CEeyVwfCVnFKaMw"/>
  <UML4CPPProfile:NonExecutable xmi:id="_FOBS8B1EEeyVwfCVnFKaMw" base_NamedElement="_VHB6YB1BEeyVwfCVnFKaMw"/>
  <PSCS.Semantics.StructuredClassifiers:CS_RequestPropagationStrategy xmi:id="_vb08gB1EEeyVwfCVnFKaMw" base_Class="_UlRJwB1EEeyVwfCVnFKaMw"/>
  <UML4CPPProfile:NonExecutable xmi:id="_iJB-0B1GEeyVwfCVnFKaMw" base_NamedElement="_9C09sB1EEeyVwfCVnFKaMw"/>
  <UML4CPPProfile:DoNotGenerate xmi:id="_pGVXkB6YEey0lspuV7FEyA" base_Element="_r2oXcB1EEeyVwfCVnFKaMw"/>
  <UML4CPPProfile:NonExecutable xmi:id="_a0BREB6vEey0lspuV7FEyA" base_NamedElement="_3wp5cB1EEeyVwfCVnFKaMw"/>
  <UML4CPPProfile:NonExecutable xmi:id="_nvFesR7CEey0lspuV7FEyA" base_NamedElement="_nvFesB7CEey0lspuV7FEyA"/>
  <UML4CPPProfile:NonExecutable xmi:id="_CTii4B7FEey0lspuV7FEyA" base_NamedElement="_qert8B7BEey0lspuV7FEyA"/>
</xmi:XMI>
