Skip to content

Commit

Permalink
Merge pull request #475 from isaacsas/initial_ensemble_propensity_test
Browse files Browse the repository at this point in the history
add test initial variable rate propensities are unique in ensembles
  • Loading branch information
isaacsas authored Feb 11, 2025
2 parents 5d454dc + 16ac07f commit 4d52a24
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/thread_safety.jl
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,12 @@ let
ode_prob = ODEProblem(f!, u_0, (0.0, 10))
rate(u, p, t) = 1.0
jump!(integrator) = nothing
jump_prob = JumpProblem(ode_prob, Direct(), VariableRateJump(rate, jump!); rng)
jump_prob = JumpProblem(ode_prob, Direct(), VariableRateJump(rate, jump!))
prob_func(prob, i, repeat) = deepcopy(prob)
prob = EnsembleProblem(jump_prob,prob_func = prob_func)
solve(prob, Tsit5(), EnsembleThreads(), trajectories=10)

sol = solve(prob, Tsit5(), EnsembleThreads(), trajectories=400)
init_props = [sol[i].u[1][2] for i = 1:length(sol)]
@test allunique(init_props)
end

0 comments on commit 4d52a24

Please sign in to comment.