// weight_option() computes the value of an evaluation weight, by combining // two UCI-configurable weights (midgame and endgame) with an internal weight. public static WeightS weight_option(string mgOpt, string egOpt, Score internalWeight) { WeightS w = new WeightS(Engine.Options[mgOpt].getInt() * Types.mg_value(internalWeight) / 100, Engine.Options[egOpt].getInt() * Types.eg_value(internalWeight) / 100); return(w); }
public static Score[][] KingDanger = new Score[ColorS.COLOR_NB][] { new Score[128], new Score[128] }; // 2, 128 // apply_weight() weighs score 'v' by weight 'w' trying to prevent overflow public static Score apply_weight(Score v, WeightS w) { return(Types.make_score(Types.mg_value(v) * w.mg / 256, Types.eg_value(v) * w.eg / 256)); }