CS 420/527 — Biologically Inspired Computation
NetLogo Simulation

AICA - Activation/Inhibition Cellular Automaton


This page was automatically generated by NetLogo 5.0beta2. Questions, problems? Contact feedback@ccl.northwestern.edu.

The applet requires Java 5 or higher. Java must be enabled in your browser settings. Mac users must have Mac OS X 10.4 or higher. Windows and Linux users may obtain the latest Java from Sun's Java site. If the display appear cut off with Firefox, then try another browser (Safari works).



powered by NetLogo

view/download model file: AICA.nlogo

WHAT IS IT?

Could it be that 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. 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 values (the numbers that the rules work on) are slightly different.

Thinking of the formation of fur in terms of rules also helps us understand how offspring of animals may have the same type of pattern, but not the same exact pattern. This is because what they have inherited is the rules and the values rather than a fixed picture. The process by which the rules and values generate a pattern is affected by chance factors, so each individual’s pattern is different, but as long as the offspring receive the same rules and values, their own fur will self organize into the same type of pattern as their parents’.

HOW IT WORKS

We model the animal skin by a square array of many melanocytes (pigment cells) that are each in either of two states: colorful (‘D’ for differentiated) or not-colorful (‘U’ for undifferentiated). The state of a cell can flip between D and U. The color cells (the D’s) have an activity level of +1 and the uncolored cells (the U’s) have and activity level of -1.

Each cell, whether or not it is colorful, is itself the center of its own neighborhood. For now, suppose the neighborhood is a circle. Say this circular neighborhood has a radius of 6 cells. This means that the cell in the center can be affected by other cells that are as far as 6 cells away from it in any direction. So the activity level of a D cell within this circle will affect this central cell (but a D cell 7 cells away will not directly or immediately affect it). Also, each cell has an inner circle of radius, say, 3 cells.

The total activity (+1s and -1s) of the cells within the inner circle each contributes to the activation of the central cell. Between the inner circle and the perimeter of the outer circle we have a ring of cells that are more than 3 cells away from the center but 6 or less cells away from the center. The total activity in this outer ring contributes to the inhibition of the central cell. So at every moment each cell is both activated and inhibited by cells in its circle and the question is: will it ultimately be activated and become colorful or be inhibited and lose its color (or just remain the way it was). The logic is that if the activation power is bigger than the inhibition power then the cell will become colorful and vice versa (and if activation and inhibition are balanced then nothing happens). The idea of “power” is that it’s not enough to know total activity of each cell affecting the center cell, but one must multiply each cell by its “power”: the total activity of the cells in the inner circle is multiplied by J1 (a positive quantity), giving the activation power; the total activity in the ring of cells is multiplied by J2 (a negative quantity) to give the inhibition power. If the activation exceeds the inhibition in magnitude, the cell becomes activated and D (colored), but if the inhibition is greater in magnitude, the cell becomes U (uncolored). Furthermore, cells may be biased more towards activation or inhibition, so that inhibition has to exceed inhibition be a certain threshold, or vice versa. (A tricky point to notice is that while a certain D-cell is activating a neighboring cell, this same D-cell can be inhibiting a different cell further away.)

Here are the rules that summarize what we’ve been discussing: add up all the activities (+1 or -1) of the cells in the ring and call this number I (inhibitory activity), and add up all the activities of the cells in the iner circle and call this number A (activating activity). Let H be the bias (which makes activation or inhibition more likely, depending on whether it’s positive or negative). Then compute J1*A + J2*I + H (recalling that J2 < 0), and:

Note that this computation happens to all cells at the same time. After the first step and once the cells have been set accordingly, the entire business starts over at the next step. Once again, the cells are counted up according to the same rule. The rules have not changed but because some of the D cells are now U and vice versa we might get different counts and because of that – different results of the “fight” between the activation and inhibition powers.

