ConwayLife.com - A community for Conway's Game of Life and related cellular automata
Home  •  LifeWiki  •  Forums  •  Download Golly

Thread for basic non-CGOL questions

For discussion of other cellular automata.

Re: Thread for basic non-CGOL questions

Postby 77topaz » July 4th, 2018, 4:00 am

AforAmpere wrote:The code is very unoptimized, but it works. You input new spaceships by putting the RLE in a string in the top list, and the string corresponding to the rule in the bottom. The bottom rule string is what you get when you take each transition in the order below, and for each transition, put a 0 if it is not allowed, a 1 if it is allowed, or a 2 if it does not matter.


Just to clarify, you mean "1 if it is required", right?
User avatar
77topaz
 
Posts: 859
Joined: January 12th, 2018, 9:19 pm

Re: Thread for basic non-CGOL questions

Postby AforAmpere » July 4th, 2018, 10:40 am

Yes, sorry, now edited.

EDIT, here is a script to convert to the rulestring at the bottom:
# torulestring.py, run with Golly.
import golly as g
import os
import sys
g.new("")
class RuleGenerator:
    notationdict = {
        "0"  : [0,0,0,0,0,0,0,0],   #   
        "1e" : [1,0,0,0,0,0,0,0],   #   N
        "1c" : [0,1,0,0,0,0,0,0],   #   NE
        "2a" : [1,1,0,0,0,0,0,0],   #   N,  NE
        "2e" : [1,0,1,0,0,0,0,0],   #   N,  E
        "2k" : [1,0,0,1,0,0,0,0],   #   N,  SE
        "2i" : [1,0,0,0,1,0,0,0],   #   N,  S
        "2c" : [0,1,0,1,0,0,0,0],   #   NE, SE
        "2n" : [0,1,0,0,0,1,0,0],   #   NE, SW
        "3a" : [1,1,1,0,0,0,0,0],   #   N,  NE, E
        "3n" : [1,1,0,1,0,0,0,0],   #   N,  NE, SE
        "3r" : [1,1,0,0,1,0,0,0],   #   N,  NE, S
        "3q" : [1,1,0,0,0,1,0,0],   #   N,  NE, SW
        "3j" : [1,1,0,0,0,0,1,0],   #   N,  NE, W
        "3i" : [1,1,0,0,0,0,0,1],   #   N,  NE, NW
        "3e" : [1,0,1,0,1,0,0,0],   #   N,  E,  S
        "3k" : [1,0,1,0,0,1,0,0],   #   N,  E,  SW
        "3y" : [1,0,0,1,0,1,0,0],   #   N,  SE, SW
        "3c" : [0,1,0,1,0,1,0,0],   #   NE, SE, SW
        "4a" : [1,1,1,1,0,0,0,0],   #   N,  NE, E,  SE
        "4r" : [1,1,1,0,1,0,0,0],   #   N,  NE, E,  S
        "4q" : [1,1,1,0,0,1,0,0],   #   N,  NE, E,  SW
        "4i" : [1,1,0,1,1,0,0,0],   #   N,  NE, SE, S
        "4y" : [1,1,0,1,0,1,0,0],   #   N,  NE, SE, SW
        "4k" : [1,1,0,1,0,0,1,0],   #   N,  NE, SE, W
        "4n" : [1,1,0,1,0,0,0,1],   #   N,  NE, SE, NW
        "4z" : [1,1,0,0,1,1,0,0],   #   N,  NE, S,  SW
        "4j" : [1,1,0,0,1,0,1,0],   #   N,  NE, S,  W
        "4t" : [1,1,0,0,1,0,0,1],   #   N,  NE, S,  NW
        "4w" : [1,1,0,0,0,1,1,0],   #   N,  NE, SW, W
        "4e" : [1,0,1,0,1,0,1,0],   #   N,  E,  S,  W
        "4c" : [0,1,0,1,0,1,0,1],   #   NE, SE, SW, NW
        "5i" : [1,1,1,1,1,0,0,0],   #   N,  NE, E,  SE, S
        "5j" : [1,1,1,1,0,1,0,0],   #   N,  NE, E,  SE, SW
        "5n" : [1,1,1,1,0,0,1,0],   #   N,  NE, E,  SE, W
        "5a" : [1,1,1,1,0,0,0,1],   #   N,  NE, E,  SE, NW
        "5q" : [1,1,1,0,1,1,0,0],   #   N,  NE, E,  S,  SW
        "5c" : [1,1,1,0,1,0,1,0],   #   N,  NE, E,  S,  W
        "5r" : [1,1,0,1,1,1,0,0],   #   N,  NE, SE, S,  SW
        "5y" : [1,1,0,1,1,0,1,0],   #   N,  NE, SE, S,  W
        "5k" : [1,1,0,1,0,1,1,0],   #   N,  NE, SE, SW, W
        "5e" : [1,1,0,1,0,1,0,1],   #   N,  NE, SE, SW, NW
        "6a" : [1,1,1,1,1,1,0,0],   #   N,  NE, E,  SE, S,  SW
        "6c" : [1,1,1,1,1,0,1,0],   #   N,  NE, E,  SE, S,  W
        "6k" : [1,1,1,1,0,1,1,0],   #   N,  NE, E,  SE, SW, W
        "6e" : [1,1,1,1,0,1,0,1],   #   N,  NE, E,  SE, SW, NW
        "6n" : [1,1,1,0,1,1,1,0],   #   N,  NE, E,  S,  SW, W
        "6i" : [1,1,0,1,1,1,0,1],   #   N,  NE, SE, S,  SW, NW
        "7c" : [1,1,1,1,1,1,1,0],   #   N,  NE, E,  SE, S,  SW, W
        "7e" : [1,1,1,1,1,1,0,1],   #   N,  NE, E,  SE, S,  SW, NW
        "8"  : [1,1,1,1,1,1,1,1],   #   N,  NE, E,  SE, S,  SW, W,  NW
        }
   
    allneighbours = [ 
        ["0"],
        ["1e", "1c"],
        ["2a", "2e", "2k", "2i", "2c", "2n"],
        ["3a", "3n", "3r", "3q", "3j", "3i", "3e", "3k", "3y", "3c"],
        ["4a", "4r", "4q", "4i", "4y", "4k", "4n", "4z", "4j", "4t", "4w", "4e", "4c"],
        ["5i", "5j", "5n", "5a", "5q", "5c", "5r", "5y", "5k", "5e"],
        ["6a", "6c", "6k", "6e", "6n", "6i"],
        ["7c", "7e"],
        ["8"],
        ]
       
    allneighbours_flat = [n for x in allneighbours for n in x]
   
    numneighbours = len(notationdict)
   
    # Use dict to store rule elements, initialised by setrule():
    bee = {}
    ess = {}
    alphanumeric = ""
    rulename = ""
   
    # Save the isotropic rule
    def saveAllRules(self):   
        self.saveIsotropicRule()
   
    # Interpret birth or survival string
    def ruleparts(self, part):

        inverse = False
        nlist = []
        totalistic = True
        rule = { k: False for k, v in self.notationdict.iteritems() }
       
        # Reverse the rule string to simplify processing
        part = part[::-1]
       
        for c in part:
            if c.isdigit():
                d = int(c)
                if totalistic:
                    # Add all the neighbourhoods for this value
                    for neighbour in self.allneighbours[d]:
                        rule[neighbour] = True
                elif inverse:
                    # Add all the neighbourhoods not in nlist for this value
                    for neighbour in self.allneighbours[d]:
                        if neighbour[1] not in nlist:
                            rule[neighbour] = True
                else:
                    # Add all the neighbourhoods in nlist for this value
                    for n in nlist:
                        neighbour = c + n
                        if neighbour in rule:
                            rule[neighbour] = True
                        else:
                            # Error
                            return {}
                   
                inverse = False
                nlist = []
                totalistic = True

            elif (c == '-'):
                inverse = True

            else:
                totalistic = False
                nlist.append(c)
       
        return rule

    # Set isotropic, non-totalistic rule
    # Adapted from Eric Goldstein's HenselNotation->Ruletable(1.3).py
    def setrule(self, rulestring):
   
        # neighbours_flat = [n for x in neighbours for n in x]
        b = {}
        s = {}
        sep = ''
        birth = ''
        survive = ''
       
        rulestring = rulestring.lower()
       
        if '/' in rulestring:
            sep = '/'
        elif '_' in rulestring:
            sep = '_'
        elif (rulestring[0] == 'b'):
            sep = 's'
        else:
            sep = 'b'
       
        survive, birth = rulestring.split(sep)
        if (survive[0] == 'b'):
            survive, birth = birth, survive
        survive = survive.replace('s', '')
        birth = birth.replace('b', '')
       
        b = self.ruleparts(birth)
        s = self.ruleparts(survive)

        if b and s:
            self.alphanumeric = 'B' + birth + 'S' + survive
            self.rulename = 'B' + birth + '_S' + survive
            self.bee = b
            self.ess = s
        else:
            # Error
            g.note("Unable to process rule definition.\n" +
                    "b = " + str(b) + "\ns = " + str(s))
            g.exit()
           

    # Save a rule file:
    def saverule(self, name, comments, table, colours):
       
        ruledir = g.getdir("rules")
        filename = ruledir + name + ".rule"

        global results
   results = ""
        results += table

        # Only create a rule file if it doesn't already exist; this avoids
        # concurrency issues when booting an instance of apgsearch whilst
        # one is already running.
       

    # Defines a variable:
    def newvar(self, name, vallist):

        line = "var "+name+"={"
        for i in xrange(len(vallist)):
            if (i > 0):
                line += ','
            line += str(vallist[i])
        line += "}\n"

        return line

    # Defines a block of equivalent variables:
    def newvars(self, namelist, vallist):

        block = "\n"

        for name in namelist:
            block += self.newvar(name, vallist)

        return block

    def scoline(self, chara, charb, left, right, amount):

        line = str(left) + ","

        for i in xrange(8):
            if (i < amount):
                line += chara
            else:
                line += charb
            line += chr(97 + i)
            line += ","

        line += str(right) + "\n"

        return line

    def isotropicline(self, chara, charb, left, right, n):

        line = str(left) + ","
        neighbours = self.notationdict[n]
       
        for i in xrange(8):
            if neighbours[i]:
                line += chara
            else:
                line += charb
            line += chr(97 + i)
            line += ","

        line += str(right) + "\n"

        return line
       
    def saveIsotropicRule(self):
   
 

        table = """"""

        for n in self.allneighbours_flat:
            if self.bee[n]:
                table += "1"
       else:
      table += "0"

        for n in self.allneighbours_flat:
            if self.ess[n]:
                table += "1"
       else:
      table += "0"
       
        colours = ""
   comments = ""
        self.saverule(self.rulename, comments, table, colours)

