summaryrefslogtreecommitdiff
path: root/opendc/opendc-format/src
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-04-15 17:46:31 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2020-04-15 17:46:31 +0200
commit9a7bfac2475b1169c4aa9dee820dd30f412a39c1 (patch)
treecd90a10b7a2f68e9c2dcc68027d06606f6457ce7 /opendc/opendc-format/src
parenteab4c190142f54291ed235e4e18f3a35385a541c (diff)
feat: Add support for seeding experiments
Diffstat (limited to 'opendc/opendc-format/src')
-rw-r--r--opendc/opendc-format/src/main/kotlin/com/atlarge/opendc/format/trace/sc20/Sc20TraceReader.kt7
1 files changed, 5 insertions, 2 deletions
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<String>
+ selectedVms: List<String>,
+ random: Random
) : TraceReader<VmWorkload> {
/**
* 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,