Rules in non uniform tiling.
Posted: March 13th, 2019, 7:21 pm
For CA we don't need too much - just a good adjacency graph. We can have several adjacency neighbors and collect different neighbors types into hash table as part of the rule. As long as we have finite amount of adjacent vertices we can run CA on it.
To show case the idea I've prepared golly script for 8-4 tiling and I post different tiling system that can use this idea.
The reset:
This is iterate 1 generation - you need to run it instead of golly if you want to see the result:
Here is a natural linear replicator in this rule:
Attached alternative adjacency groups. It would be also nice to find someone with interest in hyperbolic geometry.
To show case the idea I've prepared golly script for 8-4 tiling and I post different tiling system that can use this idea.
The reset:
Code: Select all
#8-4 tiling rule on 100X100 Setup
#Written by Michael Simkin 2019 to check different types of CA on irregular grid.
import golly as g
import random
g.setrule("LifeHistory")
N = 100
for i in range(N):
for j in range(N):
if (i+j) % 2 == 1:
g.setcell(i,j, 6)
else:
if i % 2 == 0:
if i > 150 and i < 250 and False:
if random.uniform(0, 1) > 0.5:
g.setcell(i,j, 1)
else:
g.setcell(i,j, 2)
else:
g.setcell(i,j, 2)
else:
if i > 150 and i < 250 and False:
if random.uniform(0, 1) > 0.5:
g.setcell(i,j, 3)
else:
g.setcell(i,j, 4)
else:
g.setcell(i,j, 4)
Code: Select all
import golly as g
g.setrule("LifeHistory")
N = 100
def get2darr(n):
return [[0 for i in range(n)] for j in range(n)]
def apply_rule(x, y):
state = g.getcell(x, y)
if state == 6:
return 6
if state == 3 or state == 4:
vals = {0:0, 1:0, 2:0}
vals[g.getcell(x+-1,y+-1)] += 1
vals[g.getcell(x+-1,y+1)] += 1
vals[g.getcell(x+1,y+-1)] += 1
vals[g.getcell(x+1,y+1)] += 1
if vals[1] == 2 or vals[1] == 3:
return 3
else:
return 4
if state == 1 or state == 2:
vals = {0:0, 1:0, 2:0, 3:0, 4:0}
vals[g.getcell(x+-1,y+-1)] += 1
vals[g.getcell(x+-1,y+1)] += 1
vals[g.getcell(x+1,y+-1)] += 1
vals[g.getcell(x+1,y+1)] += 1
vals[g.getcell(x+2,y+0)] += 1
vals[g.getcell(x+-2,y+0)] += 1
vals[g.getcell(x+0,y+-2)] += 1
vals[g.getcell(x+0,y+2)] += 1
if (vals[1] >= 2 and vals[1] <= 2) or (vals[3] % 2 == 1 and vals[1] % 2 == 0):
return 1
else:
return 2
arr = get2darr(N)
for i in range(N):
for j in range(N):
arr[i][j] = apply_rule(i, j)
for i in range(N):
for j in range(N):
g.setcell(i,j, arr[i][j])
Code: Select all
x = 16, y = 13, rule = LifeHistory
FBFBFBFBFBFBFBFB$DFDFDFDFDFDFDFDF$FBFBFBFBFBFBFBFB$DFDFDFDFDFDFDFDF$F
BFBFBFBFBFBFBFB$DFDFDFCFCFDFDFDF$FBFBFBFBFBFBFBFB$DFDFDFDFDFDFDFDF$FB
FBFBFBFBFBFBFB$DFDFDFDFDFDFDFDF$FBFBFBFBFBFBFBFB$DFDFDFDFDFDFDFDF$FBF
BFBFBFBFBFBFB!
Attached alternative adjacency groups. It would be also nice to find someone with interest in hyperbolic geometry.