Expand description
Core ABM engine for rustsim.
This crate provides the foundational abstractions for agent-based modelling:
Agenttrait - the interface every agent type must implement.Modeltrait - 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 withHashMapStoreandVecStoreimplementations.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:
- Define agent types implementing
Agent. - Choose a space (from
rustsim-spaces) and a scheduler. - Wire up step functions and build a
StandardModelorEventQueueModel. - Call
StandardModel::step/StandardModel::step_nto advance the simulation. - Use
collect_stepto 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.
Modules§
- agent
- Agent trait - the fundamental interface for all simulation entities.
- avoidance
- Physical avoidance force primitives for pedestrian and agent dynamics.
- collect
- Data collection utilities.
- event_
queue - Continuous-time event-queue model.
- interaction
- Space interaction API - add, remove, move, and query agents in space.
- messaging
- Inter-agent messaging system inspired by FlameGPU2.
- model
- Abstract model trait - the interface shared by all model types.
- prelude
- scheduler
- Scheduler trait and built-in implementations.
- soa
- SoA (Structure-of-Arrays) extraction for GPU-friendly data layout.
- space
- Space trait - marker for spatial structures in which agents exist.
- standard
- Discrete-time standard model.
- step_
context - Deferred actions and the step context passed to agent step functions.
- store
- Agent containers - storage backends for the agent population.
- two_
phase - Two-phase stepping utilities inspired by FlameGPU2.
- types
- Fundamental identity, semantic, and time types used throughout the ABM engine.