Package modelarium.scheduler
Class FunctionalScheduler
java.lang.Object
modelarium.scheduler.FunctionalScheduler
- All Implemented Interfaces:
ModelScheduler
A scheduler implementation that delegates each simulation tick
to a user-defined function.
This allows flexible tick behaviour without requiring subclassing
or direct implementation of the ModelScheduler interface.
The user provides a Consumer that defines what should happen
during a single simulation tick for a given set of agents.
Typical use cases include passing a lambda expression or method reference to customise the tick logic externally, for example from another Java module or from Python via JPype with a proxy.
-
Constructor Summary
ConstructorsConstructorDescriptionFunctionalScheduler(Consumer<AgentSet> tickFunction) Constructs a FunctionalScheduler with the specified tick function. -
Method Summary
-
Constructor Details
-
Method Details
-
runTick
Executes a single simulation tick by delegating to the user-provided function.- Specified by:
runTickin interfaceModelScheduler- Parameters:
agentSet- the set of agents to act upon during this tick
-