HARK icon indicating copy to clipboard operation
HARK copied to clipboard

Updating agent counts throws an error

Open DominicWC opened this issue 1 year ago • 4 comments

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

DominicWC avatar Jul 07 '23 18:07 DominicWC