Skip to content
This repository has been archived by the owner on Jun 21, 2024. It is now read-only.

Commit

Permalink
fix missing mean from agents example
Browse files Browse the repository at this point in the history
  • Loading branch information
Datseris committed Jul 10, 2022
1 parent 415b3c2 commit 8aafcc7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "InteractiveDynamics"
uuid = "ec714cd0-5f51-11eb-0b6e-452e7367ff84"
repo = "https://github.com/JuliaDynamics/InteractiveDynamics.jl.git"
version = "0.21.8"
version = "0.21.9"

[deps]
DataStructures = "864edb3b-99cc-5e75-8d2d-829cb0a9cfe8"
Expand Down
7 changes: 4 additions & 3 deletions docs/src/agents.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,12 +84,13 @@ fig

# One can furthermore collect data while the model evolves and visualize them using the
# convenience function [`abmexploration`](@ref)
using Statistics: mean
black(a) = a.breed == :black
white(a) = a.breed == :white
adata = [(black, count), (white, count)]
temperature(model) = mean(model.temperature)
mdata = [temperature, :solar_luminosity]
fig, p = abmexploration(model;
fig, abmobs = abmexploration(model;
agent_step! = daisy_step!, model_step! = daisyworld_step!, params, plotkwargs...,
adata, alabels = ["Black daisys", "White daisys"], mdata, mlabels = ["T", "L"]
)
Expand Down Expand Up @@ -158,15 +159,15 @@ abmvideo(

# create a basic abmplot with controls and sliders
model, = daisyworld(; solar_luminosity = 1.0, solar_change = 0.0, scenario = :change)
fig, ax, p = abmplot(model;
fig, ax, abmobs = abmplot(model;
agent_step! = daisy_step!, model_step! = daisyworld_step!, params, plotkwargs...,
adata, mdata, figure = (; resolution = (1600,800))
)
fig

#

p
abmobs

#

Expand Down

0 comments on commit 8aafcc7

Please sign in to comment.