summaryrefslogtreecommitdiff
path: root/simulator/opendc-runner-web/src/main
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2020-12-30 14:03:12 +0100
committerFabian Mastenbroek <mail.fabianm@gmail.com>2021-03-16 12:06:40 +0100
commit6a2a5423479696e8dc28885be27cc3e3252f28b0 (patch)
treee23dd1d7ab3a15969da5f7e02baf24a9434b9912 /simulator/opendc-runner-web/src/main
parentdf2f52780c08c5d108741d3746eaf03222c64841 (diff)
simulator: Add generic framework for resource consumption modeling
This change adds a generic framework for modeling resource consumptions and adapts opendc-simulator-compute to model machines and VMs on top of this framework. This framework anticipates the addition of additional resource types such as memory, disk and network to the OpenDC codebase.
Diffstat (limited to 'simulator/opendc-runner-web/src/main')
-rw-r--r--simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt12
1 files changed, 6 insertions, 6 deletions
diff --git a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt
index e7e99a3d..0ff40a28 100644
--- a/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt
+++ b/simulator/opendc-runner-web/src/main/kotlin/org/opendc/runner/web/TopologyParser.kt
@@ -34,9 +34,9 @@ import org.opendc.compute.simulator.power.models.LinearPowerModel
import org.opendc.format.environment.EnvironmentReader
import org.opendc.format.environment.MachineDef
import org.opendc.simulator.compute.SimMachineModel
-import org.opendc.simulator.compute.model.MemoryUnit
-import org.opendc.simulator.compute.model.ProcessingNode
-import org.opendc.simulator.compute.model.ProcessingUnit
+import org.opendc.simulator.compute.model.SimMemoryUnit
+import org.opendc.simulator.compute.model.SimProcessingNode
+import org.opendc.simulator.compute.model.SimProcessingUnit
import java.util.*
/**
@@ -56,13 +56,13 @@ public class TopologyParser(private val collection: MongoCollection<Document>, p
val cores = cpu.getInteger("numberOfCores")
val speed = cpu.get("clockRateMhz", Number::class.java).toDouble()
// TODO Remove hardcoding of vendor
- val node = ProcessingNode("Intel", "amd64", cpu.getString("name"), cores)
+ val node = SimProcessingNode("Intel", "amd64", cpu.getString("name"), cores)
List(cores) { coreId ->
- ProcessingUnit(node, coreId, speed)
+ SimProcessingUnit(node, coreId, speed)
}
}
val memoryUnits = machine.getList("memories", Document::class.java).map { memory ->
- MemoryUnit(
+ SimMemoryUnit(
"Samsung",
memory.getString("name"),
memory.get("speedMbPerS", Number::class.java).toDouble(),