rulestring = g.getstring("Enter minimum rule string:")

rulestring2 = g.getstring("Enter maximum rule string:")

rg = RuleGenerator()

rg.setrule(rulestring)
rg.saveIsotropicRule()
q = results
rg.setrule(rulestring2)
rg.saveIsotropicRule()
t = results
g.setrule(rulestring)

# g.show(results)

final = ""
for z in range(len(q)):
    if q[z] == t[z]:
   final+=q[z]
    else:
   final+="2"
g.setclipstr(final)


It takes the minimum rule of the pattern and the maximum rule, and outputs the rule number to your clipboard.

EDIT 2, I've added something that makes it a bit easier. Save this file as gliderlist.py:
#gliderlist.py
ships=["b2o$obo$2bo!",
"b3o$o2bo$3bo$3bo$obo!",
"7b2obo$4b2obob2ob3o$b4o2b2o6bo$o4bo3bo3b2o$b2o!",
"b2o$o2bo!",
"b2o$$o2bo!"]
y=["000002202112211222220222222222222202222222222222222200112222211212222222222022222222222222222222222222",
"000002002122211222222222222222222220222222222222022020211122111211222202222222220222022222022220202222",
"000000002111111222200000002002222220220022202222222200111112111111112120000020022222022222222222222222",
"000112222222202222222222222222222222222222222222222220220222222222222222222222222222222222222222222222",
"000121222222022222222222222222222222222222222222222002222222222222222222222222222222222222222222222222"]

