introduce bitloops
This commit is contained in:
@@ -255,8 +255,7 @@ public class SwedishGeneratorTest {
|
||||
// This should detect a slot starting at 0,1 with length 2 (0,1 and 0,2)
|
||||
var clues = Clues.createEmpty();
|
||||
clues.setClue(OFF_0_0, CLUE_RIGHT);
|
||||
var grid = clues.toGrid();
|
||||
|
||||
var grid = clues.toGrid();
|
||||
|
||||
var slots = extractSlots(clues);
|
||||
assertEquals(1, slots.length);
|
||||
@@ -269,7 +268,7 @@ public class SwedishGeneratorTest {
|
||||
|
||||
@Test
|
||||
void testMaskFitnessBasic() {
|
||||
var gen = new SwedishGenerator(new Rng(0), new int[STACK_SIZE]);
|
||||
var gen = new SwedishGenerator(new Rng(0), new int[STACK_SIZE], Clues.createEmpty());
|
||||
var grid = Clues.createEmpty();
|
||||
// Empty grid should have high penalty (no slots)
|
||||
var f1 = gen.maskFitness(grid);
|
||||
@@ -284,12 +283,12 @@ public class SwedishGeneratorTest {
|
||||
@Test
|
||||
void testGeneticAlgorithmComponents() {
|
||||
var rng = new Rng(42);
|
||||
var gen = new SwedishGenerator(rng, new int[STACK_SIZE]);
|
||||
var gen = new SwedishGenerator(rng, new int[STACK_SIZE], Clues.createEmpty());
|
||||
|
||||
var g1 = gen.randomMask();
|
||||
assertNotNull(g1);
|
||||
|
||||
var g2 = gen.mutate(g1);
|
||||
var g2 = gen.mutate(g1.deepCopyGrid());
|
||||
assertNotNull(g2);
|
||||
assertNotSame(g1, g2);
|
||||
|
||||
@@ -410,7 +409,7 @@ public class SwedishGeneratorTest {
|
||||
|
||||
@Test
|
||||
void testMaskFitnessDetailed() {
|
||||
var gen = new SwedishGenerator(new Rng(42), new int[STACK_SIZE]);
|
||||
var gen = new SwedishGenerator(new Rng(42), new int[STACK_SIZE], Clues.createEmpty());
|
||||
var grid = Clues.createEmpty();
|
||||
// Empty grid: huge penalty
|
||||
var fitEmpty = gen.maskFitness(grid);
|
||||
|
||||
Reference in New Issue
Block a user