Skip to content

Commit b9ea181

Browse files
committed
generalize reset to work with NoiseFunction
1 parent 6b63618 commit b9ea181

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/solve.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -413,15 +413,15 @@ function DiffEqBase.__init(
413413
end
414414
elseif typeof(prob) <: DiffEqBase.AbstractRODEProblem
415415
W = prob.noise
416-
if hasfield(typeof(W),:t) && W.reset
417-
if W.t[end] != t
418-
reinit!(W,t, t0=t)
416+
if W.reset
417+
if W.curt != t
418+
reinit!(W,t,t0=t)
419419
end
420420
# Reseed
421421
if typeof(W) <: NoiseProcess && W.reseed
422422
Random.seed!(W.rng,_seed)
423423
end
424-
elseif hasfield(typeof(W),:t) && W.t[end] != t
424+
elseif W.curt != t
425425
error("Starting time in the noise process is not the starting time of the simulation. The noise process should be re-initialized for repeated use")
426426
end
427427
else # Only a jump problem

0 commit comments

Comments
 (0)