Help #1539
-
Can anyone help me?
`class MyModel(Model):
`def agent_portrayal(agent):
grid = CanvasGrid(agent_portrayal,10,10,500,500) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
a = MyAgent(i, self, Model) This should have been a = MyAgent(i, self) You have to update the |
Beta Was this translation helpful? Give feedback.
This should have been
You have to update the
__init__
definition ofMyAgent
to be consistent, by removing thepos
from the argument. You don't have to assignpos
toa
during the initialization, since latera.pos
will be assigned byself.grid.place_agent(a, (x, y))
. And the model object to be passed isself
instead ofModel
.