The reasons why ABM is not a parameterized type in Agents.jl?

Hi, its great that you are curious! I hope the answer “its a matter of style” won’t dissapoint you though :smiley:

  1. AgentBasedModel has several other type parameters besides the agent type, and therefore specifiying only one of the first in {} does not appear very intuitive to me.
  2. It makes for a simpler API if everything is an argument to a function, rather than half the things being arguments to functions and the other half being type parameters. Said differently, I believe that ABM{x1}(x2) is fundamentally more complex expression than ABM(x1, x2). Internally we can transfer x1 to be type parameter if necessary.
  3. Even if you did specified the type of the other arguments, like the space type, you would still need to give the actual space instance to the function as its actual values, besides its type, are needed. So you would need to write ABM{A, S}(s::S), i.e., repeat the information S twice, which is a bit pointless if you think about it.
4 Likes