How Do I Use Gsearch

For scripts to aid with computation or simulation in cellular automata.
Post Reply
Zacinfinity
Posts: 26
Joined: March 11th, 2017, 9:12 pm

How Do I Use Gsearch

Post by Zacinfinity » April 20th, 2017, 10:51 am

I FINALLY found a program that works on repl.it(an online compiler), but how do I use Gsearch. I can't even find out how to specify the ruleset. Can someone please help me.

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

Re: How Do I Use Gsearch

Post by dvgrn » April 20th, 2017, 11:27 am

Zacinfinity wrote:I FINALLY found a program that works on repl.it(an online compiler), but how do I use Gsearch. I can't even find out how to specify the ruleset.
Huh, yes, the "rule/options" part of the instructions isn't all that clear, is it?
gsearch source code wrote:usage: gsearch rule/options
available options
  /lNN searches for NN*NN patterns (default DEFAULT_PATSIZE = 6 in source)
  /gNN limits gap between small phases to NN generations (default MAX_GENERATIONS = 50000 in source)
  /kNN kills still lifes separated from main body by NN positions
  /eNN kills small active regions separated from main body by NN empty columns
  /rNN repeatedly searches with randomly chosen rules using NN as seed
  /oNN outputs oscillators of period at least NN
  /pNN outputs photons of period at least NN
  /xNN prevents random testing of rules with survival when there are NN neighbors
  /zNN prevents random testing of rules with births when there are NN neighbors
Based on a quick look at the parsing code,

- you don't have to include a rule in your command line, if you use the /r switch;

- you can add any number of the above switches on the command line, NOT separated by spaces
     (that's what the "rule/options" is hinting at);

- the simplest way to run gsearch should be simply "gsearch B3S23" at the command line
     (or the rule of your choice)
     (you get nice explanations when you try to search a rule that can't possibly have gliders)


- otherwise your command might look like "gsearch B3S23/k5/o7" (pick your additional switches)

Disclaimer: I've never run gsearch, so I could quite possibly be reading the source code wrong somehow.

EDIT: Yikes -- PARAM_IS_BITMASK for the first four switches, so gsearch is expecting 'B', 'S', 'X' and 'Z' values to be in binary. Have adjusted my notes above, but maybe still not correctly...
EDIT2: Changed the notes back again after a re-read -- I wasn't reading the bit-shifting trickery correctly:
if (PARAM_IS_BITMASK(param)) params[param] |= 1 << (*s - '0'); just means "add a 1 to the binary representation of the rule, at the location specified by the current digit 0..8". It's not actually expecting the input to be in binary. Sorry about that.

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

Re: How Do I Use Gsearch

Post by dvgrn » April 20th, 2017, 12:02 pm

dvgrn wrote:EDIT: Yikes -- PARAM_IS_BITMASK for the first four switches, so gsearch is expecting 'B', 'S', 'X' and 'Z' values to be in binary. Have adjusted my notes above, but maybe still not correctly...
Looks like you're going to have trouble with the default definition of GLIDERDB, also. There's a copy at

https://www.ics.uci.edu/~eppstein/ca/glider.db

and another one at

http://fano.ics.uci.edu/glider.db

but neither of those quite matches the path given in the source code. You should probably copy that file to a local folder on your machine anyway, and set up the GLIDERDB variable to point to that location.

Has anyone else been running gsearch recently, who might be able to give better advice? Looks like codeholic at least has gotten it running, a couple of years ago. Is there a more recent copy of glider.db anywhere else?

EDIT: Just fixed my best guess at syntax, in the last post. The PARAM_IS_BITMASK variable name sent me off in entirely the wrong direction.

Zacinfinity
Posts: 26
Joined: March 11th, 2017, 9:12 pm

Re: How Do I Use Gsearch

Post by Zacinfinity » April 20th, 2017, 7:03 pm

Thanks, but it still doesn't work.

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

Re: How Do I Use Gsearch

Post by dvgrn » April 20th, 2017, 7:10 pm

Zacinfinity wrote:Thanks, but it still doesn't work.
What's the error message, if any? Look up the error message in the source code, and eventually (with enough pain and suffering) you'll be able to figure out what's going wrong.

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

Re: How Do I Use Gsearch

Post by wildmyron » April 20th, 2017, 10:21 pm

dvgrn wrote:Is there a more recent copy of glider.db anywhere else?
There is an update to glider.db in the Other CA forum, though it hasn't been updated recently.

I did run gsearch some years ago but unfortunately lost the drive it was on and haven't bothered to recompile it. That was on windows anyway, so I don't think I can provide any advice on that front.
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