Fixes init cell called to often

This commit is contained in:
rfeistenauer 2020-10-23 10:33:09 +02:00
parent 5df529bf9e
commit dc3903b2a6

View File

@ -54,8 +54,9 @@ class CellularAutomatonCreator(abc.ABC):
def __make_cells(self):
for coord in itertools.product(*[range(d) for d in self._dimension]):
self._current_state[coord] = CELL(self.init_cell_state(coord))
self._next_state[coord] = CELL(self.init_cell_state(coord))
cell_state = self.init_cell_state(coord)
self._current_state[coord] = CELL(cell_state)
self._next_state[coord] = CELL(cell_state)
def __add_neighbors(self):
calculate_neighbor_coordinates = self._neighborhood.calculate_cell_neighbor_coordinates