Page 3 of 5

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 7th, 2015, 7:33 pm
by Kazyan
That pair of...rotated skew long hooks, I think?...looks like a good solution. I was using table-on-table to catch those odd reactions where the other end of the fishhook is used as a rock, actually, not snake-like catalysis.

Request to add to the pile: an option to read in the catalyst list from a separate file, so the user can just call Spartan.in or CommonBellman.in instead of manually messing with the catalyst list in every input file.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 12th, 2015, 1:08 am
by Scorbie
I thought wrong that making symmetric forms of catalysts would make ptbsearch faster. Apparently I was wrong, but I'm still hoping that symmetric catalysts could make Catforce faster. Here are the suggestions:

Code: Select all

x = 21, y = 50, rule = B3/S23
b2obo6b2obo$2b2o8b2o2$2bo9bo$bobo7bobo$2b2o8bobo$13bo11$b2o9b2o$bo10bo
3bo$2b3o8b4o$4bo$11b4o$11bo3bo$14b2o10$o4bo7bo4bo$bobobo8bobobo$bo2bo
9bo2bo2$5b2o11b2o$5bobo10bobo$6b2o11b2o2$3b2o11b2o$4bo12bo$b3o10b3o$bo
11bo$13b2o2$10b2o$10bobo$11b2o!

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 12th, 2015, 6:56 am
by simsim314
Scorbie wrote:I'm still hoping that symmetric catalysts could make Catforce faster
Definetely faster as CatForce performance is linear to number of options it checks. Less options less time.

But there is a downside. Sometimes eaters are very closely placed near each other, that these components can't.

BTW do anyone has an idea of smarter implementation for CatForce such that those tricks won't be needed?

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 15th, 2015, 6:46 pm
by Kazyan
Maybe take a look at how gencols handles interactions? For SLs, it always places them at the edge of the reaction envelope until it runs out of locations, then advances one tick and repeats. At least, that's what it seems to do from the order of its report results; I haven't looked at the code.

Would it be difficult to add a "bait" feature to CatForce--allowing for SLs that don't reappear? It would be useful for finding potential Bellman targets, or in the case of the Spartan G-to-X hunt, transferring the location of the object that needs to be restored. It would open up more search space.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 15th, 2015, 11:27 pm
by simsim314
Kazyan wrote:, it always places them at the edge of the reaction envelope until it runs out of locations, then advances one tick and repeats.
I did something very similar. I precalculated for each location and each SL when the interaction starts, and I start to evolve the pattern with few catalysts from the point where the first interaction starts. This trick works well for anything which is more than one SL (for one SL it works fast anyway, just the precalculation takes unnecessary time).
Kazyan wrote:Would it be difficult to add a "bait" feature to CatForce--allowing for SLs that don't reappear?
Well how do you distinguish good bait from bad one? otherwise you'll get really flooded.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 16th, 2015, 12:25 am
by Kazyan
simsim314 wrote:Well how do you distinguish good bait from bad one? otherwise you'll get really flooded.
Filters, or if you know what you're looking for, it's not that hard to sort through the results even if there are hundreds. At least, that's how it went when I did a gencols search for signals colliding with blocks to produce another signal.
Perhaps bait would be specified in a group separate from the catalysts, so that the user could decide only to use blocks or somesuch?

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 16th, 2015, 8:43 am
by simsim314
How about using a script to generate all the needed .in files and then call the regular CatForce? The bait has nothing to do with catalyst search it's just more versatile input. Making such script shouldn't be so hard.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 16th, 2015, 1:13 pm
by Kazyan
Yeah, that's probably a better idea. I've been putting off "learn how to script in Python" for too long now anyway and this is a good starting point...

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 16th, 2015, 2:50 pm
by simsim314
Kazyan wrote: "learn how to script in Python" for too long now anyway and this is a good starting point...
Yep definitely. You can also add the option to combine all the output .rle into single one. This is done very straightforward as the .rle format allows to combine in column with just adding "100$" between the two rle strings.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: June 16th, 2015, 9:01 pm
by Scorbie
simsim314 wrote:This is done very straightforward as the .rle format allows to combine in column with just adding "100$" between the two rle strings.
Speaking of that, are you thinking of changing that to 101$? 100$ makes the spacing 99 cells, actually.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: October 28th, 2015, 11:51 pm
by Scorbie
simsim314 wrote:
Scorbie wrote:I'm still hoping that symmetric catalysts could make Catforce faster
Definetely faster as CatForce performance is linear to number of options it checks. Less options less time.

