Agent-based Modeling

Agent-based Modeling (ABM) is a simulation method where the autonomous agents interacting with the environment (space) and/or each other by a set of rules.

The most obvious example of ABM is to simulate actions of non-player characters (NPCs) in computer games.

ABM is able to model heterogeneously, i.e. it does not require the environment to be well stirred (as opposed to ODEs), continuous (as opposed to to PDEs), nor need the characteristics of each kind of agents to be identical (as opposed to SSAs).

This makes ABM more flexible to model individual behaviors. - traffic jam - infectious disease spread - molecular interactions

Elements of ABM

To use Agents.jl, we need to define:

  • The space where the agents live
  • The agents with self-defined properties.
  • The model to hold the space, the agents, and other parameters (called properties)
  • The stepping function step!() to tell how the model evolve.

Could I do ABM by myself?

Yes, you can define the agents, rules and stepping functions from scratch, but it’s more convenient (and perhaps more performant) to use a test package like Agents.jl.

Resources

Runtime environment

import InteractiveUtils
InteractiveUtils.versioninfo()
Julia Version 1.12.4
Commit 01a2eadb047 (2026-01-06 16:56 UTC)
Build Info:
  Official https://julialang.org release
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: 4 × AMD EPYC 7763 64-Core Processor
  WORD_SIZE: 64
  LLVM: libLLVM-18.1.7 (ORCJIT, znver3)
  GC: Built with stock GC
Threads: 2 default, 1 interactive, 2 GC (on 4 virtual cores)
Environment:
  JULIA_CI = true
  JULIA_CONDAPKG_OFFLINE = true
  LD_LIBRARY_PATH = /opt/hostedtoolcache/Python/3.14.2/x64/lib
  JULIA_PROJECT = /home/runner/work/jl-abm/jl-abm/Project.toml
  JULIA_DEPOT_PATH = /home/runner/.julia:/opt/hostedtoolcache/julia/1.12.4/x64/local/share/julia:/opt/hostedtoolcache/julia/1.12.4/x64/share/julia
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_NUM_THREADS = 2
  JULIA_LOAD_PATH = @:@v#.#:@stdlib
  JULIA_CPU_TARGET = generic;icelake-server,clone_all;znver3,clone_all
import Pkg
Pkg.status()
Status `~/work/jl-abm/jl-abm/Project.toml`
  [46ada45e] Agents v6.2.10
⌃ [13f3f980] CairoMakie v0.13.10
  [69e1c6dd] CellListMap v0.9.15
  [a93c6f00] DataFrames v1.8.1
  [927a84f5] DelaunayTriangulation v1.6.6
  [31c24e10] Distributions v0.25.123
⌃ [86223c79] Graphs v1.13.1
⌅ [682c06a0] JSON v0.21.4
  [98b081ad] Literate v2.21.0
  [1862ce21] MarkdownTables v1.1.0
  [90137ffa] StaticArrays v1.9.16
  [2913bbd2] StatsBase v0.34.10
⌅ [ff63dad9] StreamSampling v0.6.9
  [bd369af6] Tables v1.12.1
  [ea8e919c] SHA v0.7.0
Info Packages marked with ⌃ and ⌅ have new versions available. Those with ⌃ may be upgradable, but those with ⌅ are restricted by compatibility constraints from upgrading. To see why use `status --outdated`

This notebook was generated using Literate.jl.

Back to top