This is amazing, I think this is why cellular automata are so interesting - there are so many possibility (and conway's game of life is just a beginning!). Feel free to pull request into ./sample/, alternatively I can add this in a commit later.
The one I found the most fun is actually semi-dynamic in maze runner, there's a small trick in that you can reuse color for colormap:
I find it interesting that so many people have made their own CA simulator — I’ve made one as well! [0] Mine uses a very different design to yours: it’s distributed as a library allowing people to define their own CAs, which they can then compile and run in a GUI. Compared to yours and OP’s, this is admittedly a bit hard to use, and you do need to know Haskell to use it. Additionally, I’ve only just rewritten it to use this approach, so some of the documentation and samples are out of date. (Also, it crashes a lot, I don’t know why.) Still, I have successfully used it ‘in anger’ at least once, to simulate the Beleusov-Zhabotinsky reaction for a chemistry assignment [1], so it at least seems to work.
(The categorically inclined may also be interested to know that this uses a variant of comonads [2] to define CAs, an approach I’ve found to be surprisingly flexible.)
Oh man, I spent a lot of time in high school playing around with Tierra. It is a lot of fun. A while back I started to reimplement it in rust, just to learn it, but never got very far. About a year ago, give or take, I did do a reimplementation of another alife/GA style problem, https://gitlab.com/eythian/tracker - this evolves DFSAs to follow lines. I have some more ideas that I want to test out with it actually, it's time I got back into it.
My main idea behind creating the Genesys project was to create a network of worlds - I have full intentions to make the worlds connected in the future via internet and have functionalities to share worlds, creatures etc..
I just have too much more work to do and other more pleasant blockers like children :-)
In my case I'm doing it because I really enjoy thinking about representations of solutions that make evolutionary operators more effective - it was the topic of my masters thesis. This is more "pure" GA than alife though, mostly because alife was a bit too open-ended to structure a hypothesis around for a thesis, at least as far as I could figure out, so I had to compromise.
Multi-world with migration between them was my PgDipSci thesis :)
But I also really like the results that come out of alife in the broader sense, synthetic evolution, world/environment-building, and so on. It's quite a rich interesting field that's pretty easy to dabble in with some good ideas and some programming ability.
> As an aside, be aware that "genesys" is already taken in the field
Thanks for notification, I was already aware that it was used as a brand for anoher kind of service and was pondering if I should change it but this resolved that question :-) So many thanks for that.
I would be interested in reading your thesis, is it available somewhere?
> So... Genesys I linked is more than just basic CA, it consists of independent agents with each "creature" using a lisp-like instruction set.
Sure, I do understand that Genesys is an agent-based simulation rather than being ‘just’ a CA. Still, at heart it seems to be a CA with adjustable rules, and as such there is a similarly to my own program.
(I’ve never heard of Tierra before, but it looks interesting; I shall have to look into it!)
Unfortunately it still doesn't work on Firefox (v86.0.1), it's just black inside the grey border. I tried it in a different browser and there it works fine. The lack of a tutorial is not as frustrating now that I can see what's happening.
That's very strange as it works on my older firefox (78.8.0 / Linux). Sorry I don't have access to v86.0.1 so I can't check why it doesn't work on that.
Nice. It's fun the be able to play with the initial "forest fire" model and try to model different conditions -- a wet forest which takes more adjacent sparks to create a fire, a fire that stays burning longer, etc.
A couple small suggestions from someone who makes a lot of these kinds of models: A "Step" button would be really nice, to be able to advance the model a single step at a time; it would be helpful for "Start" to change to "Reset" or "Restart" after the initial press, so you're not surprised when it blows away your model; "Continue" could be disabled until you Stop, as it doesn't do anything.
Can anyone share some insight into why cellular automata are a big deal? I've built the original Game of Life and some variations (in 3D, 4D and on a hexagonal grid) during last year's Advent of Code but I still don't get the usefulness or where they fit in the larger picture of computer science.
Cellular automata models are widely used in different science and engineering disciplines. For example, I use them for the simulation of heat treatments of steel.
I guess that the fascination of the CS community comes from: 1) Conway; 2) They raise different interesting programming questions and exercises (writing GOL is a nice exercise to learn a new language, a parallel CA is a nice way to learn about parallelization, huge models pose interesting memory management questions,...); and 3) They are cool (isn't the video about GOL in APL by John Scholes one of the coolest programming videos you've ever seen?)
What do you mean by what kind? I work at a university and we use all kind of models. From very simple models to teach students or make some quick estimation to very large codebases in projects in collaboration with steel companies.
Using CA models is quite common in the field of metallurgy. A periodic grid is well suited to describe the polycrystalline microstructures we work with, and grain nucleation and growth laws fit well with the CA concept of rules.
I guess there could be a lot of attributes the compose "kind" here. In the Game of Life cells are either on or off (binary) and the rules are pretty simple. I'd guess that for a CA to do the kind of simulation you're talking about each cell would have a floating point value? (continuous values) Any idea what the next-state rules look like? Then there's the neighborhood of a CA. GoL uses a Moore neighborhood (9 surrounding cells) - what kind of neighborhood does your simulation CA use? Is it strictly the surrounding cells or does the neighborhood extend further out? And if it does extend further out do the cells further away have less impact than the ones immediately adjacent?
In the simplest models, a cell can be identified by only an integer, indicating either the phase in phase transformation problems or grain id for grain growth or recrystallization. But, in the more complex models, a cell can include all kind of properties (chemical composition, crystallographic orientation, dislocation density...).
The number of neighbors we use also varies. Sometimes, even inside the same CA model, we use a different number of neighbors to calculate the evolution of different properties. Some problems are more related with the boundary between cells, and there we have to use first order, but other properties depend on the bulk and we use second order neighbors too (of course, weighted accordingly). Electron microscopy results are commonly obtained in hexagonal grids, so hexagonal grids are often used in 2D simulations.
I've struggled with this question as well, although Wolfram's tribute to Solomon Golomb (recently reposted here) helped me start to see why they're interesting.
They are a novelty that is often surprising in the how their simple set of rules can lead to quite amazing emergent complexity. That the one-time chaotic game of life was eventually shown to be able to stably infinitely expand and be turing complete is quite interesting.
I don't know that they'll ever be useful for efficient computation, but they will likely always remain fun.
I have not read it myself, but I know that Stephen Wolfram ( of Mathematica/Wolfram Alpha) laid out some arguments for the usefulness of studying cellular automata in his early 2000s book "A New Kind of Science".
I'd say it's not a very useful model on it's own, but it's a great teaching tool that illustrates emergence [1] well. It's easy to get started and it gets you into a mindset that you can then bring along to other models that you might do something slightly more useful with.
I'm sure there's a better reason, but I honestly think a major factor for why people think this stuff is important is because Conway called it 'the game of life', and it was a pretty early discovery in computer science. It was basically a recipe for sci-fi imagination and headlines, leading some people to believe this is literally a program about generating cellular life.
They're useful for making pretty patterns; digital lava lamp equivalents. Others mentioned other good reasons; so I'll throw that one in for completeness.
When I was in college I had a job working for a physics professor who was studying cellular computation. The hope was that by studying examples in nature of cellular systems that solved particular problems (e.g. a leaf trying to maximize sunlight absorption while minimizing water loss) we would be able to solve similar problems in the artificial realm. Using his equations I created a cellular automata simulation in Excel with VBA, my first real programming outside of CS classes. Good times.
I’ve never tried scratch but I can see the similarity to writing cell functions. VBA is a different beast entirely, it’s more like using a dumbed-down version of JavaScript to manipulate a simpler version of the DOM.
Question: what proportion of cellular automata generate "interesting" patterns in the way Conway's Game of Life does? For instance, in the GOL, you can create gliders, which keep their pattern over time, and even build logic gates. Perhaps you could even have "life forms" in some sense?
Presumably many automata aren't like this and just generate uninteresting patterns, or always collapse into some determinate after enough time.
I've got a CA that can run a maze. Can I generate a maze using your maze-generating code and then use that as the starting point for my maze-runner? It doesn't seem to be possible - when I enter my maze running code and start the whole thing resets.
yeah sadly once it goes it doesn't accept changes to the paradigm (for now). I think it's a good feature to add though (hot start!), thanks for the suggestion.
EDIT: I just changed it to support hot loading (might have to reload). Need to pause first though, can hot load through either continue or step buttons.
Cellular Automata are so cool. I did a project for a distributed computing course on them and it was real fun throwing different rules in and seeing what emerged.
A couple years ago I threw together some MATLAB functions to take a wolfram number and a seed row, along with some cosmetic parameters, to generate elementary cellular automata. Nothing very big or elaborate, but fun and handy for exploring the ECAs themselves.
More recently, he's been exploring the application of cellular-automata-like rules to more general graphs (ie. nodes and edges) rather than the classic grids of cells:
https://www.wolframphysics.org/technical-introduction/