But there is a downside. Sometimes eaters are very closely placed near each other, that these components can't.

BTW do anyone has an idea of smarter implementation for CatForce such that those tricks won't be needed?
Sorry for pulling up an old thread... Just thought that maybe we could restrict the direction of the catalyst inside Catforce, so when we place the catalyst on the left side, Catfore forces the catalyst to face rightwards.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: October 29th, 2015, 4:07 pm
by BlinkerSpawn
You'd then be forced to define, for each catalyst, which orientation(s) are "right" or "left" or "up" or "down" and be able to establish position relative to the reactive area even for reaction that loop "behind" the catalyst (180-degree H or B turners come to mind).

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: October 29th, 2015, 8:50 pm
by Scorbie
BlinkerSpawn wrote:You'd then be forced to define, for each catalyst, which orientation(s) are "right" or "left" or "up" or "down" and be able to establish position relative to the reactive area even for reaction that loop "behind" the catalyst (180-degree H or B turners come to mind).
I think the first problem could be solved by setting a canonical position, like we do on the conduit collection, and let CatForce to do the work with parsing directions. The second problem is a problem... Although I'm not sure how often it will occur as we don't add too many catalysts.

Another option is to restrict the cells around the catalyst to be activated. Something like this:

Code: Select all

x = 6, y = 6, rule = LifeHistory
3B$B2A$.A$2.3AB$4.AB$4.2B!
Ithink this would benefit more in a tree search like ptbsearch...

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: May 23rd, 2016, 12:03 am
by Scorbie
How about introducing opaque catalysts? Abort generating patterns if a * cell is dead.

It doesn't reduce the number of patterns to try, but we can reduce the time to generate each. This would become more effective with bigger catalysts (>= eater) that has ridiculously rare incidents of transparency.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: May 23rd, 2016, 3:03 am
by simsim314
This will complicate things. For example you would need to post catalyst from LifeHistory rules instead, I'll need LifeHistory parser. Dividing catalyst or having very not intuitive representation is much worse choice.

You don't gain too much by this feature anyway. iterating some extra 10-20%? CatForce is not a smart utility that checks the boundaries of the valid catalysts, and doesn't place new catalyst outside of it. It's just brute force search that stops when catalyst is destroyed. It's basically worse than ptbsearch in most aspects except that it doesn't assume anything about catalysts and has a nice "combine" feature.

EDIT On the contrary the idea of adding conduits only in their influence surrounding is not such a bad idea. This could really improve performance for 3 catalysts and more.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: December 16th, 2016, 5:27 pm
by Rhombic
I'm getting an error when running, stating that I'm missing libgcc_s_seh-1.dll and then libstdc++-6.dll
Any clues?

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: December 18th, 2016, 11:36 am
by simsim314
Rhombic wrote:I'm getting an error when running, stating that I'm missing libgcc_s_seh-1.dll and then libstdc++-6.dll
Any clues?
Just copy those from the mingw library to the CatForce.exe directory.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 22nd, 2017, 10:13 am
by Scorbie
Is it hard to implement the range of symmetric catalysts like this? Or is it already implemented this way?
(A demonstration of the four corners of the range of possible positions of "eater2 ? -2 -2 x", compared to that of "eater1 ? -2 -2 *")

Code: Select all

x = 87, y = 30, rule = LifeHistory
2A.A32.A.2A$2A.3A28.3A.2A$6.A26.A$2A.2A.A26.A.2A.2A$.A.2A.2A24.2A.2A.
A$.A36.A16.A29.A$2.3A.2A24.2A.3A17.3A25.3A$4.A.2A24.2A.A22.A23.A$57.
2A23.2A$9.D20BD$9.22B29.D20BD$9.22B29.22B$9.22B29.22B$9.22B29.22B$9.
22B29.22B$9.22B29.22B$9.22B29.22B$9.22B29.22B$9.22B29.22B$9.22B29.22B
$9.D20BD29.22B$60.D20BD$4.A.2A24.2A.A$2.3A.2A24.2A.3A19.2A24.2A$.A36.
A19.A24.A$.A.2A.2A24.2A.2A.A16.3A26.3A$2A.2A.A26.A.2A.2A15.A30.A$6.A
26.A$2A.3A28.3A.2A$2A.A32.A.2A!

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 22nd, 2017, 11:02 am
by BlinkerSpawn
Scorbie wrote:Is it hard to implement the range of symmetric catalysts like this? Or is it already implemented this way?
(A demonstration of the four corners of the range of possible positions of "eater2 ? -2 -2 x", compared to that of "eater1 ? -2 -2 *")

