# Wolfram Function Repository

Instant-use add-on functions for the Wolfram Language

Function Repository Resource:

Evolve a 2D array of cells by randomly adding new cells at positions with certain neighborhood configurations

Contributed by:
Kabir Khanna and Jonathan Gorard

ResourceFunction["AggregationSystem"][ generates a list representing the evolution of the aggregation system with the specified rule from initial condition |

This uses the generalized aggregation model from *A New Kind of Science* Chapter 7.

Neighborhood configurations are as specified by an outer totalistic cellular automaton rule.

While entering the rule number, one must make sure that "Dimension" is set to 2.

Possible forms for *rule* are:

{n,{2,1},{1,1}} | 9-neighbor totalistic rule |

{n,{2,{{0,1,0},{1,1,1},{0,1,0}}},{1,1}} | 5-neigbbor totalistic rule |

{n,{2,{{0,2,0},{2,1,2},{0,2,0}}},{1,1}} | 5-neighbor outer totalistic rule |

The following keys can be used to specify a rule given as an association:

"TotalisticCode" | n | totalistic code |

"OuterTotalisticCode" | n | outer totalistic code |

"Dimension" | d | overall dimension (always 2) |

"Neighborhood" | type | neigborhood |

"Range" | r | range of rule |

"Colors" | k | number of colors |

"GrowthCases" | {g_{1},g_{2},…} | make a cell 1 when g_{i} of its neighbors are 1 |

"GrowthSurvivalCases" | {{g_{1},…},{s_{1},…}} | 1 for g_{i} neighbors; unchanged for s_{i} |

"GrowthDecayCases" | {{g_{1},…},{d_{1},…}} | 1 for g_{i} neighbors; 0 for d_{i} |

Possible settings for "Neighborhood" include:

5 or "VonNeumann"

9 or "Moore"

The number of possible aggregation system rules is as follows:

2D general rules | 2^{512} |

2D 9-neighbor totalistic rules | 2^{10} |

2D 5-neighbor totalistic rules | 2^{6} |

2D 5-neighbor outer totalistic rules | 2^{10} |

2D outer totalistic rules | 2^{17}+1 |

The initial condition specification should be of the form *aspec*, {*aspec*,*bspec*} or {{{*aspec*_{1},*off*_{1}},{*aspec*_{2},*off*_{2}},…,{*aspec*_{n},*off*_{n}}},*bspec*} (for *n*>0). Each *aspec* must be a non-empty array of rank 2 whose elements at level 2 are integers *i* in the range 0≤*i*≤"Colors"-1 ("Colors"=2 by default).

Run outer totalistic code 4 for four steps:

In[1]:= |

Out[1]= |

Run totalistic code 18 for 500 steps from a single 1 on a background of 0s:

In[2]:= |

Out[2]= |

Use RulePlot to visualize an outer totalistic rule specification:

In[3]:= |

Out[3]= |

Run outer totalistic code 4 for 5000 steps using the default (Moore) neighborhood:

In[4]:= |

Out[4]= |

Run the same outer totalistic rule for 10000 steps using the von Neumann neighborhood:

In[5]:= |

Out[5]= |

An evolution with three colors:

In[6]:= |

Out[6]= |

A rule specified using growth cases:

In[7]:= |

Out[7]= |

An evolution with a specified color function:

In[8]:= |

Out[8]= |

- "Aggregation Systems: A Stochastic Approach to CA"–Wolfram Community
- A New Kind of Science|Online–The Phenomenon of Continuity
- Wikipedia–Eden growth model

- 1.0.0 – 25 September 2019

This work is licensed under a Creative Commons Attribution 4.0 International License