add masking

This commit is contained in:
2024-08-24 10:24:27 +03:00
parent 47f2989373
commit 7e247e8980
4 changed files with 31 additions and 26 deletions

View File

@ -11,7 +11,7 @@ from eolr import (
)
import humanize
from dataclasses import dataclass
from solver import EOLRBSolution, solve_eolrb, create_prune_table
from solver import EOLRBSolution, solve_eolrb, create_eolrb_prune_table
from scorer import (
FingerTrickWithRegrip,
load_config,
@ -21,7 +21,7 @@ from scorer import (
import heapq
from typing import List, Any, Generator, Dict
SOLUTIONS_TO_EVAL = 40
SOLUTIONS_TO_EVAL = 1000
SOLUTIONS_TO_SHOW = 3
PRUNE = 10
@ -52,7 +52,7 @@ def load_or_generate_prune_table(file_path: str, prune_size: int) -> Dict:
return pickle.load(file)
else:
print("generating prune table...")
prune_table = create_prune_table(prune_size)
prune_table = create_eolrb_prune_table(prune_size)
print("saving prune table to", file_path)
with open(file_path, "wb") as file:
pickle.dump(prune_table, file)
@ -61,7 +61,6 @@ def load_or_generate_prune_table(file_path: str, prune_size: int) -> Dict:
def main():
config = load_config("./moves.yaml")
prune_table = load_or_generate_prune_table("prune_table.pkl", PRUNE)
print("prune table size:", humanize.naturalsize(sys.getsizeof(prune_table)))
@ -113,6 +112,7 @@ def main():
{
"alg": " ".join(pretty_alg),
"stm": len(solution.alg),
# "mc": solution.mc,
"score": score,
"raw_alg": " ".join(solution.alg),
"pre_auf": solution.pre_auf,