This is the last part of the Learning to Fly series in which we’re coding a simulation of evolution using neural network and genetic algorithm: Now

Learning to Fly: Let's simulate evolution in Rust! (pt 4)

submited by
Style Pass
2021-07-10 22:30:08

This is the last part of the Learning to Fly series in which we’re coding a simulation of evolution using neural network and genetic algorithm:

Now that we have implemented neural network and genetic algorithm, what awaits is the most delightful part: modelling the ecosystem and displaying them dancing triangles on our screens!

I’m obliged say that at this point we’re basically on a runner’s high, so if you considered the previous three parts even remotely interesting, then going through this one will feel like eating Nutella for the first time in your life.

We’ve got struct NeuralNetwork and struct GeneticAlgorithm — but what about struct Eye or struct World? After all, our birds have to have eyes and a place to live!

So that’s what we’ll be doing today; we’ll implement all those functions that’ll determine what a bird sees or how a bird moves. We’ll also — at last! — create a user interface that’ll allow us to see beyond dry numbers; it’s about time we engage that visual cortex of ours better!

As always, next to coding, we’ll also investigate what’s exactly happening underneath all the layers of abstractions we’re given — if you’re not into that, feel free to skip those yellow boxes.

Leave a Comment