From 959d43321c7833cd403e3159439b999fa54e4d04 Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Sat, 9 Dec 2023 01:44:35 -0800 Subject: [PATCH] Adjust weights --- analysis.go | 7 +++++-- board.go | 4 ++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/analysis.go b/analysis.go index 0afa1c8..9a1ce88 100644 --- a/analysis.go +++ b/analysis.go @@ -9,8 +9,8 @@ import ( const queueBufferSize = 4096000 var ( - WeightBlot = 1.1 - WeightHit = -0.9 + WeightBlot = 1.05 + WeightHit = -1.0 WeightOppScore = -1.5 ) @@ -87,6 +87,9 @@ func (a *Analysis) _analyze() { } a.Board = a.Board.Move(move[0], move[1], a.player).UseRoll(move[0], move[1], a.player) } + if !a.Past { + a.Past = a.Board.Past() + } a.Board.evaluate(a.player, hs, a) if a.player == 1 && !a.Past { diff --git a/board.go b/board.go index 17d568e..f349674 100644 --- a/board.go +++ b/board.go @@ -345,7 +345,7 @@ func (b Board) Blots(player int) int { if checkers != 1 { continue } - pips += int(checkers) * PseudoPips(o, space) + pips += checkers * PseudoPips(o, space) } return pips } @@ -466,7 +466,7 @@ func spaceValue(player int, space int) int { func PseudoPips(player int, space int) int { v := 6 + spaceValue(player, space) + int(math.Exp(float64(spaceValue(player, space))*0.2))*2 if (player == 1 && (space > 6 || space == SpaceBarPlayer)) || (player == 2 && (space < 19 || space == SpaceBarOpponent)) { - v += 36 + v += 24 } return v }