@@ -80,7 +80,7 @@ function getmean(jprob, Nsims; use_stepper = true)
8080 end
8181 m / Nsims
8282end
83- @btime m = $ getmean ($ jprob, $ Nsims)
83+ m = getmean (jprob, Nsims)
8484
8585# test auto-alg selection works
8686jprobb = JumpProblem (js2, dprob; save_positions = (false , false ), rng)
248248rate = k
249249affect = [X ~ X - 1 ]
250250
251- crj = ConstantRateJump (1.0 , [X ~ X - 1 ])
251+ crj = ConstantRateJump (1.0 , [X ~ Pre (X) - 1 ])
252252js1 = complete (JumpSystem ([crj], t, [X], [k]; name = :js1 ))
253253js2 = complete (JumpSystem ([crj], t, [X], []; name = :js2 ))
254254
@@ -275,18 +275,18 @@ dp4 = DiscreteProblem(js4, u0, tspan)
275275@parameters k
276276@variables X (t)
277277rate = k
278- affect = [X ~ X - 1 ]
278+ affect = [X ~ Pre (X) - 1 ]
279279
280- j1 = ConstantRateJump (k, [X ~ X - 1 ])
280+ j1 = ConstantRateJump (k, [X ~ Pre (X) - 1 ])
281281@test_nowarn @mtkbuild js1 = JumpSystem ([j1], t, [X], [k])
282282
283283# test correct autosolver is selected, which implies appropriate dep graphs are available
284284let
285285 @parameters k
286286 @variables X (t)
287287 rate = k
288- affect = [X ~ X - 1 ]
289- j1 = ConstantRateJump (k, [X ~ X - 1 ])
288+ affect = [X ~ Pre (X) - 1 ]
289+ j1 = ConstantRateJump (k, [X ~ Pre (X) - 1 ])
290290
291291 Nv = [1 , JumpProcesses. USE_DIRECT_THRESHOLD + 1 , JumpProcesses. USE_RSSA_THRESHOLD + 1 ]
292292 algtypes = [Direct, RSSA, RSSACR]
305305 Random. seed! (rng, 1111 )
306306 @variables A (t) B (t) C (t)
307307 @parameters k
308- vrj = VariableRateJump (k * (sin (t) + 1 ), [A ~ A + 1 , C ~ C + 2 ])
308+ vrj = VariableRateJump (k * (sin (t) + 1 ), [A ~ Pre (A) + 1 , C ~ Pre (C) + 2 ])
309309 js = complete (JumpSystem ([vrj], t, [A, C], [k]; name = :js , observed = [B ~ C * A]))
310310 oprob = ODEProblem (js, [A => 0 , C => 0 ], (0.0 , 10.0 ), [k => 1.0 ])
311311 jprob = JumpProblem (js, oprob, Direct (); rng)
346346let
347347 @variables x1 (t) x2 (t) x3 (t) x4 (t) x5 (t)
348348 @parameters p1 p2 p3 p4 p5
349- j1 = ConstantRateJump (p1, [x1 ~ x1 + 1 ])
349+ j1 = ConstantRateJump (p1, [x1 ~ Pre (x1) + 1 ])
350350 j2 = MassActionJump (p2, [x2 => 1 ], [x3 => - 1 ])
351- j3 = VariableRateJump (p3, [x3 ~ x3 + 1 , x4 ~ x4 + 1 ])
351+ j3 = VariableRateJump (p3, [x3 ~ Pre (x3) + 1 , x4 ~ Pre (x4) + 1 ])
352352 j4 = MassActionJump (p4 * p5, [x1 => 1 , x5 => 1 ], [x1 => - 1 , x5 => - 1 , x2 => 1 ])
353353 us = Set ()
354354 ps = Set ()
390390 p4 = DelayParentScope (p4)
391391 p5 = GlobalScope (p5)
392392
393- j1 = ConstantRateJump (p1, [x1 ~ x1 + 1 ])
393+ j1 = ConstantRateJump (p1, [x1 ~ Pre (x1) + 1 ])
394394 j2 = MassActionJump (p2, [x2 => 1 ], [x3 => - 1 ])
395- j3 = VariableRateJump (p3, [x3 ~ x3 + 1 , x4 ~ x4 + 1 ])
395+ j3 = VariableRateJump (p3, [x3 ~ Pre (x3) + 1 , x4 ~ Pre (x4) + 1 ])
396396 j4 = MassActionJump (p4 * p5, [x1 => 1 , x5 => 1 ], [x1 => - 1 , x5 => - 1 , x2 => 1 ])
397397 @named js = JumpSystem ([j1, j2, j3, j4], t, [x1, x2, x3, x4, x5], [p1, p2, p3, p4, p5])
398398
430430 Random. seed! (rng, seed)
431431 @variables X (t) Y (t)
432432 @parameters k1 k2
433- vrj1 = VariableRateJump (k1 * X, [X ~ X - 1 ]; save_positions = (false , false ))
434- vrj2 = VariableRateJump (k1, [Y ~ Y + 1 ]; save_positions = (false , false ))
433+ vrj1 = VariableRateJump (k1 * X, [X ~ Pre (X) - 1 ]; save_positions = (false , false ))
434+ vrj2 = VariableRateJump (k1, [Y ~ Pre (Y) + 1 ]; save_positions = (false , false ))
435435 eqs = [D (X) ~ k2, D (Y) ~ - k2 / 10 * Y]
436436 @named jsys = JumpSystem ([vrj1, vrj2, eqs[1 ], eqs[2 ]], t, [X, Y], [k1, k2])
437437 jsys = complete (jsys)
472472 Random. seed! (rng, seed)
473473 @variables X (t) Y (t)
474474 @parameters α β
475- vrj = VariableRateJump (β * X, [X ~ X - 1 ]; save_positions = (false , false ))
476- crj = ConstantRateJump (β * Y, [Y ~ Y - 1 ])
475+ vrj = VariableRateJump (β * X, [X ~ Pre (X) - 1 ]; save_positions = (false , false ))
476+ crj = ConstantRateJump (β * Y, [Y ~ Pre (Y) - 1 ])
477477 maj = MassActionJump (α, [0 => 1 ], [Y => 1 ])
478478 eqs = [D (X) ~ α * (1 + Y)]
479479 @named jsys = JumpSystem ([maj, crj, vrj, eqs[1 ]], t, [X, Y], [α, β])
540540 @variables X (t)
541541 rate1 = p
542542 rate2 = X * d
543- affect1 = [X ~ X + 1 ]
544- affect2 = [X ~ X - 1 ]
543+ affect1 = [X ~ Pre (X) + 1 ]
544+ affect2 = [X ~ Pre (X) - 1 ]
545545 j1 = ConstantRateJump (rate1, affect1)
546546 j2 = ConstantRateJump (rate2, affect2)
547547
0 commit comments