lantunes / cellpylib

A library for working with Cellular Automata, for Python.
https://cellpylib.org
Apache License 2.0
228 stars 32 forks source link

Neighbourhood #33

Open Melcar179 opened 2 years ago

Melcar179 commented 2 years ago

Hello! First of all thanks for this great library. It's very helpful as I have only started working with automata. I would like to ask whether its possible to define my own neighborhood and not use neither Moore nor von Neummann. Thank you.

lantunes commented 2 years ago

Hello, and thank you for the message! I'm glad you find the library useful. Unfortunately, there isn't a way to specify alternative arrangements of neighbours in CellPyLib. For 2D CA, only Moore and von Neumann neighbourhoods are currently supported.

In order to make operations faster, CellPyLib constrains the topology of the network of cells, such that it must be a uniform grid. It also constrains the specification of cell neighbourhoods. If you'd like to work with CA on arbitrary networks, you might find the Netomaton library helpful, though currently it is less performant.