Skip to content

Commit

Permalink
Update jprob_symbol_indexing.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas authored Dec 31, 2023
1 parent c4e3bee commit d99890d
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions test/jprob_symbol_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ affect1!(integ) = (integ.u[1] += 1)
affect2!(integ) = (integ.u[2] += 1)
crj1 = ConstantRateJump(rate1, affect1!)
crj2 = ConstantRateJump(rate2, affect2!)
g = DiscreteFunction((du, u, p, t) -> nothing; syms = [:a, :b])
# g = DiscreteFunction((du, u, p, t) -> nothing; syms = [:a, :b], paramsyms = [:p1, :p2])
g = DiscreteFunction((du, u, p, t) -> nothing; sys = SymbolicIndexingInterface.SymbolCache([:a, :b], [:p1, :p2], :t)
dprob = DiscreteProblem(g, [0, 10], (0.0, 10.0), [1.0, 2.0])
jprob = JumpProblem(dprob, Direct(), crj1, crj2)

Expand All @@ -16,5 +15,5 @@ jprob = JumpProblem(dprob, Direct(), crj1, crj2)
@test jprob[:b] == 10

# these are no longer supported by SciMLBase
# @test jprob[:p1] == 1.0
# @test jprob[:p2] == 2.0
@test getp(jprob,:p1)(jprob) == 1.0
@test getp(jprob,:p2)(jprob) == 2.0

0 comments on commit d99890d

Please sign in to comment.