projectmesa / mesa-examples

User and showcase agent-based models developed using Mesa
Other
121 stars 153 forks source link

The error occurred while running the example "mesa-examples/examples/forest_fire/Forest Fire Model.ipynb". #228

Open weililiuo opened 4 weeks ago

weililiuo commented 4 weeks ago

There are two main errors. The first one occurs when running from mesa.batchrunner import BatchRunner. er1 When I changed the previous error part to import mesa.batchrunner, the program continued to run. However, an error occurred again in the sixth code block. er2 I'm not sure if these two errors are related, which makes it a bit difficult for me to know how to proceed. I hope someone kind can help me resolve this issue.

EwoutH commented 4 weeks ago

BatchRunner was removed a while ago (in https://github.com/projectmesa/mesa/pull/1689), we replaced it with batch_run.

You can either update the example (an PR is appreciated!) or use an older Mesa version, I think v1.2.0 is the latest version that supports the old BatchRunner.

weililiuo commented 3 weeks ago

Thanks for your suggestion, but the second issue is still not resolved. The error shows "'ForestFire' object has no attribute 'dc'." This might be a separate issue?

EwoutH commented 3 weeks ago

It’s probably just datacollector instead of dc, could you try that?

The answer is in the code :)

weililiuo commented 3 weeks ago

Thanks, the problem is solved! Next time I'll make sure to read the code carefully first...

EwoutH commented 3 weeks ago

No worries, and feel free to open a PR to fix it in our example!