Evolution Simulation Display
|
Overview A little art piece that simulates pixel creatures with neural network "brains". This was mainly a way to show off a software project I was working on to learn Rust: https://github.com/spstack/evolution-sim The basic idea is that each little pixel creature has a small neural network "brain" that allows it to take in input and perform an action in response at every step of the simulation. If a creature lives long enough to find food, it'll reproduce spreading it's brain structure to the next generation (with optional random mutations). The result is that, over time, the creatures should "learn" to be better at finding food and intelligent-ish behavior should emerge. It's pretty fun to watch the simulation progress and see what kinds of strategies the creatures start to adapt. The actual hardware here is just an LED matrix behind a blank white canvas. The canvas diffuses the LEDs really nicely, and I'm pretty happy with the way it looks! The idea came from a post on the Adafruit website: https://learn.adafruit.com/use-an-art-canvas-to-diffuse-RGB-matrix It's being driven by a raspberry pi running a custom version of Linux built using Yocto. Definitely wasn't necessary, but I wanted an excuse to learn a bit about Yocto as well :)
Software Here's a link to Github project for the main simulation code. This project was really just a way for me to learn Rust, so it took a while to write it. The README in that repo has more information about the sim! I also made an attempt to learn a bit about Yocto to create a more lightweight linux to run on the Raspberry Pi. Yocto is a kind of build environment used to create custom embedded Linux distributions. It basically allows you to create images that contain all your code and dependencies already installed. Here's a link to the Yocto repo for this project. It really just takes the baseline Poky distribution, adds support for the Raspberry Pi, and implements one recipe for getting the evolution simulation Rust code and installing it. It also sets up a startup script to ensure the program runs automatically upon boot. Hardware The hardware for this project is really pretty simple since I didn't design anything and pretty much just bought everything off the shelf. It uses a Raspberry Pi 3A with a special "bonnet" for interfacing with a HUB75 type LED matrix. Here are the parts:
|