morphogen.models.automata¶
Microstructures generated by cellular automata and reaction-diffusion.
Each realization is a LatticeField on a
lattice of cells of edge cell_size covering the domain:
periodic domains use periodic lattices (the realization tiles space);
non-periodic domains are windows of an automaton running on a larger periodic lattice, enlarged by the distance information travels in the run (the light cone: neighbourhood radius times the number of steps, at most 32 cells): the windows are then unbiased, without boundary effects.
dimension: 2 runs planar automata (one cell through the thickness of the domain).
Other lattice values than square run the automata (and reaction-diffusion, with
the finite-volume Laplacian of the tiling) on the cells of a tiling
(morphogen.automata.tilings: triangles, hexagons, Penrose and Ammann-Beenker
tiles, prisms, the Voronoi cells of the BCC and FCC lattices, golden rhombohedra) and
give a TilingField, rasterized cell by cell; the
non-periodic windows are then cut from a larger periodic tiling (a larger quasi-periodic
patch, with free boundaries) in the same way. Quasi-periodic tilings fill periodic
domains through their periodic approximants (approximant: an order), the same tiles
in a rectangle or a cube of which the box holds a whole number.
- morphogen.models.automata.MAX_MARGIN = 32¶
Largest margin (in cells) added around non-periodic windows.
- class morphogen.models.automata.CellularAutomatonModel(cell_size: float = 1.0, dimension: int = 3, smoothing: float = 0.0, rule: str = 'anneal', steps: int = 30, neighbourhood: str = 'moore', radius: float = 1.0, initial_fraction: float = 0.5, volume_fraction: float | None = None, update: str = 'synchronous', async_fraction: float = 0.5, lattice: str = 'square', approximant: int | None = None)[source]¶
Bases:
_LatticeModelTwo-phase structure grown by a cellular automaton from random noise.
- property conserved: bool¶
- automaton(periodic: bool = True, tiling=None) CellularAutomaton[source]¶
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) LatticeField[source]¶
One realization of the model in
domain.
- class morphogen.models.automata.ActivatorInhibitorModel(cell_size: float = 1.0, dimension: int = 3, smoothing: float = 0.0, activation_radius: float = 2.0, inhibition_radius: float = 5.0, inhibition_weight: float | None = None, volume_fraction: float | None = None, initial_fraction: float = 0.5, steps: int = 15, lattice: str = 'square', approximant: int | None = None)[source]¶
Bases:
_LatticeModelTuring patterns of Young’s (1984) activator-inhibitor cellular automaton.
Spots, stripes or labyrinths with a wavelength set by the inhibition radius.
- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) LatticeField[source]¶
One realization of the model in
domain.
- morphogen.models.automata.MAX_ATTEMPTS = 5¶
Initial conditions drawn (from the same random stream) before giving up on a pattern.
- class morphogen.models.automata.ReactionDiffusionModel(cell_size: float = 1.0, dimension: int = 3, smoothing: float = 0.0, pattern: str | None = 'labyrinth', feed: float | None = None, kill: float | None = None, diffusion_u: float = 0.16, diffusion_v: float = 0.08, steps: int = 4000, volume_fraction: float | None = None, threshold: float = 0.2, seed_fraction: float = 0.1, lattice: str = 'square', approximant: int | None = None)[source]¶
Bases:
_LatticeModelTuring patterns of the Gray-Scott reaction-diffusion system.
Spots, worms, labyrinths or holes, thresholded on the activator concentration. With the default diffusion coefficients, the patterns have a period of about 12 cells:
cell_sizesets their scale. Lattices narrower than about two periods (24 cells) may not sustain them; the activator then dies out and new initial conditions are drawn (up to 5 times). Other lattices thansquarerun the system on the cells of a tiling with its finite-volume Laplacian (aTilingField).- generate(domain: Domain, seed: int | SeedSequence | Generator | None = None) LatticeField[source]¶
One realization of the model in
domain.