News:

Precision Simulator update 10.178 (27 September 2024) is now available.
Navburo update 13 (23 November 2022) is now available.
NG FMC and More is released.

Main Menu

Myrmecology with Latitude!

Started by martin, Sat, 12 Sep 2015 18:33

martin

Greetings!

¤ Ever wanted to see Emergence in action?
  (No, it's not a ship from the Star Wars fleets.)
¤ Seriously worried about if the Cohen-Kong theorem really applies to Langton's Ant?
¤ Missing the kaleidoscope you had so much fun with as a kid?
¤ Wondering why extended ants would be running around on Truchet tiles?
¤ Always have longed to observe Turmites in the wild?

Here's your chance!

LATITUDE -- Langton's Ant&Turmite Interactive Toy & User-Delighting Emergence

To keep my Licence To Kill (Java) current, I implemented Langton's Ant (and its extension, the Turmite), a little critter which among other things cutely demonstrates "emergent behaviour" of systems, i.e. the development of very complex (and possibly chaotic) behaviour or patterns, based on very simple and completely deterministic rules. (In that sense it's perhaps my little contribution to the refutation of "Intelligent Design"? :o)

It's also quite a lot of fun*. Nothing as relaxing as watching colourful pixels come and go**, forming pretty patterns (or not)...

I'm certain there are many and mostly better implementations of Langton's Ant available on the Net, but this one is mine. (And it's perhaps a bit more interactive than some others.)
Read more about it here (includes download link).
You will need a Java Runtime Environment, but being on the PSX forum, you very probably have that already.
If not, get it here (the JRE will do; no need to download the full JDK = Java Development Kit).

Then you can just fool around with the sim, or you can even read the documentation (recommended, for else you might miss the best parts)...

Have fun!

Cheers,
Martin

* At least for the types who also like to watch their washing machine. Provided it has one of those bullseyes, that is.
(If you like watching your washing machine when it (like mine) does not have such a bullseye, you may have reason to worry.)

** Up here, colouring books for adults seem to be the latest craze.
LATITUDE is even better: it saves you messing about with crayons!

Hardy Heinlin

Moi!

Interesting program. Nice for the cruise part :-)


Thanks :-)

|-|ardy

brian747

An entertaining toy indeed, Martin - thank you!    :)

A great suggestion from Hardy, too. Maybe you could approach Boeing with a view to being able to display it on one of the EICAS screens during the cruise???

No?  Ah well, I suppose not. The crew will just have to resort to running it on their EFB laptops, then.    ;)

Cheers and thanks,

Brian




(Author of "The Big Tutorial" for PS1, and "Getting started with PSX" Parts 1, 2, and 3).

torrence

Thanks for the program, Martin

Most fun I've had with a math toy since James Gleick's old Chaos program - that was a pure DOS program and, along with PS1, one the main reasons I struggled as long as I could to keep my system DOS-compatible (Gleick actually answered one of my emails on the topic, apologizing that the market was too small to make a commercial Windows version (sound familiar, Hardy  :) ) ).

A couple of questions:

Re:  "More on TURMITES" link:  I was able to reproduce a couple of these examples, but not most.  Probably due to my inability to translate their Rules nomenclature to LATITUDE Model states/colors, rules etc.  Any hints?

Re: Request (you did expect update requests posting on this forum, didn't you ? :) ):  I experimented some with the simple rules that produce 'highways', using the Inspector to place dots or lines of dots in the way of the highways.  Sometimes the ant just dithered around a bit in a little cloud and then plowed right through, sometimes it produced a cloud 'node' and then projected the highway off at different angle, and sometimes it seemed (at least as long as I ran it) that it blocked the highway building, just generating a ever expanding cloud.  It reminded me a bit of the multi-attractor games in Chaos where you could change the patterns completely by putting in one or two new attractors.  Question - can you make it easier to place lines, simple shapes, etc. in the Habitat, instead of changing cell states one by one with clicks?  I know - maybe version 16.1.12 or something ...

Cheers,
Torrence
Cheers
Torrence

martin

Thanks, Hardy and Brian!

Quote from: BrianThe crew will just have to resort to running it on their EFB laptops, then.
But don't try it on flights to the US of A or to Oz: Home Security (or whoever) will insist on spraying the EFB (and possibly the crew) with pesticides and disinfectants....

Cheers,
Martin

martin

["brace brace brace"]
Emergence EXIT

Hello Torrence,

thanks for the feedback!
(you decide if that includes requests or not :-)).

Re #1: Replication of the dreaded Wolfram Turmite

During the tests, I had only tried (successfully) to reproduce the examples as seen in the "aldoaldoz" video, but have so far not looked into the Turmites as presented on the Wolfram webpage.

As so often, it's all about semantics (or, more appropriately here, about taxonomy):

Firstly, an Ant (at least in LATITUDE) is very stupid simple: It only has a turning rule, one for each colour it encounters when entering a cell of the field.
The classical Langton Ant thus has 2 rules, e.g. "LR": when hitting white, turn left; when hitting black, turn right. And change the colour of the cell just entered. But the latter is trivial as (in this case) there are only two colours (cell states), so they will just be flipped back and forth, no extra rule required.

Now, for me, so far, a Turmite was essentially the same as an Ant, with the one difference that it may encounter cells with more than two possible colours (states); say 4. The Turmite is still stupid simple, but it requires a longer rule set, with one rule for each cell colour (state) it may encounter; in this case e.g. "RLRR".
Note that I am mentioning cell states, not Turmite states -- the Turmite itself, just as its cousin the Ant, does not have a state!

We are thus setting up the system with only two essential parameters (ignoring the number of ants, field size, etc.): the number of states (colours) for a cell, and the turning rules for the Ants/Turmites.

On closer inspection of the Wolfram webpage, I now realize (had missed it before) that they are actually using a different model:
Their cells have a state (colour), just as ours; their Turmites have turning rules (also just as ours), but their Turmites also have an internal state, as a third parameter.

So when their Turmite hits a cell, not only does it turn (as per rule) and change the cell state (colour) as per colour sequence, but it also changes its own internal state. And that is something not available in the LATITUDE model (simulating Turmitus torrentialis which can react to more than just two cell colours but otherwise is the same as the classic Myrmica langtonii -- whereas Turmitus wolframicus has an internal state in addition (speciation by mutation, no doubt).

If, for T.wolframicus, the cell state change and the internal state change flip "in sync" as it were, the result is the same as with T. torrentialis: That is the "second turmite" they refer to, which "shows a 2-state 2-color rule* that is essentially equivalent to Langton's ant. In this rule, if the state is 1 and the underlying cell is gray, the cell is changed to white, the state is changed to 2, and the turmite turns left."

But for the following Wolfram examples, the cell colour changes and the changes of the internal Turmite state are independent, and that is something which you cannot replicate in LATITUDE, I'm afraid.

To include that feature would require a re-write of the logical simulation model, and I am not quite sure if it would be a good idea. I find as it is now, with just two major parameters, the possibilities of what may happen are already so many that it is quite hard to stay away from feeling exposed to total chaos... :-)

[BTW, another difference is that in LATITUDE, the ant can change colours only in the fixed sequence given by the "palette", whereas in the Wolfram Turmites it can be given an arbitrary transition matrix, i.e. the user can control what "trigger" colour will result in what "target" colour.]

Re #2: Let the user draw lines and shapes on the field, to make the ant's life more difficult.

There is a (boring) practical and a (perhaps) conceptual and thus (perhaps) more interesting restraint on what can (or should) be done in this respect.

