JuliaDynamics/Agents.jl

abmexploration() throws exceptions when initialising agent data after all agents were previously

Open

#1.128 geöffnet am 23. Jan. 2025

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Julia (146 Forks)batch import
buggood first issueplotting

Repository-Metriken

Stars
 (904 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 12h 3m) (1 gemergte PR in 30 T)

Beschreibung

Describe the bug In Agents version 6.2.1 using abmexploration(), if I am collecting agent data and press the Reset button after all agents were removed on the previous run, it throws a DimensionsMismatch exception.

Minimal Working Example

module Ecosystem
using Agents, GLMakie

@agent struct Turtle(ContinuousAgent{2,Float64})
end

function agent_step!( me::Turtle, model)
    remove_agent!( me, model)
    return
end

xvel( me::Turtle) = me.vel[1]

abm = StandardABM( Turtle, ContinuousSpace((60,60)); agent_step!)
add_agent!( abm; vel=[1,1])
playground, _ = abmexploration( abm; adata=[(xvel, sum)])
display(playground)
end

If the code is runnable, it will help us identify the problem faster.

Agents.jl version

6.2.1

Contributor Guide