I have been teaching myself Java programming lately1. I have some long term projects I would like to explore, but I have come up with a little program where “ants” learn to find “honey” while avoiding a strip of “flypaper”2. It usually takes around 100 generations to get to the honey, but once they find it, many more find it.
Every time you refresh your browser, the generation count restarts. read more below the player…
From a more technical side,the ants learn from the previous generation, The algorithm rewards ants that find the honey, but also gives more value to the ants that find the honey the fastest. There is also a lifespan algorithm, so ants that get stuck on the flypaper, or hit a wall have less influence on the next generation.
I am may come back and make some changes, but for now, I find watching these random creatures kind of mesmerizing.