So what you see is that from step to step the individual cells often change from black (representing D or color cells) to white (representing U or no-color cells) and the overall impression is that the configuration of white and black changes as a whole. But these configurations are not random. You will see how these configurations often take form. Understanding how each cell behaves, as we have explained above, can help understanding how these global patterns take form.

HOW TO USE IT

In order that your first experiment will more-or-less match the explanations above, you should choose to set the initial-density slider to 50% (that gives each cell an equal chance of being white or black to start with and so the whole window will be roughly 50% black), set the R1 (inner radius) slider to 1 and the R2 (outer radius) sliders to 6, set inner interaction strength J1 to 1 and outer interacton strength J2 to -0.1 (which makes inner cells activating and outer cells inhibiting), and set H (bias) to 0. Now press SETUP. (In later experiments you are welcome to change those settings in various combinations.) It will converge in very few cycles (less than 20). If you press STEP the model will advance a single step. If you press GO the model will keep stepping indefinitely.

The program precomputes the neighborhoods. Because of this, only press CALCULATE NBDS when you change the metric or radius sliders. If you only change the INITIAL-DENSITY, J1, J2, and H sliders or if you’d like to run the model again with the same settings, press RESTART instead of CALCULATE NBDS. The SETUP button doesn’t ask the patches to recalculate their neighborhoods.

DRAW BLACK and DRAW WHITE allow patches to be colored by hand, while the simulation is running or when it is stopped.

THINGS TO NOTICE

As the model runs, patterns may begin to emerge. Eventually, they stabilize. (Well, sometimes the model will run into an endless flip-flop between two states, but we could call that dynamic stability.) Even when it seems to come to a halt, the model is still running and executing the commands and carrying out the computations, but nothing is changing visibly. This is because for each and every cell the power of activators is equal to that of the inhibitors, so nothing changes.

THINGS TO TRY

Run the model with different INITIAL-DENSITY settings. How, if at all, does the value of the INITIAL-DENSITY affect the emergent pattern? Do you get the same pattern? Do you get a different pattern? Does it take longer?

Note how fragile the self organization of the cells is to slight changes in parameters. If you hold all other factors and slightly change just the RATIO, from trial to trial, you will note that for small ratios you will invariably get completely white fur and for high ratios you will invariably get completely black fur (why is that?). For ratios in between it fluctuates. That happens partially because the initial setting of black/white coloration has a random element to it (see the RESTART procedure in the code).

To see that even when the state has stabilized, the model is still computing it (called a “stationary state” or “dynamic equilibrium”), try the following. Click DRAW BLACK or DRAW WHITE and change some of cells. Notice how the pattern is almost instantly restored (not always exactly, but to a qualitatively similar pattern).

To see the effects of more extensive damage, stop the simulation and use DRAW BLACK and DRAW WHITE to change large areas of cells. Then restart the simulation and see what happens.

EXTENDING THE MODEL

If you find a combination of slider and switch values that consistently give you the fur patterns of a favorite animal, you could create a button, for instance “Zebra,” that sets the sliders to those values. That way, if you make several of these, you can go on a virtual safari tour by moving between your favorite animals. One such combination that you could set in a single button could be:

Parameters

R1 3
R2 6
J1 1
J2 -0.1
H 0
INITIAL-DENSITY 50%

You could call this, perhaps, Fish.

The model provides three neighborhood shapes, L1, L2, and L_infinity. Add some other neighborhood shapes. In particular, add oval or oblong shapes, and add sliders so that the user can control their width and height.

How about adding more colors? What could be the logic here? If you introduced, say, red, you would have to decide on specific conditions under which that color would appear. Also, you’d have to decide how that color influences other cells.

RELATED MODELS

The Fur model, in the Biology section, implements a similar model of pattern formation, using diffusing “morphogens” to implement short-range activation and long-range inhibition.

The Voting model, in the Social Science section, is based on simpler rules but generates patterns that are similar in some respects.

CREDITS AND REFERENCES

