Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update examples to version 1.2 (using SingleGrid instead of Grid)
  • Loading branch information
Jeremy Silver committed Apr 25, 2023
commit 60e41eb2616ad97db407933bf9a2e13ea6d0032b
2 changes: 1 addition & 1 deletion examples/color_patches/color_patches/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def __init__(self, width=20, height=20):
The agents next state is first determined before updating the grid
"""

self._grid = mesa.space.Grid(width, height, torus=False)
self._grid = mesa.space.SingleGrid(width, height, torus=False)
self._schedule = mesa.time.SimultaneousActivation(self)

# self._grid.coord_iter()
Expand Down
2 changes: 1 addition & 1 deletion examples/color_patches/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mesa~=1.1
mesa~=1.2
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def __init__(self, width=50, height=50):
self.schedule = mesa.time.SimultaneousActivation(self)

# Use a simple grid, where edges wrap around.
self.grid = mesa.space.Grid(width, height, torus=True)
self.grid = mesa.space.SingleGrid(width, height, torus=True)

# Place a cell at each location, with some initialized to
# ALIVE and some to DEAD.
Expand Down
2 changes: 1 addition & 1 deletion examples/conways_game_of_life/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mesa~=1.1
mesa~=1.2
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def __init__(
self.max_iters = max_iters
self.iteration = 0
self.schedule = mesa.time.RandomActivation(self)
self.grid = mesa.space.Grid(width, height, torus=True)
self.grid = mesa.space.SingleGrid(width, height, torus=True)
model_reporters = {
"Quiescent": lambda m: self.count_type_citizens(m, "Quiescent"),
"Active": lambda m: self.count_type_citizens(m, "Active"),
Expand Down
2 changes: 1 addition & 1 deletion examples/epstein_civil_violence/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jupyter
matplotlib
mesa~=1.1
mesa~=1.2
2 changes: 1 addition & 1 deletion examples/forest_fire/forest_fire/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, width=100, height=100, density=0.65):
"""
# Set up model objects
self.schedule = mesa.time.RandomActivation(self)
self.grid = mesa.space.Grid(width, height, torus=False)
self.grid = mesa.space.SingleGrid(width, height, torus=False)

self.datacollector = mesa.DataCollector(
{
Expand Down
2 changes: 1 addition & 1 deletion examples/forest_fire/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
jupyter
matplotlib
mesa~=1.1
mesa~=1.2