我正在关注 python mesa 的教程(http://mesa.readthedocs.io/en/latest/index.html),我无法从高级教程(http://mesa.readthedocs.io /en/latest/tutorials/adv_tutorial.html)启动并运行。
我遇到麻烦的代码:
server = ModularServer(SwarmportModel,
[grid],
"SwarmportModel",
100, 10, 10)
我得到的错误:
server = ModularServer(SwarmportModel, [grid], "SwarmportModel", 100, 10, 10)
TypeError: __init__() takes from 3 to 5 positional arguments but 7 were given
当我在我提到的代码的最后一行中省略了 3 个参数时,我收到了缺少 3 个参数的错误消息。
server = ModularServer(SwarmportModel, [grid], "SwarmportModel",)
TypeError: __init__() missing 3 required positional arguments: 'N', 'width', and 'height'
有谁知道我做错了什么?