summaryrefslogtreecommitdiff
path: root/opendc-compute/opendc-compute-simulator/src
diff options
context:
space:
mode:
authorDante Niewenhuis <d.niewenhuis@hotmail.com>2025-01-07 11:25:48 +0100
committerGitHub <noreply@github.com>2025-01-07 11:25:48 +0100
commitf71e07f55a5176c5bd5447cdb3bcfebf2f5f47ee (patch)
tree9a7e5b11887c560668a17fc2f130bfed7aaceda5 /opendc-compute/opendc-compute-simulator/src
parentc425a03c59e7d5c2e5d82988c61e340a6cbf61fe (diff)
Updated the FlowDistributor (#285)
* Updated the FlowDistributor to work in more cases and be more performant. * Removed old FlowDistributor
Diffstat (limited to 'opendc-compute/opendc-compute-simulator/src')
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/host/SimHost.kt4
-rw-r--r--opendc-compute/opendc-compute-simulator/src/main/kotlin/org/opendc/compute/simulator/provisioner/HostsProvisioningStep.kt6
2 files changed, 5 insertions, 5 deletions
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" }