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 ofMyAgentto be consistent, by removing theposfrom the argument. You don't have to assignpostoaduring the initialization, since latera.poswill be assigned byself.grid.place_agent(a, (x, y)). And the model object to be passed isselfinstead ofModel.