TurSquiral
Do you have questions or comments about this model? Ask them here! (You'll first need to log in.)
TurSquiral
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 to compare the logic of (turtle’s) geometry to that of cellular automata: both could recreate the same figure (e.g. a squared spiral) but in very different ways. The first one implies a program’s inner representation of spiral, in the second one, the same pattern can be the emergent output of the rules with which an agent and its environment interact, i.e. the cells of a grid that itself contributes to change. Indeed, according to the hypothesis suggested by an article published in Nature magazine (544, 173-179) cellular automata are not only an abstract computational system but it could be actual biological dynamics supported by evolution, at the base of some morphogenetic processes.
HOW IT WORKS
The model is conceptually divided into two parts, both inspired by two different articles that appeared on the "Computer Recreations" column in Scientific American.
The (chronologically) first article introduces the turtle geometry implemented in Logo computer language; the article suggests how to code a computer program to generate squared spirals (squirals), giving some instruction to an agent called "turtle".
The second article describes 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 a (virtually) infinite two-dimensional grid of cells. In this project, a turtle will be able to represent a turmite, as well. As with Langton's ant, turmites perform the following operations each time step (tick): 1. observe the colour of the occupied patch (i.e. square) 2. as a consequence of the patch's colour, turn on the body (by some multiple of 90°) and change the colour of the patch, according to a set of given rules ; 3. move forward one patch.
HOW TO USE IT
After SETUP, you can try one of the four TURMITES' behaviour; one of them is able to output a squared spiral. It is possible to get a similar figure properly setting the SQUIRAL parameters
THINGS TO NOTICE
As with Turing machines, the actions are specified by a state transition table listing the current internal state of the turmite and the colour of the patch it is currently standing on. SQUIRAL's procedure does not interact with patches so it is blind toward its environment.
THINGS TO TRY
Varying Squirals parameters, you can get different graphical effects. Turmites creates the same patterns if they start from the same (empty) background: you can try and alter the initial grid by drawing same patches with the mouse, after DRAW button activation; as in morphogenesis, some procedures are more robust than others: you can see which procedures show a strong attractor (i.e. the emergence of a constant pattern), a weak attractor or no attractor.
EXTENDING THE MODEL
In order to discover new patterns formation, you could combine different procedures or modify some parameter of the transition tables, codified in the behaviour procedures.
NETLOGO FEATURES
MOUSE-DOWN? reports true or false to indicate whether the mouse button is down or up, allowing users to interact with the model's world.
RELATED MODELS
The model LIFE -- enclosed in the NetLogo Models Library -- is an example of a two-dimensional cellular automaton based on the transition table of the renowned Game of Life by John H. Conway. It has been shown that turmites and game of life are equivalent in power to Turing machines; indeed, they are universal calculator either can simulate each other.
CREDITS AND REFERENCES
- Brian Hayes. Computer Recreations: Turning turtle gives one a view of geometry from the inside out. Scientific American, February 1 – 1984 http://bit-player.org/wp-content/extras/bph-publications/SciAm-1984-02-Hayes-turtle.pdf
- Alexander K. Dewdney. Computer Recreations: Two-dimensional Turing machines and tur-mites make tracks on a plane. Scientific American, September 1 – 1989 (a brief description in Wikipedia https://en.wikipedia.org/wiki/Turmite)
- Ian Stewart. The Ultimate in Anty-Particles, Scientific American, July 1994 https://www.imsc.res.in/~sitabhra/teaching/cmp03/ian_stewart.html?fbclid=IwAR3JOskhlbZ1XZxtmr4Tguk7WSm_Enuanizfe1-XNHn-gWwE5H0edxvcoHc
- Uri Wilensky. Mouse example. NetLogo Modeling Commons http://modelingcommons.org/browse/one_model/2234#model_tabs_browse_info
- Uri Wilensky. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern Institute on Complex Systems, Northwestern University, Evanston, IL.
Comments and Questions
;; --------------------- TurSquiral ---------------------------------------------------------------- ;; ----------------------------------------------------------------------------------------------------- globals [ side step ] turtles-own [state] to setup clear-all ask patches [set pcolor white] crt 1[set heading -90] ;; starting with different heading angle, you could get different outputs reset-ticks end to patch-draw if mouse-down? ;; reports true or false to indicate whether mouse button is down [ ask patch mouse-xcor mouse-ycor [ set pcolor orange display ] ] end ;; Squirals ;; ----------------------------------------------------------------------------------------------------- to go_squiral set step 0 ask turtles [ walk ] ask turtles [ rt angle ] set side side + increase tick-advance 1 end to walk set pcolor sky set step step + 1 fd 1 if step <= side [walk] end ;; Turmites ;; ----------------------------------------------------------------------------------------------------- to behaviour1 ;; the Langton's ant if pcolor != white [set pcolor white lt 90 fd 1] if pcolor = white [set pcolor sky rt 90 fd 1] end to behaviour2 if pcolor = white and state = 0 [set pcolor sky lt 90 set state 0 fd 1] if pcolor = white and state = 1 [set pcolor white rt 90 set state 0 fd 1] if pcolor != white and state = 0 [set pcolor white lt 90 set state 1 fd 1] if pcolor != white and state = 1 [set pcolor sky rt 90 set state 1 fd 1] end to behaviour3 if pcolor = white [set pcolor magenta rt 90 fd 1] if pcolor = magenta [set pcolor sky rt 90 fd 1] if pcolor = sky [set pcolor orange lt 90 fd 1] if pcolor = orange [set pcolor white lt 90 fd 1] end to behaviour4 if pcolor = white and state = 0 [set pcolor sky rt 90 set state 0 fd 1] if pcolor = white and state = 1 [set pcolor white rt 0 set state 0 fd 1] if pcolor != white and state = 0 [set pcolor sky rt 90 set state 1 fd 1] if pcolor != white and state = 1 [set pcolor white rt 0 set state 1 fd 1] end
There are 7 versions of this model.
Attached files
File | Type | Description | Last updated | |
---|---|---|---|---|
TurSquiral.png | preview | Preview for 'TurSquiral' | almost 7 years ago, by Cosimo Leuci | Download |
This model does not have any ancestors.
This model does not have any descendants.