Code: Select all

something
I don't understand this diagram. What's the purpose of this and in what sense are you using "range"?

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 22nd, 2017, 12:13 pm
by Scorbie
Let's say the state 2 cells are the search area (specified by search-area x y w h)
Then the catalysts' pivot points can move within the search area. (Drawn in state 4(red) in this diagram.)
Well, for asymmetric catalysts like the eater, the pivot can be outside of the catalyst. The catalyst can reach farther out than the search area as in the right part of the diagram. (I just drew the four corner cases)
For symmetric catalysts, it seems that the pivot needs to be placed at the center. Therefore the catalyst cannot reach farther out than the asymmetric one.
My suggestion was to enable the pivot be outside of the catalyst like the left part of the diagram.

Another question: Is there a way to filter out the plain block reactions from the twit+block catalyst?

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 23rd, 2017, 8:21 pm
by Scorbie
Hi, I'm figuring out how to work out with the input options.
Does the "combine-results yes" option not work with "num-catalyst 2"?

Code: Select all

==Setup==
max-gen 120
start-gen 35
last-gen 75
num-catalyst 2
survive-interval 10

search-area -11 -15 25 25
#fit-in-width-height 10 10

pat obo$b2o$bo11$10b2o$10b2o! -10 -13
filter 120 2o$2o! 0 0

==Catalysts==
cat 2o$2o 60 0 0 . forbidden obo$b2o$bo2$2o$2o! 0 -4 forbidden 2o3bo$2ob2o$4b2o! 0 0 forbidden b2o$b2o2$bo$2o$obo! -1 0 forbidden 2o$b2ob2o$o3b2o! -4 -1 forbidden o3b2o$b2ob2o$2o! -4 0 forbidden obo$2o$bo2$b2o$b2o! -1 -4 forbidden 4b2o$2ob2o$2o3bo! 0 -1 forbidden 2o$2o2$bo$b2o$obo! 0 0
cat 2o$o$b3o$3bo! 12 -2 -2 * forbidden 2o$o$b3ob2o$3bobobo$6bo! -2 -2 forbidden bo$obo$2o2$2o$o$b3o$3bo! -2 -6 forbidden bo$2bo$3o2$3b2o$3bo$4b3o$6bo! -5 -6 forbidden 2bo$obo$b2o2$3b2o$3bo$4b3o$6bo! -5 -6
cat bo$obo$obo$bo! 50 1 2 /
cat b2o$o2bo$bobo$2bo 35 2 2 +
cat bo$obo$bo! 15 1 1 .
cat 2o$obo$bo! 25 1 1 +
cat 2o$obo$b2o! 35 1 1 |
--Eater 2--
cat 2obo$2ob3o$6bo$2ob2obo$bob2ob2o$bo$2b3ob2o$4bob2o! 15 3 3 x forbidden 2obo$2ob3o$6bo$2ob2obo$bob2ob2o$bo$2b3ob2o$4bob2o2$8b2o$8bobo$8bo! 3 3 forbidden 2obo$2ob3o$6bo$2ob2obo$bob2ob2o$bo$2b3ob2o$4bob2o2$8b3o$8bo$9bo! 3 3 forbidden 2obo$2ob3o$6bo$2ob2obo$bob2ob2o$bo$2b3ob2o$4bob2o$9b3o$9bo$10bo! 3 3 forbidden 2obo$2ob3o$6bo$2ob2obo$bob2ob2o$bo$2b3ob2o$4bob2o$9b2o$9bobo$9bo! 3 3 forbidden bo$2bo$3o$4b2obo$4b2ob3o$10bo$4b2ob2obo$5bob2ob2o$5bo$6b3ob2o$8bob2o! 7 6 forbidden 2bo$obo$b2o$4b2obo$4b2ob3o$10bo$4b2ob2obo$5bob2ob2o$5bo$6b3ob2o$8bob2o! 7 6 forbidden 2bo$obo$b2o2$3b2obo$3b2ob3o$9bo$3b2ob2obo$4bob2ob2o$4bo$5b3ob2o$7bob2o! 6 7 forbidden bo$2bo$3o2$3b2obo$3b2ob3o$9bo$3b2ob2obo$4bob2ob2o$4bo$5b3ob2o$7bob2o! 6 7
--BTS--
cat 2b2obo$3bob3o$bobo4bo$ob2ob2obo$o4bobo$b3obo$3bob2o! 12 4 3 x
--Bookend--
cat 2o$o2bo$b3o$6bo$b6o$bo$4b3o$4bo2bo$6b2o! 15 3 4 x
--Dual Eater--
cat 3b2o$3bobo$bobob3o$ob2o4bo$o4b2obo$b3obobo$3bobo$4b2o! 12 4 3 x
--Hook with tail--
cat 2obo$bob3o$o5bo$b3obo$3bob2o! 7 3 2 /
--Tableend--
cat o2bo$4o$6bo$7o$o$3b4o$3bo2bo! 10 3 3 x
# --TWIT--
# cat 2o$2o3bo$4bobo$5bobo$7bo$7b2o! 12 3 0 *
--Long hook with tail--
cat 3bo$obobo$2o2bo$4b2o$2o$bo2b2o$bobobo$2bo! 7 2 3 x

