Commit e0f9c937 by Victor

### again bm dm update

parent 629d8201
Pipeline #77578 passed with stage
in 22 minutes and 10 seconds
 ... @@ -31,15 +31,15 @@ function updateWorld!(w::World{A,S,T},c::CFM) where {A,S,T} ... @@ -31,15 +31,15 @@ function updateWorld!(w::World{A,S,T},c::CFM) where {A,S,T} alive = agents(w) alive = agents(w) # Total rate of events # Total rate of events n = size(w) n = size(w) Cbar = (bm + dm) CbarI = bm + dm*(n+1) dt = rand(Exponential(Cbar)) / (n*(n+1)) dt = rand(Exponential(CbarI)) / n update_clock!(w,dt) update_clock!(w,dt) i = rand(1:n) i = rand(1:n) x = get_x(w[i]) x = get_x(w[i]) W = rand() W = rand() if dt > 0. if dt > 0. deathprob = (sum(d.(get_x.(alive),Ref(x),w.t)) .- d(x,x,w.t)) / (Cbar*(n+1)) deathprob = (sum(d.(get_x.(alive),Ref(x),w.t)) .- d(x,x,w.t)) / CbarI birthprob = b(x,w.t) / (Cbar*(n+1)) birthprob = b(x,w.t) / CbarI if W <= deathprob if W <= deathprob updateDeathEvent!(w,c,i) updateDeathEvent!(w,c,i) elseif W <= deathprob + birthprob elseif W <= deathprob + birthprob ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!