r/Slimemolds • u/LeabhairUathuil • 3h ago
r/Slimemolds • u/KarstenSiemer • 14h ago
Educational Physaum slime mold simulator
galleryHi all!
Some years back I have found a repo by Michael Fogleman, where he showcased a physarum simulation and I was mesmerized and wanted to create my own for the browser but never found the time.
Thanks to claude, the time required to do it and the negging effort on starting was reduced enough that I decided to give it a swing.
It pretty much one shotted something comparable to Folgemans and I played around with my little slimey friends.
I then read up on some papers on mold behavior and noticed, there a lot of situations where the classic physarum algorithm by Jones paper from 2010 is not accurate at all.
It missing a lot of behavioral patterns, like this model is not producing slime nor trying to avoid it.
Physarum mold doesnt have a brain, yet it can make decisions. It is doing a lot of that using slime it is leaving behind.
Or, a famous experiment used physarum to map the tokio rail roads efficiently. Do do that, the simulated mold actually needs to pump plasma in its tubes. Where plasma flows stronger (between food), we need to increase growth and where it flows weaker, we need to kill of agents to have these arms fade away.
I used the tests recorded in the scientific papers as a test to develop the simulated physarum model. When my model produces the same result as the paper, it is closer to the real mold then the base line Jones model from 2010.
So I tested and tested. Day and night for almost 3 to 4 weeks until I was able to get to the solution presented in the repo. It was quite stressful even, somehow. Even though claude did most of the actual work, but guiding it was quite tough over the long run.
The hardest part was getting the outer cell barrier somewhat correctly. I couldnt find a paper that has a model of the whole physarum, only part and these models never really fit together nicely.
Anyways, you can play around with slime mold.
Feed it, cut it, place it, let two strains fight each other, place electrodes and even recreate the tokio experiment and watch the slime mold building up the rail roads more and more efficiently with time.
And you can turn off certain things of the model and see how it will react differently now.
Have fun!
Feel free to give it a go: https://github.com/KarstenSiemer/physarum-slime-mold
Its also deployed to github pages: https://karstensiemer.github.io/physarum-slime-mold