Updated to make it more elegant
@@ -1617,8 +1617,7 @@ class PerfForesightConsumerType(AgentType):
# Fill in BoroCnstArt and MaxKinks if they're not specified or are irrelevant.
if not hasattr(self, "BoroCnstArt"): # If no borrowing constraint specified...
self.BoroCnstArt = None # ...assume the user wanted none
- if not hasattr(self, "PerfMITShk"):
- self.PerfMITShk = False
+
if not hasattr(self, "MaxKinks"):
if self.cycles > 0: # If it's not an infinite horizon model...
self.MaxKinks = np.inf # ...there's no need to set MaxKinks
@@ -1716,6 +1715,9 @@ class PerfForesightConsumerType(AgentType):
seed=self.RNG.randint(0, 2 ** 31 - 1)
).draw(N)
self.t_age[which_agents] = 0 # How many periods since each agent was born
+
+ if not hasattr(self, "PerfMITShk"): # If PerfMITShk not specified, let it be False
+ self.PerfMITShk = False
if self.PerfMITShk == False: # If True, Newborns inherit t_cycle of agent they replaced (i.e. t_cycles are not reset).
self.t_cycle[
which_agents
@@ -2379,8 +2381,6 @@ class IndShockConsumerType(PerfForesightConsumerType):
# have been changed since `__init__` or `solve()` was last called.
# self.update_income_process()
self.update_solution_terminal()
- if not hasattr(self, "PerfMITShk"):
- self.PerfMITShk = False
if not self.quiet:
self.check_conditions(verbose=self.verbose)
