Package modelarium.multithreading
Class CoordinatorThread
java.lang.Object
modelarium.multithreading.CoordinatorThread
- All Implemented Interfaces:
Runnable
Coordinator thread responsible for managing synchronised access to shared simulation state
between multiple worker threads in a parallel simulation.
This class listens to the request queue and uses CoordinatorRequestHandler
to respond to agent/environment-related queries or updates.
-
Constructor Summary
ConstructorsConstructorDescriptionCoordinatorThread(String name, Config config, Environment environment, modelarium.multithreading.requestresponse.RequestResponseController requestResponseController, modelarium.clock.Clock sharedClock) Constructs the coordinator thread with required references.CoordinatorThread(String name, Config config, Environment environment, modelarium.multithreading.requestresponse.RequestResponseController requestResponseController, modelarium.clock.Clock sharedClock, AgentSet predefinedGlobalAgentSet, Map<String, String> agentThreadMap) Constructs the coordinator thread with required references. -
Method Summary
-
Constructor Details
-
CoordinatorThread
public CoordinatorThread(String name, Config config, Environment environment, modelarium.multithreading.requestresponse.RequestResponseController requestResponseController, modelarium.clock.Clock sharedClock) Constructs the coordinator thread with required references.- Parameters:
name- the thread name or IDconfig- global model settingsenvironment- the shared simulation environmentrequestResponseController- the controller managing request/response queuessharedClock- the clock used to keep a track of time passing in the model
-
CoordinatorThread
public CoordinatorThread(String name, Config config, Environment environment, modelarium.multithreading.requestresponse.RequestResponseController requestResponseController, modelarium.clock.Clock sharedClock, AgentSet predefinedGlobalAgentSet, Map<String, String> agentThreadMap) Constructs the coordinator thread with required references.- Parameters:
name- the thread name or IDconfig- global model settingsenvironment- the shared simulation environmentrequestResponseController- the controller managing request/response queuessharedClock- the clock used to keep a track of time passing in the modelpredefinedGlobalAgentSet- the pre-defined agent set instance to use as the global agent setagentThreadMap- the map from agent name to the worker thread containing that agent
-
-
Method Details