WP3 demo last touch

parent 65682057
......@@ -88,7 +88,7 @@ public class NFRTool {
Worker worker1A = new Worker(node1, pid1A, active1A, appA, cpuUsage1A, computingUnits1A, node1.getIpEth(),
communicationCost1A);
// Attach worker to Node and COMPSsApplication
node1.addWorker(worker1A);
//node1.addWorker(worker1A);
appA.addWorker(worker1A);
// Worker 1B definition:
......@@ -101,7 +101,7 @@ public class NFRTool {
Worker worker1B = new Worker(node1, pid1B, active1B, appA, cpuUsage1B, computingUnits1B, node1.getIpEth(),
communicationCost1B);
// Attach worker to Node and COMPSsApplication
node1.addWorker(worker1B);
//node1.addWorker(worker1B);
appB.addWorker(worker1B);
// Worker 2A definition:
......@@ -114,7 +114,7 @@ public class NFRTool {
Worker worker2A = new Worker(node2, pid2A, active2A, appA, cpuUsage2A, computingUnits2A, node1.getIpEth(),
communicationCost2A);
// Attach worker to Node and COMPSsApplication
node2.addWorker(worker2A);
//node2.addWorker(worker2A);
appA.addWorker(worker2A);
// Worker 2B definition:
......@@ -127,7 +127,7 @@ public class NFRTool {
Worker worker2B = new Worker(node2, pid2B, active2B, appB, cpuUsage2B, computingUnits2B, node1.getIpEth(),
communicationCost2B);
// Attach worker to Node and COMPSsApplication
node2.addWorker(worker2B);
//node2.addWorker(worker2B);
appB.addWorker(worker2B);
// Worker 3A definition:
......@@ -140,7 +140,7 @@ public class NFRTool {
Worker worker3A = new Worker(node3, pid3A, active3A, appA, cpuUsage3A, computingUnits3A, node3.getIpEth(),
communicationCost3A);
// Attach worker to Node and COMPSsApplication
node3.addWorker(worker3A);
//node3.addWorker(worker3A);
appA.addWorker(worker3A);
// Worker 3B definition:
......@@ -153,7 +153,7 @@ public class NFRTool {
Worker worker3B = new Worker(node3, pid3B, active3B, appB, cpuUsage3B, computingUnits3B, node3.getIpEth(),
communicationCost3B);
// Attach worker to Node and COMPSsApplication
node3.addWorker(worker3B);
//node3.addWorker(worker3B);
appB.addWorker(worker3B);
/////////////////////////////////////////////////////////////////////////////////////////////////
......
......@@ -131,7 +131,7 @@ public class ResourceManagerComms extends ResourceManager {
// float monitoredRTT = workerLinks.get(ll).getDelayRtt();
if (workerLinks.get(ll).getDelayRtt() >= rttmax) {
worker.setActive(false); // Is inactive true or false?
System.out.println("Thres. violation. Worker " + worker.getID() + "disabled");
System.out.println("[NFR Resource Manager] Max. RTT exceeded. Worker disabled");
worker.setCommunicationCost(Float.POSITIVE_INFINITY);
return -1;
} else {
......@@ -151,12 +151,11 @@ public class ResourceManagerComms extends ResourceManager {
public void getCosts(Node node) {
double commsCost = 0;
// Is Inactive True or False???
List<Worker> workerList = node.getWorkers();
List<Worker> activeWorkers = node.getWorkers().stream().filter(w -> w.isActive()).collect(Collectors.toList());
for (int ww = 0; ww < activeWorkers.size(); ww++) {
if((commsCost = getCost(activeWorkers.get(ww))) == -1)
return;
commsCost = getCost(activeWorkers.get(ww));
}
//System.out.println("Worker.setCommunicationCost(" + String.valueOf(commsCost) + ")");
}
......
......@@ -117,7 +117,7 @@ public class HardwareInfo {
Matcher m = r.matcher(pingText);
if (m.find()) {
String rtt = m.group(1);
System.out.println("Monitored RTT to target IP \t" + ip + "\t: " + rtt + "ms");
System.out.println("[NFR Monitor] Monitored RTT to target IP \t" + ip + "\t: " + rtt + "ms");
return Float.parseFloat(rtt);
}
else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment