Categories
Computers and Software programming

Ants Version 1

I have been teaching myself Java programming lately{{1}}. 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…

[pp-shortcode id=”3424″]

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.

 

[[1]] I was inspired by (and took most of the code from) this YouTube video [[1]]

[[2]]Yes I am using a lot of quotes, because these are all just figments of the programs “imagination”[[2]]

Leave a Reply

Your email address will not be published. Required fields are marked *