Activator Inhibitor “Fur” Pattern – Example 12.1

01_Fur_01_3-3-75 This is the first example I am showing based on a family of algorithms known as Cellular Automata. I will not write too much here about the theory of a cellular automaton, you can read the Wikipedia page or google the term if my basic explanation doesn’t make sense, but Cellular Automata have

1 – A regular system of cells. The most basic cellular automata are based on a simple grid, but other systems work as well, such as hexagonal matrices, irregular grids, voronoi cells, etc.

2-Each cell has a “state.” Many cellular automata have only two states, on/off, dead/alive, etc, although more than two states are also possible.

3-Each cell also has a “neighborhood” that will affect its behavior in the next round. Again, the neighborhood could be only four adjacent cells, (left/right/up/down), all adjacent cells including the diagonals (8 neighbors), or other configurations.

4-Production Rule which determines how a cell’s state changes each round. This change is almost always based on its relationship to the neighbors, and sometimes also affected by its current state.

In this example, we will look at a system known as an Activator/Inhibitor System. The algorithm is based, with very minor modifications, on an algorithm from the “Netlogo” program, (which can be downloaded and tested for free) and which was developed by Uri Wilensky. From the Netlogo page description… “Does a single mechanism underlies such diverse patterns such as the stripes on a zebra, the spots on a leopard, and the blobs on a giraffe? This model is a possible explanation of how the patterns on animals’ skin self-organize. It was first proposed by Alan Turing. If the model is right, then even though the animals may appear to have altogether different patterns, the rules underlying the formation of these patterns are the same and only some of the parameters (the numbers that the rules work on) are slightly different.” I won’t try and explain the science behind this. It is still somewhat speculative if this is the actual mechanism for pattern formation in animals, but it is based on a series of real-life observations. There is actually a pretty good description of the process in Philip Ball’s book “Shapes” which I highly recommend for anyone interested in form creation in nature. Anyways, while the algorithm runs quicker and it is easier to test variations in NetLogo, and I would recommend doing so to get a feel for the system, putting it into Rhino/Grasshopper allows you to spatialize the system and adapt it to various forms, and also change the initial structure. I will show some of these at the end. But for now, onto the script!

