Skip to content

Commit 580f117

Browse files
committed
fix var2op
1 parent 36e56b7 commit 580f117

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/systems/reaction/reactionsystem.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -224,7 +224,7 @@ function assemble_diffusion(rs, noise_scaling; combinatoric_ratelaws=true)
224224
end
225225

226226
function var2op(var)
227-
Operation(var,Vector{Expression}())
227+
Sym{symtype(var)}(nameof(var.op))
228228
end
229229

230230
# Calculate the Jump rate law (like ODE, but uses X instead of X(t).
@@ -310,7 +310,7 @@ end
310310
@inline function makemajump(rx; combinatoric_ratelaw=true)
311311
@unpack rate, substrates, substoich, netstoich = rx
312312
zeroorder = (length(substoich) == 0)
313-
reactant_stoch = Vector{Pair{Term,eltype(substoich)}}(undef, length(substoich))
313+
reactant_stoch = Vector{Pair{Any,eltype(substoich)}}(undef, length(substoich))
314314
@inbounds for i = 1:length(reactant_stoch)
315315
reactant_stoch[i] = var2op(substrates[i]) => substoich[i]
316316
end
@@ -320,7 +320,7 @@ end
320320
#push!(rates, rate)
321321
net_stoch = [Pair(var2op(p[1]),p[2]) for p in netstoich]
322322
#push!(nstoich, net_stoch)
323-
MassActionJump(rate, reactant_stoch, net_stoch, scale_rates=false, useiszero=false)
323+
MassActionJump(Num(rate), reactant_stoch, net_stoch, scale_rates=false, useiszero=false)
324324
end
325325

326326
function assemble_jumps(rs; combinatoric_ratelaws=true)

0 commit comments

Comments
 (0)