Agents.jl icon indicating copy to clipboard operation
Agents.jl copied to clipboard

Does EventQueueABM require @multiagent?

Open jdm204 opened this issue 9 months ago • 1 comments

Describe the bug I'm trying out the new EventQueueABM functionality, and I get an error that my agent wasn't created with the @multiagent macro, which is true, but I just have a single agent type with no need for Union or @multiagent.

Minimal Working Example

using Agents
@agent struct Foo(GridAgent{2}) end

bar!(agent, model) = println(agent)

function init_foo()
    space = GridSpaceSingle((10, 10))
    events = (
        AgentEvent(action! = bar!, propensity = 0.1),
    )
    model = EventQueueABM(
        Foo,
        events, space)
    add_agent!((5, 5), model)
    model
end
init_foo()

ERROR: ArgumentError: Agent of type Foo has not been created via @multiagent.

Agents.jl version

Agents v6.0.13 https://github.com/JuliaDynamics/Agents.jl.git#8c36b50 Julia 1.10.3

jdm204 avatar May 26 '24 08:05 jdm204