# TurSquiral

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

## WHAT IS IT?

We live in a world that seems in some sense mathematical – even if the way is still debated by mathematicians, physicists, philosophers and other scholars. In this project I’d like compare the logic of (turtle’s) geometry to that of cellular automata: both could recreate the same figure (eg a squared spiral) but in very different ways. The first one implies a program’s inner representation of spiral, in the second the same pattern can be the emergent output of the rules with which an agent and its environment interact, ie with the cells of a grid that itself contributes to change. In an article published in Nature (544, 173-179) the suggested hypothesis is that cellular automata are not only an abstract computational system but can be actual biological dynamics supported by evolution, at the base of some morphogenetic processes.

## HOW IT WORKS

The model is conceptually divided in two parts, both inspired by two articles appeared on the "Computer Recreations" column in Scientific American. The first one introduce the turtle geometry implemented in Logo computer language; the article suggest how to code a computer program to generate spirals . The second describe what is a turmite i.e. a Turing machine which has an orientation as well as a current state and a "tape" that consists of an infinite two-dimensional grid of cells.

## HOW TO USE IT

(how to use the model, including a description of each of the items in the Interface tab)

## THINGS TO NOTICE

(suggested things for the user to notice while running the model)

## THINGS TO TRY

(suggested things for the user to try to do (move sliders, switches, etc.) with the model)

## EXTENDING THE MODEL

(suggested things to add or change in the Code tab to make the model more complicated, detailed, accurate, etc.)

## NETLOGO FEATURES

(interesting or unusual features of NetLogo that the model uses, particularly in the Code tab; or where workarounds were needed for missing features)

## RELATED MODELS

(models in the NetLogo Models Library and elsewhere which are of related interest)

## CREDITS AND REFERENCES

• Brian Hayes. Computer Recreations: Turning turtle gives one a view of geometry from the inside out. Scientific American, February 1 – 1984

• Alexander K. Dewdney. Computer Recreations: Two-dimensional Turing machines and tur-mites make tracks on a plane. Scientific American, September 1 – 1989

• Uri Wilensky. Mouse example. NetLogo Modeling Commons

## Comments and Questions

globals [ side step ] turtles-own [state] to setup clear-all crt 1[ set heading -90 set state 1 ] reset-ticks end to patch-draw if mouse-down? ;; reports true or false to indicate whether mouse button is down [ ;; mouse-xcor and mouse-ycor report the position of the mouse -- ;; note that they report the precise position of the mouse, ;; so you might get a decimal number like 12.3, but "patch" ;; automatically rounds to the nearest patch ask patch mouse-xcor mouse-ycor [ set pcolor red display ] ] end to go_squiral set step 0 ask turtles [ walk ] ask turtles [ rt angle ] set side side + increase tick-advance 1 end to turmite1 ask turtles [ behaviour1 ] tick-advance 1 end to turmite2 ask turtles [ behaviour2 ] tick-advance 1 end to turmite3 ask turtles [ behaviour3 ] tick-advance 1 end to walk set pcolor blue set step step + 1 fd 1 if step <= side [walk] end to behaviour1 if pcolor != black [set pcolor black lt 90 fd 1] if pcolor = black [set pcolor green rt 90 fd 1] end to behaviour2 if pcolor != black and state = 1 [set pcolor black lt 90 set state 2 fd 1] if pcolor != black and state = 2 [set pcolor green rt 90 set state 2 fd 1] if pcolor = black and state = 1 [set pcolor green lt 90 set state 1 fd 1] if pcolor = black and state = 2 [set pcolor black rt 90 set state 1 fd 1] end to behaviour3 if pcolor = black [set pcolor red rt 90 fd 1] if pcolor = red [set pcolor yellow rt 90 fd 1] if pcolor = yellow [set pcolor cyan lt 90 fd 1] if pcolor = cyan [set pcolor black lt 90 fd 1] end

There are 3 versions of this model.

## Attached files

File | Type | Description | Last updated | |
---|---|---|---|---|

TurSquiral.png | preview | Preview for 'TurSquiral' | 7 months ago, by Cosimo Leuci | Download |

This model does not have any ancestors.

This model does not have any descendants.