From f616b720406250b1415593ff04c9d910b1fda54c Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Mon, 22 Mar 2021 12:13:23 +0100 Subject: simulator: Expose capacity and remaining work outside consumer callback This change changes the consumer and context interfaces to expose the provider capacity and remaining work via the context instance as opposed to only via the callback. This simplifies aggregation of resources. --- .../kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'simulator/opendc-simulator/opendc-simulator-compute/src') diff --git a/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt b/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt index cc4f3136..e8050263 100644 --- a/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt +++ b/simulator/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTraceWorkload.kt @@ -50,7 +50,7 @@ public class SimTraceWorkload(public val trace: Sequence) : SimWorkloa } private inner class CpuConsumer : SimResourceConsumer { - override fun onNext(ctx: SimResourceContext, capacity: Double, remainingWork: Double): SimResourceCommand { + override fun onNext(ctx: SimResourceContext): SimResourceCommand { val now = ctx.clock.millis() val fragment = fragment ?: return SimResourceCommand.Exit val work = (fragment.duration / 1000) * fragment.usage -- cgit v1.2.3