Skip to content

Help #1539

Answered by rht
BENFREDJRima-34 asked this question in Q&A
Help #1539
Nov 28, 2022 · 1 comments · 3 replies
Discussion options

You must be logged in to vote
a = MyAgent(i, self, Model)

This should have been

a = MyAgent(i, self)

You have to update the __init__ definition of MyAgent to be consistent, by removing the pos from the argument. You don't have to assign pos to a during the initialization, since later a.pos will be assigned by self.grid.place_agent(a, (x, y)). And the model object to be passed is self instead of Model.

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@BENFREDJRima-34
Comment options

@rht
Comment options

@BENFREDJRima-34
Comment options

Answer selected by BENFREDJRima-34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants