CA Continuous

CA Continuous preview image

2 collaborators

Uri_dolphin3 Uri Wilensky (Author)
Eytan Bakshy (Author)


cellular automata 

Tagged by Reuven M. Lerner about 11 years ago

computer science 

Tagged by Reuven M. Lerner about 11 years ago

Model group CCL | Visible to everyone | Changeable by group members (CCL)
Model was written in NetLogo 5.0.4 • Viewed 465 times • Downloaded 84 times • Run 0 times
Download the 'CA Continuous' modelDownload this modelEmbed this model

Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)


This is a continuous cellular automaton, otherwise known as a "coupled map lattice." (See CA 1D Elementary and CA 1D Totalistic if you are unfamiliar with cellular automata.) It operates just like a standard cellular automaton, except for the fact that its states are not discrete, but continuous values.

In this particular continuous cellular automaton, the cell's values range from 0.0 to 1.0, 0.0 being black and 1.0 being green.

Unlike two- or three-state cellular automata, each cell in a continuous cellular automaton can ideally have infinite states, but is limited by the precision of the computer (in this case the maximum is 16 decimal places, which is the most NetLogo can handle). The continuous nature of the CA and its particular rules allow this model to generate a great deal of complex behavior under almost any settings.


The rules are a cross between a totalistic cellular automaton and an iterated map.

An iterated map is a fixed map, or function, that is applied to a number repeatedly. The iterated map that is used in this model takes in a number, adds a constant (ADD-CONSTANT) between 0 and 1, and then the fractional part of that number is taken. For example, if the given number is 0.8 and the add-constant is 0.6, the sum would be 1.4, and the fractional part would be 0.4.

The cellular automaton is totalistic, which means that at every time step, each cell's new state is determined by taking the average of itself and its nearest neighbors, and then passing it through the iterated map.

The precision of the values in the cells is determined by the PRECISION slider.


Set up:

  • SETUP SINGLE initializes the model with a single cell set to 1 in the center.
  • SETUP RANDOM initializes the model with each initial cell being a random value ranging from 0 to MAX-VALUE


  • ADD-CONSTANT is the constant added to the average value of the nearest cells before the fractional part is taken.
  • PRECISION-LEVEL is the precision of the value of each cell, with a slider value of 1 being an accuracy of 1 decimal place, and 16 being an accuracy of 16 decimal places.

Running the model:

  • GO begins running the model with the currently set parameters. It continues until it reaches the last row of patches. If it is clicked again, GO will continue the run from the top.
  • AUTO-CONTINUE? automatically wraps to the top once it reaches the last row when the switch is on


Like their discrete counterparts, continuous cellular automata exhibit certain classes of behavior: Class I - cellular automaton is ordered and always ends up in a uniform state. Class II - cellular automaton is ordered and produces repetitive patterns. Class III - cellular automaton is "chaotic," or almost completely random. Class IV - cellular automaton is neither in class I, II, or III. It exhibits "complex" behavior, which often lies between order and chaos.

Can you find any cellular automaton configurations that exhibit these properties? What does this tell you about the nature of cellular automata?

Unlike elementary two-state cellular automata, certain configurations grow outwards at a rate that may be faster or slower than others, and less linear than the permitted one-cell per step growth in two-state cellular automata. Why do you think this is? What might this tell you about the relationship between the number of states and the growth of cellular automata?

The growth of continuous cellular automata is closely related to the continuity of space that it can produce. With certain ADD-VALUES, this model is able to produce very smooth curves. This is a sharp contrast to the jagged triangular patterns often found in two or three state cellular automata. Why do you think this happens? What might this tell you about the relationship between the number of states and spatial continuity in cellular automata?

Structures might seem to spontaneously occur from parts that seem very regular, especially when the model is run with initial random conditions with a with a very small MAX-VALUE. It is important to note that this is generally caused by small changes in cell values that cannot be seen due to the color limitations of NetLogo, and ultimately the human eye.


Try these with single point initial conditions:

Run the model with ADD-CONSTANT set to 0.0 and 1.0. Why do they produce the same pattern?

Why does it make sense that an ADD-CONSTANT of 0.5 produces relatively solid alternating green and black patterns? Why does the line produced by the rule diffuse faster when the ACCURACY is higher?

Set the MAX-VALUE slider to a number between 0 and 0.10, and click setup random. Run the model a couple of times with different values for MAX-VALUE:

  • Why do you think there is a delay in the occurrence of complex structures?
  • Is there a relationship between the initial MAX-VALUE and the length of the delay? If so, Why?

Change ADD-CONSTANT back to 0.47, and experiment with different values of the ACCURACY slider:

  • How does the accuracy affect the patterns?
  • How come the effect of the accuracy is more noticeable after a large number of steps? - Why might low accuracies create incongruities in the cellular automata?

Try out different ADD-CONSTANTS under various the ACCURACY slider values. Now ask yourself, what disadvantages do computer-simulated continuous cellular automata have that discrete cellular automata do not?


