From 751971d91c028fb19e20a2a424431da3f11a6713 Mon Sep 17 00:00:00 2001 From: Georgios Andreadis Date: Sat, 11 Apr 2020 11:10:27 +0200 Subject: Fix computation of VM interference set size --- .../atlarge/opendc/core/workload/PerformanceInterferenceModel.kt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt index ea110934..1efe7588 100644 --- a/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt +++ b/opendc/opendc-core/src/main/kotlin/com/atlarge/opendc/core/workload/PerformanceInterferenceModel.kt @@ -31,12 +31,11 @@ data class PerformanceInterferenceModel( } val score = intersectingItems .filter { it.minServerLoad <= currentServerLoad } - .map { it.performanceScore } - .min() + .minBy { it.performanceScore } // Apply performance penalty to (on average) only one of the VMs - return if (score != null && Random.nextInt(items.size) == 0) { - score + return if (score != null && Random.nextInt(score.workloadNames.size) == 0) { + score.performanceScore } else { 1.0 } -- cgit v1.2.3