Skip to content

Conversation

@quaquel
Copy link
Member

@quaquel quaquel commented Aug 28, 2024

the datacollector allways includes grasspatches even if grass is False. This is breaking (the proposed changes to agent storage in Model)[https://github.com/mesa/mesa/pull/2251#issue-2488519860].

The underlying problem is that Model.get_agents_of_type now raises a KeyError if type does not exist. I think this is desirable behavior becuase errrors should not be passed over in silence. But this requires fixing the wolf sheep example as done here.

Copy link
Member

@EwoutH EwoutH left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I think this actually can be a single dict comprehension but let's go for readability here.

@EwoutH EwoutH merged commit 1d67252 into mesa:main Aug 28, 2024
EwoutH pushed a commit to EwoutH/mesa-examples that referenced this pull request Sep 20, 2024
the datacollector allways includes grasspatches even if grass is False. This is breaking (the proposed changes to agent storage in Model.

The underlying problem is that Model.get_agents_of_type now raises a KeyError if type does not exist. I think this is desirable behavior becuase errrors should not be passed over in silence. But this requires fixing the wolf sheep example as done here.
@quaquel quaquel deleted the wolfsheep branch November 11, 2024 18:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants