Package modelarium
Class Model
java.lang.Object
modelarium.Model
Main class for executing an agent-based model using multithreaded execution.
This class is responsible for configuring the environment, distributing agents across worker threads, running the simulation (synchronously or asynchronously), and collecting results.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the results of the most recent model run.voidrun()Runs the model using the configurations given during construction.
-
Constructor Details
-
Model
Constructs a new model instance with the specified settings.- Parameters:
config- the settings to use for model initialisation and execution
-
-
Method Details
-
run
public void run()Runs the model using the configurations given during construction.Calling this method again starts a new run with the same configuration and replaces the previously exposed results after generation begins.
- Throws:
ModelRunException- if a worker fails or the calling thread is interrupted while waiting for workers
-
getResults
Returns the results of the most recent model run.- Returns:
- a new
ReadOnlyResultsinstance - Throws:
IllegalStateException- if the model has not yet been run
-