Gillespie algorithm

Alex sascha.orlov at gmail.com
Tue Feb 5 20:06:12 UTC 2019


Doing some physical simulations I could abstract the Gillespie 
algorithm, see

https://code.dlang.org/packages/gillespied

which may be useful.

The number of algorithms able to model physical (continuous) time 
during an ongoing (reaction) process is rather limited. The 
announced algorithm is known to provide this feature. There are 
very much manifestations and improvements of the original 
Gillespie. In general, the improvements try to improve the speed 
of the algorithm either via
- faster timing generation
- faster next reaction look up
- approximating the output by assumptions

Compared to the standard Gillespie algorithm two enhancements 
were implemented:
- for the case, reaction propensities are known, interarrival 
timings do not necessarily depend on a random number and its 
logarithm. This makes each time query faster.
- If the governing simulation can handle non-nogc algorithm 
instantiation, a dedicated working array can be handled inside 
the algorithm. This provides faster next reaction search for all 
operations.

All issues are of course welcome and will be tackled in my spare 
time. I hope, for this library, many further improvements, and 
applications could be found in future.


More information about the Digitalmars-d-announce mailing list