-
-
Notifications
You must be signed in to change notification settings - Fork 38
Open
Labels
Description
See the test added in #475, which fails for StableRngs for example.
One way this could be handled is to ensure we reseed in
Lines 48 to 77 in 4d52a24
| function resetted_jump_problem(_jump_prob, seed) | |
| jump_prob = deepcopy(_jump_prob) | |
| if !isempty(jump_prob.jump_callback.discrete_callbacks) | |
| rng = jump_prob.jump_callback.discrete_callbacks[1].condition.rng | |
| if seed === nothing | |
| Random.seed!(rng, rand(UInt64)) | |
| else | |
| Random.seed!(rng, seed) | |
| end | |
| end | |
| if !isempty(jump_prob.variable_jumps) | |
| @assert jump_prob.prob.u0 isa ExtendedJumpArray | |
| randexp!(_jump_prob.rng, jump_prob.prob.u0.jump_u) | |
| jump_prob.prob.u0.jump_u .*= -1 | |
| end | |
| jump_prob | |
| end | |
| function reset_jump_problem!(jump_prob, seed) | |
| if seed !== nothing && !isempty(jump_prob.jump_callback.discrete_callbacks) | |
| Random.seed!(jump_prob.jump_callback.discrete_callbacks[1].condition.rng, seed) | |
| end | |
| if !isempty(jump_prob.variable_jumps) | |
| @assert jump_prob.prob.u0 isa ExtendedJumpArray | |
| randexp!(jump_prob.rng, jump_prob.prob.u0.jump_u) | |
| jump_prob.prob.u0.jump_u .*= -1 | |
| end | |
| end |
even if there are no discrete callbacks.