NetLogo User Community Models
by Costantino Carugno (Submitted: 02/17/2018)
## WHAT IS IT?
This models is a **multi-color extension** of the basic virtual ant ("*vant*") model. It is inspired by the "*Generalized Ant Automaton*" described in the July 1994 Scientific American. It shows how extremely simple deterministic rule can result in very complex-seeming behavior. Everything that happens in this model is entirely time-reversible and deterministic (it can and will be proved), but it so complex that can become completely indistinguishable from chaotic behavior.
## HOW IT WORKS
The *ant* is a **cellular automaton** that follows a binary deterministic rule which governs its behavior. The world is a grid of patches, each with a *state* variable (color).
- **Check** *state* of current patch: the ant finds out how many times has visited the cell
- **Turn**: left (*L*) or right (*R*) according to the current *state* of the patch
- **Update** *state*: change the color of the patch and increments the state
- **Move**: forward of 1 patch unit
The Rule is given as an Input string in the interface that has to be a series of capital '*R*' and '*L*', and the 0-state is the last character (least significant convention). As the ant moves, it increments the state of the patches; when the end of the rule string is reached and no more states are available, the next state will be the 0-state, so that states are wrapped in a cyclic way. For example if the Rule is *LR* (the classical Langton's Ant) the ant will turn *right* if it has never visited the cell and *left* if it has been there once; if it goes over that cell the third time it would turn *right* again since the cell is now back to the original state. The Rule can be arbitrarily long (so the states can be so many) but the color palette is limited to 15, thus visualization won't be proper over this value.
## HOW TO USE IT
- The **Rule** string is needed, and it has to be a series of capital 'R' and 'L', other values will raise an error. The length of the Rule will determine how many states are available, thus also the possible colors.
- The **SETUP** button sets the ant looking in the x direction, all the patches have *state* variable 0.
- The **GO** button will start the computation, which goes on forever since the world is wrapped, but it can take many cycles to reach the edge. Can you find the shortest more localized rules?
- The **StopAtEdge?** switch can be used when we don't want to have our model to degenerate in chaos due to wrapping. When the ant reaches the end of the world, everything stops, and the tick counter provides a measure of how quick the ant explores the world.
- The **GO-REVERSE** does everything that GO does but in reverse: first the ant takes a step backwards, then it updates the state to a lower value and finally it turns left or right. It demonstrates the reversibilty of the model since it can be used to demolish all the work that the ant does right up to the beginning.
## THINGS TO NOTICE
Sometimes longer rules don't cause more complex behavior.
Notice that this model wouldn't work with an initial random "face" point, why?
How many single configurations are there with a rule of length n?
## THINGS TO TRY
WHOLE PLANE FILLING
## EXTENDING THE MODEL
- **Add more ants**: In his original work, Chris Langton made his ants interact collaborate and build ant colonies (explained here https://www.youtube.com/watch?v=w6XQQhCgq5c). How would multi-color ants behave together?
## NETLOGO FEATURES
## RELATED MODELS
* Vants -- Implementation of muliple Langton's Ant cellular automata.
* Turing Machine 2D -- similar to Vants, but much more general. This model can be configured to use Vants rules, or to use other rules.
## CREDITS AND REFERENCES
Credits to Chris Langton for the idea and to Uri Wilensky for the NetLogo implementation.
## HOW TO CITE
If you mention this model or the NetLogo software in a publication, we ask that you include the citations below.
For the model itself:
* Carugno, C. (2018). NetLogo MultiColorAnt model https://github.com/rugantio/MultiColorAnt
Please cite the NetLogo software as:
* Wilensky, U. (1999). NetLogo. http://ccl.northwestern.edu/netlogo/. Center for Connected Learning and Computer-Based Modeling, Northwestern University, Evanston, IL.
## COPYRIGHT AND LICENSE
Copyright 2018 Costantino Carugno
MultiColorAnt is licensed under the
Permissions of this strong copyleft license are conditioned on making available complete source code of licensed works and modifications, which include larger works using a licensed work, under the same license. Copyright and license notices must be preserved. Contributors provide an express grant of patent rights.
(back to the NetLogo User Community Models)