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

Numbers For Individual Iterations #169

Closed
gaianoseworthy opened this issue Jun 4, 2020 · 4 comments
Closed

Numbers For Individual Iterations #169

gaianoseworthy opened this issue Jun 4, 2020 · 4 comments

Comments

@gaianoseworthy
Copy link
Contributor

I'm not 100% sure if this is better as a feature request or just a standard issue, but I'll tag feature require either way.

Would there be a way (or could there be a way) to extract the number of susceptible individuals in a network after, let's say, 100 iterations? This would be useful for if we want to develop a probability distribution of the model given certain settings.

@GiulioRossetti
Copy link
Owner

Such value can be obtained by aggregating individual iterations results in the proper way for basically any of the model compartments (as done, for instance, when building the trends for visualization purposes).

Actually, if I'm not mistaken, for the susceptible class build_trend will allow you to compute such value. Just run the simulation for N iterations, build the trends, and access the last susceptible count. After that, you can execute other iterations if you need to continue the simulation and once finished - to visualize the overall results - extend the original iterations' set with the novel one.

Maybe I missed something in your question, though.

@gaianoseworthy
Copy link
Contributor Author

@GiulioRossetti Thank you for your comment! I got it all figured out!
As a quick followup, is there any way to automatically end the simulation if every person is either susceptible or removed?

@GiulioRossetti
Copy link
Owner

Unfortunately, there is not.

However you can implement something like that following a same logic as before. For instance, you can execute an iteration (or a bunch of them) within a loop and impose as exit condition the value of an indicator you build starting from the trend counters (e.g., considering a simple SIR model, controlling when S=0 or when R=N)

@gaianoseworthy
Copy link
Contributor Author

Ah okay, thank you for the quick replies and all the help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants