Controller

io.github.srs.controller.ControllerModule.Controller
trait Controller[S <: State]

Controller trait that defines the interface for the controller.

Type parameters

S

the type of the state, which must extend ModelModule.State.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any

Members list

Value members

Abstract methods

def simulationLoop(s: S, queue: Queue[IO, Event]): IO[S]

Runs the simulation loop, processing events from the queue and updating the state.

Runs the simulation loop, processing events from the queue and updating the state.

Value parameters

queue

a concurrent queue that holds events to be processed.

s

the current state of the simulation.

Attributes

Returns

an IO task that completes when the simulation loop ends.

def start(initialState: S): IO[S]

Starts the controller with the initial state.

Starts the controller with the initial state.

Value parameters

initialState

the initial state of the simulation.

Attributes