Next-Reaction Method variant of the Gillespie stochastic simulation algorithm.