Thanks, that's exactly what I was looking forcalcyman wrote:For non-totalistic isotropic rules, it delegates to ntcanon.py.
Script request thread
Re: Script request thread
Re: Script request thread
A version of apgluxe that quits and restarts if the ram usage exceeds a certain limit
- Apple Bottom
- Posts: 1034
- Joined: July 27th, 2015, 2:06 pm
- Contact:
Re: Script request thread
You can probably rig up something using ulimit(1). Set a memory limit, and create a wrapper script that detects whether apgluxe aborted due to a failed allocation and restarts it if so.danny wrote:A version of apgluxe that quits and restarts if the ram usage exceeds a certain limit
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: Script request thread
Since Golly doesnt support them yet for some reason, can we get a script that changes a non-totalistic hexagonal rule into its MAP string?
Help wanted: How can we accurately notate any 1D replicator?
Re: Script request thread
A search script that can search bounded grids for objects. I want to search my favorite rule that I made, Platoon (B2cek3i/S12-ak).
Re: Script request thread
Here you go, this should do it: https://gist.github.com/vyznev/0ef7eb2a ... 647f10d685muzik wrote:Since Golly doesnt support them yet for some reason, can we get a script that changes a non-totalistic hexagonal rule into its MAP string?
The script can be used either as a Golly plugin or as a stand-along script with the rules given as command line arguments. When used on the command line, it can output either 3+22 character hex MAP rules or, with the optional --long-map (or -l) switch, 3+86 character rectangular MAP rules that simply ignore the NE and SW corner neighbors.
(When called from Golly, the script always generates 22 character MAP rules, since that way Golly will draw live cells as hexagons when zoomed in.)
I haven't tested this code very extensively, but it seems to work at least for the totalistic rule B245/S3H and for Paul Callahan's B2o/S2m34H, so I have some confidence that it may be working correctly in general. If you find any bugs, let me know.
Note that the hex rule parser ignores letter case and leading / trailing whitespace, but will reject rule strings with internal spaces or which lack the final "H". The parser will also silently accept repeated neighbor counts (of which the last one will take effect, if they're followed by different sets of letters), repeated letters for a given neighbor count (which are redundant anyway) and a minus sign followed by no letters (which is effectively ignored). It will, however, reject rules with invalid neighborhood type letters (i.e. other than o/m/p), as well as rules with neighborhood type letters following a digit other than 2, 3 or 4.
As a demonstration, here's Callahan's B2o/S2m34H glider gun:
Code: Select all
x = 25, y = 13, rule = MAPFAMgVwhXAP4AP4B+gH4A6A
17b2o$2bo15b2obo$b2obo13bob2o$2ob3o13b2ob2o$2bobobo13bobo$2b2ob4o3b2o
6bob2o$2bob2obo5b3o4b3obo$13bobo6bo$12b4o$12bo3bo$13b5o$15bo$15bo!
Code: Select all
x = 25, y = 13, rule = MAPEUQAMyIAVXcRRAAzIgBVdwCIVXcAAP/uAIhVdwAA/+4AADP/iAB37gAAM/+IAHfuiAB37gAA7oiIAHfuAADuiA
17b2o$2bo15b2obo$b2obo13bob2o$2ob3o13b2ob2o$2bobobo13bobo$2b2ob4o3b2o
6bob2o$2bob2obo5b3o4b3obo$13bobo6bo$12b4o$12bo3bo$13b5o$15bo$15bo!
Re: Script request thread
Is it possible to make a script that, given an apgcode, looks through Catagolue for rules where that apgcode has appeared and then returns the rule in which that pattern is the most common relative to other patterns (i.e. in which it appears the highest in the list of most common objects)?
Re: Script request thread
This gets a +1 from me because I need to find that one rule where the bun evolves into a monogram77topaz wrote:Is it possible to make a script that, given an apgcode, looks through Catagolue for rules where that apgcode has appeared and then returns the rule in which that pattern is the most common relative to other patterns (i.e. in which it appears the highest in the list of most common objects)?
Re: Script request thread
The support is built and will be in the next released build.vyznev wrote:Alas, LifeViewer doesn't seem to currently support 3+22 character MAP rules, and so refuses to run the pattern above.
LifeViewer https://lazyslug.com/lifeviewer
- Majestas32
- Posts: 549
- Joined: November 20th, 2017, 12:22 pm
- Location: 'Merica
Re: Script request thread
I also need to find the rule with the xp104_hexeh and xp14_eh so +1danny wrote:This gets a +1 from me because I need to find that one rule where the bun evolves into a monogram77topaz wrote:Is it possible to make a script that, given an apgcode, looks through Catagolue for rules where that apgcode has appeared and then returns the rule in which that pattern is the most common relative to other patterns (i.e. in which it appears the highest in the list of most common objects)?
Also the xp170 OMOS from my avatar
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.
- toroidalet
- Posts: 1514
- Joined: August 7th, 2016, 1:48 pm
- Location: My computer
- Contact:
Re: Script request thread
(even though I only know Javascript and not much of it)77topaz wrote:Is it possible to make a script that, given an apgcode, looks through Catagolue for rules where that apgcode has appeared and then returns the rule in which that pattern is the most common relative to other patterns (i.e. in which it appears the highest in the list of most common objects)?
A brute-force search of all 2^98 (about 3.17*10^29) (excluding B0, B1 and B2a) possible non-totalistic rules seems impractical. How would this limitation be surpassed?
B2i3-ck6/S2-i35nMajestas32 wrote:Also the xp170 OMOS from my avatar
Code: Select all
x = 7, y = 3, rule = B2i3-ck4e6/S2-i35n
o5bo$2o3b2o$o5bo!
Any sufficiently advanced software is indistinguishable from malice.
- Majestas32
- Posts: 549
- Joined: November 20th, 2017, 12:22 pm
- Location: 'Merica
Re: Script request thread
Ah thank
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.
- Majestas32
- Posts: 549
- Joined: November 20th, 2017, 12:22 pm
- Location: 'Merica
Re: Script request thread
I mean only a few thousand of those rules have been searched on Catagolue tho.toroidalet wrote: A brute-force search of all 2^98 (about 3.17*10^29) (excluding B0, B1 and B2a) possible non-totalistic rules seems impractical. How would this limitation be surpassed?
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: Script request thread
Indeed, that was my point, the Catagolue database is of a size a lot smaller than 10^29; it should be searchable.Majestas32 wrote:I mean only a few thousand of those rules have been searched on Catagolue tho.toroidalet wrote: A brute-force search of all 2^98 (about 3.17*10^29) (excluding B0, B1 and B2a) possible non-totalistic rules seems impractical. How would this limitation be surpassed?
Re: Script request thread
Can someone update this script to reflect the new catagolue changes?
Re: Script request thread
In case anyone wants to play around with rulespaces, I have made three hopefully useful scripts for converting a range of rules to a partial rule (in Macbi format), to obtain a partial rule from the evolution of a pattern and this one that I am listing here that calculates the cardinality of a given partial rule:
This one is Golly-independent.
For instance, the copperhead gives the partial rule pB3aijnqr4-aijknrtwyz5-cnqry6-cik7-e8/S02aceikn3aejnqry4-aknqrtw5-acijqry6-a7-c8 with a cardinality of 2^37 non-totalistic rules.
The goldenhead gives the partial rule pB3aijnqr4-aijknrtwyz5-cnqry6-ack7e8/S02aceikn3aeijnqry4-aknqrtw5-acijnqry6-ac8 with a cardinality of 2^33 non-totalistic rules available.
The copperhead is present in 16 times more rules than the goldenhead, therefore.
Interestingly, their partial rules are evidently mutually exclusive because they evolve differently.
For comparison, the glider works in 2^82 rules. The way I defined tRules (containing t-ships, gliders, the C2-symmetric xp6 and the cap p4) gives 2^54 rules. Since it is exponential, this is crazy orders of magnitude less than the gliders. (2^28 times less --> 0.01 parts per trillion).
Code: Select all
# cardinality.py (Rhombic, Feb 2018)
# Calculates the non-totalistic cardinality of a partial rule.
# The cardinality of a partial rule is the number of rules in the rulespace defined by the partial conditions.
# This script is Golly-independent.
print "Please input partial rules in appropriate format pB/S."
partial=raw_input("Partial rule: ")[2:]
ntcvals=["c","ce","aceikn","aceijknqry","aceijknqrtwyz","aceijknqry","aceikn","ce","c"]
pbs=partial.split("/S")
names=["Birth","Survival"]
total=0
for W in [0,1]:
pbs[W]+="/"
for cells in xrange(9):
if str(cells) in pbs[W]:
pos=pbs[W].index(str(cells))
for n in xrange(len(pbs[W])):
if pbs[W][pos+n+1] in "012345678/":
length=n
break
else:
pass
if "-" not in pbs[W][pos:pos+length+1]:
N=len(ntcvals[cells])-length
total+=N
print names[W]+" conditions for %d gave "%cells+str(N)+" new combinations."
else:
N=len(ntcvals[cells])-length+1
total+=N
print names[W]+" conditions for %d gave "%cells+str(N)+" new combinations."
else:
pass
print "2^"+str(total)+" rules available."
For instance, the copperhead gives the partial rule pB3aijnqr4-aijknrtwyz5-cnqry6-cik7-e8/S02aceikn3aejnqry4-aknqrtw5-acijqry6-a7-c8 with a cardinality of 2^37 non-totalistic rules.
The goldenhead gives the partial rule pB3aijnqr4-aijknrtwyz5-cnqry6-ack7e8/S02aceikn3aeijnqry4-aknqrtw5-acijnqry6-ac8 with a cardinality of 2^33 non-totalistic rules available.
The copperhead is present in 16 times more rules than the goldenhead, therefore.
Interestingly, their partial rules are evidently mutually exclusive because they evolve differently.
For comparison, the glider works in 2^82 rules. The way I defined tRules (containing t-ships, gliders, the C2-symmetric xp6 and the cap p4) gives 2^54 rules. Since it is exponential, this is crazy orders of magnitude less than the gliders. (2^28 times less --> 0.01 parts per trillion).
-
- Posts: 318
- Joined: January 24th, 2018, 4:36 pm
- Location: The hertzsprung gap
Re: Script request thread
I would like a script that, given a rule and 1-4 elementary spaceships, finds all collisions and outputs them to an rle.
Look at me! I make patterns in golly and go on the forums! I wanna be Famous!
Re: Script request thread
Just two-spaceship collisions right? That's probably doable, but if you have more than two spaceships colliding finding "all" collisions becomes non-trivial (just look at the "enumerating three-glider collisions" thread, and that's for CGoL with one elementary spaceship).googleplex wrote:I would like a script that, given a rule and 1-4 elementary spaceships, finds all collisions and outputs them to an rle.
-
- Posts: 318
- Joined: January 24th, 2018, 4:36 pm
- Location: The hertzsprung gap
Re: Script request thread
Yes, just two ship collisions.77topaz wrote:Just two-spaceship collisions right? That's probably doable, but if you have more than two spaceships colliding finding "all" collisions becomes non-trivial (just look at the "enumerating three-glider collisions" thread, and that's for CGoL with one elementary spaceship).googleplex wrote:I would like a script that, given a rule and 1-4 elementary spaceships, finds all collisions and outputs them to an rle.
Look at me! I make patterns in golly and go on the forums! I wanna be Famous!
Re: Script request thread
A script that outputs the black/white reversal of a non-totalistic rule.
- Majestas32
- Posts: 549
- Joined: November 20th, 2017, 12:22 pm
- Location: 'Merica
Re: Script request thread
And the checkerboard dual too
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: Script request thread
Though, isn't it only rules with the Von Neumann neighbourhood that have checkerboard duals?Majestas32 wrote:And the checkerboard dual too
- praosylen
- Posts: 2446
- Joined: September 13th, 2014, 5:36 pm
- Location: Pembina University, Home of the Gliders
- Contact:
Re: Script request thread
Only self-complementary rules, actually.77topaz wrote:Though, isn't it only rules with the Von Neumann neighbourhood that have checkerboard duals?
former username: A for Awesome
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
praosylen#5847 (Discord)
The only decision I made was made
of flowers, to jump universes to one of springtime in
a land of former winter, where no invisible walls stood,
or could stand for more than a few hours at most...
Re: Script request thread
Hmm. If I'm not totally confused, all self-complementary isotropic rules on the square lattice should indeed have checkerboard duals, but the checkerboard duals of totalistic rules are totalistic only on the von Neumann neighborhood (or, more generally, on any neighborhood where all neighbors of each cell have the same color on the checkerboard). So in a way, you're both right, it just depends on which class of rules (totalistic or general isotropic) you consider.A for awesome wrote:Only self-complementary rules, actually.77topaz wrote:Though, isn't it only rules with the Von Neumann neighbourhood that have checkerboard duals?
- Majestas32
- Posts: 549
- Joined: November 20th, 2017, 12:22 pm
- Location: 'Merica
Re: Script request thread
Isotropic. And I think Calcyman talked about every rule actually having a strobing checkerboard dual?
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.