From: Fine-tuning anti-tumor immunotherapies via stochastic simulations
Require: (T0, E0, I0), t0, t stop . |
---|
1: set the initial state to (T0, E0, I(t0)) and the initial time t to t0; |
2: while t < t stop do |
3: let x be the current state, for evaluate a j (x), define ; |
4: let χ be a random number with distribution Exp(1), solve the transcendental equation |
|
and then define ; |
5: let r be a random number U[0, 1], for the next event to fire find j by solving |
|
where if then a i (t + Ï„ ) = a i (x); |
6: update (T, E, I(t)) to (T + νT,j, E + νE,j, I(t + τ )) and change clock to t + τ ; |
7: end while |