@@ -91,12 +91,12 @@ function assemble_crj(js, crj, statetoid)
91
91
end
92
92
93
93
function assemble_maj (js, maj:: MassActionJump{U,Vector{Pair{V,W}},Vector{Pair{V2,W2}}} ,
94
- statetoid, parammap ) where {U,V,W,V2,W2}
94
+ statetoid, subber ) where {U,V,W,V2,W2}
95
95
sr = maj. scaled_rates
96
96
if sr isa Operation
97
- pval = simplify ( substitute (sr,parammap) ). value
97
+ pval = subber (sr ). value
98
98
elseif sr isa Variable
99
- pval = Dict (parammap)[ sr ()]
99
+ pval = subber ( sr ()) . value
100
100
else
101
101
pval = maj. scaled_rates
102
102
end
@@ -167,7 +167,8 @@ function DiffEqJump.JumpProblem(js::JumpSystem, prob, aggregator; kwargs...)
167
167
parammap = map ((x,y)-> Pair (x (),y), parameters (js), prob. p)
168
168
eqs = equations (js)
169
169
170
- majs = MassActionJump[assemble_maj (js, j, statetoid, parammap) for j in eqs. x[1 ]]
170
+ subber = substituter (first .(parammap), last .(parammap))
171
+ majs = MassActionJump[assemble_maj (js, j, statetoid, subber) for j in eqs. x[1 ]]
171
172
crjs = ConstantRateJump[assemble_crj (js, j, statetoid) for j in eqs. x[2 ]]
172
173
vrjs = VariableRateJump[assemble_vrj (js, j, statetoid) for j in eqs. x[3 ]]
173
174
((prob isa DiscreteProblem) && ! isempty (vrjs)) && error (" Use continuous problems such as an ODEProblem or a SDEProblem with VariableRateJumps" )
@@ -210,4 +211,4 @@ function modified_states!(mstates, jump::MassActionJump, sts)
210
211
for (state,stoich) in jump. net_stoch
211
212
(state. op in sts) && push! (mstates, state)
212
213
end
213
- end
214
+ end
0 commit comments