First idea I had was that with Golly now around, it could be possible to make the component/variant definition simpler. There would be just one pattern in a multistate rule which would contain both information about the beginning and ending group (with intent of supporting multiple groups, not just Herschel), their mutual position, contents of the initial patterns, usage area, and catalysts supporting evolution of the pattern which must not collide with other components.
Second thought here is that it might be useful also for the effort of extending the current Hersrch so maybe you could give it a try, too.
Hersrch.table:
Code: Select all
n_states:8
neighborhood:Moore
symmetries:permute
# 0 - dead cell which was dead since start and didn't change
# 1 - live cell which was alive since start and didn't change
# 2 - dead cell which was dead at the start, then became live, then died again (active)
# 3 - dead cell, manually marked (end group)
# 4 - dead cell, manually marked (end group + start group)
# 5 - dead cell which was alive at the start (start group)
# 6 - live cell which was alive at the start, then died, then became alive again (catalyst)
# 7 - live cell which was dead at the start
var livea={1,6,7}
var liveb={1,6,7}
var livec={1,6,7}
var lived={1,6,7}
var deada={0,2,3,4,5}
var deadb={0,2,3,4,5}
var deadc={0,2,3,4,5}
var deadd={0,2,3,4,5}
var deade={0,2,3,4,5}
var deadf={0,2,3,4,5}
var deadg={0,2,3,4,5}
var anya={0,1,2,3,4,5,6,7}
var anyb={0,1,2,3,4,5,6,7}
var anyc={0,1,2,3,4,5,6,7}
var anyd={0,1,2,3,4,5,6,7}
# birth on three neighbors
0,deada,deadb,deadc,deadd,deade,livea,liveb,livec,7
2,deada,deadb,deadc,deadd,deade,livea,liveb,livec,7
3,deada,deadb,deadc,deadd,deade,livea,liveb,livec,7
4,deada,deadb,deadc,deadd,deade,livea,liveb,livec,6
5,deada,deadb,deadc,deadd,deade,livea,liveb,livec,6
# death on underpopulation
1,deada,deadb,deadc,deadd,deade,deadf,deadg,anya,5
6,deada,deadb,deadc,deadd,deade,deadf,deadg,anya,5
7,deada,deadb,deadc,deadd,deade,deadf,deadg,anya,2
# death on overcrowding
1,anya,anyb,anyc,anyd,livea,liveb,livec,lived,5
6,anya,anyb,anyc,anyd,livea,liveb,livec,lived,5
7,anya,anyb,anyc,anyd,livea,liveb,livec,lived,2
# state change for catalyst cell when touched by active pattern
1,deada,deadb,deadc,deadd,deade,anya,livea,7,6
Code: Select all
color=0 255 255 255
color=1 0 0 0
color=2 192 255 255
color=3 192 64 64
color=4 128 128 64
color=5 64 192 64
color=6 0 0 255
color=7 96 96 96
1/ paste standard 2-state component including starting group into the rule
Code: Select all
x = 26, y = 23, rule = Hersrch
A$3A$3.A$2.2A18.A$21.2A2$19.3A2.A$21.A.A.A$22.A2.A$23.2A$.A$.A.A$.3A
12.2A$3.A11.A2.A2.2A$15.A.A4.A$16.A5.A.2A$19.2A.A.A$19.A2.A2.A$16.A4.
A2.2A$16.5A2$18.2A.A$18.A.2A!
3/ overwrite final group by state 3. If initial group overlaps with final group, mark overlapping cells using state 4.
Code: Select all
x = 28, y = 29, rule = Hersrch
16.B$15.3C$15.BCB$14.2B3C$14.5B$14.6B$2.A11.6B$2.3A9.5B$5.A7.6B$4.2F
3.B4.6B3.GF$4.8B.7B3.2EG$6.13B3.G.B$6.13B2.EFEB.A$5.16B.GE.F.A$3.17B
4.A2.A$.18B6.2A$.2BE13B$3BEBE4B.7B$.2B3E4B2.B.4B2F$.4BE4B7.F2BF2.2A$
2.7B8.FBFB3.A$18.F4B.A.2A$20.B2F.A.A$20.BFB.A2.A$18.A4.F2.2A$18.5A2$
20.2A.A$20.A.2A!
Code: Select all
x = 28, y = 29, rule = Hersrch
16.B$15.3C$15.BCB$14.2B3C$14.5B$14.6B$2.A11.6B$2.3A9.5B$5.A7.6B$4.2F
3.B4.6B3.BF$4.8B.7B3.2FB$6.13B3.B.B$6.13B2.3FB.A$5.16B.BF.F.A$3.17B4.
A2.A$.18B6.2A$.2BE13B$3BEBE4B.7B$.2B3E4B2.B.4B2F$.4BE4B7.F2BF2.2A$2.
7B8.FBFB3.A$18.F4B.A.2A$20.B2F.A.A$20.BFB.A2.A$18.A4.F2.2A$18.5A2$20.
2A.A$20.A.2A!
You can always re-run the pattern by overwriting initial state (4, 5) by state 1. Of course you must also restore the final group in the end.
For another example, pattern defining a component changing "H-minus-6" group into Herschel is this:
Code: Select all
x = 8, y = 6, rule = Hersrch
.EB$2B2EC$3BEDBC$.2B.CDCB$5EBC$3BEB!
- position, orientation, and type of initial group (states 4 and 5)
- position, orientation, and type of final group (states 3 and 4)
- active area of the component (states 2, 3, 4, 5, 6, and 7)
- catalyst areas of the component (state 6 and its immediate neighborhood)
- structure of the component to be used when building the circuit (states 1 and 6)
When checking for collisions, Hersrch would not test active areas against each other, rather catalyst area of one component against active areas of other components. Therefore there's no need to shape the active area. You may want, however, to mark some catalysts by state 1 if they are not essential and may eventually overlap with something.
Regarding further development I intend to switch definitions from many files as they are now to using just a single definition file containing all components and their variants, probably encoded using slightly extended JSON with search parameters defined using another JSON-encoded file instead of extending already huge amount of command-line parameters. Hersrch would then run with just two parameters, one specifying the definition file and the other specifying the file with search parameters.
I understand that what was done so far does not really deserve a post yet because there's not much to use on it ... but I'd hate to miss something obvious and only realize it when it's too late. So any comments are welcome.