That just consists of the ship lists. Then, save this as the new Glider_Database.py:
# Glider_Database.py, run with Golly.
import golly as g
import os
import sys
import gliderlist ; reload(gliderlist)
g.new("")
class RuleGenerator:
    notationdict = {
        "0"  : [0,0,0,0,0,0,0,0],   #   
        "1e" : [1,0,0,0,0,0,0,0],   #   N
        "1c" : [0,1,0,0,0,0,0,0],   #   NE
        "2a" : [1,1,0,0,0,0,0,0],   #   N,  NE
        "2e" : [1,0,1,0,0,0,0,0],   #   N,  E
        "2k" : [1,0,0,1,0,0,0,0],   #   N,  SE
        "2i" : [1,0,0,0,1,0,0,0],   #   N,  S
        "2c" : [0,1,0,1,0,0,0,0],   #   NE, SE
        "2n" : [0,1,0,0,0,1,0,0],   #   NE, SW
        "3a" : [1,1,1,0,0,0,0,0],   #   N,  NE, E
        "3n" : [1,1,0,1,0,0,0,0],   #   N,  NE, SE
        "3r" : [1,1,0,0,1,0,0,0],   #   N,  NE, S
        "3q" : [1,1,0,0,0,1,0,0],   #   N,  NE, SW
        "3j" : [1,1,0,0,0,0,1,0],   #   N,  NE, W
        "3i" : [1,1,0,0,0,0,0,1],   #   N,  NE, NW
        "3e" : [1,0,1,0,1,0,0,0],   #   N,  E,  S
        "3k" : [1,0,1,0,0,1,0,0],   #   N,  E,  SW
        "3y" : [1,0,0,1,0,1,0,0],   #   N,  SE, SW
        "3c" : [0,1,0,1,0,1,0,0],   #   NE, SE, SW
        "4a" : [1,1,1,1,0,0,0,0],   #   N,  NE, E,  SE
        "4r" : [1,1,1,0,1,0,0,0],   #   N,  NE, E,  S
        "4q" : [1,1,1,0,0,1,0,0],   #   N,  NE, E,  SW
        "4i" : [1,1,0,1,1,0,0,0],   #   N,  NE, SE, S
        "4y" : [1,1,0,1,0,1,0,0],   #   N,  NE, SE, SW
        "4k" : [1,1,0,1,0,0,1,0],   #   N,  NE, SE, W
        "4n" : [1,1,0,1,0,0,0,1],   #   N,  NE, SE, NW
        "4z" : [1,1,0,0,1,1,0,0],   #   N,  NE, S,  SW
        "4j" : [1,1,0,0,1,0,1,0],   #   N,  NE, S,  W
        "4t" : [1,1,0,0,1,0,0,1],   #   N,  NE, S,  NW
        "4w" : [1,1,0,0,0,1,1,0],   #   N,  NE, SW, W
        "4e" : [1,0,1,0,1,0,1,0],   #   N,  E,  S,  W
        "4c" : [0,1,0,1,0,1,0,1],   #   NE, SE, SW, NW
        "5i" : [1,1,1,1,1,0,0,0],   #   N,  NE, E,  SE, S
        "5j" : [1,1,1,1,0,1,0,0],   #   N,  NE, E,  SE, SW
        "5n" : [1,1,1,1,0,0,1,0],   #   N,  NE, E,  SE, W
        "5a" : [1,1,1,1,0,0,0,1],   #   N,  NE, E,  SE, NW
        "5q" : [1,1,1,0,1,1,0,0],   #   N,  NE, E,  S,  SW
        "5c" : [1,1,1,0,1,0,1,0],   #   N,  NE, E,  S,  W
        "5r" : [1,1,0,1,1,1,0,0],   #   N,  NE, SE, S,  SW
        "5y" : [1,1,0,1,1,0,1,0],   #   N,  NE, SE, S,  W
        "5k" : [1,1,0,1,0,1,1,0],   #   N,  NE, SE, SW, W
        "5e" : [1,1,0,1,0,1,0,1],   #   N,  NE, SE, SW, NW
        "6a" : [1,1,1,1,1,1,0,0],   #   N,  NE, E,  SE, S,  SW
        "6c" : [1,1,1,1,1,0,1,0],   #   N,  NE, E,  SE, S,  W
        "6k" : [1,1,1,1,0,1,1,0],   #   N,  NE, E,  SE, SW, W
        "6e" : [1,1,1,1,0,1,0,1],   #   N,  NE, E,  SE, SW, NW
        "6n" : [1,1,1,0,1,1,1,0],   #   N,  NE, E,  S,  SW, W
        "6i" : [1,1,0,1,1,1,0,1],   #   N,  NE, SE, S,  SW, NW
        "7c" : [1,1,1,1,1,1,1,0],   #   N,  NE, E,  SE, S,  SW, W
        "7e" : [1,1,1,1,1,1,0,1],   #   N,  NE, E,  SE, S,  SW, NW
        "8"  : [1,1,1,1,1,1,1,1],   #   N,  NE, E,  SE, S,  SW, W,  NW
        }
   
    allneighbours = [ 
        ["0"],
        ["1e", "1c"],
        ["2a", "2e", "2k", "2i", "2c", "2n"],
        ["3a", "3n", "3r", "3q", "3j", "3i", "3e", "3k", "3y", "3c"],
        ["4a", "4r", "4q", "4i", "4y", "4k", "4n", "4z", "4j", "4t", "4w", "4e", "4c"],
        ["5i", "5j", "5n", "5a", "5q", "5c", "5r", "5y", "5k", "5e"],
        ["6a", "6c", "6k", "6e", "6n", "6i"],
        ["7c", "7e"],
        ["8"],
        ]
       
    allneighbours_flat = [n for x in allneighbours for n in x]
   
    numneighbours = len(notationdict)
   
    # Use dict to store rule elements, initialised by setrule():
    bee = {}
    ess = {}
    alphanumeric = ""
    rulename = ""
   
    # Save the isotropic rule
    def saveAllRules(self):   
        self.saveIsotropicRule()
   
    # Interpret birth or survival string
    def ruleparts(self, part):

        inverse = False
        nlist = []
        totalistic = True
        rule = { k: False for k, v in self.notationdict.iteritems() }
       
        # Reverse the rule string to simplify processing
        part = part[::-1]
       
        for c in part:
            if c.isdigit():
                d = int(c)
                if totalistic:
                    # Add all the neighbourhoods for this value
                    for neighbour in self.allneighbours[d]:
                        rule[neighbour] = True
                elif inverse:
                    # Add all the neighbourhoods not in nlist for this value
                    for neighbour in self.allneighbours[d]:
                        if neighbour[1] not in nlist:
                            rule[neighbour] = True
                else:
                    # Add all the neighbourhoods in nlist for this value
                    for n in nlist:
                        neighbour = c + n
                        if neighbour in rule:
                            rule[neighbour] = True
                        else:
                            # Error
                            return {}
                   
                inverse = False
                nlist = []
                totalistic = True

            elif (c == '-'):
                inverse = True

            else:
                totalistic = False
                nlist.append(c)
       
        return rule

    # Set isotropic, non-totalistic rule
    # Adapted from Eric Goldstein's HenselNotation->Ruletable(1.3).py
    def setrule(self, rulestring):
   
        # neighbours_flat = [n for x in neighbours for n in x]
        b = {}
        s = {}
        sep = ''
        birth = ''
        survive = ''
       
        rulestring = rulestring.lower()
       
        if '/' in rulestring:
            sep = '/'
        elif '_' in rulestring:
            sep = '_'
        elif (rulestring[0] == 'b'):
            sep = 's'
        else:
            sep = 'b'
       
        survive, birth = rulestring.split(sep)
        if (survive[0] == 'b'):
            survive, birth = birth, survive
        survive = survive.replace('s', '')
        birth = birth.replace('b', '')
       
        b = self.ruleparts(birth)
        s = self.ruleparts(survive)

        if b and s:
            self.alphanumeric = 'B' + birth + 'S' + survive
            self.rulename = 'B' + birth + '_S' + survive
            self.bee = b
            self.ess = s
        else:
            # Error
            g.note("Unable to process rule definition.\n" +
                    "b = " + str(b) + "\ns = " + str(s))
            g.exit()
           

    # Save a rule file:
    def saverule(self, name, comments, table, colours):
       
        ruledir = g.getdir("rules")
        filename = ruledir + name + ".rule"

        global results
   results = ""
        results += table

        # Only create a rule file if it doesn't already exist; this avoids
        # concurrency issues when booting an instance of apgsearch whilst
        # one is already running.
       

    # Defines a variable:
    def newvar(self, name, vallist):

        line = "var "+name+"={"
        for i in xrange(len(vallist)):
            if (i > 0):
                line += ','
            line += str(vallist[i])
        line += "}\n"

        return line

    # Defines a block of equivalent variables:
    def newvars(self, namelist, vallist):

        block = "\n"

        for name in namelist:
            block += self.newvar(name, vallist)

        return block

    def scoline(self, chara, charb, left, right, amount):

        line = str(left) + ","

        for i in xrange(8):
            if (i < amount):
                line += chara
            else:
                line += charb
            line += chr(97 + i)
            line += ","

        line += str(right) + "\n"

        return line

    def isotropicline(self, chara, charb, left, right, n):

        line = str(left) + ","
        neighbours = self.notationdict[n]
       
        for i in xrange(8):
            if neighbours[i]:
                line += chara
            else:
                line += charb
            line += chr(97 + i)
            line += ","

        line += str(right) + "\n"

        return line
       
    def saveIsotropicRule(self):
   
 

        table = """"""

        for n in self.allneighbours_flat:
            if self.bee[n]:
                table += "1"
       else:
      table += "0"

        for n in self.allneighbours_flat:
            if self.ess[n]:
                table += "1"
       else:
      table += "0"
       
        colours = ""
   comments = ""
        self.saverule(self.rulename, comments, table, colours)

