Package modelarium.scheduler
Class InOrderScheduler
java.lang.Object
modelarium.scheduler.InOrderScheduler
- All Implemented Interfaces:
Scheduler
Class for scheduling agents to execute in the order they appear in the agent set.
This scheduling strategy ensures that all agents are processed sequentially and predictably for each simulation tick.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidrunTick(String threadName, ReadOnlyClock clock, ReadOnlyEnvironment environment, AgentSet agentSet, RandomGenerator random) Executes each agent'srun()method in the order they are stored in the agent set.
-
Constructor Details
-
InOrderScheduler
public InOrderScheduler()Constructs an in-order scheduler.
-
-
Method Details
-
runTick
public void runTick(String threadName, ReadOnlyClock clock, ReadOnlyEnvironment environment, AgentSet agentSet, RandomGenerator random) Executes each agent'srun()method in the order they are stored in the agent set.- 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 the scheduler can use for ordering decisions
-