rustsim - high-performance agent-based modelling engine.
This is the top-level orchestration crate that re-exports all sub-crates and adds:
- [
compute] - CUDA/CPU compute routing and SoA batch stepping. - [
control_plane] - deterministic replay, checkpoint/restore, engine metrics, typed failures, and partition metadata. - [
device_store] - persistent device-side SoA storage (FlameGPU2-style). - [
ensemble] - parameter sweep and batch simulation runner. - [
layers] - layer-based execution model for multi-function steps. - [
interaction] - columnar spatial interaction/message indexes. - [
telemetry] - end-to-end pipeline from data collection to ClickHouse.
Quick start
See the full working example under examples/basic_particle.rs:
use rand::rngs::StdRng;
use rand::SeedableRng;
use rustsim::prelude::*;
use rustsim_spaces::nothing::NothingSpace;
#[derive(Debug, Clone)]
struct Particle { id: AgentId, x: f64 }
impl Agent for Particle { fn id(&self) -> AgentId { self.id } }
let mut store: HashMapStore<Particle> = HashMapStore::new();
store.insert(Particle { id: 1, x: 0.0 });
let rng = StdRng::seed_from_u64(42);
let mut model: StandardModel<NothingSpace, Particle, _, (), _, Fastest> =
StandardModel::new(
store,
NothingSpace,
Fastest::new(),
(),
rng,
None::<Box<dyn FnMut(&mut Particle, &mut StepContext<NothingSpace, Particle, (), StdRng, Fastest>)>>,
None,
true,
);
model.step_n(100);
Crate architecture
| Crate | Purpose |
|---|---|
rustsim-core |
ABM engine: agents, models, stores, schedulers, stepping, messaging |
rustsim-spaces |
Space implementations: nothing, grid, continuous, graph, hybrid |
rustsim-schedulers |
Re-exports scheduler types |
rustsim-pathfinding |
Generic A* and grid-specific pathfinding |
rustsim-io |
Arrow batch building, ClickHouse writer |
rustsim-geometry |
2-D and 3-D geometric primitives (vectors, AABB, rays, triangles, spheres) |
rustsim-broadphase |
Spatial neighbour queries: uniform grids in 2-D and 3-D |
rustsim-modes |
Shared mode semantics (TravelMode, AllowedModes) |
rustsim-traffic |
Macroscopic traffic-flow semantics (link properties, FDs, signals, turns) |
rustsim-crowd |
Microscopic crowd locomotion (5 pedestrian models + layered 2.5-D) |
rustsim-vehicle |
Vehicle dynamics: IDM longitudinal, bicycle lateral, MOBIL lane-change |
rustsim-transit |
Transit primitives: stops, routes, schedules, boarding queues, dwell times |
rustsim-mobility |
Multi-modal glue: trips, legs, mode-transition state machine, modal Dijkstra, shared obstacle trait |
rustsim (this crate) |
Orchestration, compute routing, device storage, ensemble, telemetry |