rulestring = g.getstring("Enter rule string in Alan Hensel's isotropic rule notation",
                         "B2-a/S12")

rg = RuleGenerator()

rg.setrule(rulestring)
rg.saveIsotropicRule()
g.setrule(rulestring)

# g.show(results)
p=0

j=0
y=gliderlist.y
ships=gliderlist.ships
for z in range(len(y)):
    p = 0
    for x in range(len(results)):
        if (results[x] == "1" and y[z][x] == "0") or (results[x] == "0" and y[z][x] == "1"):
       # g.show(rg.rulename + "False")
       p = 1

    if p ==0:
   # g.show(rg.rulename + "True")
   g.setclipstr(ships[z])
   g.paste(j,0,"or")
   j+=20


This addition should allow easier pasting, as all the ships will be contained in a separate document. Format as you wish.

Another EDIT, fixed reloading issue.
Things to work on:
- Find a (7,1)c/8 ship in a Non-totalistic rule (someone please search the rules)
- Find a C/10 in JustFriends
- Find a C/10 in Day and Night
AforAmpere
 
Posts: 752
Joined: July 1st, 2016, 3:58 pm

Re: Thread for basic non-CGOL questions

Postby muzik » July 10th, 2018, 10:44 am

Has anyone attempted to make a 16-state rule where every state represents a combination of cells that fits in a 2x2 square, that simulates a scaled-down version of Life?
waiting for apgsearch to support one-dimensional rules
muzik
 
