From 9a7bfac2475b1169c4aa9dee820dd30f412a39c1 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Wed, 15 Apr 2020 17:46:31 +0200 Subject: feat: Add support for seeding experiments --- .../kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'opendc/opendc-format/src') diff --git a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt index d4eef029..da678c07 100644 --- a/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt +++ b/opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt @@ -38,6 +38,7 @@ import java.io.FileReader import java.util.UUID import kotlin.math.max import kotlin.math.min +import kotlin.random.Random /** * A [TraceReader] for the internal VM workload trace format. @@ -48,7 +49,8 @@ import kotlin.math.min class Sc20TraceReader( traceDirectory: File, performanceInterferenceModel: PerformanceInterferenceModel, - selectedVms: List + selectedVms: List, + random: Random ) : TraceReader { /** * The internal iterator to use for this reader. @@ -161,7 +163,8 @@ class Sc20TraceReader( val relevantPerformanceInterferenceModelItems = PerformanceInterferenceModel( - performanceInterferenceModel.items.filter { it.workloadNames.contains(vmId) }.toSet() + performanceInterferenceModel.items.filter { it.workloadNames.contains(vmId) }.toSet(), + Random(random.nextInt()) ) val vmWorkload = VmWorkload( uuid, "VM Workload $vmId", UnnamedUser, -- cgit v1.2.3