Step 01 – Initial Setup 01_Fur_01The initial setup is fairly straightforward. In this case, I setup a basic grid of cells, although I will show at the end some variations where other grid sizes are used. From this grid, I extract three sets of information. The first set of information is the list of boundary surfaces for each cell, which I will not put through the loop, but which will be assigned at the end of the loop with one of two colors, based on the current “state” of the cell. The second list, which will be modified in our loop, is a simple list of “cell states”, which in this case are either 0 or 1, “dead” or “alive” (which will be colored black or yellow at the end of the loop. Here I am showing how this is done, but will later move the colors and custom preview to the end of the loop. It is much faster to loop simple data, such as 0s and 1s, rather than geometry. Finally, I extract the center point of each cell, which will be used in the next step to determine the proximity to adjacent cells, the “neighborhood.”

Step 02 – Proximity Tests 01_Fur_02For this next step, I am using a component I just recently discovered called “Proximity 2D”.  This has various inputs and settings, here I am most interested in the R- and R+ inputs. (Minimum and Maximum Radius). You will note that I put in the number “1000” into G which is the number of relations to test, and since I don’t want this to play in the calculations, I put a sufficiently high number here, although with the radius tests I will never get to this number. The essential logic of this script is each cell changes its state to “alive” or “dead” based on two sets of “chemicals”, activators and inhibitors. If the number of activators close to the cell is greater than the number of inhibitors away from the cell, the cell will be “alive” or a “1”. If inhibitors dominate, the cell will be “dead” or a “0”. Note that ONLY currently “alive” cells contribute to the calculation, that is, only alive cells secrete chemicals that contribute to the process. In the example above, the inner circle, based on the activator radius, which is 3.25 units, has 36 cells in its neighborhood. Of these, 19 are “alive”. The second neighborhood, the inhibitor ring, has a thickness of 2 units, with 32 cells in the neighborhood. Of these 18 are “alive”. So in this case, cell 750, which is currently “dead” would become “alive” in the next round since the activators in the activation ring are outnumbering the activators in the inhibitor ring. But I’m a little ahead of myself. These calculations will only happen in the next step. The Prox component tells you nothing about the state, etc. All it tells you is the “Item Index” of all the cells in the respective rings. The indices are listed in the “T” output. We will use these indices in the next step.

Step Three – Calculate New Cell State 01_Fur_step03 So now we finally get into the meat of the algorithm, and insert it into the Anemone loop. From the previous step, I have the Item Indices for all the cells in each neighborhood. I use “List Item” to retrieve the current cell state (either 0 or 1) from my data container, the one I am looping. I then use the “Mass Addition” component to sum up all the “1s”. This is done once for the activator region, and once again for the inhibitor ring. I then put these into a simple “Expression” component. The text in the component is ”  If (x>y,1,0)  ”  What does that mean? I thought you told us we didn’t have to do programming!! I lied. Kind of. This is Grasshopper’s way of doing an “If/then” expression. If you are somewhat familiar with programming, this should be clear, but the commas in the expression stand for “then” and “else”.  So what it means essentially is ”  If x is greater than y then the result will be 1 or else if is not greater than y then the result will be 0  The syntax the computer understands, however, must be much abbreviated, and shorter, and precise. Hence the commas. And the parentheses. (the parentheses allow you to do IF/AND/THEN/ELSE statements, which we will see in the next example.) Anyways, once you get past that, we are home free. I put panels on the components so you can see what is going on in the first few cells in the list, but it does this for all 1225 cells in this case.  If you are keeping track, the first three cells all have dominant inhibitors, so they are “Dead/0”. The next three have dominant activators, so they are “Alive/1”. ..etc… Now the new Cell States get fed into the D0 port on Anemone, and these will be used instead of our random noise in the next few rounds. If you are curious. You will see the results of the script after the first 5 rounds, along with the initial state, in the image below. Note that the initial “Noise” quickly disappears and a pattern emerges fairly quickly, and soon becomes consolidated. Once consolidated, it remains fairly stable, and won’t change too much, even if you run it for 100s of rounds. 01_Fur04_evolution

If you play with the random seed to change the initial noise, the final pattern will change, but only a little bit. The image below shows three variations using the settings just described.


If you want to get real variation at this point, you can change the radius of the activator or inhibitor rings to see how the pattern changes. In the previous example, the central Activator Region had a radius of 3.25. If I change this to 4.25, the pattern will look like the images below. Looks kind of like Hebrew letters to me…


Step Four – Optional Weight Ratio for Activators / Inhibitors


While you can control the pattern a lot by controlling the rings, a last control would be to control the ratio, or relative strength of the Activators vis-a-vis the inhibitors. You can insert this between the “Mass Addition” and the If/Then expression. Variations Once you get it working, you can use a bigger grid, play with the Radii, the Ratios, and even maybe use a different cell proportion…


Applying to Other Shapes

Anyways, as said previously, the algorithm works better in a program such as NetLogo, but once it is in Rhino, you can play with other typologies rather than square grids. One of the theories of the pattern formation in animals is that the size and shape of spots isn’t only dependent on the chemical reaction system, but also on the form of the animal, and the animals growth process. To test this out, I applied the script to a quick sketch of a 2D animal skin…. 01_Fur_06Honestly, I was hoping for more topological reaction, but you can already start to see in very narrow areas, such as tails, only stripes can form since there isn’t enough room for spots. Also, this test doesn’t account for growth processes. The theory is the spots or stripes are laid down when the animal is still an embryo, when the torso is relatively small, and then this gets bigger, so bigger spots in some areas come after a process of growth/transformation/deformation.

So what does this have to do with Landscape???

Apart from being an interesting form making system, and an introduction to cellular automata, the logic of activator/inhibitor system has some uses in ecology, especially in ecosystems in semi-arid climates. If you are curious, you can read more on the Wikipedia page on “Tiger Bush” although here is an image that also communicates the idea. tigerbush This pattern also emerges in people’s lawns when you don’t water them enough. Of course, few clients will want you to design a activator/inhitor lawn for them, but maybe people will start having to investigate this soon in California. Apart from that, it may have potential as a form-giver on projects with a more contemporary aesthetic, I’m not sure if the people at Stoss LU were thinking about Cellular Automata when they designed the Erie Street Plaza in Milwaukee, but it is certainly possible. The bands of pavement/vegetation certainly have a feel of a CA, and Chris Reed and company have been known to tinker with Grasshopper in the past, so it is certainly possible! Anyways, I had some of my own experiments with this applied to some sketch projects, but I think I’ll keep those to myself for now…just in case the right competition comes along to enter them into 😉