Search in sources :

Example 51 with LoadedPatternGenerator

use of common.pattern.LoadedPatternGenerator in project solution-finder by knewjade.

the class NormalEnumeratePiecesTest method enumerateNoHoldJustMulti.

@Test
void enumerateNoHoldJustMulti() 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, 4, false);
    Set<LongPieces> pieces = core.enumerate();
    assertThat(pieces).hasSize(3);
    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)

Example 52 with LoadedPatternGenerator

use of common.pattern.LoadedPatternGenerator 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 53 with LoadedPatternGenerator

use of common.pattern.LoadedPatternGenerator 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 54 with LoadedPatternGenerator

use of common.pattern.LoadedPatternGenerator 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 55 with LoadedPatternGenerator

use of common.pattern.LoadedPatternGenerator 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)

Aggregations

LoadedPatternGenerator (common.pattern.LoadedPatternGenerator)61 PatternGenerator (common.pattern.PatternGenerator)61 Test (org.junit.jupiter.api.Test)35 LongPieces (common.datastore.blocks.LongPieces)31 AnalyzeTree (common.tree.AnalyzeTree)30 ParameterizedTest (org.junit.jupiter.params.ParameterizedTest)25 ArgumentsSource (org.junit.jupiter.params.provider.ArgumentsSource)25 Piece (core.mino.Piece)11 Randoms (lib.Randoms)8 LongTest (module.LongTest)7 HashSet (java.util.HashSet)4 Pieces (common.datastore.blocks.Pieces)2 Field (core.field.Field)2 MinoFactory (core.mino.MinoFactory)2 ArrayList (java.util.ArrayList)2 Injector (com.google.inject.Injector)1 Action (common.datastore.action.Action)1 LockedCandidateThreadLocal (concurrent.LockedCandidateThreadLocal)1 LockedReachableThreadLocal (concurrent.LockedReachableThreadLocal)1 LockedCandidate (core.action.candidate.LockedCandidate)1