diff --git a/src/GoEngine.ts b/src/GoEngine.ts index 2bd41b87..a95d76a7 100644 --- a/src/GoEngine.ts +++ b/src/GoEngine.ts @@ -38,7 +38,7 @@ declare const CLIENT: boolean; declare const SERVER: boolean; export const AUTOSCORE_TRIALS = 1000; -export const AUTOSCORE_TOLERANCE = 0.3; +export const AUTOSCORE_TOLERANCE = 0.1; export type GoEnginePhase = "play" | "stone removal" | "finished"; export type GoEngineRules = "chinese" | "aga" | "japanese" | "korean" | "ing" | "nz"; diff --git a/src/GobanCore.ts b/src/GobanCore.ts index 759acfa8..11371dbb 100644 --- a/src/GobanCore.ts +++ b/src/GobanCore.ts @@ -3170,7 +3170,7 @@ export abstract class GobanCore extends EventEmitter { this, this.engine, AUTOSCORE_TRIALS, - Math.min(0.1, AUTOSCORE_TOLERANCE), + AUTOSCORE_TOLERANCE, true, ); diff --git a/src/ScoreEstimator.ts b/src/ScoreEstimator.ts index 1f410e5f..07471d3e 100644 --- a/src/ScoreEstimator.ts +++ b/src/ScoreEstimator.ts @@ -566,11 +566,6 @@ export class ScoreEstimator { } else { this.white.scoring_positions += encodeMoves(gr.points); } - - console.warn( - "What should be unreached code is running, should probably be running " + - "this[color].territory += markScored(gr.points, false);", - ); } }); } diff --git a/src/__tests__/GobanCanvas.test.ts b/src/__tests__/GobanCanvas.test.ts index 09dbcb81..e29814ba 100644 --- a/src/__tests__/GobanCanvas.test.ts +++ b/src/__tests__/GobanCanvas.test.ts @@ -5,8 +5,7 @@ (global as any).CLIENT = true; import { GobanCanvas, GobanCanvasConfig } from "../GobanCanvas"; -import { GobanCore } from "../GobanCore"; -import { AUTOSCORE_TOLERANCE, AUTOSCORE_TRIALS } from "../GoEngine"; +import { GobanCore, SCORE_ESTIMATION_TOLERANCE, SCORE_ESTIMATION_TRIALS } from "../GobanCore"; import { GobanSocket } from "../GobanSocket"; import * as GoMath from "../GoMath"; import WS from "jest-websocket-mock"; @@ -419,8 +418,8 @@ describe("onTap", () => { expect(goban.engine.estimateScore).toBeCalledTimes(1); expect(goban.engine.estimateScore).toBeCalledWith( - AUTOSCORE_TRIALS, - AUTOSCORE_TOLERANCE, + SCORE_ESTIMATION_TRIALS, + SCORE_ESTIMATION_TOLERANCE, false, ); (goban.engine.estimateScore as jest.Mock).mockClear();