==Output===
#full-report full-pi.rle
output pi.rle
combine-results yes 1 5 10 15

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 25th, 2017, 12:58 am
by Scorbie
simsim314 wrote:
Kazyan wrote:Am I missing something with the 'forbidden' flag here?
Well first of all forbidden and the catalysts itself should be in the same orientation.

Now another annoying issue I missed: the center (x, y) it's actually the movement of each catalyst by (x, y), so this is exactly the opposite from center. I'm not sure I should fix it, as all catalyst will stop working for "all" the current users, but I definitely write about it in ReadMe.

For your question this should work (didn't checked it):

Code: Select all

cat 2o3b2o$obobobo$2bobo$2bobo$obobobo$2o3b2o 12 -3 -3 / forbidden 2o3b2o$obobobo$2bobo$2bobo4bo$obobobobobo$2o3b2ob2o! -3 -3 forbidden 2o3b2ob2o$obobobobobo$2bobo4bo$2bobo$obobobo$2o3b2o! -3 -3 forbidden b2ob2o3b2o$obobobobobo$bo4bobo$6bobo$4bobobobo$4b2o3b2o! -7 -3 forbidden 4b2o3b2o$4bobobobo$6bobo$bo4bobo$obobobobobo$b2ob2o3b2o! -7 -3
EDIT I think I will fix it soon, and write about it here. Will post the catalyst with the correct sign.
@simsim314 I think the "shift" of the given spartan catalyts are also wrong. Here are the corrected ones:

Code: Select all

cat bo$obo$obo$bo! 50 -1 -2 /
cat b2o$o2bo$bobo$2bo 35 -2 -2 +
cat bo$obo$bo! 15 -1 -1 .
cat 2o$obo$bo! 25 -1 -1 +
cat 2o$obo$b2o! 35 -1 -1 |




I made a catalyst parsing golly script, so please let me know if you are planning to change the sign.
edit: The script and docs below is very quickly written. I'll make a proper repo and docs when I get to finish it.
loadcat.lua : Load a sample catalyst like the one in simsim314's quotes to see the format inside Golly.

Code: Select all

-- Load golly patterns from clipboard as CatForce catalyst file format
local g = golly()

local catstring = g.getclipstr()

-- Get catalyst info (first pattern)
local rle, gen, x, y, sym = assert(catstring:match(
  "cat ([bo$%d]+!?) (%S+) (%S+) (%S+) ([%+%-%/%*%|x])"))
g.note(string.format("RLE: %s\ngen: %s\nx: %s\ny: %s\nsym: %s\n", rle, gen, x, y, sym))

-- Save catalyst into first layer
g.new(string.format("gen: %s, sym: %s", gen, sym))
g.putcells(g.parse(rle, tonumber(x), tonumber(y))) -- catalyst x y are parsed backwards.

-- Get forbidden positions and save it to its own layer
for rle, x, y in assert(catstring:gmatch(
  "forbidden ([bo$%d]+!?) (%S+) (%S+)")) do
  g.note(string.format("RLE: %s\nx:%s\ny:%s", rle, x, y))
  g.addlayer(); g.new("forbidden")
  g.putcells(g.parse(rle, tonumber(x), tonumber(y)))
end
savecat.lua -- Use the format you learned from above. Don't have to set the layer names.

Code: Select all

-- Save golly patterns to clipboard as CatForce catalyst file format
local g = golly()

local function getpatchunks ()
  -- Get pattern of current layer as CatForce pat format
  -- The header can be pat/filter/forbidden.
  local x, y, _, _ = table.unpack(g.getrect())
  g.select(g.getrect())
  g.copy()
  g.select({})
  -- Get one-liner RLE string
  local rle = g.getclipstr()
  rle = rle:sub(rle:find('\n'), nil)
  rle = rle:gsub('\n', '')

  return rle, x, y
end

-- Save all patterns to clipboard.
local catchunks = {}
local rle, x, y

-- Special handling for layer index 0 (Catalyst description)
local gen, sym = g.getname(0):match("gen: (%S+), sym: (%S+)")
g.setlayer(0)
rle, x, y = getpatchunks()
gen, sym = gen or "GEN!", sym or "SYM!"
table.insert(catchunks, string.format("cat %s %s %d %d %s", rle, gen, x, y, sym))

-- Handle layers 1 through numlayers()-1
for i=1, g.numlayers()-1 do
  g.setlayer(i)
  rle, x, y = getpatchunks()
  table.insert(catchunks, string.format("forbidden %s %d %d", rle, x, y))
end
local text = table.concat(catchunks, ' ')
-- g.note(text)
g.setclipstr(text)

-- Alert the user to save the generation or symmetry if not specified.
local alert = ""
if not gen then alert = alert + "SURVIVE_GENERATION\n" end
if not sym then alert = alert + "SYMMETRY\n" end
if alert ~= "" then
  g.note(string.format(
    "Make sure you specify the \n%s of the catalyst!", alert
  ))
end
g.exit("Saved all layers to clipboard.")
Also, I sent you a pull request on Github fixing a glitch in GetRLE.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 25th, 2017, 6:00 am
by simsim314
Hey Scorbie, sorry for the delayed response.
Scorbie wrote:Another question: Is there a way to filter out the plain block reactions from the twit+block catalyst?
Well not really... at least not for the current code. It's possible to add simple check that adding catalyst is changing the cell count. It's simple addition, and you're welcome to add it.
Scorbie wrote:Does the "combine-results yes" option not work with "num-catalyst 2"?
Should work, it will combine all catalyst pairs. I've ran this kind of searches several times. Only notice it will not combine single catalyst option with catalyst pairs, it will only try to combine pair catalysts.
Scorbie wrote:Also, I sent you a pull request on Github fixing a glitch in GetRLE.
Thx, I've merged it into the CatForce repository. I know there was a glitch in GetRLE.

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 25th, 2017, 6:44 am
by Scorbie
simsim314 wrote:Well not really... at least not for the current code. It's possible to add simple check that adding catalyst is changing the cell count. It's simple addition, and you're welcome to add it.
Well, actually, I prefer to postprocess the results (Hence that fix and pull request. The fix makes post-processing easier.) I'll share the code when I get to write and finish that script.
Could you confirm this in my last post?
Scorbie wrote:@simsim314 I think the "shift" of the given spartan catalyts are also wrong. Here are the corrected ones:

Re: CatForce new catalyst search utility (LifeAPI based)

Posted: January 5th, 2018, 9:58 am
by dani
I'm really sorry to necrobump this thread, but I'm running the example 1.in and it returns with no 1.rle and no console output. What's going on? I'm not very skilled in C. If you need it, here is the example 1.in:

Code: Select all

max-gen 100
start-gen 1
num-catalyst 3
stable-interval 10
search-area -8 -8 16 16
pat 2bo$bobo$o3bo$o3bo$o3bo$bobo$2bo! -3 -4
filter 24 b2o$obo$bo 5 -3
filter 30 3o$3o! -9 2
fit-in-width-height 20 3
cat 2o$2o 60 0 0 .
cat 2b2o$3bo$3o$o 10 -2 -2 *
output 1.rle
full-report full.rle