@@ -128,12 +128,12 @@ end
128
128
129
129
130
130
# ## Functions to determine which states a jump depends on
131
- function get_variables ! (dep, jump:: Union{ConstantRateJump,VariableRateJump} , variables)
131
+ function equation_dependencies ! (dep, jump:: Union{ConstantRateJump,VariableRateJump} , variables)
132
132
foreach (var -> (var in variables) && push! (dep, var), vars (jump. rate))
133
133
dep
134
134
end
135
135
136
- function get_variables ! (dep, jump:: MassActionJump , variables)
136
+ function equation_dependencies ! (dep, jump:: MassActionJump , variables)
137
137
jsr = jump. scaled_rates
138
138
139
139
if jsr isa Variable
@@ -150,6 +150,17 @@ function get_variables!(dep, jump::MassActionJump, variables)
150
150
dep
151
151
end
152
152
153
-
154
153
# ## Functions to determine which states are modified by a given jump
154
+ function modified_states! (mstates, jump:: Union{ConstantRateJump,VariableRateJump} , sts)
155
+ for eq in jump. affect!
156
+ st = convert (Variable, eq. lhs)
157
+ (st in sts) && push! (mstates, st)
158
+ end
159
+ end
155
160
161
+ function modified_states! (mstates, jump:: MassActionJump , sts)
162
+ for (state,stoich) in jump. net_stoch
163
+ st = convert (Variable, state)
164
+ (st in sts) && push! (mstates, st)
165
+ end
166
+ end
0 commit comments