The Anagram application was developed in order to perform some tests on how well the
a certain architecture could support communications for a modestly large number of agents. The results
of this effort are described in a paper I wrote. A postscript version of which is
here and a pdf version (readable with Adobe Acrobat)
is here:
Section 5.2 of this paper explains how Anagram program works, so I am not going to repeat it here, except to say that I have simplified the operation of this application to make it more accessible to those not interested in agents per se.
The essence of the Anagram application is that a set of letters is randomly placed on the screen. These letters come from a "target phrase" plus possibly some "excess" letters (some of which are redundant to those in the target phrase). The goal of the letters is to organize themselves back into the target phrase. If the excess letters are present, the redundant letters must decide who will fill the target phrase. This is done by a bidding process among the letters.
Each letter is represented by an agent. These agents act to fulfill the organizing goal.
There are two ways to run "Anagram": with or without the excess letters and agents bidding on locations. Without the excess letters and bidding is the fastest running, but it precludes an important aspect of the process as is explained below.
When the program is started, Anagram places the letters contained in the top two text fields randomly on the display. You can use the default strings or type in your own. If you type in your own phrase, DO NOT have any embedded spaces in the string. This will cause a Java exception somewhere in the code. Use underscores for spaces.
Clicking on the "Initialize" button causes the letters to be strewn about the screen and an agent to be started for each letter. The letter agents "orient" themselves and when this is done, they turn red. What is happening during this orientation, among other things, is that the letters are all bidding for positions within the target pharse, initially "The_Office_of_Naval_Research". Such bidding is necessary because the excess letter set contains letters that duplicate those of the target phrase and, in an effort to be fair, the excess letters are given the opportunity for bid for the cherished positions within the target phrase.
Once the letters know that they have a position (if they get one) they then determine what agent is controlling the letter before them and request updates from that agent whenever its letter changes position.
After all the letters are red AND NOT BEFORE press the "Run" button.
When the "Run" button is pushed, the following happens. All the letter agents except the first subscribe for location information from the letter (agent) ahead of them in the target phrase. As each letter agent gets a position update from its predecessor, it begins moving toward aligning itself behind its predecessor. Of course, its predecessor is doing the same, all except for the first letter. The first letter knows the target location for the beginning of the target phrase and simply heads directly there. The net result of the process is a flocking behavior by the letters.
At any point in time you can click on the screen to select a new starting location for the phrase. When you do this, the first letter will begin moving toward the point clicked. This can be done repeatedly.