From 6171ab09f1df2ab3475a7b28ece383a9f87a77c5 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 22 Sep 2022 10:28:37 +0200 Subject: refactor(sim/compute): Extract Random dependency from interference model This change moves the Random dependency outside the interference model, to allow the interference model to be completely immutable and passable between different simulations. --- .../src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'opendc-web') diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt index c958bdb2..d5dbed1c 100644 --- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt +++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt @@ -220,6 +220,7 @@ public class OpenDCRunner( coroutineContext, clock, computeScheduler, + seed = 0L, failureModel, interferenceModel.takeIf { phenomena.interference } ) @@ -230,7 +231,7 @@ public class OpenDCRunner( // Instantiate the topology onto the simulator simulator.apply(topology) // Run workload trace - simulator.run(vms, seeder.nextLong(), servers) + simulator.run(vms, servers) val serviceMetrics = simulator.service.getSchedulerStats() logger.debug { -- cgit v1.2.3