|
84 | 84 |
|
85 | 85 | # One can furthermore collect data while the model evolves and visualize them using the |
86 | 86 | # convenience function [`abmexploration`](@ref) |
| 87 | +using Statistics: mean |
87 | 88 | black(a) = a.breed == :black |
88 | 89 | white(a) = a.breed == :white |
89 | 90 | adata = [(black, count), (white, count)] |
90 | 91 | temperature(model) = mean(model.temperature) |
91 | 92 | mdata = [temperature, :solar_luminosity] |
92 | | -fig, p = abmexploration(model; |
| 93 | +fig, abmobs = abmexploration(model; |
93 | 94 | agent_step! = daisy_step!, model_step! = daisyworld_step!, params, plotkwargs..., |
94 | 95 | adata, alabels = ["Black daisys", "White daisys"], mdata, mlabels = ["T", "L"] |
95 | 96 | ) |
@@ -158,15 +159,15 @@ abmvideo( |
158 | 159 |
|
159 | 160 | # create a basic abmplot with controls and sliders |
160 | 161 | model, = daisyworld(; solar_luminosity = 1.0, solar_change = 0.0, scenario = :change) |
161 | | -fig, ax, p = abmplot(model; |
| 162 | +fig, ax, abmobs = abmplot(model; |
162 | 163 | agent_step! = daisy_step!, model_step! = daisyworld_step!, params, plotkwargs..., |
163 | 164 | adata, mdata, figure = (; resolution = (1600,800)) |
164 | 165 | ) |
165 | 166 | fig |
166 | 167 |
|
167 | 168 | # |
168 | 169 |
|
169 | | -p |
| 170 | +abmobs |
170 | 171 |
|
171 | 172 | # |
172 | 173 |
|
|
0 commit comments