Posts: 2812
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Thread for basic non-CGOL questions

Postby AforAmpere » July 10th, 2018, 11:18 am

muzik wrote:Has anyone attempted to make a 16-state rule where every state represents a combination of cells that fits in a 2x2 square, that simulates a scaled-down version of Life?

I did try that at some point, but realized that literal billions of transitions were needed, and gave up.
Things to work on:
- Find a (7,1)c/8 ship in a Non-totalistic rule (someone please search the rules)
- Find a C/10 in JustFriends
- Find a C/10 in Day and Night
AforAmpere
 
Posts: 752
Joined: July 1st, 2016, 3:58 pm

Re: Thread for basic non-CGOL questions

Postby BlinkerSpawn » July 10th, 2018, 11:33 am

AforAmpere wrote:
muzik wrote:Has anyone attempted to make a 16-state rule where every state represents a combination of cells that fits in a 2x2 square, that simulates a scaled-down version of Life?

I did try that at some point, but realized that literal billions of transitions were needed, and gave up.

If you use variables for grouping properly, such that only the subcells adjacent to each cell are checked, you might only need a few thousand, although even that would be best handled by computer.
LifeWiki: Like Wikipedia but with more spaceships. [citation needed]

Image
User avatar
BlinkerSpawn
 
Posts: 1790
Joined: November 8th, 2014, 8:48 pm
Location: Getting a snacker from R-Bee's

Re: Thread for basic non-CGOL questions

Postby AforAmpere » July 10th, 2018, 11:43 am

BlinkerSpawn wrote:If you use variables for grouping properly, such that only the subcells adjacent to each cell are checked, you might only need a few thousand, although even that would be best handled by computer.

I think that using that method would bring the transitions to around 65536, which is more reasonable.
Things to work on:
- Find a (7,1)c/8 ship in a Non-totalistic rule (someone please search the rules)
- Find a C/10 in JustFriends
- Find a C/10 in Day and Night
AforAmpere
 
Posts: 752
Joined: July 1st, 2016, 3:58 pm

Re: Thread for basic non-CGOL questions

Postby muzik » November 3rd, 2018, 7:46 pm

Does there exist a program that can simulate higher-range outer-totalistic cellular automata with more specific birth conditions than just a range, and/or can rule tables be made for such rules?
waiting for apgsearch to support one-dimensional rules
muzik
 
Posts: 2812
Joined: January 28th, 2016, 2:47 pm
Location: Scotland

Re: Thread for basic non-CGOL questions

Postby wildmyron » November 6th, 2018, 4:24 am

muzik wrote:Does there exist a program that can simulate higher-range outer-totalistic cellular automata with more specific birth conditions than just a range, and/or can rule tables be made for such rules?

You didn't respond to my reply on the discord server so I'll post it again here.

----

Golly cannot simulate such rules except by either using a script to evolve the pattern or emulating the rule with a multistate CA which uses two steps per generation (first step to count neighbours, second step to update states). See this Extended Neighborhood Emulator for an example which uses a radius 2 disc neighbourhood.

Brian Prentice's Java Square Cell can simulate many different types of cellular automata with range 2 neighbourhoods, including 2-state outer totalistic CA on the range 2 Moore nieghbourhood. Download the application from the link above and have a quick read of the description and usage instructions. I recommend setting the world size to 500x500 after a opening the application by clicking on the globe icon and adjusting the size parameters (default 1000x1000; you will need to do this once each time you run the app). Then save this pattern to a file and open it in the app. This will set the rule family to "Rule Table" (the default) and set the rule table options, states and neighbour weights to outer-totalistic range 2 Moore.

#Rule = Rule Table
#States = 2
#Counts = 25
#SW 0,1
#NW 1,1,1,1,1
#NW 1,1,1,1,1
#NW 1,1,0,1,1
#NW 1,1,1,1,1
#NW 1,1,1,1,1
#RT 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
#RT 0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
#Rows = 20
#Columns = 5
#L .A2$2.3A$2.3A2$.A9$.A$2.3A$2.3A2$2A$A

To change the rule, click the "change rule" button. The state and neighbour weights will appear as shown here (no need to change them):
ruletable.png
Rule Table dialogue
ruletable.png (15.44 KiB) Viewed 742 times

Change the rule by clicking the cells in the table (top row state 0 [birth], second row state 1 [survival]). A mouse click sets the current table entry to the "current state". I don't think this is displayed anywhere so it's a bit confusing. Change the current state by holding Shift when you click. The image above shows the replicator rule which you mentioned here. You can change to a random rule by clicking the Random button in this dialogue, or by pressing 'N' in the main view of the world. I think the app is meant to allow choosing which table elements to allow in the random rule generation by clicking the "Use" button in the rule dialogue, but I can't get this to work properly. Maybe bprentice can provide more information on this issue. Useful shortcut keys (for easy reference, more info in the instructions):

* 'N' to test new random rule
* 'R' to random fill the world
* When the simulation is stopped:
* * Space to step
* * Enter to run the simulation
* * Mouse click to set current cell to "current state"
* * Shift click to cycle "current state" and set current cell
* * Ctrl click to start and finish selection
* * Numkey +/- to zoom in / out
* * Arrow keys to pan
* When the simulation is running
* * Enter to stop simulation
* * Numkey +/- to speed up / slow down the simulation

----

Another option for exploring higher range cellular automata is Visions of Chaos. This allows exploration of many different types of CA on all kinds of neighbourhoods. Unfortunately I don't think VoC supports outer totalistic rules on large neighbourhoods, but it does support a variation of totalistic CA on arbitrary neighbourhoods up to range 15. Use Mode -> Cellular Automata -> 2D -> Large Neighbourhood Cellular Automata. If you load the .LNT file attached to this post you will see a simulation of the range 2 replicator rule. VoC has a limited range of starting conditions, if you choose Solid Square you can get a good visualisation of the replication behaviour. The rule format goes something like this:
:m0,n0,r0,:m1,n1,r1,:m2,n2,r2,