Developed 2008-09-15 by B. J. MacLennan to be implemented and behave similarly to the activation-inhibition cellular automaton model of pattern formation in Bar Yam (1997, sec. 7.2).

Bar Yam, Y. (1997). Dynamics of Complex Systems. Reading, MA: Perseus. http://www.necsi.org/publications/dcs/.

Much of this documentation and a few lines of code were borrowed from: Wilensky, U. (2003). NetLogo Fur model. http://ccl.northwestern.edu/netlogo/models/Fur. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.

All rights reserved. See http://ccl.northwestern.edu/netlogo/models/Fur for terms of use.

PROCEDURES

globals [
  inner-nbd       ;; the set of inner neighborhood [dx dy] pairs
  outer-nbd       ;; the set of outer neighborhood [dx dy] pairs
]

patches-own [
  new-color       ;; currently, always either white or black
]

to calculate-nbds
  ;; (for this model to work with NetLogo's new plotting features,
  ;; __clear-all-and-reset-ticks should be replaced with clear-all at
  ;; the beginning of your setup procedure and reset-ticks at the end
  ;; of the procedure.)
  __clear-all-and-reset-ticks
  set inner-nbd compute-neighborhood R1
  set outer-nbd compute-neighborhood R2
  setup
end

to-report compute-neighborhood [R]
  let neighborhood []
  let diameter n-values (2 * R + 1) [? - R]
  foreach diameter [
    let delta-x ?
    foreach diameter [
      if (magnitude delta-x ?) <= R
      [ set neighborhood fput (list delta-x ?) neighborhood ]
    ] 
  ]
  report neighborhood
end

to-report magnitude [delta-x delta-y]
  ifelse metric = "L1"
    [ report abs delta-x + abs delta-y ]
  [ ifelse metric = "L2"
    [ report round (sqrt (delta-x ^ 2 + delta-y ^ 2)) ]
  [ ifelse metric = "L_infinity"
    [ report max list (abs delta-x) (abs delta-y) ]
  [ report "unimplemented metric" ]
  ]]
end

to setup
  cp
  if inner-nbd = 0 or outer-nbd = 0 ;; they didn't CALCULATE_NBDS
  [ calculate-nbds ]
  ask patches
    [ ifelse random-float 100.0 < initial-density
        [ set pcolor black set new-color black ]
        [ set pcolor white set new-color white ] ]
end

to go
  ask patches [ pick-new-color ]
  ask patches [ set pcolor new-color ]
end

to pick-new-color  ;; patch procedure
  let activation sum-within inner-nbd
  let inhibition (sum-within outer-nbd) - activation
  let difference h + J1 * activation + J2 * inhibition
  ifelse difference > 0
    [ set new-color black ]
    [ if difference < 0
        [ set new-color white ] ]
  ;; note that we did not deal with the case that difference = 0.
  ;; this is because we would then want cells not to change color.
end

to-report sum-within [nbd]
  let activity 0
  foreach nbd
  [
    ifelse black = [ pcolor ] of patch-at (first ?) (item 1 ?)
      [ set activity activity + 1 ]
      [ set activity activity - 1]
  ]
  report activity
end

;; The following two procedures allow patches to be colored black or white

to draw-black
if mouse-down?
 [ask patches
  [if ((abs (pxcor - mouse-xcor)) < 4) and ((abs (pycor - mouse-ycor)) < 4)
   [set pcolor black]
 ]]
end

to draw-white
if mouse-down?
 [ask patches
  [if ((abs (pxcor - mouse-xcor)) < 4) and ((abs (pycor - mouse-ycor)) < 4)
   [set pcolor white]
 ]]
end

Return to COSC 420/527 home page

Return to MacLennan's home page

Send mail to Bruce MacLennan / MacLennan@utk.edu

Valid HTML 4.01!This page is web.eecs.utk.edu/~mclennan/Classes/420/NetLogo/AICA.html
Last updated: 2012-01-30.