Skip to content

Commit ad0b5c0

Browse files
authored
Merge pull request #84 from isaacsas/mixed-jumps-fix
missing jumps fix
2 parents 2b308a0 + 6622220 commit ad0b5c0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/massaction_jump_utils.jl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,14 @@ function network_to_jumpset(rn, specmap, ratemap, params, jumps)
8787
Base.eval(param_context, :($param = $(params[index])))
8888
end
8989

90+
# check if a (non-mass action) jump is defined for all reactions:
91+
alljumps = (length(rn.reactions) == length(rn.jumps))
92+
9093
idx = 1
91-
for (i,rs) in enumerate(rn.reactions)
94+
for rs in rn.reactions
9295
if rs.is_pure_mass_action
9396
push!(majumpvec, make_majump(rs, specmap, ratemap, params, param_context))
97+
alljumps && (idx += 1)
9498
else
9599
push!(cjumpvec, jumps[idx])
96100
idx += 1

0 commit comments

Comments
 (0)