HARK
HARK copied to clipboard
Updating agent counts throws an error
Describe the bug If we run a simulation with a certain number of agents, and then change the number of agents and rerun a simulation, we get an error.
We're able to change other parameters, like the distributions of income, but not the agent count.
To Reproduce Run the following:
from HARK.ConsumptionSaving.ConsIndShockModel import PerfForesightConsumerType agent=PerfForesightConsumerType() agent.solve() Params={"AgentCount":10000,"aNrmInitStd": 1.0,"T_sim":10} agent.assign_parameters(**Params) agent.initialize_sim() agent.simulate() print("First simulation works")
Params={"AgentCount":10000,"aNrmInitStd": 2.0,"T_sim":10} agent.assign_parameters(**Params) agent.initialize_sim() agent.simulate() print("Second simulation works")
Params={"AgentCount":20000,"aNrmInitStd": 1.0,"T_sim":10} agent.assign_parameters(**Params) agent.initialize_sim() agent.simulate() print("Third simulation works")
Expected behavior All three simulations should run without issue
Desktop: OS: Windows Browser: Firefox Econ-ARK and Python version: 0.13.0 and Python 3.9.13