@@ -21,7 +21,7 @@ function DiffEqBase.__init(prob::AbstractSDDEProblem,# TODO DiffEqBasee.Abstract
2121 DiffEqBase. has_analytic (prob. f[1 ]) : DiffEqBase. has_analytic (prob. f)),
2222 save_on = true ,
2323 save_start = save_everystep || isempty (saveat) || typeof (saveat) <: Number ? true : prob. tspan[1 ] in saveat,
24- save_end = save_everystep || isempty (saveat) || typeof (saveat) <: Number ? true : prob . tspan[ 2 ] in saveat ,
24+ save_end = nothing ,
2525 callback = nothing ,
2626 dense = save_everystep && isempty (saveat),
2727 calck = (! isempty (setdiff (saveat, tstops)) || dense),
@@ -331,6 +331,9 @@ function DiffEqBase.__init(prob::AbstractSDDEProblem,# TODO DiffEqBasee.Abstract
331331 # id = StochasticDiffEq.LinearInterpolationData(timeseries,ts)
332332 id = StochasticDiffEq. LinearInterpolationData (sde_integrator. sol. u, sde_integrator. sol. t)
333333
334+ save_end_user = save_end
335+ save_end = save_end === nothing ? save_everystep || isempty (saveat) || saveat isa Number || prob. tspan[2 ] in saveat : save_end
336+
334337 opts = StochasticDiffEq. SDEOptions (maxiters, save_everystep,
335338 adaptive, abstol_internal,
336339 reltol_internal, QT (gamma),
@@ -347,7 +350,7 @@ function DiffEqBase.__init(prob::AbstractSDDEProblem,# TODO DiffEqBasee.Abstract
347350 QT (beta1), QT (beta2),
348351 convert .(uBottomEltypeNoUnits, delta),
349352 QT (qoldinit),
350- dense, save_on, save_start, save_end, save_noise,
353+ dense, save_on, save_start, save_end, save_end_user, save_noise,
351354 callbacks_internal, isoutofdomain, unstable_check,
352355 verbose, calck, force_dtmin,
353356 advance_to_tstop, stop_at_next_tstop)
0 commit comments