introduce bitloops

This commit is contained in:
mike
2026-01-14 00:57:41 +01:00
parent 2430dbdfb9
commit 1d731334d9
6 changed files with 144 additions and 149 deletions

View File

@@ -1,6 +1,7 @@
package puzzle;
import lombok.Data;
import lombok.val;
import puzzle.SwedishGenerator.Rng;
import java.io.IOException;
@@ -346,7 +347,7 @@ public class Main {
static PuzzleResult attempt(Rng rng, Dict dict, Opts opts) {
try {
return _attempt(rng, dict, opts);
return _attempt(rng, dict, opts);
} catch (Exception e) {
e.printStackTrace();
System.err.println("Failed to operate" + e.getMessage());
@@ -356,8 +357,9 @@ public class Main {
static PuzzleResult _attempt(Rng rng, Dict dict, Opts opts) {
TOTAL_ATTEMPTS.incrementAndGet();
var swe = new SwedishGenerator(rng);
var mask = swe.generateMask(opts.pop, opts.gens, Math.max(opts.pop, (int) Math.floor(opts.pop * 1.5)));
var filled = swe.fillMask(mask, dict.index(), opts.fillTimeout);
val stack = new int[STACK_SIZE];
var mask = swe.generateMask(stack, opts.pop, opts.gens, Math.max(opts.pop, (int) Math.floor(opts.pop * 1.5)));
var filled = fillMask(rng, mask, dict.index());
TOTAL_NODES.addAndGet(filled.stats().nodes);
TOTAL_BACKTRACKS.addAndGet(filled.stats().backtracks);