SimulationScheduler

floodsim.controller.SimulationScheduler
See theSimulationScheduler companion object
sealed trait SimulationScheduler

Handles the scheduling and execution of simulation tasks at specified intervals. Provides methods to control the simulation flow (start, pause, stop) and adjust the simulation speed dynamically.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def addTask(task: () => Unit, speed: SimulationSpeed): Unit

Registers a new task to be executed at the specified speed.

Registers a new task to be executed at the specified speed.

Value parameters

speed

the simulation speed determining the execution interval

task

the function to execute periodically

Attributes

def changeSpeed(speedMultiplier: Double): Unit

Changes the speed of all scheduled tasks by applying the given multiplier.

Changes the speed of all scheduled tasks by applying the given multiplier.

Value parameters

speedMultiplier

the factor by which to adjust the base task intervals

Attributes

Returns the current state of the scheduler.

Returns the current state of the scheduler.

Attributes

Returns

the current SchedulerState

def pause(): Unit

Pauses the scheduler, temporarily halting all task execution. The simulation state is preserved and can be resumed later.

Pauses the scheduler, temporarily halting all task execution. The simulation state is preserved and can be resumed later.

Attributes

def start(): Unit

Starts the scheduler, executing all registered tasks at their specified intervals. If the scheduler is already running, this method has no effect.

Starts the scheduler, executing all registered tasks at their specified intervals. If the scheduler is already running, this method has no effect.

Attributes

def stop(): Unit

Stops the scheduler, canceling all scheduled tasks. Returns the scheduler to the idle state.

Stops the scheduler, canceling all scheduled tasks. Returns the scheduler to the idle state.

Attributes