gencols: techniques

For scripts to aid with computation or simulation in cellular automata.
User avatar
dvgrn
Moderator
Posts: 5897
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: Problem with gencols/3g.py

Post by dvgrn » July 14th, 2017, 1:12 pm

gmc_nxtman wrote:

Code: Select all

5, 6, 7, 9, 8, 9, 12, 11

Code: Select all

x = 7, y = 9, rule = B3/S23
4bobo$o3b2o$b2o2bo$2o3$5bo$4b2o$4bobo!
In case there's something odd with gencols itself, here's a few lines of 3g.col...
Thanks! It all looks perfectly healthy to me, but there's always a reason why these things aren't working. Probably something obvious, once somebody points it out.

Here's what your 3g.col output is really saying, when you unpack each line by replacing exclamation points:

Code: Select all

......*
....*.*
.....**





.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**





.....**
....*.*
......*
.............**
.............*.*
.............*



---------------------------



...*
.*.*
..**







.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**







...**
..*.*
....*
...........**
...........*.*
...........*



---------------------------



...*
.*.*
..**






.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**






...**
..*.*
....*
...........**
...........*.*
...........*



---------------------------



..*
*.*
.**







.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



.....*
...*.*
....**






.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**






.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**






....**
...*.*
.....*
............**
............*.*
............*



---------------------------



....*
..*.*
...**







.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**







..**
.*.*
...*
..........**
..........*.*
..........*



---------------------------



....*
..*.*
...**






.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**






..**
.*.*
...*
..........**
..........*.*
..........*



---------------------------



.......*
.....*.*
......**




.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



.......*
.....*.*
......**



.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



......*
....*.*
.....**






.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



.....*
...*.*
....**







.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**







....**
...*.*
.....*
............**
............*.*
............*



---------------------------



........*
......*.*
.......**



.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**






.....**
....*.*
......*
.............**
.............*.*
.............*



---------------------------



..*
*.*
.**







.....**
....*.*
......*
.............**
.............*.*
.............*



---------------------------



...*
.*.*
..**








.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**








...**
..*.*
....*
...........**
...........*.*
...........*



---------------------------



..*
*.*
.**








.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**








....**
...*.*
.....*
............**
............*.*
............*



---------------------------



....*
..*.*
...**








.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**








..**
.*.*
...*
..........**
..........*.*
..........*



---------------------------



..*
*.*
.**








.....**
....*.*
......*
.............**
.............*.*
.............*



---------------------------



..*
*.*
.**







......**
.....*.*
.......*
..............**
..............*.*
..............*



---------------------------



..*
*.*
.**






......**
.....*.*
.......*
..............**
..............*.*
..............*



---------------------------



..*
*.*
.**





......**
.....*.*
.......*
..............**
..............*.*
..............*



---------------------------



..*
*.*
.**




......**
.....*.*
.......*
..............**
..............*.*
..............*



---------------------------



..*
*.*
.**



......**
.....*.*
.......*
..............**
..............*.*
..............*



---------------------------



..*
*.*
.**


......**
.....*.*
.......*
..............**
..............*.*
..............*



---------------------------



..*
*.*
.**








......**
.....*.*
.......*
..............**
..............*.*
..............*



---------------------------



..*
*.*
.**









...**
..*.*
....*
...........**
...........*.*
...........*



---------------------------



..*
*.*
.**









.**
*.*
..*
.........**
.........*.*
.........*



---------------------------



..*
*.*
.**









....**
...*.*
.....*
............**
............*.*
............*



---------------------------



..*
*.*
.**









..**
.*.*
...*
..........**
..........*.*
..........*



---------------------------



..*
*.*
.**









.....**
....*.*
......*
.............**
.............*.*
.............*



---------------------------



...*
.*.*
..**









.**
*.*
..*
.........**
.........*.*
.........*
That's gliders traveling NW, NE, and SE, all right, and the NW and NE ones start interacting between T=10 and T=13, and the next one interacts by 12 ticks after that, T=25 (unless it misses, which does happen sometimes in edge cases like the last line you quoted -- I believe that's known gencols behavior). So far so good -- gencols seems to be doing its job.

Code: Select all

..*
*.*
.**









..**
.*.*
...*
..........**
..........*.*
..........*
If you rotate your sample R recipe by 180 degrees and back it off by a dozen ticks or so, it certainly looks like something that should show up in some line or other of your 3g.col. So why isn't it there? Or is the script not seeing it?

One thing you could do is make your own test.col and point the script at that --

Code: Select all

*.*!.**!.*!!!!.....**!.*..**!.**...*!*.*!
Very likely chris_c's script will find the R-pentomino fine if you append the above line to 3g.col -- though it will take a while of course. Should be pretty much instantaneous if the above is the only line in the file. What kind of run times are you seeing, to get through the full 3g.col and back to a command prompt?

