Skip to content

Commit

Permalink
Merge pull request #347 from DiODeProject/ssa_patch_346
Browse files Browse the repository at this point in the history
Patched SSA bug
  • Loading branch information
joefresna committed Sep 18, 2019
2 parents 511c47a + 441ee28 commit fa920ef
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion mumot/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4646,8 +4646,9 @@ def _simulationStep(self) -> Tuple[float, object]:
else:
reactantOccurencies = re_stoch[0]
if reactantOccurencies > 0:
prob *= self._currentState[reactant] * reactantOccurencies
prob *= self._currentState[reactant] ** reactantOccurencies
numReagents += reactantOccurencies
# print("for reaction " + str(reaction) + " counted " + str(numReagents) + " reagents (prob:" + str(prob) +" ) (rate: " + str(self._ratesDict[str(reaction["rate"])]) + ")")
if prob > 0 and numReagents > 1:
prob /= sum(self._currentState.values())**(numReagents - 1)
probabilitiesOfChange[reaction_id] = prob
Expand Down

0 comments on commit fa920ef

Please sign in to comment.