Research Article

HSimulator: Hybrid Stochastic/Deterministic Simulation of Biochemical Reaction Networks

Algorithm 6

The hybrid rejection-based stochastic simulation algorithm (HRSSA, please refer to [21] for details). In HSimulator, step is implemented by a deterministic Runge-Kutta numerical method.
Input: The same as RSSA (Algorithm 2) together with the time granularity used for the
(approximate) simulation of fast reactions; the minimum amount of molecules that
has to be available for fast reactions; the minimum number of times that a fast
reaction has to be applied, in average, within the time range of size .
Output: a time series of states , providing the dynamics of the system.
Pseudocode:
  ;
  while    do
     Define the fluctuation interval according to (8);
     For each reaction , compute propensity bounds and ;
     Update reaction partitioning (sets and ) by applying the algorithm
     in Algorithm 5 according to input parameters , and ;
     Compute according to (20);
     ;
     while    do
       , where is a random number in ;
       Compute by simulating fast reactions (), at time steps of
       maximum length , according to an approximate algorithm (either
       stochastic or deterministic), where is a value such that ;
       if    then
         Select a candidate slow reaction by applying RSSA steps
         in Algorithm 2;
         if   is accepted by RSSA  then  update computed at step by
         applying ;
         if    then  ;
       else
         ;
       end if
       ;
     end while
  end while