There are many iterated maps that could be used to produce chaotic or complex behavior in a continuous cellular automaton. Try coming up with your own iterated map function.

Try increasing the spatial continuity of the model by increasing the number of neighbors each cell has on either side.

Try making your own number data structure that has a greater accuracy than the normal NetLogo math primitives permit.

Can you come up with a new coloring function to represent values using a wider array of colors, not just a gradient between green and black?


CA 1D Elementary- the elementary two-state 1D cellular automaton CA 1D Totalistic- a three-state totalistic 1D cellular automaton Turbulence (in the Chemistry & Physics section)- a 1D continuous cellular automaton which demonstrates turbulence


Pattern Dynamics in Spatiotemporal Chaos: Kunihiko Kaneko. 1989 Physics D 34 1-41 A New Kind of Science. Wolfram, S. 2002. Wolfram Media Inc. Champaign, IL.

Thanks to Eytan Bakshy for his work on this model.


If you mention this model in a publication, we ask that you include these citations for the model itself and for the NetLogo software:

  • Wilensky, U. (2003). NetLogo CA Continuous model. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
  • Wilensky, U. (1999). NetLogo. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.


Copyright 2003 Uri Wilensky.


This work is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License. To view a copy of this license, visit or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.

Commercial licenses are also available. To inquire about commercial licenses, please contact Uri Wilensky at

This model was created as part of the projects: PARTICIPATORY SIMULATIONS: NETWORK-BASED DESIGN FOR SYSTEMS LEARNING IN CLASSROOMS and/or INTEGRATED SIMULATION AND MODELING ENVIRONMENT. The project gratefully acknowledges the support of the National Science Foundation (REPP & ROLE programs) -- grant numbers REC #9814682 and REC-0126227.

Comments and Questions

Click to Run Model

  row             ;; current row we are now calculating
  done?           ;; flag used to allow you to press the go button multiple times

  value           ;; some real number between 0 and 1

;; Setup general working environment.  The other setup procedures call this.

to setup-general
  set row max-pycor   ;; Set the current row to be the top
  set done? false
  cp ct

;; Setup for a single point

to setup-single
  ;; Set only the middle patch to be 1 on the top row
  ask patches with [pycor = row]
    ifelse pxcor = 0
      [ set value 1 ]
      [ set value 0 ]

;; Setup for a random top row

to setup-random
  ;; Randomize the values of the top row
  ask patches with [pycor = row]
    set value random-float max-value

;; This is called when auto-continue? is enabled or go is clicked after a run.
;; Setup the patches to continue a particular model run.  This will copy the i
;; bottom row of patches to the top row.

to setup-continue
  let value-list []
  if not done?  ;; make sure go has already been called
    [ stop ]

  set value-list map [[value] of ?] sort patches with [pycor = row]  ;; copy cell states from bottom row to a list
  ask patches with [pycor = row]  ;; copy states from list to top row
    set value item (pxcor + max-pxcor) value-list
  set done? false

;; Run the model.

to go
  ;; Did we reach the bottom row?
  if row = min-pycor
    ;; If auto-continue? is enabled or we are clicking go again,
    ;; we continue from the top, otherwise we stop
    ifelse auto-continue? or done?
       set done? true
       display    ;; ensure all the patches get drawn before we clear
       set done? true

  ;; Go down a row
  set row (row - 1)

  ;; Calculate the values for the current row
  ask patches with [pycor = row]

to calculate-value  ;; patch procedure
  ;; Retrieve the three patches that touch this patch one row above it
  let top-neighbors neighbors with [pycor = [pycor] of myself + 1]

  ;; Calculate the average of their values
  let mean-value mean [value] of top-neighbors

  ;; Perform a function to the average and set it as our value
  set value iterated-map mean-value

;; This is a simple function that takes in a number, adds a constant to it and
;; only reports the decimal portion rounded to a given number of decimal places.

to-report iterated-map [x]
  report precision (fractional-part (add-constant + x))

;; Scales the patch's color according to its value

to color-patch  ;; patch procedure
  set pcolor scale-color green value 0 2

;; Reports only the decimal part of the number

to-report fractional-part [x]
  report x - (int x)

; Copyright 2003 Uri Wilensky.
; See Info tab for full copyright and license.

There are 10 versions of this model.

Uploaded by When Description Download
Uri Wilensky about 11 years ago Updated to NetLogo 5.0.4 Download this version
Uri Wilensky over 11 years ago Updated version tag Download this version
Uri Wilensky over 11 years ago Updated to version from NetLogo 5.0.3 distribution Download this version
Uri Wilensky over 12 years ago Updated to NetLogo 5.0 Download this version
Uri Wilensky about 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 14 years ago Updated from NetLogo 4.1 Download this version
Uri Wilensky about 14 years ago Model from NetLogo distribution Download this version
Uri Wilensky about 14 years ago CA Continuous Download this version

Attached files

File Type Description Last updated
CA Continuous.png preview Preview for 'CA Continuous' over 11 years ago, by Uri Wilensky Download

This model does not have any ancestors.

This model does not have any descendants.