Skip to main content
. Author manuscript; available in PMC: 2022 Jun 21.
Published in final edited form as: Phys Biol. 2021 Feb 13;18(1):015002. doi: 10.1088/1478-3975/abc2ab
Algorithm 2.2 Pseudocode for the hybrid simulation algorithm
Require:n,yA,KK:Maximum number of reactionsEnsure:t1,t2,Timings of creation ofBmolecules1:Sett0=02:fori=1,2,,Kdo3:CalculateΛ=(0nτ(s)yA(ti1,s)ds)1.4:if0<Λ<then5:Draw an exponential random variableTwith meanΛ,i.e.,TEXPONENTIAL(Λ)6:Setti=ti1+T7:else8:Stop and break loop9:endif10:Seti=i+1.11:endfor