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.
So far, the predefined models that exist in the Models
sub-module are:
Agents.Models.daisyworld
— Methoddaisyworld(;
griddims = (30, 30),
max_age = 25,
init_white = 0.2,
init_black = 0.2,
albedo_white = 0.75,
albedo_black = 0.25,
surface_albedo = 0.4,
solar_change = 0.005,
solar_luminosity = 1.0,
scenario = :default,
seed = 165
)
Same as in Daisyworld.
To access the Daisy
and Land
types, simply call
using Agents.Models: Daisy, Land
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,
dims = (100, 100),
)
Same as in Flock model.
Agents.Models.forest_fire
— Methodforest_fire(;
f = 0.02,
d = 0.8,
p = 0.01,
griddims = (100, 100),
seed = 111
)
Same as in Forest fire model.
Agents.Models.game_of_life
— Methodgame_of_life(;
rules::Tuple = (2, 3, 3, 3),
dims = (100, 100),
Moore = true
)
Same as in Conway's game of life.
Agents.Models.growing_bacteria
— Methodgrowing_bacteria()
Same as in Bacterial Growth.
Agents.Models.hk
— Methodhk(;
numagents = 100,
ϵ = 0.2
)
Same as in HK (Hegselmann and Krause) opinion dynamics model.
Agents.Models.predator_prey
— Methodpredator_prey(;
n_sheep = 100,
n_wolves = 50,
dims = (20, 20),
regrowth_time = 30,
Δenergy_sheep = 4,
Δenergy_wolf = 20,
sheep_reproduce = 0.04,
wolf_reproduce = 0.05,
)
Same as in Model of predator-prey dynamics.
To access the Sheep
, Wolf
and Grass
types, simply call
using Agents.Models: Sheep, Wolf, Grass
Agents.Models.schelling
— Methodschelling(;
numagents = 320,
griddims = (20, 20),
min_to_be_happy = 3
)
Same as in Schelling's segregation model.
Agents.Models.social_distancing
— Methodsocial_distancing(;
infection_period = 30 * steps_per_day,
detection_time = 14 * steps_per_day,
reinfection_probability = 0.05,
isolated = 0.5, # in percentage
interaction_radius = 0.012,
dt = 1.0,
speed = 0.002,
death_rate = 0.044, # from website of WHO
N = 1000,
initial_infected = 5,
seed = 42,
βmin = 0.4,
βmax = 0.8,
)
Same as in Continuous space social distancing for COVID-19.
Agents.Models.wealth_distribution
— Methodwealth_distribution(;
dims = (25, 25),
wealth = 1,
M = 1000
)
Same as in Wealth distribution model.
Agents.Models.wright_fisher
— Methodwright_fisher(;
numagents = 100,
selection = true
)
Same as in Wright-Fisher model of evolution.