From f71e07f55a5176c5bd5447cdb3bcfebf2f5f47ee Mon Sep 17 00:00:00 2001 From: Dante Niewenhuis Date: Tue, 7 Jan 2025 11:25:48 +0100 Subject: Updated the FlowDistributor (#285) * Updated the FlowDistributor to work in more cases and be more performant. * Removed old FlowDistributor --- .../src/main/kotlin/org/opendc/compute/simulator/host/SimHost.kt | 4 ++-- .../opendc/compute/simulator/provisioner/HostsProvisioningStep.kt | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'opendc-compute/opendc-compute-simulator') diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/host/SimHost.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/host/SimHost.kt index f34e135d..cc4ac2d8 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/host/SimHost.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/host/SimHost.kt @@ -62,7 +62,7 @@ public class SimHost( private val graph: FlowGraph, private val machineModel: MachineModel, private val cpuPowerModel: CpuPowerModel, - private val powerMux: FlowDistributor, + private val powerDistributor: FlowDistributor, ) : AutoCloseable { /** * The event listeners registered with this host. @@ -131,7 +131,7 @@ public class SimHost( SimMachine( this.graph, this.machineModel, - this.powerMux, + this.powerDistributor, this.cpuPowerModel, ) { cause -> hostState = if (cause != null) HostState.ERROR else HostState.DOWN diff --git a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/provisioner/HostsProvisioningStep.kt b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/provisioner/HostsProvisioningStep.kt index 8dcf2fa1..933b4e63 100644 --- a/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/provisioner/HostsProvisioningStep.kt +++ b/opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/provisioner/HostsProvisioningStep.kt @@ -64,8 +64,8 @@ public class HostsProvisioningStep internal constructor( service.addPowerSource(simPowerSource) simPowerSources.add(simPowerSource) - val powerMux = FlowDistributor(graph) - graph.addEdge(powerMux, simPowerSource) + val powerDistributor = FlowDistributor(graph) + graph.addEdge(powerDistributor, simPowerSource) // Create hosts, they are connected to the powerMux when SimMachine is created for (hostSpec in cluster.hostSpecs) { @@ -78,7 +78,7 @@ public class HostsProvisioningStep internal constructor( graph, hostSpec.model, hostSpec.cpuPowerModel, - powerMux, + powerDistributor, ) require(simHosts.add(simHost)) { "Host with uid ${hostSpec.uid} already exists" } -- cgit v1.2.3