If that R-pentomino collision isn't in 3g.col, for whatever reason, then it would be good to know why. I can have a look later. Anyone else have an easy explanation in the meantime? I'm not really a gencols expert, I just play one on the forums...!

User avatar
gmc_nxtman
Posts: 1147
Joined: May 26th, 2015, 7:20 pm

Re: gencols: techniques

Post by gmc_nxtman » July 14th, 2017, 1:33 pm

I appended the test sample to the beginning of 3g.col (also entering a different population sequence as necessary), and the script didn't find it.

Code: Select all

8, 9, 12, 11, 18, 11, 11, 10
I also tried with the original collision (....*.*!*...**!.**..*!**!.....*!....**!....*.*) and appended that. Entering the original corresponding population sequence into the script doesn't seem to find that either. Doing a quick ctrl-F search finds neither of the possible R-pentomino collisions, which might suggest a problem with gencols as well, or a not-thorough-enough search on my part...!

User avatar
dvgrn
Moderator
Posts: 5897
Joined: May 17th, 2009, 11:00 pm
Location: Madison, WI
Contact:

Re: gencols: techniques

Post by dvgrn » July 14th, 2017, 2:03 pm

gmc_nxtman wrote:I also tried with the original collision (....*.*!*...**!.**..*!**!.....*!....**!....*.*) and appended that. Entering the original corresponding population sequence into the script doesn't seem to find that either.
That's not the original collision -- should be ....*.*!*...**!.**..*!**!!!.....*!....**!....*.*!

Looks like maybe you hand-translated the RLE, same as I did? There's a "3$" in the middle that actually means "two blank lines" -- I did it wrong also (!). And I only checked to see that my reconstruction made an R-pentomino, and didn't notice that it wasn't the same one... sometimes the Life universe just doesn't play fair.

Code: Select all

....*.*
*...**
.**..*
**
.
.
.....*
....**
....*.*
vs. my version (unrotated):

Code: Select all

....*.*
*...**
.**..*
**
.
.
.
.....*
....**
....*.*
gmc_nxtman wrote:Doing a quick ctrl-F search finds neither of the possible R-pentomino collisions, which might suggest a problem with gencols as well, or a not-thorough-enough search on my part...!
You wouldn't find your !*.-encoded collision in the 3g.col file, nor mine, though I did rotate mine 180 degrees so that's one step closer. You'd have to back all the gliders up by 10-13 ticks to get a pattern that maybe ought to be in the list.

In general it's probably best to spend at least a few days continuing to assume that you and I are making mistakes like the above, and try to find them... and then look at all of the results gencols is actually putting out again. What chris_c's script does, and for that matter what gencols does, is simple enough that usually it turns out that Problem Exists Between Keyboard And Chair... somehow.

I've double-checked both of your population sequences with LifeViewer ('G' shortcut), by the way -- definitely don't see any mistakes there.

EDIT: Are you letting the script run to completion? How long does it take for the full 3g.col?

EDIT2: On second reading, that script really ought to be rewritten to not use the clipboard -- it's assuming that nobody will use the clipboard for anything else while the script is running. Otherwise it might silently lose matches from early in the run, or possibly error out mysteriously if the clipboard contents look like invalid RLE.

It's pretty simple to patch it to use g.getcells(g.getrect()) instead -- maybe copy results-so-far to the clipboard only on demand, say if the user hits Ctrl+C while the script is running.

M. I. Wright
Posts: 372
Joined: June 13th, 2015, 12:04 pm

Re: gencols: techniques

Post by M. I. Wright » August 20th, 2017, 8:29 pm

Minor necro, apologies, but I'm quite confused about the meaning of "Also match the phase of this pattern with pattern 2" in the Arguments.Explanation description of -test2. As I understand it, -del and -test1 all serve to forcefully ignore some desired pattern such that it doesn't interfere with the output filters, so what additional functionality does -test2's phase-matching provide?

EDIT: Oh. Duh. -nph can change the phase of pattern2, so -test2 will simply advance its given pattern automatically by however much is needed in order to match it with the current pattern2 phase. After looking at codeholic's pi fuse examples early in this thread it's easy to see when this is useful.
gamer54657 wrote:God save us all.
God save humanity.

hgkhjfgh
nutshelltlifeDiscord 'Conwaylife Lounge'

M. I. Wright
Posts: 372
Joined: June 13th, 2015, 12:04 pm

Re: gencols: techniques

Post by M. I. Wright » September 1st, 2017, 2:38 pm

Hm.

Code: Select all

x = 31, y = 9, rule = B3/S23
b2o2bob2o$o2bo2b2o$bobo$2bo$8bo7b6o$6b3o7bo5bo5b2o$5bo10bo10b4o$6bo10b
o4bo3b2ob2o$7b2o10b2o6b2o!
There are plenty of possible placements for a third *WSS that leave the transient eater intact, but I can't seem to get gencols to find any of them. Perhaps I'm misunderstanding how -test1 works... could somebody check this over, please?

