-
Notifications
You must be signed in to change notification settings - Fork 220
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
Stopping policy #36
Open
boazbk
wants to merge
14
commits into
ryansmcgee:master
Choose a base branch
from
boazbk:stopping_policy
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Stopping policy #36
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…y in random testing to people for which more time passed before they were last tested
This reverts commit 51d3ad0
…ion if a certain condition is met, and ability to supress print statements.
…ndom_testing_degree_bias` parameter.
Just a quick note that setting the parameter |
At least from a quick search I don't see a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request makes edits to
run_tti_sim
insim_loop.py
to add support for stopping the simulation early, for example when a sufficiently large outbreak is detected that the mitigation is "outside the model". It also adds support for logging the history and for suppressing print statements.Suppressing print statements is via a parameter
verbose
- True (default) means print statement are printed as currently, False means they are suppressed.I didn't want to change the return value of the function, so am achieving logging by taking as a parameter a dictionary
history
. If this parameter isNone
then no logging takes place. Otherwise, at each timet
the loop runs, we store inhistory[t]
a dictionary containing the current parameters of the model, as well as testing outcomes.It is easy (one line of code) to transform the resulting dictionary into a
pandas
DataFrame, but I didn't want to add a dependency to this module.Stopping early is is achieved by adding a parameter
stopping_policy
that is a function taking the model and the history and returningTrue
to stop andFalse
otherwise.