-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a dynamic version of agents #1070
Comments
Hm I am concerned about the performance implications this has... The implementation in that package is actually rather simple. A dict with symbol keys is added to the type. We can do this here as well, but the better question is should we? It would likely have terrible performance plus it is also easy for a user to do this on their own no? Anyone can make an additional properties dictionary for the agents. |
yes sure, it's simple, the point to me is that it reduces the boilerplate needed to do it by yourself, so it's mostly for convenience. That package also implements an interface, apart from using a dictionary as a field. Sure, even this is not that difficult, but it would require some more code to do also that yourself. It will surely cause some performance degradation though. But you can always go back to |
In this discussion we are not putting any weight on the cost of the impact this has on the learning curve. Sure, for you it's simple to just add another concept to grasp, static or dynamic, but when one learns the agents macro they have to learn all of them at once. And the macro is already somehing non trivial. I guess you can document this new feature at the end of the existing docstring as a new section. That probably will be enough. I am not a fan of introducing new macros though such as that has macro. Macros put a heavy load on the learning curve. Which is the minimal functionality that we need here? |
Exactly, we can just do that. I think it won't need much more than that.
I think that |
First of all, let's think if this feature is useful: in what kind of simulation do you foresee requiring to add completely new properties to an agent, in a way that can't be done in an existing dictionary property? I am trying to think a simulation where I would need to add completely new, and unexpected, properties to agents, but I can't think of something. |
Saw this package: https://github.com/AntonOresten/DynamicStructs.jl
We could maybe incorporate it in Agents.jl to offer a dynamic version of an
@agent
which can have new attributes over time, to be added with:static
being the old version and the default. This seems like a cool feature, provided that it is easy to integrate.The text was updated successfully, but these errors were encountered: