Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up ScoreEstimator.ts #135

Merged
merged 19 commits into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
92f95bc
Remove unused getProbablyDead call.
benjaminpjones Oct 25, 2023
2015e3b
ScoreEstimator.getProbablyDead: Remove the WASM code path.
benjaminpjones Oct 25, 2023
3172963
Remove duplicate removal variable.
benjaminpjones Oct 25, 2023
54f1008
Delete commented code.
benjaminpjones Oct 25, 2023
9c83a22
Remove SERVER path for init_score_estimator.
benjaminpjones Oct 25, 2023
4edb6d2
Remove ScoreEstimator.estimated_area
benjaminpjones Oct 25, 2023
d6194f4
Extract score adjustment into its own function.
benjaminpjones Oct 25, 2023
b765fa0
Remove heat and area from ScoreEstimator.
benjaminpjones Oct 25, 2023
dd6bf8f
Remove estimated_score from ScoreEstimator (unused)
benjaminpjones Oct 25, 2023
898bfe7
Remove unused tolerance paramter from estimateScoreRemote.
benjaminpjones Oct 25, 2023
1ce6871
Remove black_prisoners and white_prisoners as these are only ever set…
benjaminpjones Oct 25, 2023
ae22ca5
Remove estimated_score and estimated_hard_score from SEGroup
benjaminpjones Oct 25, 2023
e231515
Use GoMath functions for group logic.
benjaminpjones Oct 25, 2023
578b62f
Remove liberties from SEGroup (unused member)
benjaminpjones Oct 25, 2023
f7ead99
Add test for resetGroups
benjaminpjones Oct 25, 2023
c5c7eea
Add test for amount and winner
benjaminpjones Oct 25, 2023
8149a84
Remove amount_frational (unused)
benjaminpjones Oct 25, 2023
7ad1995
Remove currentMarker, since IDs are now generated by GoStoneGroups
benjaminpjones Oct 26, 2023
0d30b30
Re-add prisoners to the ScoreEstimateRequest
benjaminpjones Oct 27, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 0 additions & 22 deletions src/GoEngine.ts
Original file line number Diff line number Diff line change
Expand Up @@ -681,28 +681,6 @@ export class GoEngine extends EventEmitter<Events> {
if (config.removed) {
removed = this.decodeMoves(config.removed);
}
if (
CLIENT &&
!this.territory_included_in_sgf &&
typeof config.removed === "undefined" &&
config.original_sgf &&
/[0-9.]+/.test(self.outcome)
) {
// Game data for SGF uploaded games don't always include removed stones, so we use score
// estimator to find probably dead stones to get a closer approximation of what
// territories should be marked in the final board position.
//
// NOTE: Some Go clients (not OGS, at least for now) do include dead stones in their
// SGFs, which we respect if present and skip using the score estimator.
const se = new ScoreEstimator(
this.goban_callback,
this,
AUTOSCORE_TRIALS,
AUTOSCORE_TOLERANCE,
true,
);
removed = this.decodeMoves(se.getProbablyDead());
}
if (removed) {
for (let i = 0; i < removed.length; ++i) {
this.setRemoved(removed[i].x, removed[i].y, true, false);
Expand Down
2 changes: 1 addition & 1 deletion src/GobanCanvas.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2100,7 +2100,7 @@ export class GobanCanvas extends GobanCore {

if (this.scoring_mode && this.score_estimate) {
const se = this.score_estimate;
const est = se.heat[j][i];
const est = se.ownership[j][i];

ctx.beginPath();

Expand Down
Loading
Loading