Fixes init cell called to often
This commit is contained in:
parent
5df529bf9e
commit
dc3903b2a6
@ -54,8 +54,9 @@ class CellularAutomatonCreator(abc.ABC):
|
|||||||
|
|
||||||
def __make_cells(self):
|
def __make_cells(self):
|
||||||
for coord in itertools.product(*[range(d) for d in self._dimension]):
|
for coord in itertools.product(*[range(d) for d in self._dimension]):
|
||||||
self._current_state[coord] = CELL(self.init_cell_state(coord))
|
cell_state = self.init_cell_state(coord)
|
||||||
self._next_state[coord] = CELL(self.init_cell_state(coord))
|
self._current_state[coord] = CELL(cell_state)
|
||||||
|
self._next_state[coord] = CELL(cell_state)
|
||||||
|
|
||||||
def __add_neighbors(self):
|
def __add_neighbors(self):
|
||||||
calculate_neighbor_coordinates = self._neighborhood.calculate_cell_neighbor_coordinates
|
calculate_neighbor_coordinates = self._neighborhood.calculate_cell_neighbor_coordinates
|
||||||
|
Loading…
Reference in New Issue
Block a user