Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve time offset implementation #1007

Closed
wants to merge 1 commit into from
Closed

Improve time offset implementation #1007

wants to merge 1 commit into from

Conversation

Tortar
Copy link
Member

@Tortar Tortar commented Mar 15, 2024

this improves the time offset implementation, the collected dataframe is no more modified, the points are just moved in the plots

@Tortar Tortar requested a review from Datseris March 15, 2024 02:08
@Tortar
Copy link
Member Author

Tortar commented Mar 15, 2024

I verified it works correctly by running and verify the working of

using Revise
using Agents, GLMakie
using AgentsExampleZoo

model = AgentsExampleZoo.daisyworld(;
    solar_luminosity = 1.0, solar_change = 0.0, scenario = :change
)

daisycolor(a) = a.breed # agent color
agent_size = 20    # agent size
agent_marker = ''  # agent marker
agentsplotkwargs = (strokewidth = 1.0,) # add stroke around each agent

heatarray = :temperature
heatkwargs = (colorrange = (-20, 60), colormap = :thermal)
plotkwargs = (;
    agent_color = daisycolor, agent_size, agent_marker,
    agentsplotkwargs = (strokewidth = 1.0,),
    heatarray, heatkwargs
)


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

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;
    params, plotkwargs...,  adata, alabels = ["Black daisys", "White daisys"],
    mdata, mlabels = ["T", "L"]
)
fig

@Tortar
Copy link
Member Author

Tortar commented Mar 15, 2024

it's probably better if we add a slightly modified version of this to #1001 but it doesn't work as intended there because the branch already doesn't work correctly, so first that should be fixed

@Datseris
Copy link
Member

Can you please do this PR on the existing branch of PR #1001 ?

@Tortar Tortar closed this Mar 15, 2024
@Tortar Tortar deleted the offset branch September 15, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants