Package modelarium.scheduler
Class RandomOrderScheduler
java.lang.Object
modelarium.scheduler.RandomOrderScheduler
- All Implemented Interfaces:
Scheduler
Class for scheduling agents to execute in a randomised order for each tick.
This scheduling strategy helps reduce bias introduced by fixed execution orders and may more closely reflect stochastic processes in real-world systems.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrunTick(String threadName, ReadOnlyClock clock, ReadOnlyEnvironment environment, AgentSet agentSet, RandomGenerator random) Executes each agent'srun()method in a randomised order.
-
Constructor Details
-
RandomOrderScheduler
public RandomOrderScheduler()Constructs a random-order scheduler.
-
-
Method Details
-
runTick
public void runTick(String threadName, ReadOnlyClock clock, ReadOnlyEnvironment environment, AgentSet agentSet, RandomGenerator random) Executes each agent'srun()method in a randomised order.- Specified by:
runTickin interfaceScheduler- Parameters:
threadName- the name of the worker thread running the tickclock- the model's clock, giving the current tickenvironment- a read-only view of the worker's environmentagentSet- the set of agents to run for this tickrandom- the random generator used to shuffle the agents
-