diff options
Diffstat (limited to 'opendc-compute/opendc-compute-simulator/src')
2 files changed, 8 insertions, 3 deletions
diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt index 628f324b..ece3f752 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/SimHost.kt @@ -62,6 +62,7 @@ public class SimHost( context: CoroutineContext, engine: FlowEngine, hypervisorProvider: SimHypervisorProvider, + random: SplittableRandom, scalingGovernor: ScalingGovernor = PerformanceScalingGovernor(), powerDriver: PowerDriver = SimplePowerDriver(ConstantPowerModel(0.0)), private val mapper: SimWorkloadMapper = SimMetaWorkloadMapper(), @@ -92,7 +93,7 @@ public class SimHost( * The hypervisor to run multiple workloads. */ private val hypervisor: SimHypervisor = hypervisorProvider - .create(engine, scalingGovernor = scalingGovernor) + .create(engine, random, scalingGovernor = scalingGovernor) /** * The virtual machines running on the hypervisor. diff --git a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt index 5ba4a667..0b2285e5 100644 --- a/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt +++ b/opendc-compute/opendc-compute-simulator/src/test/kotlin/org/opendc/compute/simulator/SimHostTest.kt @@ -67,6 +67,7 @@ internal class SimHostTest { fun testOvercommitted() = runBlockingSimulation { val duration = 5 * 60L val engine = FlowEngine(coroutineContext, clock) + val random = SplittableRandom(1) val host = SimHost( uid = UUID.randomUUID(), name = "test", @@ -74,7 +75,8 @@ internal class SimHostTest { meta = emptyMap(), coroutineContext, engine, - SimFairShareHypervisorProvider() + SimFairShareHypervisorProvider(), + random, ) val vmImageA = MockImage( UUID.randomUUID(), @@ -149,6 +151,7 @@ internal class SimHostTest { fun testFailure() = runBlockingSimulation { val duration = 5 * 60L val engine = FlowEngine(coroutineContext, clock) + val random = SplittableRandom(1) val host = SimHost( uid = UUID.randomUUID(), name = "test", @@ -156,7 +159,8 @@ internal class SimHostTest { meta = emptyMap(), coroutineContext, engine, - SimFairShareHypervisorProvider() + SimFairShareHypervisorProvider(), + random ) val image = MockImage( UUID.randomUUID(), |
