Skip to content
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

user-defined interaction kernels would be useful #386

Open
bhaller opened this issue Aug 18, 2023 · 2 comments
Open

user-defined interaction kernels would be useful #386

bhaller opened this issue Aug 18, 2023 · 2 comments

Comments

@bhaller
Copy link
Contributor

bhaller commented Aug 18, 2023

It would be great to be able to define an interaction kernel with an interaction type of 's' (like a type 's' mutation type), where the user supplies a function that translates distance into interaction strength. That could be pre-evaluated and cached by SLiM, at some high resolution (say, 1024 steps between 0 and maxDistance, or even more), so it would be extremely fast to evaluate – probably faster than most of the built-in kernels, in fact (and maybe the built-in kernels should be recast into this implementation for more speed). This would get rid of one common usage of interaction() kernels, which are very slow.

@petrelharp Might be of interest. What resolution do you think would suffice? (I suppose that could even be user-specified, but maybe that's excessively complicated.) The only issue really is memory usage, and the memory usage for, say, 1024 doubles is trivial.

@bhaller
Copy link
Contributor Author

bhaller commented Sep 28, 2023

Perhaps this would be a good improvement to postpone until such time as the SpatialKernel class is visible in Eidos, if that ever happens. The up-front computational cost of this kernel type would be best done just once, not once per call, which (for many uses) would mean needing to construct and keep a permanent SpatialKernel instance. Tagging long-term.

@bhaller
Copy link
Contributor Author

bhaller commented Feb 26, 2024

This would notably be useful for the circle-intersection interaction function of @samchamper.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant