Open gamzetuncay opened 4 years ago
You can read your error from bottom to top to debug it yourself:
Last line:
TypeError: __init__() takes 3 positional arguments but 4 were given
You tried to call a function that takes 3 arguments with 4 arguments. But where?
second-to-last-line:
File "C:\Users\gamzetuncay\Desktop\ticket_sales\agents.py", line 29, in __init__
super().__init__(pos, unique_id, model)
So you called super().__init__
with pos, unique_id, model
. Since this is a instance method you implicitly also pass self
as a first argument, which makes it four arguments.
I presume super
refers to mesas agents base class, which is defined as follows:
class Agent:
""" Base class for a model agent. """
def __init__(self, unique_id, model):
""" Create a new agent. """
self.unique_id = unique_id
self.model = model
So it only accepts the implicit argument self
and id and model. But you also passed pos
which it can't handle. Thus, your error.
However I don't know how this relates to
When I remove 'model' parameter from Consumer in agents.py , since you did not provide your
agents.py
, but only your server file twice.
Describe the bug When I remove 'model' parameter from Consumer in agents.py , the server opens, but the step and start buttons does not work
Expected behavior ---------agents.py
---------model.py
---------server.py
---------run.py
To Reproduce
Additional context