Rev 154 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 154 | Rev 156 | ||
|---|---|---|---|
| Line 78... | Line 78... | ||
| 78 | * again and again until we reach the top of the book * |
78 | * again and again until we reach the top of the book * |
| 79 | * tree. * |
79 | * tree. * |
| 80 | * * |
80 | * * |
| 81 | ************************************************************ |
81 | ************************************************************ |
| 82 | */ |
82 | */ |
| 83 | t_learn_value = ((float) learn_value) / 100.0; |
83 | t_learn_value = (float) (((float) learn_value) / 100.0); // Pierre-Marie Baty -- added type cast |
| 84 | for (i = 0; i < 64; i++) |
84 | for (i = 0; i < 64; i++) |
| 85 | if (learn_nmoves[i] > 1) |
85 | if (learn_nmoves[i] > 1) |
| 86 | nplies++; |
86 | nplies++; |
| 87 | nplies = Max(nplies, 1); |
87 | nplies = Max(nplies, 1); |
| 88 | for (i = 0; i < 64; i++) { |
88 | for (i = 0; i < 64; i++) { |
| Line 113... | Line 113... | ||
| 113 | if (j >= cluster) |
113 | if (j >= cluster) |
| 114 | return; |
114 | return; |
| 115 | if (fabs(book_buffer[j].learn) < 0.0001) |
115 | if (fabs(book_buffer[j].learn) < 0.0001) |
| 116 | book_buffer[j].learn = book_learn[i]; |
116 | book_buffer[j].learn = book_learn[i]; |
| 117 | else |
117 | else |
| 118 | book_buffer[j].learn = (book_buffer[j].learn + book_learn[i]) / 2.0; |
118 | book_buffer[j].learn = (float) ((book_buffer[j].learn + book_learn[i]) / 2.0); // Pierre-Marie Baty -- added type cast |
| 119 | fseek(book_file, learn_seekto[i] + 4, SEEK_SET); |
119 | fseek(book_file, learn_seekto[i] + 4, SEEK_SET); |
| 120 | if (cluster) |
120 | if (cluster) |
| 121 | BookClusterOut(book_file, cluster, book_buffer); |
121 | BookClusterOut(book_file, cluster, book_buffer); |
| 122 | fflush(book_file); |
122 | fflush(book_file); |
| 123 | } |
123 | } |
| Line 138... | Line 138... | ||
| 138 | ******************************************************************************* |
138 | ******************************************************************************* |
| 139 | */ |
139 | */ |
| 140 | int LearnFunction(int sv, int search_depth, int rating_difference, |
140 | int LearnFunction(int sv, int search_depth, int rating_difference, |
| 141 | int trusted_value) { |
141 | int trusted_value) { |
| 142 | float multiplier; |
142 | float multiplier; |
| 143 | static const float rating_mult_t[11] = { . |
143 | static const float rating_mult_t[11] = { .00625f, .0125f, .025f, .05f, .075f, .1f, // Pierre-Marie Baty -- fixed constant truncations |
| 144 | 0. |
144 | 0.15f, 0.2f, 0.25f, 0.3f, 0.35f |
| 145 | }; |
145 | }; |
| 146 | static const float rating_mult_ut[11] = { . |
146 | static const float rating_mult_ut[11] = { .25f, .2f, .15f, .1f, .05f, .025f, .012f, // Pierre-Marie Baty -- added type cast |
| 147 | . |
147 | .006f, .003f, .001f |
| 148 | }; |
148 | }; |
| 149 | int sd, rd, value; |
149 | int sd, rd, value; |
| 150 | 150 | ||
| 151 | sd = Max(Min(search_depth - 10, 19), 0); |
151 | sd = Max(Min(search_depth - 10, 19), 0); |
| 152 | rd = Max(Min(rating_difference / 200, 5), -5) + 5; |
152 | rd = Max(Min(rating_difference / 200, 5), -5) + 5; |