Class RandomOrderScheduler

java.lang.Object
modelarium.scheduler.RandomOrderScheduler
All Implemented Interfaces:
Scheduler

public class RandomOrderScheduler extends Object implements 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 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's run() method in a randomised order.
      Specified by:
      runTick in interface Scheduler
      Parameters:
      threadName - the name of the worker thread running the tick
      clock - the model's clock, giving the current tick
      environment - a read-only view of the worker's environment
      agentSet - the set of agents to run for this tick
      random - the random generator used to shuffle the agents