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

No vertical red line appearing when resetting model during abmexploration #107

Closed
hbsmith opened this issue Aug 31, 2022 · 1 comment · Fixed by #110
Closed

No vertical red line appearing when resetting model during abmexploration #107

hbsmith opened this issue Aug 31, 2022 · 1 comment · Fixed by #110
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@hbsmith
Copy link
Contributor

hbsmith commented Aug 31, 2022

Here's a MWE pulled almost entirely from the AgentsZoo example page.

According to this page https://juliadynamics.github.io/InteractiveDynamics.jl/dev/agents/#InteractiveDynamics.abmexploration
"Clicking the "reset" button will add a red vertical line to the data plots for visual guidance." But this doesn't happen for me.

I'm running InteractiveDynamics v0.21.11, Agents v5.4.3.

using InteractiveDynamics, Agents
using GLMakie
daisypath = joinpath(dirname(pathof(InteractiveDynamics)), "agents", "daisyworld_def.jl")
include(daisypath)
model, daisy_step!, daisyworld_step! = daisyworld(;
    solar_luminosity = 1.0, solar_change = 0.0, scenario = :change
)

daisycolor(a::Daisy) = a.breed # color of agents
as = 20 # size of agents
am = '' # marker of agents

params = Dict(
    :surface_albedo => 0:0.01:1,
    :solar_change => -0.1:0.01:0.1,
)

heatarray = :temperature
heatkwargs = (colorrange = (-20, 60), colormap = :thermal)
plotkwargs = (;
    ac = daisycolor, as, am,
    scatterkwargs = (strokewidth = 1.0,),
    heatarray, heatkwargs
)

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, abmobs = abmexploration(model;
    agent_step! = daisy_step!, model_step! = daisyworld_step!, params, plotkwargs...,
    adata, alabels = ["Black daisys", "White daisys"], mdata, mlabels = ["T", "L"]
)

display(fig)

if !isinteractive()
    println("Keeping process alive so that the Makie window doesn't close... Press ENTER to kill...")
    readline()
end
@Datseris Datseris added bug Something isn't working good first issue Good for newcomers labels Sep 4, 2022
@Datseris
Copy link
Member

Datseris commented Sep 4, 2022

Yeah that's a bug, I guess with all the code refactoring we somehow forgot this clause in the source. It's easy to implement again!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants