summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2021-09-30 16:00:05 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-10-03 17:17:40 +0200
commit94783ff9d8cd81275fefd5804ac99f98e2dee3a4 (patch)
tree9668a4370fa49aa7bae4decb4b358681dd3031b7 /opendc-simulator/opendc-simulator-compute
parenta2ce07026bf3ef17326e72f395dfa2dd9d9b17be (diff)
fix(simulator): Fix loss computation for UPS and PDU
This change fixes the loss computation for both the UPS and PDU implementation that was broken due to the new pushing mechanism. We implement a new class FlowMapper that can be used to map the flow pushed by a `FlowSource` using a user-specified method.
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute')
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt2
1 files changed, 1 insertions, 1 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt
index 8400c225..62d91c0b 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt
+++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/device/SimPsu.kt
@@ -80,7 +80,7 @@ public class SimPsu(
update()
}
- override fun createConsumer(): FlowSource = object : FlowSource {
+ override fun createSource(): FlowSource = object : FlowSource {
override fun onStart(conn: FlowConnection, now: Long) {
_ctx = conn
}