apgsearch v4.0
-
- Posts: 318
- Joined: January 24th, 2018, 4:36 pm
- Location: The hertzsprung gap
Re: apgsearch v4.0
can you make it work on non-x86-64 machines?
Look at me! I make patterns in golly and go on the forums! I wanna be Famous!
Re: apgsearch v4.0
Any progress updates on how this is getting on? I remain intrigued by this rulespace.calcyman wrote:In terms of further rule families, the next one I intend to implement is outer-totalistic rules up to range 5.muzik wrote:Seems like a valid next step. The other two main ones I can think of would be B0 non-totalistic and LTL Generations.
Help wanted: How can we accurately notate any 1D replicator?
-
- Posts: 1334
- Joined: July 1st, 2016, 3:58 pm
Re: apgsearch v4.0
I kind of hope that update will come to Golly as well, so we can actually run those rules.muzik wrote: Any progress updates on how this is getting on? I remain intrigued by this rulespace.
I manage the 5S project, which collects all known spaceship speeds in Isotropic Non-totalistic rules. I also wrote EPE, a tool for searching in the INT rulespace.
Things to work on:
- Find (7,1)c/8 and 9c/10 ships in non-B0 INT.
- EPE improvements.
Things to work on:
- Find (7,1)c/8 and 9c/10 ships in non-B0 INT.
- EPE improvements.
Re: apgsearch v4.0
How about non-totalistic hexagonal rules? I would think those would be a fairly trivial variant of non-totalistic Moore neighborhood rules. The original HexLife from the Lifelines (B2om/S2H) is one of these, as is Callahan's hexagonal rule (B2o/S2m34H). These can, of course, be done using rule tables, but it seems like QuickLife and HashLife should be able to do these virtually free.calcyman wrote:In terms of further rule families, the next one I intend to implement is outer-totalistic rules up to range 5.
Re: apgsearch v4.0
We have them for free already, don't we? Isotropic hexagonal rules must be a subset of anisotropic non-totalistic MAP rules, which are available both in LifeViewer and in recent versions of Golly.mniemiec wrote:How about non-totalistic hexagonal rules? I would think those would be a fairly trivial variant of non-totalistic Moore neighborhood rules. The original HexLife from the Lifelines (B2om/S2H) is one of these, as is Callahan's hexagonal rule (B2o/S2m34H). These can, of course, be done using rule tables, but it seems like QuickLife and HashLife should be able to do these virtually free.calcyman wrote:In terms of further rule families, the next one I intend to implement is outer-totalistic rules up to range 5.
I haven't worked out how to do the translation to MAP format yet, exactly -- partly because I can't seem to find a definition of the hex neighborhoods you mention. What are "o" and "m", and what other letters are available?
There's some mention of HexLife in LifeLine #2, but no Hensel-notation-ish letters... I can see from the LifeLine definition that 2o and 2m must be two-cells-adjacent and 2-cells-at-120-degrees, but I don't know which is which.
Anyway, yes, it would certainly be nice to support rule strings like "B2om/S2H" instead of (whatever the equivalent 86-character MAP rule is) -- with nice hexagonal rendering in the case of lifeviewer.lua, and at least a semi-reasonable rendering for LifeViewer:
Code: Select all
x = 11, y = 9, rule = B3/S1345H
8o$9o$2o2bobob2o$b8o$2b2ob3ob2o$4b2ob4o$4bob2ob2o$4b5obo$5b3o!
#C [[ GRID GPS 2 AUTOSTART ]]
Re: apgsearch v4.0
Here are some relevant forum posts:dvgrn wrote: I haven't worked out how to do the translation to MAP format yet, exactly -- partly because I can't seem to find a definition of the hex neighborhoods you mention. What are "o" and "m", and what other letters are available?
Notation: http://conwaylife.com/forums/viewtopic.php?p=6822#p6822
Extended notation: http://conwaylife.com/forums/viewtopic. ... 073#p11073
Conversion to MAP script: http://conwaylife.com/forums/viewtopic. ... 715#p55715
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.
Semi-active here - recovering from a severe case of LWTDS.
-
- Posts: 1175
- Joined: June 14th, 2014, 5:03 pm
- Contact:
Re: apgsearch v4.0
2o is adjacent and 2m is 120°
Re: apgsearch v4.0
Thanks for the links. I tried various searches for "HexLife" but didn't turn up that thread.
Here's a copy of vyznev's script with a few more links and attribution in the comments.
Seems to be in working order -- I tried one of Paul Callahan's rule-less RLE chunks from his "hexrule" article.
Interestingly, while "x = 270, y = 51, rule = B2o/S2m34" doesn't work in either Golly or LifeViewer, the MAP string produced by vyznev's script works fine in Golly, but not in LifeViewer:
My apologies if most of this is old news to everyone else -- I haven't done much with hex rules up to this point, and hadn't noticed that a reasonably standard isotropic hex format was available.
Here's a copy of vyznev's script with a few more links and attribution in the comments.
Code: Select all
#!/usr/bin/python
"""
This script converts hexagonal isotropic (possibly non-totalistic) CA rules[1]
into the equivalent MAP rules[2]. It runs under both Python 2 and Python 3, and
can be used either as a stand-alone script (with the rules given as command line
arguments) or run directly in Golly. Posted[3] to github 27 Jan 2018 by vyznev[4].
Copy posted to forums (with these additional notes) 17 Mar 2018 [5].
[1]: http://www.conwaylife.com/wiki/Isotropic_non-totalistic_Life-like_cellular_automaton#Hexagonal_neighbourhood
[2]: http://golly.sourceforge.net/Help/Algorithms/QuickLife.html
[3]: http://conwaylife.com/forums/viewtopic.php?p=55715#p55715
[4]: https://gist.github.com/vyznev/0ef7eb2ac98645b284dc8e647f10d685
[5]: http://conwaylife.com/forums/viewtopic.php?f=7&t=3049&p=58058#p58058
"""
import re
from base64 import b64encode
def hex2map (rulestr, mapbits=7):
"""
Convert a hexagonal isotropic (possibly non-totalistic) CA rule string
into the equivalent MAP rule. By default, the result will be a 3+22
character hex MAP rule string; to generate a 3+86 character rectangular
MAP rule, use mapbits=9 instead of the default mapbits=7.
"""
# validate rule string format and extract the birth/survive strings
match = re.match(
"^\s*b((?:[0156]|[234]-?[omp]*)*)/s((?:[0156]|[234]-?[omp]*)*)h\s*$",
rulestr.lower()
)
if not match:
return None
# initialize rule structure (list of lists of dicts)
hexrule = [ [], [] ]
for array in hexrule:
for count in range(7):
array.append({"o": 0, "m": 0, "p": 0})
# set birth/survive bits in rule based on input string
for oldstate in range(2):
nhoods = match.group(oldstate + 1)
for m in re.finditer("([0-6])(-?)([omp]*)", nhoods):
count = int(m.group(1))
negate = bool(m.group(2))
letters = m.group(3)
for letter in "omp":
newstate = 0
if letter in letters or not letters:
newstate = 1
if negate and letters:
newstate = 1 - newstate
hexrule[oldstate][count][letter] = newstate
# convert hex rule to map rule
maprule = bytearray(2**mapbits // 8)
for mapindex in range(2**mapbits):
bits = [ (mapindex >> i) & 1 for i in reversed(range(mapbits)) ]
# reorder bits in clockwise order around the center cell
if mapbits == 7:
neighbors = [bits[i] for i in (0,1,4,6,5,2)]
oldstate = bits[3]
elif mapbits == 9:
# ignore bits 2=NE and 6=SW
neighbors = [bits[i] for i in (0,1,5,8,7,3)]
oldstate = bits[4]
else:
raise NotImplementedError("only 7 and 9 bit MAPs are supported")
count = sum(neighbors)
# canonicalize neighbors so that the longest run of dead cells
# comes first and the longest run of live cells comes last
rotations = [neighbors, list(reversed(neighbors))]
while len(rotations) < 12:
neighbors.append(neighbors.pop(0))
rotations += [neighbors, list(reversed(neighbors))]
neighbors = min(rotations)
# determine symmetry letter from longest run
# (this always yields "o" for 0/1/5/6 neighbors)
if count <= 3:
maxgap = 0
while maxgap < 6 and not neighbors[maxgap]:
maxgap += 1
letter = "omp"[6 - count - maxgap]
else:
maxrun = 0
while maxrun < 6 and neighbors[5 - maxrun]:
maxrun += 1
letter = "omp"[count - maxrun]
# set bit in map rule
if hexrule[oldstate][count][letter]:
maprule[mapindex // 8] |= (0x80 >> (mapindex % 8))
# return base64 encoded map
return "MAP" + b64encode(maprule).decode('ascii').strip("=")
if __name__ == '__main__':
# looks like we're being run as a stand-alone script
import argparse
parser = argparse.ArgumentParser(description='Convert hex CA rule strings to MAP rules.')
parser.add_argument('rule', nargs='+', help='input hex rule (e.g. B245/S3H or B2o/S2m34H)')
parser.add_argument('-l', '--long-map', dest='mapbits', action='store_const', const=9, default=7,
help='generate 3+86 character instead of 3+22 character MAP rules')
args = parser.parse_args()
for hexrule in args.rule:
maprule = hex2map(hexrule, args.mapbits)
if maprule:
print(maprule)
else:
print(hexrule + " does not look like a valid hex rule. :(")
else:
# assume we're being run as a Golly plug-in
import golly as g
prompt = "Enter hex rule (e.g. B245/S3H or B2o/S2m34H):"
hexrule = "B2o/S2m34H"
while True:
hexrule = g.getstring(prompt, hexrule, "Set Hex Rule")
maprule = hex2map(hexrule)
if maprule:
g.setrule(maprule)
break
else:
prompt = "The string you entered does not appear to be a valid hex rule. Try again:"
Interestingly, while "x = 270, y = 51, rule = B2o/S2m34" doesn't work in either Golly or LifeViewer, the MAP string produced by vyznev's script works fine in Golly, but not in LifeViewer:
Code: Select all
x = 270, y = 51, rule = MAPFAMgVwhXAP4AP4B+gH4A6A
17bo$17bobobo$17bo3b2o$20b2o$20bo$3bobo14b2o$3b4o13bob2o$4bo2bo12bo2bo
$5bobo15bo$5b4o$5bo2$o$obobo13bo$o3b2o12b3o$3b2o13bo2bo$3bo13b3ob2o$3b
2o15b2o$3bob2o14b2o$3bo2bo$6bo74bo$81bo$81bo2bo$81bo$82bo5$31b3o7b3o$
30b2o2bo5b3o2b2o219bo$31bo11bo222bobo$31b3o10bob2o220bo$31bobo10bo220b
2o$34bo232bobo$268b2o$268b2o$268bo5$12bo3$16b4o$15b2o$15b5o2$20bo$20bo
bo!
Re: apgsearch v4.0
Would such rules then be allowable into the 5s project, provided they're two-state?AforAmpere wrote:I kind of hope that update will come to Golly as well, so we can actually run those rules.muzik wrote: Any progress updates on how this is getting on? I remain intrigued by this rulespace.
Help wanted: How can we accurately notate any 1D replicator?
Re: apgsearch v4.0
I think using rules with ranges >1 would be too large a change for the current project, but maybe a separate database could be created for those rules.muzik wrote:Would such rules then be allowable into the 5s project, provided they're two-state?AforAmpere wrote:I kind of hope that update will come to Golly as well, so we can actually run those rules.muzik wrote: Any progress updates on how this is getting on? I remain intrigued by this rulespace.
Re: apgsearch v4.0
...you are aware that catagolue and apgluxe have been handling LtL rules up to range 7 fine for the past seven months or so?77topaz wrote:I think using rules with ranges >1 would be too large a change for the current project, but maybe a separate database could be created for those rules.
Help wanted: How can we accurately notate any 1D replicator?
Re: apgsearch v4.0
That's not the problem. The problem is that we would have so many new speeds caused by adding these rules that it would make things more difficult.muzik wrote:...you are aware that catagolue and apgluxe have been handling LtL rules up to range 7 fine for the past seven months or so?
Re: apgsearch v4.0
Yes, that was my point. I don't know what Catagolue and apgluxe have to do with it; I mean, they can also run B0 rules, but B0 ships aren't included in the main 5s project for the same reason. Still, I think separate side-projects for B0 and LtL ships could be done.danny wrote:That's not the problem. The problem is that we would have so many new speeds caused by adding these rules that it would make things more difficult.muzik wrote:...you are aware that catagolue and apgluxe have been handling LtL rules up to range 7 fine for the past seven months or so?
-
- Posts: 1334
- Joined: July 1st, 2016, 3:58 pm
Re: apgsearch v4.0
Yeah, as I said in the 5s thread, if someone wants to take the job for LTL rules, go ahead, make a supplementary collection. B0 is already taken, though seldom updated as of now.
I manage the 5S project, which collects all known spaceship speeds in Isotropic Non-totalistic rules. I also wrote EPE, a tool for searching in the INT rulespace.
Things to work on:
- Find (7,1)c/8 and 9c/10 ships in non-B0 INT.
- EPE improvements.
Things to work on:
- Find (7,1)c/8 and 9c/10 ships in non-B0 INT.
- EPE improvements.
- Majestas32
- Posts: 549
- Joined: November 20th, 2017, 12:22 pm
- Location: 'Merica
Re: apgsearch v4.0
Will update b0 collection Tuesday
Searching:
b2-a5k6n7cs12-i3ij4k5j8
b2-a3c7cs12-i
Currently looking for help searching these rules.
b2-a5k6n7cs12-i3ij4k5j8
b2-a3c7cs12-i
Currently looking for help searching these rules.
Re: apgsearch v4.0
Don't know if I've suggested this before, but here's some suggestions for symmetry operators:
x - Explodes the soup on the x axis.
y - Explodes the soup on the y axis.
Code: Select all
x = 16, y = 16, rule = B3/S23
2o6bob3ob2o$3b2o3b2o2b2o$b5ob2o3bo$4b7o2b3o$bobob2ob5o2bo$o2bob2ob6obo
$o3bo3b3o4bo$o2bob3ob3obo$2o2b2o3bo4bo$6obob6o$b2o2b4o2b2o2bo$obobo2b
3obobobo$b4ob2o4b2o$bobobobob6o$ob2ob3o4bo2bo$o3bo5b2obobo!
Code: Select all
x = 31, y = 16, rule = B3/S23
obo13bo3bobobo3bobo$6bobo7bobo5bobo$2bobobobobo3bobo7bo$8bobobobobobob
o5bobobo$2bo3bo3bobo3bobobobobo5bo$o5bo3bobo3bobobobobobo3bo$o7bo7bobo
bo9bo$o5bo3bobobo3bobobo3bo$obo5bobo7bo9bo$obobobobobo3bo3bobobobobobo
$2bobo5bobobobo5bobo5bo$o3bo3bo5bobobo3bo3bo3bo$2bobobobo3bobo9bobo$2b
o3bo3bo3bo3bobobobobobo$o3bobo3bobobo9bo5bo$o7bo11bobo3bo3bo!
Code: Select all
x = 16, y = 31, rule = B3/S23
2o6bob3ob2o2$3b2o3b2o2b2o2$b5ob2o3bo2$4b7o2b3o2$bobob2ob5o2bo2$o2bob2o
b6obo2$o3bo3b3o4bo2$o2bob3ob3obo2$2o2b2o3bo4bo2$6obob6o2$b2o2b4o2b2o2b
o2$obobo2b3obobobo2$b4ob2o4b2o2$bobobobob6o2$ob2ob3o4bo2bo2$o3bo5b2obo
bo!
Help wanted: How can we accurately notate any 1D replicator?
Re: apgsearch v4.0
My biggest suggestion is D2_x-skewgutter, like so:
Code: Select all
x = 16, y = 15, rule = B2ci3ai4c8/S02ae3eijkq4iz5ar6i7e
6b2o6b2o$3b3obobobobobo$bo3bo4bo3bo$bo4b5o4bo$b2o3bo5bob2o$o2b2o2bobob
ob2o$2obobo2b2o2bo2bo$3bo2bo2bobobo$bobob3o2b2ob3o$2b2o4bo2b3obo$bo3bo
b3o2b2obo$4bobo2b2o4bo$bo3bob4o4bo$obob2o2bo$2ob2obob5o!
Re: apgsearch v4.0
When you enter a rulestring in the incorrect "B3/S23" format instead of "b3s23", apgsearch becomes stuck in an infinite loop during the setup process; it would be better for the script to simply post an error message like "invalid rulestring" and halt, rather than having this loop.
Re: apgsearch v4.0
What makes B2cei3ary4aeiry5any/S2-c3-inq4ikry5eijr6i (Spaghetti2) so hard to search?
Re: apgsearch v4.0
Perhaps apgluxe and catagolue should start supporting Circular LTL neighborhoods since it's also in golly now?
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: apgsearch v4.0
Patches/pull requests welcome, I'm sure.Saka wrote:Perhaps apgluxe and catagolue should start supporting Circular LTL neighborhoods since it's also in golly now?
If you speak, your speech must be better than your silence would have been. — Arabian proverb
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Small tori in apgluxe?
My wish for the next or one of the next versions of apgsearch / apgluxe is the support of (small) tori (via the rulestring) so that we can do a joint distributed effort to fully explore at least the 7x7 and 8x8 tori. This would then not start with a random soup (and the unique seed for the random generator) but with a designated 'slice' of the entire 7x7 or 8x8 universe of starting patterns, and apgluxe would take care of the slicing so that in the end we have an entire cake. It would be a finite [sub-]project with a foreseeable end, contrary to what apgluxe is doing today.
For exploration of small tori, I think it would be best to always consider the entire torus as an "object", and not trying to count blocks or blinkers etc within the ash. The entire torus would be the ash object, at least up to 8x8 (which seems to be a natural limit to exhaustive / brute-force exploration). Only 'canonical' patterns would be considered different, all others are derivatives. A 'block' would be a 7x7 (or 8x8) torus with one block and nothing else, no matter where on the torus it is located. Same for 'blinker' etc.
Just my 2 cents ... feedback welcome.
Frank
For exploration of small tori, I think it would be best to always consider the entire torus as an "object", and not trying to count blocks or blinkers etc within the ash. The entire torus would be the ash object, at least up to 8x8 (which seems to be a natural limit to exhaustive / brute-force exploration). Only 'canonical' patterns would be considered different, all others are derivatives. A 'block' would be a 7x7 (or 8x8) torus with one block and nothing else, no matter where on the torus it is located. Same for 'blinker' etc.
Just my 2 cents ... feedback welcome.
Frank
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Small tori in apgluxe?
Support for toroidal universes in apgsearch would be great --- I think there's some rudimentary support for this server-side, rulestrings anyway, but not yet in the client.F_rank wrote:Just my 2 cents ... feedback welcome.
Frank
For an exhaustive search of small tori, I think a separate client would work better. There's prior art for this --- slow salvos were investigated using a different tool called hs (HoneySearch), and Calcyman's on record saying that Catagolue basically acts as a generic object datastore anyway. You can feed it data from soup searches --- but you don't have to.
So yeah, I'd suggest a different project (which could start as a fork of apgsearch of course). Lifelib is a separate project these days anyway; I don't recall off-hand if the object classification code etc. is also in there somewhere, but if not it should be easily moved over from apgsearch.
How about having a go at it yourself? This seems like a cool project, and a great opportunity to learn how to work with lifelib.
If you speak, your speech must be better than your silence would have been. — Arabian proverb
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Catagolue: Apple Bottom • Life Wiki: Apple Bottom • Twitter: @_AppleBottom_
Proud member of the Pattern Raiders!
Re: apgsearch v4.0
I agree that this really needs to be a separate client program (with Catagolue as the server, of course, for simplicity).
At this stage, before anyone programs anything, it's worth discussing how best to represent objects in a toroidal universe.
At this stage, before anyone programs anything, it's worth discussing how best to represent objects in a toroidal universe.
What do you do with ill crystallographers? Take them to the mono-clinic!
Re: apgsearch v4.0
Searching rules such as B012345678/S023456 spams pathologicals everywhere, why is this?
Help wanted: How can we accurately notate any 1D replicator?