A strange method of soup-searching

For scripts to aid with computation or simulation in cellular automata.
Post Reply
googoIpIex
Posts: 292
Joined: February 28th, 2019, 4:49 pm
Location: Sqrt(-1)

A strange method of soup-searching

Post by googoIpIex » February 28th, 2019, 5:14 pm

So I was wondering what would happen if you repeatedly filled the same, per se, 20x20 square every time the pattern settled down. however, I am not good at python and cannot make a script to do it, so I am fairly sure there's some easy way to do it, but I am not sure how.
woomy on a vroomy

User avatar
pcallahan
Posts: 854
Joined: April 26th, 2013, 1:04 pm

Re: A strange method of soup-searching

Post by pcallahan » March 1st, 2019, 12:54 pm

googoIpIex wrote:So I was wondering what would happen if you repeatedly filled the same, per se, 20x20 square every time the pattern settled down. however, I am not good at python and cannot make a script to do it, so I am fairly sure there's some easy way to do it, but I am not sure how.
I had a similar idea in the early 90s and I am sure others have. It sounds like you are looking for some kind of fixed point in which the settled pattern works as a catalyst. I never had much luck with that, but it may be worth exploring with more modern tools and faster computers. Sorry, I can't help with the scripting, but I am curious to hear other replies.

One thing I would recommend is that you don't fill a 20x20 square every time but start with something smaller.

googoIpIex
Posts: 292
Joined: February 28th, 2019, 4:49 pm
Location: Sqrt(-1)

Re: A strange method of soup-searching

Post by googoIpIex » March 1st, 2019, 4:59 pm

pcallahan wrote:
googoIpIex wrote:So I was wondering what would happen if you repeatedly filled the same, per se, 20x20 square every time the pattern settled down. however, I am not good at python and cannot make a script to do it, so I am fairly sure there's some easy way to do it, but I am not sure how.
I had a similar idea in the early 90s and I am sure others have. It sounds like you are looking for some kind of fixed point in which the settled pattern works as a catalyst. I never had much luck with that, but it may be worth exploring with more modern tools and faster computers. Sorry, I can't help with the scripting, but I am curious to hear other replies.

One thing I would recommend is that you don't fill a 20x20 square every time but start with something smaller.
Maybe have the area it fills be one cell larger each time, starting with a 3x3 square?
woomy on a vroomy

wildmyron
Posts: 1544
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: A strange method of soup-searching

Post by wildmyron » March 2nd, 2019, 12:22 am

googoIpIex wrote:So I was wondering what would happen if you repeatedly filled the same, per se, 20x20 square every time the pattern settled down. however, I am not good at python and cannot make a script to do it, so I am fairly sure there's some easy way to do it, but I am not sure how.
I wrote a script based on a similar idea but randomising the small bounding box every generation rather than when the pattern has stabilised. It's here: http://conwaylife.com/forums/viewtopic. ... 839#p31839
It wouldn't be too hard to use apgsearch's naivestab to in between randomising, but how to do it really depends on what you want to achieve. Do you just want to watch cgol evolve and automatically have activity reintroduced whenever it dies down, or do you need greater efficiency to answer a bigger question about long term behaviour?
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

googoIpIex
Posts: 292
Joined: February 28th, 2019, 4:49 pm
Location: Sqrt(-1)

Re: A strange method of soup-searching

Post by googoIpIex » March 2nd, 2019, 12:36 am

wildmyron wrote:
googoIpIex wrote:So I was wondering what would happen if you repeatedly filled the same, per se, 20x20 square every time the pattern settled down. however, I am not good at python and cannot make a script to do it, so I am fairly sure there's some easy way to do it, but I am not sure how.
I wrote a script based on a similar idea but randomising the small bounding box every generation rather than when the pattern has stabilised. It's here: http://conwaylife.com/forums/viewtopic. ... 839#p31839
It wouldn't be too hard to use apgsearch's naivestab to in between randomising, but how to do it really depends on what you want to achieve. Do you just want to watch cgol evolve and automatically have activity reintroduced whenever it dies down, or do you need greater efficiency to answer a bigger question about long term behaviour?
The 1st one.
woomy on a vroomy

wildmyron
Posts: 1544
Joined: August 9th, 2013, 12:45 am
Location: Western Australia

Re: A strange method of soup-searching

Post by wildmyron » March 2nd, 2019, 1:02 pm

This script should do what you are looking for. It only uses a fixed size area to introduce randomness into the world but you can adjust it by changing width and height. You can also adjust the delay which is there because i think it makes the soup evolution a bit more enjoyable. Set to 0 to run faster.

Code: Select all

# active_soup.py
import golly as g
from time import time

width = 4
height = 4
rect = [0, 0, width, height]
ii = 0
delay = 0.005

# Stabilisation detection based on naivestab() from apgsearch by Adam P Goucher
# Tests for population periodicity:
def naivestab():
    length = 1000
    security = 3
    period = 24
    depth = 0
    prevpop = 0
    for i in xrange(length):
        for k in xrange(period):
            t1 = time()
            while (time() < t1 + delay):
                pass
            g.run(1)
            g.update()
        currpop = int(g.getpop())
        if (currpop == prevpop):
            depth += 1
        else:
            depth = 0
        prevpop = currpop
        if (depth == security):
            # Population is periodic.
            return True

    return False

g.show("Press 'Esc' to stop the fountain.")
g.new("")
while True:
    g.select(rect)
    # p = 10 * random.randint(3,8)
    p = 50
    g.randfill(p)
    g.select([])
    g.update()
    naivestab()
The 5S project (Smallest Spaceships Supporting Specific Speeds) is now maintained by AforAmpere. The latest collection is hosted on GitHub and contains well over 1,000,000 spaceships.

Semi-active here - recovering from a severe case of LWTDS.

Post Reply