projectmesa/mesa-examples

Error while trying to run Viz_MoneyModel.py: TypeError: __init__() takes from 3 to 5 positional arguments but 7 were given

anonymousDog12 opened this issue · 3 comments

$ ls
MoneyModel.py Readme.md Viz_MoneyModel.py pycache/ requirements.txt

$ pwd
/Users/erin/Developer/mesa-examples/examples/Boltzmann_Wealth_Model

$ python3 Viz_MoneyModel.py
Traceback (most recent call last):
File "Viz_MoneyModel.py", line 28, in
server = ModularServer(MoneyModel, [grid, chart], "Money Model", 100, 10, 10)
TypeError: init() takes from 3 to 5 positional arguments but 7 were given

Update:

Through a little debugging, I managed to get it work once I change the last three parameter to a dictionary, {'N': 100, 'width': 10, 'height': 10}:

server = ModularServer(MoneyModel, [grid, chart], "Money Model", {'N': 100, 'width': 10, 'height': 10})

This looks like something you were writing and not part of the repository. Am I correct?
And if you were writing this, were you writing it in correctly and there is nothing to fix? Or is there something to fix in the tutorial?

I didn't realize I was in this repo. This is a bad repo that hasn't been updated. We intended to move the examples here and never did. You can find the examples here: https://github.com/projectmesa/mesa/tree/master/examples

I will remove these examples.