TurSquiral

TurSquiral preview image

1 collaborator

Cosimo.leuci Cosimo Leuci (Author)

Tags

cellular automata 

Tagged by Cosimo Leuci over 7 years ago

emergence 

Tagged by Cosimo Leuci over 7 years ago

morphogenesis 

Tagged by Cosimo Leuci over 7 years ago

turmite 

Tagged by Cosimo Leuci over 7 years ago

turtle geometry 

Tagged by Cosimo Leuci over 7 years ago

Part of project 'Starfish_Planet'
Visible to everyone | Changeable by the author
Model was written in NetLogo 6.1.1 • Viewed 992 times • Downloaded 147 times • Run 0 times
Download the 'TurSquiral' modelDownload this modelEmbed this model

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

Comments and Questions

Please start the discussion about this model! (You'll first need to log in.)

Click to Run Model

;;  ---------------------   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.

Uploaded by When Description Download
Cosimo Leuci about 5 years ago 0.6.1 Download this version
Cosimo Leuci about 5 years ago Rev. 0.5.1 Download this version
Cosimo Leuci about 5 years ago Rev. 0.5 Download this version
Cosimo Leuci about 6 years ago references updates Download this version
Cosimo Leuci over 7 years ago Info update: References Download this version
Cosimo Leuci over 7 years ago Info update: what is it? Download this version
Cosimo Leuci over 7 years ago Initial upload Download this version

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.