From 33b0e250ab3ff3747b2c6c1441936a733609c6da Mon Sep 17 00:00:00 2001 From: giacomoaccursi Date: Thu, 11 Jan 2024 11:39:57 +0100 Subject: [PATCH] chore: removed waiting for event update from the engine --- src/main/kotlin/control/EngineImpl.kt | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/src/main/kotlin/control/EngineImpl.kt b/src/main/kotlin/control/EngineImpl.kt index a0119c9..95575c3 100644 --- a/src/main/kotlin/control/EngineImpl.kt +++ b/src/main/kotlin/control/EngineImpl.kt @@ -10,7 +10,6 @@ package control import entity.Environment import entity.Time -import kotlinx.coroutines.delay import java.util.concurrent.CountDownLatch /** @@ -30,7 +29,6 @@ class EngineImpl( override suspend fun start() { scheduleEvents() - delay(1000) status = Status.RUNNING while (currentStep < maxSteps && status == Status.RUNNING) { doStep() @@ -74,9 +72,9 @@ class EngineImpl( } currentTime = scheduledTime if (nextEvent.canExecute()) { - this.latch = CountDownLatch(nextEvent.getNumberOfEventExecutionObserver()) + // this.latch = CountDownLatch(nextEvent.getNumberOfEventExecutionObserver()) nextEvent.execute() - waitForEventUpdate() + // waitForEventUpdate() nextEvent.updateEvent(currentTime) scheduler.eventsUpdated() } @@ -85,9 +83,9 @@ class EngineImpl( currentStep += 1 } - private fun waitForEventUpdate() { - latch.await() - } +// private fun waitForEventUpdate() { +// latch.await() +// } /** * Enum for the status of the simulation.