Practical: 
The whole GUI of the thing is coming from MASON (thank heaven for not having to do that myself!). And it is all based (like the simulation logic) on a simple (and therefore fast to process!) square grid with four movement options (NEWS) for the ants (Minkowksi geometry, was it? It's been a while...**)

To allow you to "draw" lines etc. on this two-dimensional array of cells is of course logically possible; the snag is that it requires messing about with the GUI (a lot, e.g. we will need yet another mouse-click input mode). But I'd rather not touch the GUI...

No blame attaches to MASON: It's all Open Source, I can even access the Repository directly, and the main author (Sean Luke, from the George Mason University) is always willing to help out. So it's really just me. To see what I mean, download the Manual/API (6.3 MB, 354 pages) and have a look (or a peek online here)...

And here is my...
Conceptual Excuse:

The intriguing point of the whole exercise (at least for me) is the demonstration of "emergence": You have a rather stupid simple ant, which does its rather stupid simple thing, creating first a rather stupid mess of dots, and then all of a sudden, without any interference by you, it starts producing a structure (the "highway"). And if you give it other rules and perhaps more than one cell state to encounter, it does all sorts of other interesting things (see the "aldoaldoz" video), while still being the same stupid simple ant.

But now, you want to introduce an "environment", in the form of lines and shapes. That is of course a perfectly valid extension of the experiment.
However, I do  wonder if it does not in a way water down the "spirit of the thing"?

Yes, the ant as such is still stupid simple. But there is now a difference: In the original experiment, there is only the ant. And everything that happens (in terms of emerging structures) springs, nay can only spring, from the ant properties.

If you now start to introduce shapes (in fact it's already true for simple dots) for the ant to run against, and then end up with the most surprisingly intricate carpet pattern after two million steps, you can no longer be sure that it is really the ant alone which has "created" this structure.

For the sake of rhetoric and provocation, we might even assert that you have just (re-)introduced the Intelligent Designer (you) through the backdoor: "Yes that pattern is very complex and intricate, and thus it proves that there must be an External (to the ant) Intelligence behind it (which deliberately places shapes on the field so that a beautiful pattern results) -- the ant then just dumbly executes the instructions given it by said Designer..."
And you'll be no longer in a position to refute this argument and to claim "It's an emergence and nothing but an emergence!" .
Methinks.

Seen from another angle: The ant has an Event Horizon, as it were, of exactly four cells (NEWS, Minkowski, remember? :-)) and one time step.
So the ant cannot perceive more than one dot (cell) ahead anyway. A "line" or "shape" (made of multiple dots behind the horizon) is something the ant with its limited Weltbild cannot comprehend at all. It "makes sense" only for us the external (and larger) observers.

Thus, again we find something external introduced which will serve no purpose for the ant but will dilute the demonstration of emergence...

Or ? :-)

Finally, here's my offer of at least some comfort (for the lack of lines and shapes):

I am currently working on LATITUDE v.2: If it succeeds, you still won't get drawable lines or shapes, but two other features which will also vastly extend your options to play around, but without compromising the ant's genuine stupid simple character (note a colour, apply respective rule, period).

Stay tuned, as they say...

Entomologically,
Martin
("Code A Little, Talk A Lot".)

* I had some initial problem to understand their notation: They do not explicitly explain which colour in the diagram is the initial "triggering colour" (of the cell when the Turmite has just hit it), and which the later "target colour" to which the Turmite changes it.
Now I think that the small squares at the top edge depict the trigger, and the colour of the matrix squares depict the resulting colour after the change has been made; this would be the equivalent to the notation for the internal states changes (the numbers).

** Google is a spoilsport -- one cannot really drop erudite remarks any more unpunished...
It's not (of course) the Minkowski geometry, it's the Manhattan distance (a.k.a. Taxicab distance as I now learn) I was thinking of...
Still, that was "considered" (invented?) by Minkowski. Ha!

torrence

Martin,

Thanks for the discussion.  Re Rules - I figured somehow there weren't enough mode parameters to reproduce some of those cases, just couldn't figure out which ones.

Re: Interfering with emergence of ants:  Wow Dude! what a guilt trip.  Here I was, just poking around with the program, and now I find I was actually an Intelligent Designer (or ID - some psychological connection here?) messing up the emergence of free will in the entire TURMITE universe.  And I was actually feeling proud of 'my' ants for persevering in building their highways in spite of the obstacles I put in their way.  Bad ID!!  I'm going to slink off to Pandemonium and have a few beers and a good sulk with Lucifer.  :)

Cheers,
Torrence
Cheers
Torrence

martin

Hello Torrence,

Quote from: TorrenceBad ID!!  I'm going to slink off to Pandemonium and have a few beers and a good sulk with Lucifer.  :)
Wrong address!!

That personage is not what the Intelligent Design movement is trying to covertly hint at!
To restore your bruised self-esteem (sorry -- but Ants can be a pest...),  go here.
Or perhaps better here...
:-)

Cheers,
Martin

torrence

Actually,  right address for a good time.  Lu and I are off to a pan-galactic Solipsism tournament (EVERYONE WINS!   Those other losers think they're winners  ----  but it's all in their heads, not mine). 
Cheers,
Torrence
Cheers
Torrence