Skip to content

Commit

Permalink
MultiGrid: Set to using list for cell content
Browse files Browse the repository at this point in the history
  • Loading branch information
rht committed Jan 16, 2020
1 parent 7ae78e1 commit 745c04a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions mesa/space.py
Original file line number Diff line number Diff line change
Expand Up @@ -424,12 +424,13 @@ class MultiGrid(Grid):
@staticmethod
def default_val():
""" Default value for new cell elements. """
return set()
return []

def _place_agent(self, pos, agent):
""" Place the agent at the correct location. """
x, y = pos
self.grid[x][y].add(agent)
if agent not in self.grid[x][y]:
self.grid[x][y].append(agent)
self.empties.discard(pos)

def _remove_agent(self, pos, agent):
Expand Down

0 comments on commit 745c04a

Please sign in to comment.