rustsim-core 0.0.1

Core ABM engine: agents, models, stores, schedulers, stepping, data collection
Documentation

Core ABM engine for rustsim.

This crate provides the foundational abstractions for agent-based modelling:

  • Agent trait - the interface every agent type must implement.
  • Model trait - the abstract model interface exposing time, RNG, space, and agents.
  • StandardModel - discrete-time model with per-agent and per-model step functions.
  • EventQueueModel - continuous-time model driven by a deterministic event queue.
  • AgentStore - container trait with HashMapStore and VecStore implementations.
  • Scheduler - trait for controlling agent activation order each step.
  • StepContext - safe, borrow-checked context passed to agent step functions.
  • Core semantic types - shared identifiers and interfaces for nodes, edges, zones, levels, and connectors.
  • SoaExtractable - trait for extracting agent data into GPU-friendly SoA buffers.

Architecture

The crate mirrors the design of Julia's Agents.jl:

  1. Define agent types implementing Agent.
  2. Choose a space (from rustsim-spaces) and a scheduler.
  3. Wire up step functions and build a StandardModel or EventQueueModel.
  4. Call StandardModel::step / StandardModel::step_n to advance the simulation.
  5. Use collect_step to gather data at each step.

Interior Mutability

Agent stores use RefCell-based interior mutability so that agent step functions can read other agents while mutating the current one. This means the model types are !Send and !Sync - see the top-level rustsim crate for compute-routing alternatives.