diff options
Diffstat (limited to 'opendc-simulator')
2 files changed, 4 insertions, 2 deletions
diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt index 68792c72..63a82e78 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/SimBareMetalMachine.kt @@ -91,8 +91,9 @@ public class SimBareMetalMachine( if (duration > 0) { // Compute the power and energy usage of the machine computeEnergyUsage(now) - _powerUsage = powerDriverLogic.computePower() } + + _powerUsage = powerDriverLogic.computePower() } init { diff --git a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt index 207e8579..6b820e5d 100644 --- a/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt +++ b/opendc-simulator/opendc-simulator-compute/src/main/kotlin/org/opendc/simulator/compute/workload/SimTrace.kt @@ -55,6 +55,7 @@ public class SimTrace( /** * Construct a [SimTrace] with the specified fragments. */ + @JvmStatic public fun ofFragments(fragments: List<SimTraceFragment>): SimTrace { val size = fragments.size val usageCol = DoubleArray(size) @@ -180,7 +181,7 @@ public class SimTrace( */ private fun grow() { val arraySize = usageCol.size - val newSize = arraySize * 2 + val newSize = arraySize + (arraySize shr 1) usageCol = usageCol.copyOf(newSize) timestampCol = timestampCol.copyOf(newSize) |
