Skip to content

First time Mesa User: Can't use self.model.grid.get_neighbors over an arbitrary value. #1532

Answered by rht
Jomomo05 asked this question in Q&A
Discussion options

You must be logged in to vote

The error happened because self.nueva_posicion is None instead of a tuple. If you handle this case in advance, there should be no problem. Make sure to also check that if self.pos != self.nueva_posicion also makes sense if it is None.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@Jomomo05
Comment options

@rht
Comment options

@Jomomo05
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Jomomo05
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