-
Notifications
You must be signed in to change notification settings - Fork 884
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
batchrunnerMP example? #1107
Comments
This seems to be a known problem. There are 2 solutions:
The first solution is a one-line fix, but requires installing an external library. The second one uses stdlib, but requires more changes in the code. Also, the code won't look clean (note: this messiness is invisible to the user; it's messy only for Mesa developers). @swirya if you want a quick fix, you can do the first solution. But a permanent solution requires more discussion. |
I think this is still an open issue. |
I tried adding a lambda function in the model reporter of examples/bank_reserves/batch_run.py. This breaks Closing now, because pickling lambda functions work in |
Adapting the bank_reserves example to use batchrunnerMP results in the following error:
MaybeEncodingError: Error sending result: '((25, 5, 0, 0), <main.BankReservesModel object at 0x7f5d26e1a700>)'. Reason: 'AttributeError("Can't pickle local object 'BankReservesModel.init..'")'
Here's the command:
batch = BatchRunnerMP(
BankReservesModel,
nr_processes=None,
variable_parameters=br_params,
iterations=1,
max_steps=1000,
model_reporters={"Data Collector": lambda m: m.datacollector},
)
batch.run_all()
What am I missing? Thanks in advance.
The text was updated successfully, but these errors were encountered: