Skip to content

Commit c7f35de

Browse files
committed
Add partial fix for time-updating logic in SSA
1 parent 73d0c4d commit c7f35de

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/+ssit/+ssa/runSingleSsa.m

+5-5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,10 @@
128128
else
129129
% If the reaction is not delayed, perform it; i.e.
130130

131+
% Advance t to the time of the reaction:
132+
133+
t = t + delta_t;
134+
131135
% Add the current state to the record of states for all
132136
% intervening times:
133137

@@ -142,11 +146,7 @@
142146

143147
% Update the state according to the reaction:
144148

145-
x = x + S(:, rxn);
146-
147-
% Advance t to the time of the reaction:
148-
149-
t = t + delta_t;
149+
x = x + S(:, rxn);
150150
end % Step 7 ...
151151
end % rowsize(1, 1) == 0 [No delayed reactions were upcoming]
152152
end % while t < max(T_array) ...

0 commit comments

Comments
 (0)