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

read_shocks now reads mortality as well #613

Merged
merged 2 commits into from
Apr 7, 2020
Merged

read_shocks now reads mortality as well #613

merged 2 commits into from
Apr 7, 2020

Conversation

mnwhite
Copy link
Contributor

@mnwhite mnwhite commented Apr 7, 2020

For a long time we've had the ability to store a history of shocks in an AgentType instance and then read them on a simulation pass (rather than draw them anew each time). This used the makeShockHistory() method of AgentType. However, this didn't fully do what it was supposed to, as mortality shocks need to be recorded as well.

This commit makes the history of who_dies be recorded when makeShockHistory is run, and for who_dies to be read from that history when read_shocks is True. It also breaks up one method of MrkvConsumerType into two; just a copy-paste of code with a new docstring.

For a long time we've had the ability to store a history of shocks in an AgentType instance and then read them on a simulation pass (rather than draw them anew each time).  This used the makeShockHistory() method of AgentType.  However, this didn't fully do what it was supposed to, as *mortality* shocks need to be recorded as well.

This commit makes the history of who_dies be recorded when makeShockHistory is run, and for who_dies to be read from that history when read_shocks is True.  It also breaks up one method of MrkvConsumerType into two; just a copy-paste of code with a new docstring.
@mnwhite
Copy link
Contributor Author

mnwhite commented Apr 7, 2020

This functionality is required for code for a soon-to-be released research paper to run. We'll need to merge and do a release.

@sbenthall sbenthall merged commit 70a5b2c into master Apr 7, 2020
@mnwhite mnwhite deleted the ReadMortality branch April 7, 2020 17:22
@MridulS
Copy link
Member

MridulS commented Apr 7, 2020

@mnwhite anything else that needs to be done in HARK before a release?

@mnwhite
Copy link
Contributor Author

mnwhite commented Apr 7, 2020 via email

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

Successfully merging this pull request may close these issues.

3 participants