gencols:

Code: Select all

./gencols -pat obj/2wss_loafer.life obj/allss_w.list -nph 4 -tc 17 45 -gen 200 -test1 obj/eater_se1.life -filt ap > findeater.col
Finishes search with 0 results.

obj/2wss_loafer.life:

Code: Select all

.**..*.**
*..*..**
.*.*
..*
........*.......******
......***.......*.....*.....**
.....*..........*..........****
......*..........*....*...**.**
.......**..........**......**
gamer54657 wrote:God save us all.
God save humanity.

hgkhjfgh
nutshelltlifeDiscord 'Conwaylife Lounge'

User avatar
Scorbie
Posts: 1389
Joined: December 7th, 2013, 1:05 am

Re: gencols: techniques

Post by Scorbie » November 7th, 2017, 1:05 pm

Any idea why gencols cannot find some diuresis stabilizations?

diuresis.life

Code: Select all

....**.......................
..*..*.......................
..**.*.*.....................
...*..**.....................
...*.........................
.*.**........................
.**..*..........**...........
....*..........*.*...........
.***...........**............
*...***........*.............
.***..*......................
....*........................
...*.........................
...**........................
......*......................
.******........*.............
.*.............**............
....*..........*.*...........
...*.*..........**...........
...**........................
......................**.....
......**..............**.....
.....*.*..............**.....
.....*................*......
....**...............*.*.....
......................*.*.***
.......................*.****
........................*....
pd.list

Code: Select all

..*..*....*..*..!***..******..***!..*..*....*..*..!
.*.!.*.!***!...!...!***!.*.!.*.!.*.!.*.!***!...!...!***!.*.!.*.!
command

Code: Select all

./gencols -pat diuresis.life pd.list -nph 15 -tc 5 30 -gen 91 -del1 -del2 -nosynch -filt ap | ./makematrix > test.life
It missed this:

Code: Select all

x = 36, y = 28, rule = B3/S23
4b2o$2bo2bo$2b2obobo14bo2bo4bo2bo$3bo2b2o12b3o2b6o2b3o$3bo18bo2bo4bo2b
o$bob2o$b2o2bo10b2o$4bo10bobo$b3o11b2o$o3b3o8bo$b3o2bo$4bo$3bo$3b2o$6b
o$b6o8bo$bo13b2o$4bo10bobo$3bobo10b2o$3b2o$22b2o$6b2o14b2o$5bobo14b2o$
5bo16bo$4b2o15bobo$22bobob3o$23bob4o$24bo!
Best wishes to you, Scorbie

User avatar
Goldtiger997
Posts: 547
Joined: June 21st, 2016, 8:00 am
Location: 11.329903°N 142.199305°E

Re: gencols: techniques

Post by Goldtiger997 » October 6th, 2018, 8:54 pm

I've been trying to use gencols to find a p42 gun, as suggested here by Sokwe. By using commands such as...

Code: Select all

time ./gencols  -pat obj/p42.life obj/p21-1.life -nph 21 -tc 3 11 -gen 43 -filt ap > p42gunhope.col
...gencols returns a lot of results. However, I've ran into issues when trying to filter the results to find patterns where the p42 and p21 oscillators are not destroyed. I pretty sure the way of doing this is to use the -del1 and -del2 options, and then use -filt ap to ensure that the deletion succeeded. But when I run a command like this...

Code: Select all

time ./gencols  -pat obj/p42.life obj/p21-1.life -nph 21 -tc 3 11 -gen 43 -nosynch -del1 -del2 -filt ap > p42gunhope.col
...gencols returns no results, even though there are some. This may just be because my command is incorrect, but I suspect it's something else because when I enter the example command for finding the Gosper Glider Gun...

Code: Select all

time ./gencols -pat obj/gunhalf1.life obj/gunhalf2.life -nph 15 -tc 12 20 -gen 31 -nosynch -del1 -del2 -filt g > glidergun.col
...gencols also returns no results. Strangley enough, other examples with -del commands (such as the buckaroo reflector) seem to work.

So has anyone else encountered similar issues before and/or know how to fix it?

User avatar
2718281828
Posts: 738
Joined: August 8th, 2017, 5:38 pm

Re: gencols: techniques

Post by 2718281828 » August 20th, 2019, 3:10 pm

If I got it correctly gencols returns a list of interacting pattern.
E.g. this is counted as 'collision' of 2 gliders in Life:

Code: Select all

x = 9, y = 4, rule = B3/S23
6b3o$2bo3bo$obo4bo$b2o!
This is due to possible 2n, 2k and 2i (Hensel notation) neighbourhood. I did not dive deep into the gencols code, but is it feasible to modify the code so that these 'collisions' are removed?

Post Reply