Skip to content

Commit fa1544e

Browse files
authored
test: add typecheck
1 parent d016f3a commit fa1544e

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test/jumpsystem.jl

+18
Original file line numberDiff line numberDiff line change
@@ -533,3 +533,21 @@ let
533533
Xsamp /= Nsims
534534
@test abs(Xsamp - Xf(0.2, p) < 0.05 * Xf(0.2, p))
535535
end
536+
537+
@testset "JumpProcess simulation should be Int64 valued (#3446)" begin
538+
@parameters p d
539+
@variables X(t)
540+
rate1 = p
541+
rate2 = X*d
542+
affect1 = [X ~ X + 1]
543+
affect2 = [X ~ X - 1]
544+
j1 = ConstantRateJump(rate1, affect1)
545+
j2 = ConstantRateJump(rate2, affect2)
546+
547+
# Works.
548+
@mtkbuild js = JumpSystem([j1, j2], t, [X], [p,d])
549+
dprob = DiscreteProblem(js, [X => 15], (0.0, 10.), [p => 2.0, d => 0.5])
550+
jprob = JumpProblem(js, dprob, Direct())
551+
sol = solve(jprob, SSAStepper())
552+
@test eltype(sol[X]) === Int64
553+
end

0 commit comments

Comments
 (0)