Closed jessica-reale closed 2 months ago
you need to call @finalize_patterns
at the end of your module to register the various functions...but @multiagent
will probably be deprecated in a subsequent version of Agents.jl, because Julia 1.11 is a lot more efficient that the previous version and something like @multiagent
is no more necessary for performance code. There is a new methodology in DynamicSumTypes which will probably be mentioned somewhere in the docs. But will be useful just when max performance is required. So I suggest you to stick with normal Julia structs :-)
Sorry it is @finalize_dispatch
actually
Hi to everyone, first of all, thank you very much for all your work.
I am implementing a macroeconomic model with multiple agents, and the new multiagent feature is very useful. However, recent changes to the dispatch macro have caused problems in my previously working code. After some debugging, I have the impression that the newly defined dispatch macro within the DynamicSumTypes package does not work within Julia modules, as the functions defined with the dispatch macro encounter UndefVarError. No error is instead encountered outside modules.
Could you please check whether this is the case and fix this issue? Otherwise, what other possible solution would you suggest? For now, I am not upgrading to the new version and I keep using
Agents v6.0.14
.I tried to create an easy code example that I attach below.
When running this code in
Agents v6.0.17
, I encounter the following error. Instead, everything works fine withAgents v6.0.14
.I hope this can be useful.
Thank you in advance for your feedback, best Jessica