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.10.6
Commit 67dffc4a8ae (2024-10-28 12:23 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
  LIBM: libopenlibm
  LLVM: libLLVM-15.0.7 (ORCJIT, znver3)
Threads: 2 default, 0 interactive, 1 GC (on 4 virtual cores)
Environment:
  JULIA_CI = true
  LD_LIBRARY_PATH = /opt/hostedtoolcache/Python/3.12.7/x64/lib
  JULIA_PROJECT = /home/runner/work/jl-abm/jl-abm/Project.toml
  JULIA_DEPOT_PATH = /home/runner/.julia:/opt/hostedtoolcache/julia/1.10.6/x64/local/share/julia:/opt/hostedtoolcache/julia/1.10.6/x64/share/julia
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_NUM_THREADS = 2
  JULIA_LOAD_PATH = @:@v#.#:@stdlib
import Pkg
Pkg.status()
Status `~/work/jl-abm/jl-abm/Project.toml`
  [46ada45e] Agents v6.1.11
  [13f3f980] CairoMakie v0.12.16
  [a93c6f00] DataFrames v1.7.0
  [31c24e10] Distributions v0.25.113
  [86223c79] Graphs v1.12.0
  [76b6901f] OSMMakie v0.0.10
  [2913bbd2] StatsBase v0.34.3

This notebook was generated using Literate.jl.