Skip to content

Commit

Permalink
fix: examples: Make space x, y order consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
rht authored and Corvince committed Jun 19, 2022
1 parent c210383 commit bb01358
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ def __init__(
if self.random.random() < self.cop_density:
cop = Cop(unique_id, self, (x, y), vision=self.cop_vision)
unique_id += 1
self.grid[y][x] = cop
self.grid[x][y] = cop
self.schedule.add(cop)
elif self.random.random() < (self.cop_density + self.citizen_density):
citizen = Citizen(
Expand All @@ -98,7 +98,7 @@ def __init__(
vision=self.citizen_vision,
)
unique_id += 1
self.grid[y][x] = citizen
self.grid[x][y] = citizen
self.schedule.add(citizen)

self.running = True
Expand Down
2 changes: 1 addition & 1 deletion examples/forest_fire/Forest Fire Model.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@
" # Set all trees in the first column on fire.\n",
" if x == 0:\n",
" new_tree.condition = \"On Fire\"\n",
" self.grid[y][x] = new_tree\n",
" self.grid[x][y] = new_tree\n",
" self.schedule.add(new_tree)\n",
" self.running = True\n",
"\n",
Expand Down

0 comments on commit bb01358

Please sign in to comment.