conways way of life is broken?
attempted to run conways game of life
i could get it to run by wrapping it in singlegrid and then for the idx errors, i added a ghost
self.grid = SingleGrid(width, height, torus=True)
ghost = Agent(self)
self.grid.place_agent(ghost, (0, 0))
so i think the simulation is running correctly, as in, when population density is at 1, it dissapears instantly but, i cant see any cells except the ghost itself, am i missing something here?, also changed this to "cell_layer" it was "cells" previously, (cell_layer is defined in app.py) i wasnt too sure of this, but replacing it with cells gives error anyways self.cell_layer = PropertyLayer("cell_layer", width, height, False, dtype=bool)
i added placeholders/dummies to trigger the rendering, becasue the simulation was running, just not showing, let me know if i can PR this:
for _, (x, y) in self.grid.coord_iter():
dummy = Agent(self)
self.grid.place_agent(dummy, (x, y))
Still broken on Mesa 3.5.0. Getting this error when running app.py:
ValueError: Unknown space type: <class 'NoneType'> Comes from make_space_component in app.py. it's expecting an actual grid/space but the model only has a PropertyLayer, so it gets None. The dummy agent workaround mentioned above doesn't fix this either.
Happy to look into a proper fix if no one else is working on it. @jackiekazil @disgruntled-penguin @tpike3 @EwoutH
I've investigated this issue and have a working fix. The root cause is that Mesa 3.3.1's _scatter() crashes with an IndexError when there are no agents (empty 1D array). My fix attaches the PropertyLayer to an OrthogonalMooreGrid and uses a custom Solara matplotlib component with imshow to render the cells. Opening a PR shortly.