Rulegolfer script

For scripts to aid with computation or simulation in cellular automata.
Post Reply
User avatar
pzq_alex
Posts: 793
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Rulegolfer script

Post by pzq_alex » August 17th, 2022, 12:03 am

I did a rewrite to w33z8kqrqk8zzzw33's "rulegolfer" script and put it on github.
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

User avatar
May13
Posts: 789
Joined: March 11th, 2021, 8:33 am

Re: Rulegolfer script

Post by May13 » August 17th, 2022, 9:04 am

Script throws an error after running:

Code: Select all

$ python search.py

Choosing a good initial rule in 5 candidates...
Traceback (most recent call last):
  File "search.py", line 91, in <module>
    golf()
  File "search.py", line 65, in golf
    rule = init_rule()
  File "search.py", line 58, in init_rule
    score = rule_eval(rule, high_score)
  File "search.py", line 34, in rule_eval
    ret += evaluate(find_spaceship(rule, p, y, maxw))
  File "search.py", line 29, in find_spaceship
    return Failure(int(match[1]))
TypeError: 'NoneType' object is not subscriptable
I'm using Cygwin.
The latest version of hex-gliders.db have 668 gliders from OT hexagonal rules. Let's find more!
My CA (13 rules)
My scripts: new-glider.py v0.2 (new version), nbsearch2a.py, collector.py v0.3

User avatar
pzq_alex
Posts: 793
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: Rulegolfer script

Post by pzq_alex » August 17th, 2022, 9:22 am

May13 wrote:
August 17th, 2022, 9:04 am
Script throws an error after running:

Code: Select all

$ python search.py

Choosing a good initial rule in 5 candidates...
Traceback (most recent call last):
  File "search.py", line 91, in <module>
    golf()
  File "search.py", line 65, in golf
    rule = init_rule()
  File "search.py", line 58, in init_rule
    score = rule_eval(rule, high_score)
  File "search.py", line 34, in rule_eval
    ret += evaluate(find_spaceship(rule, p, y, maxw))
  File "search.py", line 29, in find_spaceship
    return Failure(int(match[1]))
TypeError: 'NoneType' object is not subscriptable
I'm using Cygwin.
Can you tell me the contents of the file .tmp_out?
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

User avatar
May13
Posts: 789
Joined: March 11th, 2021, 8:33 am

Re: Rulegolfer script

Post by May13 » August 17th, 2022, 9:28 am

pzq_alex wrote:
August 17th, 2022, 9:22 am
May13 wrote:
August 17th, 2022, 9:04 am
Script throws an error after running:

Code: Select all

$ python search.py

Choosing a good initial rule in 5 candidates...
Traceback (most recent call last):
  File "search.py", line 91, in <module>
    golf()
  File "search.py", line 65, in golf
    rule = init_rule()
  File "search.py", line 58, in init_rule
    score = rule_eval(rule, high_score)
  File "search.py", line 34, in rule_eval
    ret += evaluate(find_spaceship(rule, p, y, maxw))
  File "search.py", line 29, in find_spaceship
    return Failure(int(match[1]))
TypeError: 'NoneType' object is not subscriptable
I'm using Cygwin.
Can you tell me the contents of the file .tmp_out?
.tmp_out contains no text.
The latest version of hex-gliders.db have 668 gliders from OT hexagonal rules. Let's find more!
My CA (13 rules)
My scripts: new-glider.py v0.2 (new version), nbsearch2a.py, collector.py v0.3

User avatar
pzq_alex
Posts: 793
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: Rulegolfer script

Post by pzq_alex » August 17th, 2022, 9:35 am

May13 wrote:
August 17th, 2022, 9:28 am
.tmp_out contains no text.
That means the executable at qfind_path is broken or you forgot to configure the variable. (qfind_path is a config variable declared near the beginning of search.py .)
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

User avatar
May13
Posts: 789
Joined: March 11th, 2021, 8:33 am

