Permalink
Browse files

Add new superlinear interpolator

Faster transition and between phases and
more persistent during mid and ending game.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
  • Loading branch information...
1 parent 2dbc8fe commit cde7b30b656471f28e1bfbafbf2c4de2c746bd2c @mcostalba committed Sep 20, 2008
Showing with 6 additions and 1 deletion.
  1. +6 −1 src/evaluate.cpp
View
@@ -1156,7 +1156,12 @@ namespace {
else
ev = apply_scale_factor(ev, sf[BLACK]);
- Value result = Value(int((mv * ph + ev * (128 - ph)) / 128));
+ // Superlinear interpolator
+ int sli_ph = int(ph);
+ sli_ph -= (64 - sli_ph) / 4;
+ sli_ph = Min(PHASE_MIDGAME, Max(PHASE_ENDGAME, sli_ph)); // ceiling
+
+ Value result = Value(int((mv * sli_ph + ev * (128 - sli_ph)) / 128));
return Value(int(result) & ~(GrainSize - 1));
}

0 comments on commit cde7b30

Please sign in to comment.