Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Jon Shahen
vagabond
Commits
2dd17578
Commit
2dd17578
authored
May 22, 2016
by
Jonathan Shahen
Browse files
HOTFIX for sum
parent
8a6c9c09
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/vagabond/VagabondInstance.java
View file @
2dd17578
...
...
@@ -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"
...
...
src/vagabond/pieces/ClientToClientInformationLeakage.java
View file @
2dd17578
...
...
@@ -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
;
}
...
...
src/vagabond/results/StatisticsManager.java
View file @
2dd17578
...
...
@@ -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
(
","
);
/**
...
...
tests/bugTest.txt
View file @
2dd17578
# 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=1
2
seed=1
1
name=CNFSimple
comment=Just a simple test to show that something works
\ No newline at end of file
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment