diff options
| author | Dante Niewenhuis <d.niewenhuis@hotmail.com> | 2024-10-30 17:35:06 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-30 17:35:06 +0100 |
| commit | 7511fb768fab68d542adf5bbfb15e32300156c7e (patch) | |
| tree | 959736689bff655be4ea7e6cc92aaec60ca74f1a /opendc-web/opendc-web-runner/src/main/kotlin | |
| parent | 2325c62377e7c94e768a22807e107a9714626bfc (diff) | |
Added power sources to OpenDC (#258)
* Added power sources to OpenDC.
In the current form each Cluster has a single power source that is connected to all hosts in that cluster
* Added power sources to OpenDC.
In the current form each Cluster has a single power source that is connected to all hosts in that cluster
* Ran spotless Kotlin and Java
Diffstat (limited to 'opendc-web/opendc-web-runner/src/main/kotlin')
| -rw-r--r-- | opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt index 70152b2c..ca42f566 100644 --- a/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt +++ b/opendc-web/opendc-web-runner/src/main/kotlin/org/opendc/web/runner/OpenDCRunner.kt @@ -31,7 +31,9 @@ import org.opendc.compute.simulator.provisioner.setupComputeService import org.opendc.compute.simulator.provisioner.setupHosts import org.opendc.compute.simulator.scheduler.createComputeScheduler import org.opendc.compute.simulator.service.ComputeService +import org.opendc.compute.topology.specs.ClusterSpec import org.opendc.compute.topology.specs.HostSpec +import org.opendc.compute.topology.specs.PowerSourceSpec import org.opendc.compute.workload.ComputeWorkloadLoader import org.opendc.compute.workload.sampleByLoad import org.opendc.compute.workload.trace @@ -233,7 +235,7 @@ public class OpenDCRunner( private inner class SimulationTask( private val scenario: Scenario, private val repeat: Int, - private val topology: List<HostSpec>, + private val topologyHosts: List<HostSpec>, ) : RecursiveTask<WebComputeMonitor.Results>() { override fun compute(): WebComputeMonitor.Results { val monitor = WebComputeMonitor() @@ -262,6 +264,13 @@ public class OpenDCRunner( val scenario = scenario + val powerSourceSpec = + PowerSourceSpec( + UUID(0, 0), + totalPower = Long.MAX_VALUE, + ) + val topology = listOf(ClusterSpec("cluster", topologyHosts, powerSourceSpec)) + Provisioner(dispatcher, seed).use { provisioner -> provisioner.runSteps( setupComputeService( |
