Getting started with the Agents tutorial

Hi,
I just can’t seem to find out how to the Agents.jl tutorial up and running. I’ve used previous incarnations, but something’s not working this time - it’s been about a year since I last used it. The problems start with the @agents macro, even though I’ve previously updated the Agents package:

julia> versioninfo()
Julia Version 1.11.1
Commit 8f5b7ca12a (2024-10-16 10:53 UTC)
Build Info:
  Official https://julialang.org/ release
Platform Info:
  OS: Windows (x86_64-w64-mingw32)
  CPU: 8 × Intel(R) Core(TM) i7-1065G7 CPU @ 1.30GHz
  WORD_SIZE: 64
  LLVM: libLLVM-16.0.6 (ORCJIT, icelake-client)
Threads: 1 default, 0 interactive, 1 GC (on 8 virtual cores)

julia> using Agents

julia> @agent struct Person(GridAgent{2})
           age::Int
           money::Float64
       end
ERROR: LoadError: MethodError: no method matching var"@agent"(::LineNumberNode, ::Module, ::Expr)
The function `@agent` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  var"@agent"(::LineNumberNode, ::Module, ::Any, ::Any, ::Any)
   @ Agents C:\Users\hswt136nia\.julia\packages\Agents\06AXy\src\core\agents.jl:210
  var"@agent"(::LineNumberNode, ::Module, ::Any, ::Any, ::Any, ::Any)
   @ Agents C:\Users\hswt136nia\.julia\packages\Agents\06AXy\src\core\agents.jl:172

in expression starting at REPL[6]:1

Hi, you need to report the version of Agents.jl you are using before we can help you. Most likely you have an older version. You should always strive to have the latest version. The documentation shows the latest version in the bottom left corner:

Ah. Well, yes, thanks - that does indeed seem to be the problem: my current version is v5.17.2. What I don’t understand is that when I perform a Pkg.update on Agents, the version number doesn’t rise. What might prevent the update from happening?

OK, thanks very much - it was a compatibility issue. I think I’ve finally got my tomls all sorted now. Best wishes! :grinning: