“bloop” evaluation functionsandiway/csc483/task4/nation.pdf · “bloop” evaluation function...

4
“Bloop” evaluation function 10/22/07 By: Zach Nation Lines of code: 1,159 Total hours: ~55

Upload: others

Post on 17-Oct-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: “Bloop” evaluation functionsandiway/CSC483/task4/nation.pdf · “Bloop” evaluation function 10/22/07 By: Zach Nation Lines of code: 1,159 Total hours: ~55. Disclaimer The numbers

“Bloop” evaluationfunction

10/22/07By: Zach Nation

Lines of code: 1,159Total hours: ~55

Page 2: “Bloop” evaluation functionsandiway/CSC483/task4/nation.pdf · “Bloop” evaluation function 10/22/07 By: Zach Nation Lines of code: 1,159 Total hours: ~55. Disclaimer The numbers

Disclaimer

The numbers produced are a littleinaccurate due to my dysfunctionalbitboard implementation.

More methods of getting anaccurate evaluation will becomeavailable to me (and will beimplemented) when that isfinished.

Page 3: “Bloop” evaluation functionsandiway/CSC483/task4/nation.pdf · “Bloop” evaluation function 10/22/07 By: Zach Nation Lines of code: 1,159 Total hours: ~55. Disclaimer The numbers

The Evaluation Function // first, sum piece value double value = 0.0; int i; for (i=0; i<12; i++) { // for each piece type, multiply the value of that piece // times the number of instances value += pieceValues[i] * (double) countPieces(board[i]); } // weight the piece value sum // against the total piece count // (being up a piece is worth more // when there are fewer pieces total) value /= (double) countPieces(occupied()); // count the number of possible captures for each side // add the difference of (white - black)/total to value // similar to the "mobility" function unsigned long long wMoves = getAllMoves(WHITE); unsigned long long wCaptures = wMoves & black(); unsigned long long bMoves = getAllMoves(BLACK); unsigned long long bCaptures = bMoves & white(); int wCapturesNum = countPieces(wCaptures); int bCapturesNum = countPieces(bCaptures); if (wCapturesNum + bCapturesNum != 0) { double ratio = countPieces(wCaptures) - countPieces(bCaptures); ratio /= (double) (countPieces(wCaptures) + countPieces(bCaptures)); value += ratio; } return value;

Page 4: “Bloop” evaluation functionsandiway/CSC483/task4/nation.pdf · “Bloop” evaluation function 10/22/07 By: Zach Nation Lines of code: 1,159 Total hours: ~55. Disclaimer The numbers

Results

1.1 ?unclear16

0=15

-0.5 (too low)=14

0 (slightly high)=/+13

0 (slightly high)=/+12

0 (slightly low)+/=11

1 (too high)+/=10

0.467742 (wrong)-/+9

-0.25-/+8

1+/-7

0.6+/-6

0.1875+/-5

-0.47931-+4

-1-+3

0.375+-2

3+-1

Evaluation Function ResultLevon’s verdictBoard Position #