Re: Rulegolfer script

Post by May13 » August 17th, 2022, 9:59 am

qfind.exe was in folder ~/C, so I mistyped qfind_path = '~/C'. It seems that '~/C/qfind.exe' works (speeds = [(5, 2, 8 )]):

Code: Select all

$ python search.py

Choosing a good initial rule in 5 candidates...
New high score: 12855504354071922204335696738729300820177623950262342682411008.000000 (B2c3ckanjqry4kinr5caq6ei/S02ceka3ckinqry4ckqytw5inj8)
New high score: 12855504354071922204335696738729300820177623950262342682411008.000000 (B2ci3ckanjqry4kinr5caq6ei/S02ceka3ckinqry4ckqytw5inj8)
New high score: 62672162783232.000000 (B2c3ckanjqy4kinr5caq6ei/S02ceka3ckinqry4ckqytw5inj8)
New high score: 274877906944.000000 (B2c3ckanjqry4kinry5caq6ei/S02ceka3ckinqry4ckqytw5inj8)

Spaceship in 4th candidate with logical width 9:

Code: Select all

x = 17, y = 58, rule = B2c3-ei4iknry5acq6ei/S02-in3-aej4ckqtwy5ijn8
6bo3bo$5bo5bo$4b2obobob2o$3b2o2b3o2b2o2$4b3o3b3o$3bobo5bobo$2b5o3b5o$
3b2obobobob2o$4b4ob4o$4b2o5b2o$7bobo$4b2o2bo2b2o$6b2ob2o$3bo2b5o2bo$3b
3obobob3o$2b2o4bo4b2o$b3o3b3o3b3o$2bobobo3bobobo$2ob2ob5ob2ob2o$3b2o2b
3o2b2o$2b2o2bo3bo2b2o$3bo2bobobo2bo$4bo3bo3bo$7bobo$b4obo3bob4o$3bobo
5bobo$3bo2bobobo2bo$5bobobobo$4bobobobobo$3bobobobobobo$2b13o2$5b7o$5b
obobobo$6b2ob2o$5b3ob3o$4b4ob4o$3b4o3b4o$4b3obob3o$4b2o5b2o$4b3obob3o$
5bobobobo$5b7o$5bobobobo$3b2o7b2o$2b2o2b2ob2o2b2o$2b4ob3ob4o$2bo11bo$
3bo9bo$5bobobobo$4bobo3bobo$4bobo3bobo$4bob2ob2obo$3b2ob5ob2o$4bo2b3o
2bo$4b2o5b2o$5bo5bo!
Edit: it looks like this script is calculating the score incorrectly due to gutter symmetry. "Partial" in candidate with score 16384:

Code: Select all

x = 17, y = 77, rule = B2c3-ei4iknr5acq6ei/S02-in3-aej4ckqrtwy5ijn8
4bo7bo$3bobobobobobo$2bob2obobob2obo$6b2ob2o$3b3o5b3o$2b2o2b2ob2o2b2o$
3b2obo3bob2o$3b2o7b2o$b2o11b2o$bo5bobo5bo$5bo5bo$2bobo7bobo$3b4o3b4o$
4b3o3b3o$3b2obo3bob2o$2b2ob3ob3ob2o$bobob2o3b2obobo$bo5bobo5bo$3bobobo
bobobo$4b2obobob2o$5bobobobo$2b2o9b2o$b2obobo3bobob2o$bo3bo5bo3bo$5bo
5bo$3b5ob5o$2b2o3bobo3b2o$4b2o5b2o$4b3o3b3o$5bo5bo$2bobobo3bobobo$b3o
9b3o$3ob2o5b2ob3o$3o11b3o2$4bo7bo$bob2o7b2obo$bobo9bobo$b2o11b2o$b3o9b
3o$2bo2b2o3b2o2bo$2bo3bo3bo3bo$4bob2ob2obo$2bobo7bobo$bo3bo5bo3bo$4bo
7bo$7bobo$4bo2bobo2bo2$5bo5bo$2b2obo5bob2o$2b3o7b3o$4bo7bo$b2ob2obobob
2ob2o$bob2obo3bob2obo$2b2ob3ob3ob2o$2bobob2ob2obobo$2o13b2o$obo2b2o3b
2o2bobo$b3obo5bob3o$2b3obo3bob3o$2bo2bo5bo2bo$5bobobobo$3bo2b2ob2o2bo$
2bob3o3b3obo$2bo3bo3bo3bo$b5o5b5o$b2o2bobobobo2b2o$3b3o5b3o$3b2o2bobo
2b2o$4b4ob4o$b5obobob5o$bo3bo5bo3bo$b2obo2bobo2bob2o$bo4bo3bo4bo$2b2o
2bo3bo2b2o$o3b3o3b3o3bo!
The latest version of hex-gliders.db have 668 gliders from OT hexagonal rules. Let's find more!
My CA (13 rules)
My scripts: new-glider.py v0.2 (new version), nbsearch2a.py, collector.py v0.3

