Predefined Models
Predefined agent based models exist in the Models
submodule in the form of functions that return model, agent_step!, model_step!
when called.
They are accessed like:
using Agents
model, agent_step!, model_step! = Models.flocking(; kwargs...)
The Examples section of the docs outline how to use and interact with each model.
Please notice that the predefined models are a convenience and not considered part of the public API. This means that they can have breaking changes between versions of Agents.jl without warning.
So far, the predefined models that exist in the Models
sub-module are:
Agents.Models.flocking
— Methodflocking(;
n_birds = 100,
speed = 1.0,
cohere_factor = 0.25,
separation = 4.0,
separate_factor = 0.25,
match_factor = 0.01,
visual_distance = 5.0,
extent = (100, 100),
spacing = visual_distance / 1.5
)
Same as in Flocking model.
Agents.Models.schelling
— Methodschelling(;
numagents = 320,
griddims = (20, 20),
min_to_be_happy = 3,
)
Same as in Schelling's segregation model.
Agents.Models.sir
— Methodsir(;
C = 8,
max_travel_rate = 0.01,
Ns = rand(50:5000, C),
β_und = rand(0.3:0.02:0.6, C),
β_det = β_und ./ 10,
infection_period = 30,
reinfection_probability = 0.05,
detection_time = 14,
death_rate = 0.02,
Is = [zeros(Int, length(Ns) - 1)..., 1],
seed = 19,
)
Same as in SIR model for the spread of COVID-19.
Agents.Models.zombies
— Methodzombies(; seed = 1234)
Same as in the Zombie Outbreak example.