simeks wrote: July 2nd, 2016, 8:41 pm
I have to look at this topic (I have not looked at the code yet).
I would rather think about glider(s) invoked destructions than the *WSS(s) destructions, as it is much easier to got a glider.
As I understand from the comments the code is looking for the objects (from a limited set) to be added (to limited regions)
to affect the ongoing reaction, such that the reaction stabilises after each added object and the evaluation function somehow evaluates the remaining objects (to be destroyed).
To use it for big patterns (ECCA in my case) you need to split the pattern to smaller regions and compute SoD for each region separately and then create gliders to reach each of the regions in the predetermined way. It seems to me it could be advantagous to allow escaping gliders from the region (probably limited some way), so the regions could serve as splitters/reflectors as well.
Destroying an escaping glider could be easier then adding additional splitters. Reflecting the escaping gliders the required way to other regions is probably the cheapest solution... (especially when the regions are far apart).
OK, no I am reading the code. I will write my toughts (cs teacher habbit) ... mid_x mid_y ... doubles just to allow halves? Maintain twice the value. length_sq ... maintan four times the value.
You compute complete "geometrical graph" probbably just to compute the minimum spannng tree.
If you want to use it for bigger patterns, consider to filter some of the edges whose cannot be part of the MST. Slsparse/pslmake could be an inspiration. (Filter does not mean consder the edge and reject it, but rather not consider it at all).
You use Kruskal algorithm to find the minimum spanning tree. Using disjoint find union technique, rather to renaming an entire component would be better (for bigger graphs). Anyways if you use it on complete graph you will still be on quadratic complexity (times log for sorting).
Oh MAX_CENSUS_OBJECTS = 512, so the complexity of the MST computation could be already important.
I like the actual cost of the edge is computed only for minmum spaning tree egdes. (I am not sure how to write the expression most efficiently ... there is a Newton interpolation in each sqrt and one would probably suffice for the entire function ... but this would not be important).
... continue reading
It tests p2 stability? So should be changed for p8 based patterns? It would be nice to know the pre destruction pattern period and check corresponding stability.
I do not understand why you use different global positions (for patterns) for each function, when the functions newer call one other. But OK let it be a style. But would adding a pattern to a function cause global renumbering, I do not think the style is good for code maintainance.
do not like "s32 stable_gen = gens_until_stable (in_setup); run_for_gens (in_setup, stable_gen);"
You can copy the final pattern from gens_until_stable rather to running the simulation twice (mod 3 calculation required to find the global pointer ... if not fixed for the purpose).
(Hmm, looking at meaning ... implementation of bleed ... so for the golgrid ... and I am confused what the pop_?_on, pop_?_off represent ... set_empty_population_rect ... I am not fun of an overcommented code, but there some hint would help. Oh its the estimate of the minimal/maximal coordinate of a living cell (and the pattern is expected to be "around the region center"). It probably only expands, but does not shrink... hmm except the tighten_pop_*... oh OK, corresponding tightening is called whenever a somehow extreme cell dies.)
OK, back to the reading destroy.c. I like the forbidden_area, must_touch_area concept. But I would try to generate objects filtered by the must_touch _area (not thinking about other objects at all) rather to have a global object list ready what would be filtered.
OK make_pos_objects called with must_touch_area could be much more efficient then trying all possible postions. ... or with all shifts by object cells ... probably already fitered by forbidden_area.
Is it DFS on relevant inserted objects returning first found solution? I must read it wrongly ... the MST evaluation must be used somehow.
Oh OK, the run_setup inserts promissing sequences to the beam ...
OK I got the idea. The most important change request would be parametrized period (allowing at least 1,2, and 8 ) and incorporation of modfied stabilty test alowing an outgoing glider ... not crossing the forbidden area. I would probably incorporated the pslmake expected costs of added objects to the evaluation as well. It would be nice to prepend the search for the starting glider line/timing to start the destruction effcently.
After some optimization it would be nice to automate larger pattern splitting to parts where chain reaction is more promissing then long jumps by reflected emitted glider. ... may be automated from the edge lengths of the minimum spanning tree of the initial pattern.