Observed since 20 Oct, 17:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
A modern, extensible agent-based simulation framework for Python.
ABMForge is a lightweight, Python-first alpha framework for agent-based modeling, with first-class support for scenarios, structured datasets, and reproducibility-oriented metadata.
It is designed for researchers, educators, model developers, and Python users who want to build agent-based simulations that are easy to write, easier to inspect, easier to analyze, and easier to reproduce when source code, inputs, and environments are preserved.
ABMForge focuses on four principles:
Reproducibility-oriented Model runs can be controlled with deterministic seeds and reproducibility metadata, while full reconstruction still depends on preserving source code, inputs, and environments.
Experiment-native
Simulations are organized around scenarios, parameter grids, multi-seed experiments, and run results.
Dataset-first
Model-level, agent-level, event-level, lifecycle, and run metadata can be recorded and exported.
Python-first and lightweight
The core is intentionally small, typed, and easy to inspect.
ABMForge is not intended to be a clone of Mesa, NetLogo, or AgentPy. Its goal is to provide a research-friendly ABM workflow centered on reproducibility, experiments, datasets, and extensibility.
ABMForge is designed around a research workflow:
Model → Scenario → Experiment → Dataset → Analysis → Visualization
The framework emphasizes:
Rather than focusing only on simulation execution, ABMForge aims to support the complete lifecycle of computational experiments.
ABMForge currently provides:
Clone the repository and install in editable mode:
git clone https://github.com/fatihuludag-lab/abmforge.git
cd abmforge
pip install -e ".[dev]"
Optional extras:
pip install -e ".[viz]"
pip install -e ".[analysis]"
pip install -e ".[docs]"
pip install -e ".[all]"
from abmforge import Agent, Model, Scenario
from abmforge.scheduling import RandomActivation
class Person(Agent):
def step(self) -> None:
self.wealth += 1
class WealthModel(Model):
def setup(self) -> None:
self.agents.create(Person, n=100, wealth=0)
self.scheduler = RandomActivation(self)
self.record.metric("total_wealth", lambda model: model.agents.sum("wealth"))
def step(self) -> None:
self.scheduler.step()
scenario = Scenario(model=WealthModel, seed=42, steps=10)
result = scenario.run()
print(result.dataset.model_records)
ABMForge currently provides:
AgentModelAgentCollectionScenarioExperimentParameterGridExperimentResultRecorderDatasetEventEventQueueABMForge supports multiple environment types:
GridWorldNetworkSpaceContinuousSpaceGISSpaceAvailable activation strategies:
SequentialActivationRandomActivationSimultaneousActivationStagedActivationABMForge can run parameter sweeps and repeated-seed experiments:
from abmforge import Experiment
experiment = Experiment(
model=WealthModel,
parameters={
"initial_wealth": [0, 10],
"growth": [1, 2],
},
seeds=[1, 2, 3],
steps=100,
)
result = experiment.run()
print(result.summary())
result.write_csv("outputs/experiment")
A run dataset can be exported as JSON/JSONL or CSV:
result.dataset.write_json("outputs/run_json")
result.dataset.write_csv("outputs/run_csv")
result.dataset.write_manifest("outputs/run_manifest")
Experiment results can also be exported:
experiment_result.write_csv("outputs/experiment")
ABMForge records run metadata such as:
Snapshot helpers are also available:
from abmforge import read_snapshot, write_snapshot
snapshot = model.snapshot()
write_snapshot(snapshot, "outputs/snapshot.json")
loaded = read_snapshot("outputs/snapshot.json")
Visualization helpers are optional and require matplotlib:
pip install -e ".[viz]"
Available helpers:
from abmforge import plot_grid, plot_multiple_runs, plot_timeseries
plot_timeseries(result.dataset, metric="infected")
plot_multiple_runs(experiment_result, metric="mean_wealth")
plot_grid(model.world)
ABMForge includes a lightweight sensitivity analysis helper:
from abmforge import SensitivityAnalysis
analysis = SensitivityAnalysis(experiment_result, metric="total_wealth")
print(analysis.summary())
Optional SALib integration is also available:
pip install -e ".[analysis]"
from abmforge import SALibProblem, sample_sobol, analyze_sobol
problem = SALibProblem(
bounds={
"density": (0.4, 0.9),
"homophily": (0.1, 0.8),
}
)
samples = sample_sobol(problem, n=128, seed=42)
The repository includes several examples:
python3 examples/wealth_model/run.py
python3 examples/schelling/run.py
python3 examples/sir_epidemic/run.py
python3 examples/sugarscape/run.py
python3 examples/parameter_sweep/run.py
python3 examples/gis_space/run.py
Current example gallery:
Install development dependencies:
pip install -e ".[dev]"
Run local checks:
ruff format src tests examples
ruff check src tests examples
mypy src
pytest
python3 -m build
ABMForge is alpha-stage software. The top-level import surface is declared in
abmforge.api and documented in docs/api-stability.md. Core research
entrypoints such as Agent, Model, Scenario, Experiment, Dataset, and
Recorder are treated as stable-alpha imports; replay, optional analysis, and
visualization helpers remain experimental until their contracts mature.
ABMForge is currently an alpha-stage framework.
The current focus is:
Near-term priorities:
ABMForge aims to differentiate through:
Contributions are welcome.
Good first areas include:
Before opening a pull request, please run:
ruff format src tests examples
ruff check src tests examples
mypy src
pytest
python3 -m build
ABMForge is distributed under the Apache-2.0 license. See LICENSE.
Please use GitHub Issues for reproducible bugs, feature requests, documentation problems, and reproducibility reports. Use the reproducibility report template for scenario, archive, manifest, checksum, seed, ODD, or validation issues.
For support details, see SUPPORT.md and docs/community-and-issues.md.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.3.0a1 | 30 Jun 2026 | 18 |
This describes our collected data; it is not a security assessment.
Observed since 20 Oct, 17:30 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:025d5f1f77facc8f250cfca0ccfb1ce919d6f343a84dfd139caca12e37db06b4