Skip to content

Commit

Permalink
simBirths only populates BLANK/None state vars at birth econ-ark#761
Browse files Browse the repository at this point in the history
  • Loading branch information
sbenthall committed Sep 14, 2020
1 parent 93923f0 commit 61b5ad8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion HARK/ConsumptionSaving/ConsIndShockModel.py
Original file line number Diff line number Diff line change
Expand Up @@ -1681,8 +1681,8 @@ def unpackcFunc(self):

def initializeSim(self):
self.PermShkAggNow = self.PermGroFacAgg # This never changes during simulation
AgentType.initializeSim(self)
self.state_vars['PlvlAggNow'] = 1.0
AgentType.initializeSim(self)

def simBirth(self, which_agents):
"""
Expand Down
3 changes: 2 additions & 1 deletion HARK/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,8 @@ def initializeSim(self):
all_agents = np.ones(self.AgentCount, dtype=bool)
blank_array = np.zeros(self.AgentCount)
for var in self.state_vars:
self.state_vars[var] = copy(blank_array)
if self.state_vars[var] is None:
self.state_vars[var] = copy(blank_array)
for var_name in self.poststate_vars:
self.poststate_vars[var_name] = copy(blank_array)
self.t_age = np.zeros(
Expand Down

0 comments on commit 61b5ad8

Please sign in to comment.