summaryrefslogtreecommitdiff
path: root/opendc-simulator/opendc-simulator-compute/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'opendc-simulator/opendc-simulator-compute/src/main')
-rw-r--r--opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/cpu/SimCpu.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/cpu/SimCpu.java b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/cpu/SimCpu.java
index fadfc4d6..1a56650e 100644
--- a/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/cpu/SimCpu.java
+++ b/opendc-simulator/opendc-simulator-compute/src/main/java/org/opendc/simulator/compute/cpu/SimCpu.java
@@ -44,7 +44,7 @@ public final class SimCpu extends FlowNode implements FlowSupplier, FlowConsumer
private double currentCpuUtilization = 0.0f;
private double currentCpuSupplied = 0.0f; // cpu capacity supplied to the mux
- private double currentPowerDemand = 0.0f; // power demanded of the psu
+ private double currentPowerDemand; // power demanded of the psu
private double currentPowerSupplied = 0.0f; // cpu capacity supplied by the psu
private double maxCapacity;
@@ -109,12 +109,13 @@ public final class SimCpu extends FlowNode implements FlowSupplier, FlowConsumer
this.cpuModel = cpuModel;
this.maxCapacity = this.cpuModel.getTotalCapacity();
- // TODO: connect this to the front-end
this.cpuPowerModel = powerModel;
this.lastCounterUpdate = clock.millis();
this.cpuFrequencyInv = 1 / this.maxCapacity;
+
+ this.currentPowerDemand = this.cpuPowerModel.computePower(this.currentCpuUtilization);
}
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////