Function Repository Resource:

# AggregationSystem

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"][rule,init,t] generates a list representing the evolution of the aggregation system with the specified rule from initial condition init for t steps.

## Details and Options

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" {g1,g2,…} make a cell 1 when gi of its neighbors are 1 "GrowthSurvivalCases" {{g1,…},{s1,…}} 1 for gi neighbors; unchanged for si "GrowthDecayCases" {{g1,…},{d1,…}} 1 for gi neighbors; 0 for di
Possible settings for "Neighborhood" include:
5 or "VonNeumann"
9 or "Moore"
The number of possible aggregation system rules is as follows:
 2D general rules 2512 2D 9-neighbor totalistic rules 210 2D 5-neighbor totalistic rules 26 2D 5-neighbor outer totalistic rules 210 2D outer totalistic rules 217+1
The initial condition specification should be of the form aspec, {aspec,bspec} or {{{aspec1,off1},{aspec2,off2},,{aspecn,offn}},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 0i"Colors"-1 ("Colors"=2 by default).
t should be a natural number. If t is specified as a list of a certain depth, then the first element of the flattened list will be taken as the input.

## Examples

### Basic Examples (3)

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]=

### Scope (5)

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]=

Kabir Khanna

## Version History

• 1.0.0 – 25 September 2019

## Author Notes

Currently limited to 2D. Hence, the dimensionality must always be set to 2.