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.3
Commit 0b4590a5507 (2024-04-30 10:59 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: 4 default, 0 interactive, 2 GC (on 4 virtual cores)
Environment:
  JULIA_CI = true
  JULIA_NUM_THREADS = auto
  JULIA_CONDAPKG_BACKEND = Null
  JULIA_PATH = /usr/local/julia/
  JULIA_DEPOT_PATH = /srv/juliapkg/
import Pkg
Pkg.status()
Status `/tmp/docs/abm/Project.toml`
  [46ada45e] Agents v6.0.12
 [13f3f980] CairoMakie v0.11.11
  [a93c6f00] DataFrames v1.6.1
  [31c24e10] Distributions v0.25.109
  [86223c79] Graphs v1.11.0
  [76b6901f] OSMMakie v0.0.10
  [2913bbd2] StatsBase v0.34.3
Info Packages marked with  have new versions available and may be upgradable.

This notebook was generated using Literate.jl.