summaryrefslogtreecommitdiff
path: root/opendc-faas/opendc-faas-simulator/src/main
diff options
context:
space:
mode:
authorFabian Mastenbroek <mail.fabianm@gmail.com>2022-09-01 14:38:34 +0200
committerFabian Mastenbroek <mail.fabianm@gmail.com>2022-10-21 22:13:04 +0200
commit44215bd668c5fa3efe2f57fc577824478b00af57 (patch)
treeb933228e5e5748716351dc9ce031b4840f254428 /opendc-faas/opendc-faas-simulator/src/main
parentc1f67a872e2d7ce63ac96f8ca80cbe8b25c62e3b (diff)
refactor(sim/compute): Re-implement using flow2
This change re-implements the OpenDC compute simulator framework using the new flow2 framework for modelling multi-edge flow networks. The re-implementation is written in Java and focusses on performance and clean API surface.
Diffstat (limited to 'opendc-faas/opendc-faas-simulator/src/main')
-rw-r--r--opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt11
1 files changed, 4 insertions, 7 deletions
diff --git a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt
index eba90cce..307ad5a5 100644
--- a/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt
+++ b/opendc-faas/opendc-faas-simulator/src/main/kotlin/org/opendc/faas/simulator/SimFunctionDeployer.kt
@@ -42,10 +42,8 @@ import org.opendc.faas.simulator.workload.SimMetaFaaSWorkloadMapper
import org.opendc.simulator.compute.SimBareMetalMachine
import org.opendc.simulator.compute.SimMachine
import org.opendc.simulator.compute.model.MachineModel
-import org.opendc.simulator.compute.power.ConstantPowerModel
-import org.opendc.simulator.compute.power.SimplePowerDriver
import org.opendc.simulator.compute.runWorkload
-import org.opendc.simulator.flow.FlowEngine
+import org.opendc.simulator.flow2.FlowEngine
import java.time.Clock
import java.util.ArrayDeque
import kotlin.coroutines.Continuation
@@ -87,10 +85,9 @@ public class SimFunctionDeployer(
/**
* The machine that will execute the workloads.
*/
- public val machine: SimMachine = SimBareMetalMachine(
- FlowEngine(scope.coroutineContext, clock),
- model,
- SimplePowerDriver(ConstantPowerModel(0.0))
+ public val machine: SimMachine = SimBareMetalMachine.create(
+ FlowEngine.create(scope.coroutineContext, clock).newGraph(),
+ model
)
/**