Skip to content

Commit a5c1dc4

Browse files
fix noise reset
1 parent 290aba7 commit a5c1dc4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/solve.jl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -247,16 +247,16 @@ function init(
247247
end
248248
else
249249
W = prob.noise
250-
if W.t[end] != t
251-
if W.reset
250+
if W.reset
251+
if W.t[end] != t
252252
reinit!(W,t)
253-
# Reseed
254-
if typeof(W) <: NoiseProcess && W.reseed
255-
srand(W.rng,seed)
256-
end
257-
else
258-
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")
259253
end
254+
# Reseed
255+
if typeof(W) <: NoiseProcess && W.reseed
256+
srand(W.rng,seed)
257+
end
258+
elseif W.t[end] != t
259+
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")
260260
end
261261
end
262262

0 commit comments

Comments
 (0)