We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents a0e5d10 + afad7cb commit 041c593Copy full SHA for 041c593
examples/sugarscape_cg/sugarscape_cg/agents.py
@@ -34,7 +34,7 @@ def get_sugar(self, pos):
34
35
def is_occupied(self, pos):
36
this_cell = self.model.grid.get_cell_list_contents([pos])
37
- return len(this_cell) > 1
+ return any(isinstance(agent, SsAgent) for agent in this_cell)
38
39
def move(self):
40
# Get neighborhood within vision
0 commit comments