summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt4
1 files changed, 4 insertions, 0 deletions
diff --git a/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt b/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt
index c1b1450e..2ceb1e3c 100644
--- a/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt
+++ b/opendc-simulator/opendc-simulator-resources/src/main/kotlin/org/opendc/simulator/resources/SimAbstractResourceProvider.kt
@@ -88,6 +88,10 @@ public abstract class SimAbstractResourceProvider(
* Update the counters of the resource provider.
*/
protected fun updateCounters(ctx: SimResourceContext, work: Double) {
+ if (work <= 0.0) {
+ return
+ }
+
val counters = _counters
val remainingWork = ctx.remainingWork
counters.demand += work