Skip to content
Snippets Groups Projects
Commit 9531bbaf authored by Marcel Samir Becker's avatar Marcel Samir Becker
Browse files

Fixed bug with setResult()

parent 5b65870f
No related branches found
No related tags found
1 merge request!215Redesign Strategy, Load, and Resources data types
......@@ -29,28 +29,28 @@ class Results (val metric: Metric) {
when (metric) {
Metric.DEMAND ->
if (optInstances.containsKey(experiment.first)) {
if(optInstances[experiment.first]!! > experiment.second) {
optInstances[experiment.first] = experiment.second
}
} else {
if(!successful){
optInstances[experiment.first] = Int.MAX_VALUE
}else {
if (successful) {
if (optInstances.containsKey(experiment.first)) {
if (optInstances[experiment.first]!! > experiment.second) {
optInstances[experiment.first] = experiment.second
}
} else {
optInstances[experiment.first] = experiment.second
}
} else if (!optInstances.containsKey(experiment.first)) {
optInstances[experiment.first] = Int.MAX_VALUE
}
Metric.CAPACITY ->
if (optInstances.containsKey(experiment.second)) {
if (optInstances[experiment.second]!! < experiment.first){
optInstances[experiment.second] = experiment.first
}
} else {
if(!successful){
optInstances[experiment.second] = Int.MIN_VALUE
if (successful) {
if (optInstances.containsKey(experiment.second)) {
if (optInstances[experiment.second]!! < experiment.first) {
optInstances[experiment.second] = experiment.first
}
} else {
optInstances[experiment.second] = experiment.first
}
} else if (!optInstances.containsKey(experiment.second)) {
optInstances[experiment.second] = Int.MIN_VALUE
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment