Artificial Ant
An ant is a simple creature with complex interaction. On itself it just tries to survive but in a colony, complex patterns emerge. This is why ants are interesting to simulate.
When they have nothing else to do, our artificial ants go out searching for food. With a somewhat random movements they use their antennae to detect food in their environment. As the range of this detections is quite low, it usually takes quite some time before they find food. That is also why it is useful to have a colony consisting of many, many ants: it increases the chance that some ant will find food.
When an ant does find food, it will let the rest of the colony know that it has found food. This is done using pheromones: it will a scent trail made of pheromones on the ground while returning to the nest. Other ants can detect these pheromones with their antennae and use that to direct them to the food source.
After more ants have found the food source, they will also leave behind pheromones while returning to the nest, increasing the strength of the trail. This will lead to a strong trail of ants for which the ants are famous for.
When the food source is exhausted, the ants will no longer find food and do not emit the pheromones. The pheromone trail will loose it strength over time, evaporate and disappear so it won't be followed anymore.
But how do the ants find the way back home? Using the same technique as for finding food: using another pheromone trail (just like Hansel and Gretel do with pebbles). When they leave their nest looking for food, they leave a pheromone trail behind, leading to the nest. When an ant has found food, it will start looking for these pheromones which will lead them back to their nest.