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.daisyworldMethod
daisyworld(;
    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
source
Agents.Models.flockingMethod
flocking(;
    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 Flock model.

source
Agents.Models.predator_preyMethod
predator_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
source
Agents.Models.social_distancingMethod
social_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.

source
Agents.Models.sugarscapeMethod
sugarscape(;
    dims = (50, 50),
    sugar_peaks = ((10, 40), (40, 10)),
    growth_rate = 1,
    N = 250,
    w0_dist = (5, 25),
    metabolic_rate_dist = (1, 4),
    vision_dist = (1, 6),
    max_age_dist = (60, 100),
    max_sugar = 4,
)

Same as in Sugarscape.

source