-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
Hello,
I want to run (stabilize) small sandpiles but the program sends errors. Below is an example:
npile = Sandpile([[4, 4, 6, 4, 4], [4, 0, 6, 0, 4], [6, 6, 0, 6, 6], [4, 0, 6, 0, 4], [4, 4, 6, 4, 4]])
>>> npile.grid
array([[4, 4, 6, 4, 4],
[4, 0, 6, 0, 4],
[6, 6, 0, 6, 6],
[4, 0, 6, 0, 4],
[4, 4, 6, 4, 4]])
>>> npile.run()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "sandpile/sandpile/sandpile.py", line 54, in run
topple(elem_x, elem_y)
File "sandpile/sandpile/sandpile.py", line 35, in topple
self.grid[elem_x+1, elem_y] += b
~~~~~~~~~^^^^^^^^^^^^^^^^^^
IndexError: index 5 is out of bounds for axis 0 with size 5
Metadata
Metadata
Assignees
Labels
No labels