SimulationController

floodsim.controller.SimulationController
See theSimulationController companion object
sealed trait SimulationController

Controller of the simulation. Implementations coordinate the engine, a state store, and a scheduler to execute ticks and deliver updates.

Attributes

Companion
object
Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def addListener(listener: SimulationListener): Unit

Registers a listener to receive simulation events.

Registers a listener to receive simulation events.

Value parameters

listener

the observer to add

Attributes

def generateRandomMap(): Unit

Regenerates the ground map (terrain and obstacles) and notifies listeners.

Regenerates the ground map (terrain and obstacles) and notifies listeners.

Attributes

def generateReport(outputPath: String): Boolean

Generates a textual report of the current simulation and writes it to the specified path.

Generates a textual report of the current simulation and writes it to the specified path.

Value parameters

outputPath

destination file path

Attributes

Returns

true if the report was successfully saved, false otherwise

def initializeSimulation(): Unit

Initializes the simulation state and notifies listeners with the initial snapshot.

Initializes the simulation state and notifies listeners with the initial snapshot.

Attributes

def pauseSimulation(): Unit

Pauses the simulation execution without resetting state.

Pauses the simulation execution without resetting state.

Attributes

def removeListener(listener: SimulationListener): Unit

Unregisters a previously added listener.

Unregisters a previously added listener.

Value parameters

listener

the observer to remove

Attributes

def setSimulationSpeed(speedMultiplier: Double): Unit

Adjusts the simulation speed by applying a multiplier to the baseline interval.

Adjusts the simulation speed by applying a multiplier to the baseline interval.

Value parameters

speedMultiplier

factor applied to the Normal speed tick interval; values > 1.0 speed up the simulation

Attributes

def startSimulation(): Unit

Starts the simulation execution if it is not already running.

Starts the simulation execution if it is not already running.

Attributes

def stopSimulation(): Unit

Stops the simulation and resets the timer.

Stops the simulation and resets the timer.

Attributes

def updateCellType(coordinate: Coordinate, cellType: CellType): Unit

Updates the cell type at a given coordinate if the simulation is not running. Requires a given CellPhysics in scope for CellFactory.

Updates the cell type at a given coordinate if the simulation is not running. Requires a given CellPhysics in scope for CellFactory.

Value parameters

cellType

the new cell type to set

coordinate

target grid position

Attributes