introduce bitloops
This commit is contained in:
@@ -7,7 +7,6 @@ import puzzle.Export.Clue;
|
||||
import puzzle.Export.Clued;
|
||||
import puzzle.Export.Gridded;
|
||||
import puzzle.Masker.Clues;
|
||||
import puzzle.SwedishGenerator.DictEntry;
|
||||
import puzzle.SwedishGenerator.Rng;
|
||||
import puzzle.SwedishGenerator.Slotinfo;
|
||||
|
||||
@@ -19,7 +18,6 @@ import static puzzle.dict900.DictData.DICT900;
|
||||
|
||||
public class PerformanceTest {
|
||||
|
||||
final DictEntry[] EN = DICT800.index();
|
||||
void main() {
|
||||
testIncrementalComplexity();
|
||||
}
|
||||
@@ -34,7 +32,7 @@ public class PerformanceTest {
|
||||
var c = 0;
|
||||
for (var size : clueSizes) {
|
||||
var t0 = System.currentTimeMillis();
|
||||
val masker = new Masker(rng, new int[SwedishGenerator.STACK_SIZE], Masker.Clues.createEmpty());
|
||||
val masker = new Masker(rng, new int[Masker.STACK_SIZE], Masker.Clues.createEmpty());
|
||||
// Increased population and generations for stress
|
||||
arr[c++] = masker.generateMask(size, 200, 100, 50);
|
||||
var t1 = System.currentTimeMillis();
|
||||
@@ -57,7 +55,7 @@ public class PerformanceTest {
|
||||
var successCount = 0;
|
||||
|
||||
for (var i = 0; i < iterations; i++) {
|
||||
val slotInfo = Masker.slots(arr[c], EN);
|
||||
val slotInfo = Masker.slots(arr[c], DICT800.index());
|
||||
val result = fillMask(rng, slotInfo, Slotinfo.grid(slotInfo));
|
||||
if (result.ok()) successCount++;
|
||||
totalNodes += result.nodes();
|
||||
@@ -106,7 +104,7 @@ public class PerformanceTest {
|
||||
|
||||
// A single horizontal slot at (0,0)
|
||||
val mask = Clued.of(r0c0d1);
|
||||
val slots = Masker.slots(mask.c(), EN);
|
||||
val slots = Masker.slots(mask.c(), DICT800.index());
|
||||
|
||||
System.out.println("[DEBUG_LOG] \n--- Single Slot Resolution ---");
|
||||
if (slots.length > 0) {
|
||||
@@ -143,8 +141,8 @@ public class PerformanceTest {
|
||||
}
|
||||
|
||||
private void visualizeSlots(Slotinfo[] slots) {
|
||||
var R = SwedishGenerator.R;
|
||||
var C = SwedishGenerator.C;
|
||||
var R = Masker.R;
|
||||
var C = Masker.C;
|
||||
var display = new char[R][C];
|
||||
for (var r = 0; r < R; r++) Arrays.fill(display[r], ' ');
|
||||
|
||||
|
||||
Reference in New Issue
Block a user