Research Article

Parallel Solutions for Voxel-Based Simulations of Reaction-Diffusion Systems

Algorithm 1

The pseudocode of the -DPP algorithm.
(1)  load the description of the -DPP system;
(2) for each membrane calculate ;
(3) for each membrane
(a) rule , : compute ;
(b) evaluate the sum of all the propensity functions in the compartment;
(c) IF : ;
   ELSE generate the step size according to the internal state, and select the way to proceed in the current
   iteration (i.e. leaping evolution with or without critical reactions);
(4) select ;
(5) for each membrane
(a) IF goto (6);
(b) switch the evolution strategy type:
  (I) case leaping with one critical reaction”:
      if : goto (d) else: goto (c);
  (II) else goto (d);
(c) extract the critical and the non-critical rules that will be applied in the current iteration;
(d) IF the execution of the selected rules in all the compartments leads to an unfeasible state ;
(6) IF a new value of was computed: and goto (4);
(7) for each membrane
(a) update the internal state by applying the internal rules
(b) update the state of other membranes by applying the communication rules;
(8) for each membrane update the value of the free space ;
(9) IF the termination criteria is satisfied, namely (i) the current time exceeds the end time OR (ii) there is not enough
   free space in any membrane: finish;
   ELSE: goto (3).