TPR-4x4x4-Solver icon indicating copy to clipboard operation
TPR-4x4x4-Solver copied to clipboard

Cancelling moves between stages

Open jfly opened this issue 13 years ago • 2 comments
trafficstars

I've seen some scrambles like:

U2 F' L2 F' D2 F' L2 B U2 B2 L' U2 F' D F2 L R2 D L' U2 Uw2 B Uw2 R' F Uw2 Rw2 L F2 U2 B Uw2 Uw' D Rw2 R' U2 L U' Fw' Uw L2 Uw2 Rw F'

There's a Uw2 Uw' in here. Here's a hacked version of FullCube.java that causes this problem:

public FullCube(Random r) {
        //<<<edge = new EdgeCube(r);
        //<<<center = new CenterCube(r);
        //<<<corner = new CornerCube(r);

        edge = new EdgeCube(r);//<<<
        //edge.ep = new byte[] {10, 18, 2,  21, 12, 15, 17, 22, 4,  14, 1,  11, 8,  6,  5,  19, 20, 3,  16, 7,  9,  13, 0,  23};
        edge.ep = new byte[] { 2,   15,  10,  23,  7,   1,   11,  13,  12,  6,   20,  16,  3,   5,   9,   19,  14,  18,  22,  8,   17,  0,   4,   21 };
        center = new CenterCube(r);//<<<
        center.ct = new byte[] { 5, 2,   1,   0,   1,   0 ,  4,   5  , 1,   3,   4,   3,   2,   2,   4,   0,   1,   5,   4,   5,   3,   3,   0,   2 };
        corner = new CornerCube(34651, 1086);//<<<
    }

From looking at Search.java's run(), it looks like no effort is made to cancel moves between stages. This is something that would be nice to have. Alternatively, we could resurrect TNoodle's TurnBuilder in CubeScrambler.java to hack around this @clementgallet

jfly avatar Sep 04 '12 07:09 jfly

I can't run it right now, but I guess it is:

Stage 1: F Rw' Uw2 L2 Uw' Fw Stage 2: U L' U2 R Rw2 D' Uw Stage 3: Uw2 B' ...

I guess it happens because the program breaks when the first solution is found, even if it searches in a specific order so to get solutions among the shortest. @ChenShuang what about letting the loop on L274 (https://github.com/ChenShuang/TPR-4x4x4-Solver/blob/master/src/Search.java#L274) going until the end before breaking, and keeping the best solution ?

clementgallet avatar Sep 04 '12 09:09 clementgallet

I think the best solution to this bug now is to write/use the TurnBuilder because I haven't found a reasonable way to process move canceling between stages.

cs0x7f avatar Sep 11 '12 03:09 cs0x7f