Update

update.Update
case class Update(customerManager: DefaultMovementManager)

Central update processor for the casino simulation's event-driven architecture.

The Update class serves as the main event processor that handles all simulation state transitions. It implements a tail-recursive event processing system where events are chained together to form complete simulation update cycles. Each simulation tick triggers a cascade of events that update different aspects of the simulation in a controlled sequence.

The class coordinates between various managers (movement, bankroll, decision) to ensure consistent state updates across all simulation components.

Value parameters

customerManager

the movement manager responsible for customer positioning and collision detection

Attributes

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

final def update(state: SimulationState, event: Event): SimulationState

Processes simulation events using tail-recursive event chaining.

Processes simulation events using tail-recursive event chaining.

This is the core method of the simulation update system. It processes events in a controlled sequence, where each event type triggers specific updates and then chains to the next appropriate event. The tail-recursive implementation ensures stack safety during long simulation runs.

The event processing flow follows this typical sequence:

  1. SimulationTick → SpawnCustomers → UpdateCustomersPosition → UpdateGames → UpdateSimulationBankrolls → UpdateCustomersState → (complete)

Configuration events (AddCustomers, UpdateWalls, etc.) typically complete without chaining to other events.

Value parameters

event

the event to process

state

the current simulation state

Attributes

Returns

the updated simulation state after processing the event and any chained events

Updates a DataManager instance with new simulation state.

Updates a DataManager instance with new simulation state.

Provides a convenient way to synchronize DataManager instances with changes to the simulation state, ensuring data consistency across different parts of the system.

Value parameters

dataManager

the current DataManager instance

state

the updated simulation state

Attributes

Returns

new DataManager instance with the updated state

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product