Show HN: Create your own cellular automata
aperocky.com
aperocky.com
{
"0": [
"CountAdjacentChance eq 1 1 1 0.01",
"CountAdjacentChance ge 1 2 1 0.03"
],
"1": [
"SpontaneousChange 2 0.00001",
"ChangeByBlockAge gt 200 3 0.1",
"CountAdjacentChance eq 2 1 2 0.4",
"CountAdjacentChance eq 2 2 2 0.8",
"CountAdjacentChance ge 2 3 2 1.0"
],
"2": [
"SpontaneousChange 3 1"
],
"3": [
"SpontaneousChange 0 0.25"
],
"InitialCondition": "1 0.0005",
"colorMap": {
"0": "black",
"1": "green",
"2": "red",
"3": "brown"
},
"timeStep": 30
}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:
{
"0": [
"SpontaneousChange 1 0.15"
],
"1": [
"CountAdjacent gt 1 5 2",
"SpontaneousChange 3 0.00001",
"CountDirectlyAdjacent gt 3 0 3"
],
"2": [],
"3": [
"ChangeByBlockAge gt 1 4 1"
],
"4": [
"ChangeByBlockAge gt 2 1 1"
],
"colorMap": {
"0": "tintblack",
"1": "cyan",
"2": "gray",
"3": "yellow",
"4": "cyan"
},
"timeStep": 100
}The famous conway game of life can be expressed as:
``` { "InitialCondition": "1 0.2", "0": [ "CountAdjacent eq 1 3 1" ], "1": [ "CountAdjacent lt 1 2 0", "CountAdjacent gt 1 3 0" ] } ```
Entirely browser based.
Some more information
https://www.reddit.com/r/alife/comments/giyjaa/show_ralife_g...
https://www.reddit.com/r/alife/comments/ger9r4/show_ralife_s...
What does the color represent? Does the creature stack?
Though this one is more about society simulation then evolution, it does come with a command line for control.
(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.)
[0] https://github.com/bradrn/cabasa
[1] http://www.jstor.org/stable/2874179 and http://www.sciencedirect.com/science/article/pii/01672789909...
[2] https://www.reddit.com/r/haskell/comments/a2vnni/a_better_co...
For anyone not familiar with tierra, peek into the rabbit hole :-)
https://web.stanford.edu/class/sts129/Alife/html/Tierra.htm
http://life.ou.edu/pubs/doc/index.html
https://ai2020.org/tom-rays-tierra
So... Genesys I linked is more than just basic CA, it consists of independent agents with each "creature" using a lisp-like instruction set.
I just have too much more work to do and other more pleasant blockers like children :-)
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: http://web.cs.ucla.edu/~dyer/Papers/AlifeTracker/Alife91Jeff... (this is the HTML of the paper the thing I linked above is based on.) This may cause google-collisions.
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?
Warning, I wouldn't say they're great, but if you're having trouble sleeping... :)
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!)
About firefox not working - strange! It should work on any device even with mobile browsers, thanks for notifying me.
edit: It looks there was some version conflict with my CI and it had uploaded old broken version - thanks for notification. Now it should work.
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.
Hammered out a fix and added the step button over lunch break, pretty easy change & fix (just 10 lines!). thanks for suggestion.
https://writings.stephenwolfram.com/2016/05/solomon-golomb-1...
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?)
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.
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.
If you are interested in the topic, you can see for example http://www.dierk-raabe.com/reprints/cellular-automata/
I don't know that they'll ever be useful for efficient computation, but they will likely always remain fun.
https://www.youtube.com/watch?v=xP5-iIeKXE8
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've never tried this but what does coding in excel feels like? Does it feel like an ancient version of scratch?
Presumably many automata aren't like this and just generate uninteresting patterns, or always collapse into some determinate after enough time.
What do we know about this?
{
"0": [
"SpontaneousChange 1 0.1"
],
"1": [
"CountAdjacent gt 1 5 2"
],
"2": [],
"colorMap": {
"0": "tintblack",
"1": "cyan",
"2": "gray"
}
}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.
[1] https://www.cs.utexas.edu/users/EWD/transcriptions/EWD06xx/E...