Commit 2dd17578 authored by Jonathan Shahen's avatar Jonathan Shahen
Browse files

HOTFIX for sum

parent 8a6c9c09
......@@ -115,6 +115,8 @@ public class VagabondInstance {
// STATS
stats.initialPM = placementMap;
stats.initialCCIL = epochHistory.get(0);
stats.listTIL.add(epochHistory.get(0).getSumInformationLeak());
stats.listMCCIL.add(epochHistory.get(0).getMaxInformationLeak());
if (logger.isLoggable(FINE)) {
logger.fine("Summation of Client-to-Client Information Leakage (Z variable):\n"
......
......@@ -27,8 +27,6 @@ public class ClientToClientInformationLeakage {
private int _maxInformationLeak = -1;
private ClientToClientKey _maxInformationLeakKey = null;
private Integer sumInformationLeak = null;
/**
* Calculates the sum for each client on each machine here
* @param place the PlacementMap that holds where VMs are stored
......@@ -159,7 +157,6 @@ public class ClientToClientInformationLeakage {
* @return sum/total information leakage
*/
public int getSumInformationLeak() {
if (sumInformationLeak != null) { return sumInformationLeak; }
int sum = 0;
for (Integer c0 : _clientIDs) {
......@@ -168,8 +165,6 @@ public class ClientToClientInformationLeakage {
}
}
sumInformationLeak = sum;
return sum;
}
......
......@@ -33,14 +33,22 @@ public class StatisticsManager {
}
public void writeOut(File statsFile) throws IOException {
boolean writeHeader = false;
if (!statsFile.exists()) {
writeHeader = true;
}
FileWriter stats = new FileWriter(statsFile, true); // NEVER OVERWRITE STATS!
if (!statsFile.exists()) {
stats.write(getCSVHeader());
stats.write("\n");
if (writeHeader) {
String header = getCSVHeader();
System.out.println(header);
stats.write(header);
}
stats.write(getCSVStatsLine());
stats.write("\n");
String line = getCSVStatsLine();
System.out.println(line);
stats.write(line);
stats.close();
}
......@@ -86,7 +94,7 @@ public class StatisticsManager {
sb.append("Last Epoch with Move,");
sb.append("Total Test Time(ms),");
sb.append("Comments");
sb.append("Comments\n");
return sb.toString();
}
......@@ -152,9 +160,9 @@ public class StatisticsManager {
sb.append(listTIL.get(0) - listTIL.get(listTIL.size() - 1)).append(",");
// sb.append("MCCIL Gain,");
sb.append(listMCCIL.get(0) - listMCCIL.get(listMCCIL.size() - 1)).append(",");
sb.append("TIL Epochs Changed,");
// sb.append("TIL Epochs Changed,");
sb.append(traceBackList(listTIL, null)).append(",");
sb.append("MCCIL Epochs Changed,");
// sb.append("MCCIL Epochs Changed,");
sb.append(traceBackList(listMCCIL, null)).append(",");
/**
......
# I am a comment
numberOfMachines=3
numberOfMachines=4
numberOfMachineSlots=3
numberOfClients=4
numberOfVMsPerClient=2
......@@ -10,6 +10,6 @@ placement=randomPlacement
reduction=ilp
migrationBudget=3
# OPTIONAL: Can Comment these lines out
seed=12
seed=11
name=CNFSimple
comment=Just a simple test to show that something works
\ No newline at end of file
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