Search in sources :

Example 61 with LongPieces

use of common.datastore.blocks.LongPieces in project solution-finder by knewjade.

the class NormalEnumeratePiecesTest method enumerateNoHoldJust.

@Test
void enumerateNoHoldJust() throws Exception {
    PatternGenerator generator = new LoadedPatternGenerator("*p3");
    NormalEnumeratePieces core = new NormalEnumeratePieces(generator, 3, false);
    Set<LongPieces> pieces = core.enumerate();
    assertThat(pieces).hasSize(210);
    assertThat(core.getCounter()).isEqualTo(210);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LongPieces(common.datastore.blocks.LongPieces) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) Test(org.junit.jupiter.api.Test)

Example 62 with LongPieces

use of common.datastore.blocks.LongPieces in project solution-finder by knewjade.

the class NormalEnumeratePiecesTest method enumerateNoHoldOverOne.

@Test
void enumerateNoHoldOverOne() throws Exception {
    PatternGenerator generator = new LoadedPatternGenerator("I, S, Z, O");
    NormalEnumeratePieces core = new NormalEnumeratePieces(generator, 4, false);
    Set<LongPieces> pieces = core.enumerate();
    assertThat(pieces).hasSize(1);
    assertThat(core.getCounter()).isEqualTo(1);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LongPieces(common.datastore.blocks.LongPieces) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) Test(org.junit.jupiter.api.Test)

Example 63 with LongPieces

use of common.datastore.blocks.LongPieces in project solution-finder by knewjade.

the class NormalEnumeratePiecesTest method enumerateNoHoldOver1.

@Test
void enumerateNoHoldOver1() throws Exception {
    PatternGenerator generator = new LoadedPatternGenerator("*p7");
    NormalEnumeratePieces core = new NormalEnumeratePieces(generator, 3, false);
    Set<LongPieces> pieces = core.enumerate();
    assertThat(pieces).hasSize(210);
    assertThat(core.getCounter()).isEqualTo(5040);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LongPieces(common.datastore.blocks.LongPieces) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) Test(org.junit.jupiter.api.Test)

Example 64 with LongPieces

use of common.datastore.blocks.LongPieces in project solution-finder by knewjade.

the class NormalEnumeratePiecesTest method enumerateHoldJustMulti.

@Test
void enumerateHoldJustMulti() throws Exception {
    PatternGenerator generator = new LoadedPatternGenerator(Arrays.asList("T, J, O, Z, I", "J, O, S, T, Z", "T, J, O, I, S", "T, J, O, Z, I"));
    NormalEnumeratePieces core = new NormalEnumeratePieces(generator, 5, true);
    Set<LongPieces> pieces = core.enumerate();
    assertThat(pieces).hasSize(3);
    assertThat(core.getCounter()).isEqualTo(4);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LongPieces(common.datastore.blocks.LongPieces) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) Test(org.junit.jupiter.api.Test)

Example 65 with LongPieces

use of common.datastore.blocks.LongPieces in project solution-finder by knewjade.

the class NormalEnumeratePiecesTest method enumerateNoHoldMulti.

@Test
void enumerateNoHoldMulti() throws Exception {
    PatternGenerator generator = new LoadedPatternGenerator(Arrays.asList("T, J, O, Z", "J, O, S, T", "T, J, O, I"));
    NormalEnumeratePieces core = new NormalEnumeratePieces(generator, 3, false);
    Set<LongPieces> pieces = core.enumerate();
    assertThat(pieces).hasSize(2);
    assertThat(core.getCounter()).isEqualTo(3);
}
Also used : PatternGenerator(common.pattern.PatternGenerator) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) LongPieces(common.datastore.blocks.LongPieces) LoadedPatternGenerator(common.pattern.LoadedPatternGenerator) Test(org.junit.jupiter.api.Test)

Aggregations

LongPieces (common.datastore.blocks.LongPieces)71 Test (org.junit.jupiter.api.Test)58 Piece (core.mino.Piece)42 PatternGenerator (common.pattern.PatternGenerator)38 LoadedPatternGenerator (common.pattern.LoadedPatternGenerator)36 Randoms (lib.Randoms)27 Collectors (java.util.stream.Collectors)22 Field (core.field.Field)19 Pieces (common.datastore.blocks.Pieces)16 LongTest (module.LongTest)16 List (java.util.List)14 Stream (java.util.stream.Stream)14 Assertions.assertThat (org.assertj.core.api.Assertions.assertThat)13 FieldFactory (core.field.FieldFactory)12 ArrayList (java.util.ArrayList)12 SizedBit (searcher.pack.SizedBit)12 MinoFactory (core.mino.MinoFactory)11 HashSet (java.util.HashSet)11 ExecutionException (java.util.concurrent.ExecutionException)10 BlockInterpreter (common.parser.BlockInterpreter)9