This is a step by step demonstration of our keeper structure,
which we use to store our food (nearly) safely. Ants that have picked
up food are programmed to follow a trail that indicates the way home.
On the anthill, trails are created during the startup sequence that
point toward the opening in the keeper.
Here we see an ant approaching with food:
The seven ants that stand on the anthill on the upper left form the
keeper. They surround the food drop point, which is green, because some
food has already been delivered there.
Just next to the anthill, on the upper and upper left sides, one can see two more ants that just have delivered food and are now surrounding the anthill in search for an already existing food trail to follow.
In the left half, one can see a few enemy ants shamelessly trespassing on our territory.
The blue ant with the dot is interesting. Even though displayed in blue, it is a black ant which is carrying food. It follows along a food and home trail, in the direction of the entrance of the keeper.
Here is the same situation magnified (left picture):
After a few more steps (middle picture), the delivering ant stands directly
in front of the food drop point, and after yet a bit more time (right
picture) it arrives at the drop point. This position is marked in a unique
way, using the same three bits that are otherwise used to encode the direction
home. While following a path home, an ant always reads the home marker, and
therefore discovers when it has arrived at the food point.
The ant in the upper left corner of the anthill, which is facing the blue ant, is constantly checking for arrivals. If a friendly ant enters the keeper, it starts to turn (left picture):
After the turn is complete (right picture), it waits a while, because it
knows precisely how long it takes for the other ant to discover that it
has arrived home and to drop its food.
When this happens (left picture), the upper left hand moves forward
(middle picture). This is the only critical moment in the whole procedure.
An enemy ant trying to enter through the opening might succeed, depending
on its id number, and block the structure completely should it decide
to stay there. The food collected thus far would still be safe -- because
the seven remaining ants, including the one sitting on the food, will wait
indefinitely for the structure to become unblocked again -- but we could
not collect any more food during the time. In the normal case though, the
following ant will immediately close the gap (right picture).
The ant that has just delivered food replaces the top left ant and turns
around to wait for the next delivery. The ant which has just left the
anthill turn as well and follows the boundary of the anthill in the hope
to find a food trail and to start the next tour.