summaryrefslogtreecommitdiff
path: root/opendc-experiments/opendc-experiments-compute
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-03 17:20:34 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-03 20:47:12 +0200
commitbd476d11ab24fe745bb54e97a11133706bb96cb1 (patch)
treeb5edaff69212986265f9edc620e40bb8695f11eb /opendc-experiments/opendc-experiments-compute
parent448b4cafe3c757812138a8ca7580975191ac2f9c (diff)
refactor(exp/compute): Remove Topology interface
This change removes the Topology interface from the `opendc-experiments-compute` module, which was meant for provisioning the experimental topology. Howerver, with the stateless `HostSpec` class, it is not needed to resolve the topology everytime.
Diffstat (limited to 'opendc-experiments/opendc-experiments-compute')
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/HostSpec.kt4
-rw-r--r--opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/Topology.kt33
2 files changed, 3 insertions, 34 deletions
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/HostSpec.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/HostSpec.kt
index c0ac0fbf..8ade963a 100644
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/HostSpec.kt
+++ b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/HostSpec.kt
@@ -23,7 +23,9 @@
package org.opendc.experiments.compute.topology
import org.opendc.simulator.compute.model.MachineModel
+import org.opendc.simulator.compute.power.LinearPowerModel
import org.opendc.simulator.compute.power.PowerDriver
+import org.opendc.simulator.compute.power.SimplePowerDriver
import org.opendc.simulator.flow.mux.FlowMultiplexerFactory
import java.util.*
@@ -42,6 +44,6 @@ public data class HostSpec(
val name: String,
val meta: Map<String, Any>,
val model: MachineModel,
- val powerDriver: PowerDriver,
+ val powerDriver: PowerDriver = SimplePowerDriver(LinearPowerModel(350.0, idlePower = 200.0)),
val multiplexerFactory: FlowMultiplexerFactory = FlowMultiplexerFactory.maxMinMultiplexer()
)
diff --git a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/Topology.kt b/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/Topology.kt
deleted file mode 100644
index bd29110f..00000000
--- a/opendc-experiments/opendc-experiments-compute/src/main/kotlin/org/opendc/experiments/compute/topology/Topology.kt
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * Copyright (c) 2021 AtLarge Research
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in all
- * copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
- * SOFTWARE.
- */
-
-package org.opendc.experiments.compute.topology
-
-/**
- * Representation of the environment of the compute service, describing the physical details of every host.
- */
-public interface Topology {
- /**
- * Resolve the [Topology] into a list of [HostSpec]s.
- */
- public fun resolve(): List<HostSpec>
-}