From d6d9d37abf17071ff050e45ea37c693e659a4e98 Mon Sep 17 00:00:00 2001 From: Fabian Mastenbroek Date: Thu, 28 Sep 2017 03:27:36 +0200 Subject: Implement JPA integration --- .../nl/atlarge/opendc/topology/container/Datacenter.kt | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt') diff --git a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt index f8954527..333609bb 100644 --- a/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt +++ b/opendc-stdlib/src/main/kotlin/nl/atlarge/opendc/topology/container/Datacenter.kt @@ -25,14 +25,14 @@ package nl.atlarge.opendc.topology.container import mu.KotlinLogging -import nl.atlarge.opendc.extension.topology.destinations +import nl.atlarge.opendc.topology.destinations import nl.atlarge.opendc.kernel.Context import nl.atlarge.opendc.kernel.Process import nl.atlarge.opendc.kernel.time.Duration -import nl.atlarge.opendc.scheduler.Scheduler +import nl.atlarge.opendc.platform.scheduler.Scheduler import nl.atlarge.opendc.topology.Entity import nl.atlarge.opendc.topology.machine.Machine -import nl.atlarge.opendc.workload.Task +import nl.atlarge.opendc.platform.workload.Task import java.util.* /** @@ -42,16 +42,16 @@ import java.util.* * @property interval The interval at which task will be (re)scheduled. * @author Fabian Mastenbroek (f.s.mastenbroek@student.tudelft.nl) */ -class Datacenter(val scheduler: Scheduler, val interval: Duration) : Entity, Process { +interface Datacenter : Entity, Process { /** - * The logger instance to use for the simulator. + * The task scheduler the datacenter uses. */ - private val logger = KotlinLogging.logger {} + val scheduler: Scheduler /** - * The initial state of the entity. + * The interval at which task will be (re)scheduled. */ - override val initialState = Unit + val interval: Duration /** * This method is invoked to start the simulation an [Entity] associated with this [Process]. @@ -69,6 +69,8 @@ class Datacenter(val scheduler: Scheduler, val interval: Duration) : Entity.run() { + val logger = KotlinLogging.logger {} + // The queue of messages to be processed after a cycle val queue: Queue = ArrayDeque() // Find all machines in the datacenter -- cgit v1.2.3