For scripts to aid with computation or simulation in cellular automata.
6 posts • Page 1 of 1
Huh, yes, the "rule/options" part of the instructions isn't all that clear, is it?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.
Based on a quick look at the parsing code,gsearch source code wrote:usage: gsearch rule/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
- 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.
Looks like you're going to have trouble with the default definition of GLIDERDB, also. There's a copy atdvgrn 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...
and another one at
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.
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.Zacinfinity wrote:Thanks, but it still doesn't work.
There is an update to glider.db in the Other CA forum, though it hasn't been updated recently.dvgrn wrote:Is there a more recent copy of glider.db anywhere else?
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.