@@ -17,8 +17,8 @@ function DiffEqBase.DiscreteProblem(lrs::LatticeReactionSystem, u0_in, tspan,
17
17
# Converts u0 and p to their internal forms.
18
18
# u0 is [spec 1 at vert 1, spec 2 at vert 1, ..., spec 1 at vert 2, ...].
19
19
u0 = lattice_process_u0 (u0_in, species (lrs), lrs. num_verts)
20
- # Both vert_ps and edge_ps becomes vectors of vectors. Each have 1 element for each parameter.
21
- # These elements are length 1 vectors (if the parameter is uniform),
20
+ # Both vert_ps and edge_ps becomes vectors of vectors. Each have 1 element for each parameter.
21
+ # These elements are length 1 vectors (if the parameter is uniform),
22
22
# or length num_verts/nE, with unique values for each vertex/edge (for vert_ps/edge_ps, respectively).
23
23
vert_ps, edge_ps = lattice_process_p (p_in, vertex_parameters (lrs),
24
24
edge_parameters (lrs), lrs)
@@ -40,7 +40,7 @@ function JumpProcesses.JumpProblem(lrs::LatticeReactionSystem, dprob, aggregator
40
40
# Computes hopping constants and mass action jumps (requires some internal juggling).
41
41
# Currently, JumpProcesses requires uniform vertex parameters (hence `p=first.(dprob.p[1])`).
42
42
# Currently, the resulting JumpProblem does not depend on parameters (no way to incorporate these).
43
- # Hence the parameters of this one does nto actually matter. If at some point JumpProcess can
43
+ # Hence the parameters of this one does nto actually matter. If at some point JumpProcess can
44
44
# handle parameters this can be updated and improved.
45
45
# The non-spatial DiscreteProblem have a u0 matrix with entries for all combinations of species and vertexes.
46
46
hopping_constants = make_hopping_constants (dprob, lrs)
@@ -68,7 +68,7 @@ function make_hopping_constants(dprob::DiscreteProblem, lrs::LatticeReactionSyst
68
68
# For each edge, finds each position in `hopping_constants`.
69
69
for (e_idx, e) in enumerate (edges (lrs. lattice))
70
70
dst_idx = findfirst (isequal (e. dst), lrs. lattice. fadjlist[e. src])
71
- # For each species, sets that hopping rate.
71
+ # For each species, sets that hopping rate.
72
72
for s_idx in 1 : (lrs. num_species)
73
73
hopping_constants[s_idx, e. src][dst_idx] = get_component_value (
74
74
all_diff_rates[s_idx], e_idx)
124
124
# ## Extra ###
125
125
126
126
# Temporary. Awaiting implementation in SII, or proper implementation withinCatalyst (with more general functionality).
127
- function int_map (map_in, sys) where {T, S}
127
+ function int_map (map_in, sys)
128
128
return [ModelingToolkit. variable_index (sys, pair[1 ]) => pair[2 ] for pair in map_in]
129
129
end
130
130
136
136
# statetoid = Dict(ModelingToolkit.value(state) => i for (i, state) in enumerate(states(rs)))
137
137
# eqs = equations(js)
138
138
# invttype = non_spat_dprob.tspan[1] === nothing ? Float64 : typeof(1 / non_spat_dprob.tspan[2])
139
- #
139
+ #
140
140
# # Assembles the non-spatial mass action jumps.
141
- # p = (non_spat_dprob.p isa DiffEqBase.NullParameters || non_spat_dprob.p === nothing) ? Num[] : non_spat_dprob.p
141
+ # p = (non_spat_dprob.p isa DiffEqBase.NullParameters || non_spat_dprob.p === nothing) ? Num[] : non_spat_dprob.p
142
142
# majpmapper = ModelingToolkit.JumpSysMajParamMapper(js, p; jseqs = eqs, rateconsttype = invttype)
143
143
# return ModelingToolkit.assemble_maj(eqs.x[1], statetoid, majpmapper)
144
144
# end
0 commit comments