User avatar
pzq_alex
Posts: 793
Joined: May 1st, 2021, 9:00 pm
Location: tell me if you know

Re: Rulegolfer script

Post by pzq_alex » August 17th, 2022, 11:01 am

May13 wrote:
August 17th, 2022, 9:59 am
Edit: it looks like this script is calculating the score incorrectly due to gutter symmetry. "Partial" in candidate with score 16384:

Code: Select all

x = 17, y = 77, rule = B2c3-ei4iknr5acq6ei/S02-in3-aej4ckqrtwy5ijn8
4bo7bo$3bobobobobobo$2bob2obobob2obo$6b2ob2o$3b3o5b3o$2b2o2b2ob2o2b2o$
3b2obo3bob2o$3b2o7b2o$b2o11b2o$bo5bobo5bo$5bo5bo$2bobo7bobo$3b4o3b4o$
4b3o3b3o$3b2obo3bob2o$2b2ob3ob3ob2o$bobob2o3b2obobo$bo5bobo5bo$3bobobo
bobobo$4b2obobob2o$5bobobobo$2b2o9b2o$b2obobo3bobob2o$bo3bo5bo3bo$5bo
5bo$3b5ob5o$2b2o3bobo3b2o$4b2o5b2o$4b3o3b3o$5bo5bo$2bobobo3bobobo$b3o
9b3o$3ob2o5b2ob3o$3o11b3o2$4bo7bo$bob2o7b2obo$bobo9bobo$b2o11b2o$b3o9b
3o$2bo2b2o3b2o2bo$2bo3bo3bo3bo$4bob2ob2obo$2bobo7bobo$bo3bo5bo3bo$4bo
7bo$7bobo$4bo2bobo2bo2$5bo5bo$2b2obo5bob2o$2b3o7b3o$4bo7bo$b2ob2obobob
2ob2o$bob2obo3bob2obo$2b2ob3ob3ob2o$2bobob2ob2obobo$2o13b2o$obo2b2o3b
2o2bobo$b3obo5bob3o$2b3obo3bob3o$2bo2bo5bo2bo$5bobobobo$3bo2b2ob2o2bo$
2bob3o3b3obo$2bo3bo3bo3bo$b5o5b5o$b2o2bobobobo2b2o$3b3o5b3o$3b2o2bobo
2b2o$4b4ob4o$b5obobob5o$bo3bo5bo3bo$b2obo2bobo2bob2o$bo4bo3bo4bo$2b2o
2bo3bo2b2o$o3b3o3b3o3bo!
Hmm. I’m currently away from my computer so I cannot push a fix, but modifying the “eog” in the script to “eoa” should work.
\sum_{n=1}^\infty H_n/n^2 = \zeta(3)

How much of current CA technology can I redevelop "on a desert island"?

Post Reply