-
Notifications
You must be signed in to change notification settings - Fork 114
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
Use @dispatch
instead of branching for multiagent models
#1034
base: main
Are you sure you want to change the base?
Conversation
so what's the documentation? If I am a user wanting to learn, what do I read? |
Currently, there is a section in the ReadMe in MixedStructTypes describing it (https://github.com/JuliaDynamics/MixedStructTypes.jl?tab=readme-ov-file#define-functions-operating-with-the-mixed-structs) , but needs to be expanded. In Agents.jl we probably need to add it to the tutorial when describing the multiagent macro. |
Okay, so this is a non-breaking addition that allows using a "multiple dispatch" like syntax for |
Maybe this is good enough? I will wait a little bit before merging anyway because I need still to improve a bit more the macro |
I don't think it is a good idea to go all in into the |
Yes, I think you are right, I just demonstrated the branching version before the macro one now in the event-based tutorial. Now it should be good to go...but actually I still need to register the package so we need to wait a little bit more :D |
register which package? edit: okay saw the rename. |
Still a bit experimental in MixedStructTypes, so this still needs some adjustments, but I'd like to know what you think about this @Datseris (I'm still a bit unsure about the name of the macro). In practice what it does is to reconstruct the branching for the user. Actually in some more advanced cases, it could be more complicated to write the branching, with this it should be a lot easier.