Skip to content

Commit

Permalink
Add description of topology package (#23, #27)
Browse files Browse the repository at this point in the history
  • Loading branch information
a5kin committed Dec 20, 2017
1 parent 504a0ee commit 3fc77b9
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions xentica/core/topology/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""This package helps you build the topology for CA models.
All ``CellularAutomaton`` subclasses **must** have ``Topology`` class
declared inside. This class describes:
- ``dimensions``: the number of dimensions your CA model operates on.
- ``lattice``: the type of lattice of your CA board. Built-in lattice
types are available in ``core.topology.lattice`` module.
- ``neighborhood``: the type of neighborhood for a single
cell. Built-in neighborhood types are available in
``core.topology.neighborhood`` module.
- ``border``: the type of border effect, e.g. how to process off-board
cells. Built-in border types are available in
``core.topology.border`` module.
In example, you can declare the topology for a 2-dimensional
orthogonal lattice with Moore neighborhood, wrapped to a 3-torus, as
follows::
class Topology:
dimensions = 2
lattice = core.OrthogonalLattice()
neighborhood = core.MooreNeighborhood()
border = core.TorusBorder()
"""

0 comments on commit 3fc77b9

Please sign in to comment.