-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
Spatial SSAs progress and TODOs #189
Comments
Additional features to plan for:
Optimizations to try after benchmarking:
|
Some more stuff:
|
I am starting to think about
@isaacsas , what do you think? |
We need to provide the location or there would be no way to have a rate that is spatially varying. For example, zero at some sites and non zero at others. |
This summer I am working on implementing spatial SSAs. There are currently two issues open about it: #107 and #130. The first PR #183 implements the NSM, adds two tests and some utility functions, essentially setting up the interface for spatial SSAs.
LightGraphs
are supported as well. There are a few TODOs that should not be forgotten:CartesianGrid
struct needs to be optimized -- probably by storing the number of neighbors for each site sonum_neighbors
is O(1) and makingneighbors
return an iterator instead of allocating an array.CartesianGrid
useCartesianIndices
instead of doing all the calculations redundantly.nsm.jl
.CartesianGrid
needs to be supported. This can be done with a special sink site: it neighbors all boundary sites and does not get updated if it is the target site of a hop. This change will require tweaking the code innsm.jl
.nsm.jl
.HopRatesGeneral
: switch to using cumulative sums to sample neighbor.add jump counter to SSAStepper to count jumps.This can be easily done with a callback as in the benchmark.DirectCRRSSA
). Can also do it for non-spatial solvers.DiffEqJump
stack up.CartesianGrid
. It should be faster than aGraph
.Dsi
. The quantityhop_rates.hopping_constants[species,site]*outdegree(spatial_system, site)
is always the same for any given site. If we precompute this quantity we won't need to store the number of neighbors for each site in the CartesianGrid struct resulting in less memory used. And we would also avoid one multiplication and one pointer access for each update of hopping rates. [EDIT]: maybe store the outdegrees as a dict, where all the interior sites do not appear. This would make the nums_neighbors array O(n^2) instead of O(n^3) where n is linear dimension of the grid.@isaacsas and @ChrisRackauckas might have more TODOs to add to this list.
The text was updated successfully, but these errors were encountered: