-
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
Refactoring the access to space related functions to move towards multispace models #910
Comments
For me this needs to be justified in the first place... How general is the need for this functionality? But yes, in any case, the refactor outlined here is very easy to do and also non breaking. |
However, the proposal here doesn't work for two spaces of the same kind, two different grid spaces. Which I would assume would be the most common case of this already extremely uncommon feature. |
It works even for two space of the same kind, take
We will solve #719 for example. More generally we will allow for separating types in different spaces which can be useful sometimes for performance e.g. the wolfsheep model would be faster this way. Also some mixture of space types could be actually interesting e.g. the one suggested in #719 is already an example NoSpace + Any other Space |
Well, yes, but as I also said in #719 I am not at all convinced about the usefulness or necessity of this feature given the arguments of #719 as it is arguably simpler to achieve the same result without mixing spaces.
There is no proof yet of whether this will have measurable performance boost, because there is no way for multiple dispatch to deduce the type. GridSpaces do not store agent types nor have any knowledge of them. So type instability will remain the main problem. Notice also that it is more complicated to setup this versus the setup of just 1 space. And more complicated to handle tit as well. All That being said, nothing stops this from being an optional feature that is discussed at some advanced section of the API. |
Take this function:
we could refactor this code so that to have:
What does this allow? It gets us nearer to possible implementation of multispace models since we need to give the possibility to the user to access the space-related function dispatching on the space when implementing a multi-space extension (which can be just as simple as a namedtuple of spaces), so that to allow to refer to different spaces inside his/her code.
Note that this is a costless abstraction.
cc: @Datseris
Related to #719, #720
The text was updated successfully, but these errors were encountered: