Interactive application

The interactive application of Agents.jl is model-agnostic. This means that provided that the space of the model is one of the supported types (currently only 2D GridSpace or ContinuousSpace), the application does not care about the model dynamics or agent properties.

The app is based on InteractiveDynamics, another package of JuliaDynamics.

Here is an example application made with InteractiveDynamics.abm_data_exploration.

The animation at the start of this page was done with:

using Agents, Random
using InteractiveDynamics
using GLMakie

model, agent_step!, model_step! = Models.forest_fire()

alive(model) = count(a.status == :green for a in allagents(model))
burning(model) = count(a.status == :burning for a in allagents(model))
mdata = [alive, burning, nagents]
mlabels = ["alive", "burning", "total"]

params = Dict(
    :f => 0.02:0.01:1.0,
    :p => 0.01:0.01:1.0,
)

ac(a) = a.status ? "#1f851a" : "#67091b"
am = :rect

p1 = abm_data_exploration(model, agent_step!, model_step!, params;
ac = ac, as = 1, am = am, mdata, mlabels)