Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexGianelli98 committed May 7, 2022
1 parent d8f755d commit 3c0235d
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,14 @@ public double evaluateState() {
if (numbOfWhite <= 4)
lateGame = true;


// Values for the weighted sum
double numberOfBlackAlive = (double) state.getNumberOf(State.Pawn.BLACK) / GameAshtonTablut.NUM_BLACK;
double numberOfWhiteEaten = (double) (GameAshtonTablut.NUM_WHITE - numbOfWhite) / GameAshtonTablut.NUM_WHITE;
double surroundKing = (double) checkAdjacentPawns(state, kingPos, State.Turn.BLACK.toString()) / getNumbToEatKing(state);

double whiteInDanger = (double) getPawnsAggression() / numbOfWhite;
stateValue += whiteInDanger * PAWNS_AGGRESSION_WEIGHT;
double whiteInDanger = getPawnsAggression();
if (whiteInDanger > 0)
stateValue += (whiteInDanger / numbOfWhite) * PAWNS_AGGRESSION_WEIGHT;

if (print) {
System.out.println("Black pawns alive: " + numberOfBlackAlive);
Expand Down

0 comments on commit 3c0235d

Please sign in to comment.