X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=dbca332896e9f5827d26cd3acaf7a4839b25cce1;hb=921bd87280e0164270ddd5c28213d5b4593ca6c3;hp=4575958c0bdd6cad71975417e32b954b0477faa9;hpb=569bc75eb860f2b644e3797c465205579c7d3ed7;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 4575958c..dbca3328 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -46,7 +46,7 @@ namespace { const int GrainSize = 8; // Evaluation weights, initialized from UCI options - enum { Mobility, PawnStructure, PassedPawns, Space, KingSafetyUs, KingSafetyThem }; + enum { Mobility, PawnStructure, PassedPawns, Space, KingDangerUs, KingDangerThem }; Score Weights[6]; typedef Value V; @@ -203,10 +203,10 @@ namespace { (1ULL<(undefended)) + InitKingDanger[relative_square(Us, s)] @@ -855,14 +855,14 @@ namespace { // out of bounds errors. attackUnits = Min(99, Max(0, attackUnits)); - // Finally, extract the king safety score from the SafetyTable[] array. + // Finally, extract the king danger score from the KingDangerTable[] array. // Subtract the score from evaluation, and set ei.futilityMargin[]. - // The reason for storing the king safety score to futility margin - // is that the king safety scores can sometimes be very big, and that + // The reason for storing the king danger score to futility margin + // is that the king danger scores can sometimes be very big, and that // capturing a single attacking piece can therefore result in a score // change far bigger than the value of the captured piece. - ei.value -= Sign[Us] * SafetyTable[Us][attackUnits]; - ei.futilityMargin[Us] = mg_value(SafetyTable[Us][attackUnits]); + ei.value -= Sign[Us] * KingDangerTable[Us][attackUnits]; + ei.futilityMargin[Us] = mg_value(KingDangerTable[Us][attackUnits]); } } @@ -1223,9 +1223,9 @@ namespace { t[i] = Value(peak); } - // Then apply the weights and get the final SafetyTable[] array + // Then apply the weights and get the final KingDangerTable[] array for (Color c = WHITE; c <= BLACK; c++) for (int i = 0; i < 100; i++) - SafetyTable[c][i] = apply_weight(make_score(t[i], 0), Weights[KingSafetyUs + c]); + KingDangerTable[c][i] = apply_weight(make_score(t[i], 0), Weights[KingDangerUs + c]); } }