where each m,n,r triple represents a range of neighbour counts from m to n which leads to cell state r. Because this is totalistic this is applied equally to Off and On cells (centre cell not included in the count). The quirk is that if a neighbour count is not included in any range then it remains unchanged (this is why I said that it's a variation of totalistic CA).

----

There are bound to be many other possibilities for simulating these kinds of CA but I would say that the most useful to you would be something where you code the rule behaviour yourself. This way you can target the specific rule families you are interested in. You could do this with any number of development platforms - here are some options:

* Modify existing software: Golly, Java Square Cell, etc.
* Implement as a script in Golly - the 3D.lua script gives a good template for how to go about doing this
* Use an existing modelling environment - agent based modelling environments are well suited to this purpose and several have built in support for cellular automata, e.g. TerraME, NetLOGO, DDLab, ...
* Implement as a model in [url]Ready[/url]. Will probably run much faster than the other options provided that Ready can use your GPU
* Implement as a shader which will run on the GPU - again, many frameworks support this, VoC has a nice Library of examples, look under Mode -> OpenGL Shading Language -> Shader Editor. The Larger than Life samples are probably a good starting point.
Attachments
R2_replicator.LNT.txt
Range 2 replicator rule for VoC (save as .LNT file, not .txt)
(2.35 KiB) Downloaded 7 times
wildmyron
 
Posts: 864
Joined: August 9th, 2013, 12:45 am

Re: Thread for basic non-CGOL questions

Postby calcyman » November 7th, 2018, 12:05 am

muzik wrote:Does there exist a program that can simulate higher-range outer-totalistic cellular automata with more specific birth conditions than just a range, and/or can rule tables be made for such rules?


Yes, apgsearch v4.63 and lifelib 2.0.17 support HROT rules with a range of up to 5.
What do you do with ill crystallographers? Take them to the mono-clinic!
User avatar
calcyman
 
Posts: 1748
Joined: June 1st, 2009, 4:32 pm

Re: Thread for basic non-CGOL questions

Postby 77topaz » November 7th, 2018, 2:01 am

calcyman wrote:Yes, apgsearch v4.63 and lifelib 2.0.17 support HROT rules with a range of up to 5.


That's still of limited usefulness, though, if there's no programs like Golly or LifeViewer that allow you to view the evolution of those patterns. Without that, there's no way to run soups to check if they produce what they are said to produce, or even if objects behave the way their apgcode says they do.
User avatar
77topaz
 
Posts: 859
Joined: January 12th, 2018, 9:19 pm

Re: Thread for basic non-CGOL questions

Postby wildmyron » November 7th, 2018, 4:47 am

77topaz wrote:
calcyman wrote:Yes, apgsearch v4.63 and lifelib 2.0.17 support HROT rules with a range of up to 5.


That's still of limited usefulness, though, if there's no programs like Golly or LifeViewer that allow you to view the evolution of those patterns. Without that, there's no way to run soups to check if they produce what they are said to produce, or even if objects behave the way their apgcode says they do.

It's much more useful than you make it out to be. Have a read of the lifelib documentation and you will see that aside from watching the evolution in real time, it's pretty easy to do all of those things and more.

I think the hard thing here is going to be finding interesting rules where the outer totalistic characteristic is required above what LtL already offers
wildmyron
 
Posts: 864
Joined: August 9th, 2013, 12:45 am

Re: Thread for basic non-CGOL questions

Postby 77topaz » November 7th, 2018, 5:03 am

wildmyron wrote:It's much more useful than you make it out to be. Have a read of the lifelib documentation and you will see that aside from watching the evolution in real time, it's pretty easy to do all of those things and more.


Oh, I see. It's still a lot more complicated to use than Golly or LifeViewer, though.

wildmyron wrote:I think the hard thing here is going to be finding interesting rules where the outer totalistic characteristic is required above what LtL already offers


Muzik had some such rules (e.g. a Fredkin-like rule with all odd numbers), which is why he asked about the concept in the first place.
User avatar
77topaz
 
Posts: 859
Joined: January 12th, 2018, 9:19 pm

Re: Thread for basic non-CGOL questions

Postby fix » November 18th, 2018, 3:30 pm

Hello, All.

03.10.2002 at random i found

rule = b356/s2
sum specifies the range
01110
11011
01110

exist spaceships, oscillators

Is this life and spaceships and oscillators known?

sample https://www.youtube.com/watch?v=WPXFWjM3hak
https://youtu.be/TnoQPKHWdTA
https://play.google.com/store/apps/details?id=ru.inbox.fix.Life
and 3d sample exist still life, oscillators https://youtu.be/P-C5UH_bc-Y
fix
 
Posts: 1
Joined: November 18th, 2018, 5:39 am
Location: Russia, Surgut

Previous

Return to Other Cellular Automata

Who is online

Users browsing this forum: Saka and 3 guests