Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
TorkelE committed Apr 7, 2024
1 parent 3c3d262 commit b257356
Showing 1 changed file with 25 additions and 25 deletions.
50 changes: 25 additions & 25 deletions test/meta/mtk_structure_indexing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ let
ps = [:p1 => 3.0, :p2 => 2.0]
dprob = DiscreteProblem(rn, u0, (0.0, 1.0), ps)
jprob = JumpProblem(rn, dprob, Direct())
jinit = init(jprob, SSAStepper())
jint = init(jprob, SSAStepper())
@test jprob.massaction_jump.scaled_rates[1] == 6.0

# Checks that the mass action rate is correctly updated after normal indexing.
Expand Down Expand Up @@ -357,33 +357,33 @@ let

# Checks that updating an integrators parameter values does not affect mass action rate until after
# `reset_aggregated_jumps!` have been applied as well (wt which point the correct rate is achieved).
jinit.ps[p1] = 4.0
@test jinit.cb.condition.ma_jumps.scaled_rates[1] != 8.0
reset_aggregated_jumps!(jinit)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] == 8.0
jint.ps[p1] = 4.0
@test jint.cb.condition.ma_jumps.scaled_rates[1] != 8.0
reset_aggregated_jumps!(jint)
@test jint.cb.condition.ma_jumps.scaled_rates[1] == 8.0

jinit.ps[rn.p1] = 5.0
@test jinit.cb.condition.ma_jumps.scaled_rates[1] != 10.0
reset_aggregated_jumps!(jinit)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] == 10.0
jint.ps[rn.p1] = 5.0
@test jint.cb.condition.ma_jumps.scaled_rates[1] != 10.0
reset_aggregated_jumps!(jint)
@test jint.cb.condition.ma_jumps.scaled_rates[1] == 10.0

jinit.ps[:p1] = 6.0
@test jinit.cb.condition.ma_jumps.scaled_rates[1] != 12.0
reset_aggregated_jumps!(jinit)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] == 12.0
jint.ps[:p1] = 6.0
@test jint.cb.condition.ma_jumps.scaled_rates[1] != 12.0
reset_aggregated_jumps!(jint)
@test jint.cb.condition.ma_jumps.scaled_rates[1] == 12.0

setp(jinit, p1)(jinit, 7.0)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] != 14.0
reset_aggregated_jumps!(jinit)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] == 14.0
setp(jint, p1)(jint, 7.0)
@test jint.cb.condition.ma_jumps.scaled_rates[1] != 14.0
reset_aggregated_jumps!(jint)
@test jint.cb.condition.ma_jumps.scaled_rates[1] == 14.0

setp(jinit, rn.p1)(jinit, 8.0)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] != 16.0
reset_aggregated_jumps!(jinit)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] == 16.0
setp(jint, rn.p1)(jint, 8.0)
@test jint.cb.condition.ma_jumps.scaled_rates[1] != 16.0
reset_aggregated_jumps!(jint)
@test jint.cb.condition.ma_jumps.scaled_rates[1] == 16.0

setp(jinit, :p1)(jinit, 3.0)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] != 6.0
reset_aggregated_jumps!(jinit)
@test jinit.cb.condition.ma_jumps.scaled_rates[1] == 6.0
setp(jint, :p1)(jint, 3.0)
@test jint.cb.condition.ma_jumps.scaled_rates[1] != 6.0
reset_aggregated_jumps!(jint)
@test jint.cb.condition.ma_jumps.scaled_rates[1] == 6.0
end

0 comments on commit b257356

Please sign in to comment.