I am very new to c++ and I've been trying to write a simple stochastic algorithm (aka Gillespie algorithm). I know what the answer should be, but c++ is giving something not quite right; instead of 100 and 1000, I'm getting 96 and 871. For the life of me I can't find a problem. If any of you could help me out here, that would be much appreciated. Again, I'm a beginner, so please don't laugh at the code. Here it is:
PLEASE USE CODE TAGS (the <> formatting button) when posting code.
It makes it easier to read your code and also easier to respond to your
post. http://www.cplusplus.com/articles/jEywvCM9/
Hint: You can edit your post, highlight your code and press the <>
formatting button.