Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Species counts are stored as doubles, not ints, allowing some nasty bugs. #116

Open
sclamons opened this issue Aug 13, 2021 · 0 comments
Open
Labels
Bioscrape Core Issues pertaining to core bioscrape functionality documentation Software and example documentation invalid This doesn't seem right Lineages Issues pertaining to bioscrape lineages

Comments

@sclamons
Copy link
Collaborator

In multiple SSA algorithms, we have species counts stored as doubles. This allows an unwary user (such as myself) to start a simulation with non-integer species counts. If you do that, it's not too difficult to get a negative species count --> negative reaction propensity --> negative time of next reaction --> infinite loop that can't be interrupted in an ipython kernel.

I assume this is done to avoid conversions between ints and doubles, for speed reasons? We might want to put a check in place at the beginning of these simulate functions to make sure all species counts are reasonably close to an integer (maybe just round them all to ints and cast them back to doubles?).

@sclamons sclamons added documentation Software and example documentation invalid This doesn't seem right Bioscrape Core Issues pertaining to core bioscrape functionality Lineages Issues pertaining to bioscrape lineages labels Aug 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bioscrape Core Issues pertaining to core bioscrape functionality documentation Software and example documentation invalid This doesn't seem right Lineages Issues pertaining to bioscrape lineages
Projects
None yet
Development

No branches or pull requests

1 participant