Modelarium 2.0.0 API

Modelarium API

Modelarium is a modular, extensible, and multithreaded agent-based modelling framework for Java 21. Models are assembled from agents, one environment, and composable property, event, and routine attributes.

Starting a model

  1. Create agent and environment attributes and group them into named attribute sets.
  2. Provide agent and environment generators.
  3. Build a Config and pass it to Model.
  4. Call Model.run().
  5. Inspect or export the ReadOnlyResults returned by Model.getResults().

Main extension points

  • modelarium.entities.attributes and its subpackages define properties, events, routines, and their functional variants.
  • modelarium.entities.generators controls population and environment construction.
  • modelarium.scheduler controls local agent execution order.
  • modelarium.entities.logging.databases.factories selects memory- or disk-backed log storage.

Concurrency

Synchronised runs advance worker threads in lockstep, support cross-worker population access, and run environment behaviour at tick boundaries. Unsynchronised runs avoid co-ordination but do not support cross-worker lookups and do not run environment attributes. Configure this behaviour through Config.ConfigBuilder; the multithreading implementation packages are not application extension points.

API status

Packages annotated with PublicApi form the supported API unless a type or member is marked @Internal. Internal elements may remain Java-public for framework integration but are not covered by semantic-versioning compatibility guarantees.

Packages
Package
Description
Provides Modelarium's primary configuration and execution API.
Defines annotations used to identify Modelarium's supported public API.
Provides read-only access to simulation time.
Defines the agents and environment which make up a Modelarium simulation.
Provides mutable and read-only collections of agents.
Defines the common API for Modelarium attributes.
Provides conditional event attributes for agents and environments.
Provides functional interfaces and lambda-backed implementations of event attributes.
Provides typed state-bearing properties for agents and environments.
Provides functional interfaces and lambda-backed implementations of property attributes.
Provides unconditional per-tick routines for agents and environments.
Provides functional interfaces and lambda-backed implementations of routine attributes.
Provides named, ordered collections of agent and environment attributes.
Provides read-only views of agent and environment attribute sets.
Defines the simulation views supplied to attribute behaviour.
Provides extension points for constructing a model's agents and environment.
Provides logs which associate an entity and attribute set with recorded attribute series.
Provides memory- and disk-backed storage for attribute log series.
Provides factories which select and create the logging backend used by a model run.
Provides read-only views of agents, environments, and their common entity state.
Defines Modelarium-specific failures for model execution, entity lookup, attribute access, coordination, timeouts, interruption, and missing functional behaviour.
Implements Modelarium's worker and co-ordinator runtime.
Provides immutable access to completed model results and result export.
Provides policies for ordering local agent execution on each tick.
Provides a lambda-backed scheduler and its tick function interface.
Provides small public utility types used by Modelarium extension points.