All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
newProgress.cc
Go to the documentation of this file.
2 #include "osl/eval/ml/weights.h"
3 #include "osl/eval/ml/midgame.h"
6 #include "osl/pieceStand.h"
7 #include "osl/oslConfig.h"
8 #include <boost/foreach.hpp>
9 #include <iostream>
10 #include <fstream>
11 
14 {
15  return l.progresses == r.progresses
19  && l.defenses == r.defenses
20  && l.rook == r.rook && l.bishop == r.bishop && l.gold == r.gold
21  && l.silver == r.silver && l.promoted == r.promoted
26 }
27 
44 osl::CArray<int, 262144>
46 osl::CArray<int, 10>
48 osl::CArray<int, 16>
50 osl::CArray<int, 56>
54 
55 bool osl::progress::ml::NewProgress::setUp(const char *filename)
56 {
57  if (initialized_flag)
58  return true;
59 
60  static CArray<int, 25> effect_weight;
61  static CArray<int, 225> effect_x_weight, effect_y_weight;
62  static CArray<int, 25> effect_defense_weight;
63  static CArray<int, 225> effect_per_effect;
64  static CArray<int, 225> effect_per_effect_defense;
65  static CArray<int, 2025> effect_per_effect_y, effect_per_effect_x;
66  std::ifstream is(filename);
67  int read_count = 0;
68 
69  osl::eval::ml::Weights weights(25);
70  for (size_t i = 0; i < weights.dimension(); ++i)
71  {
72  int val;
73  is >> val;
74  effect_weight[i] = val;
75  ++read_count;
76  }
77  for (size_t i = 0; i < 225; ++i)
78  {
79  int val;
80  is >> val;
81  effect_x_weight[i] = val;
82  ++read_count;
83  }
84  for (size_t i = 0; i < 225; ++i)
85  {
86  int val;
87  is >> val;
88  effect_y_weight[i] = val;
89  ++read_count;
90  }
91  weights.resetDimension(25);
92  for (size_t i = 0; i < weights.dimension(); ++i)
93  {
94  int val;
95  is >> val;
96  effect_defense_weight[i] = val;
97  ++read_count;
98  }
99  weights.resetDimension(225);
100  for (size_t i = 0; i < weights.dimension(); ++i)
101  {
102  int val;
103  is >> val;
104  effect_per_effect[i] = val;
105  ++read_count;
106  }
107  weights.resetDimension(225);
108  for (size_t i = 0; i < weights.dimension(); ++i)
109  {
110  int val;
111  is >> val;
112  effect_per_effect_defense[i] = val;
113  ++read_count;
114  }
115 
116  weights.resetDimension(2025);
117  for (size_t i = 0; i < weights.dimension(); ++i)
118  {
119  int val;
120  is >> val;
121  effect_per_effect_y[i] = val;
122  ++read_count;
123  }
124  weights.resetDimension(2025);
125  for (size_t i = 0; i < weights.dimension(); ++i)
126  {
127  int val;
128  is >> val;
129  effect_per_effect_x[i] = val;
130  ++read_count;
131  }
132  weights.resetDimension(Piece::SIZE);
133  for (size_t i = 0; i < weights.dimension(); ++i)
134  {
135  int val;
136  is >> val;
137  stand_weight[i] = val;
138  ++read_count;
139  }
140  weights.resetDimension(1125);
141  for (size_t i = 0; i < weights.dimension(); ++i)
142  {
143  int val;
144  is >> val;
145  attack5x5_weight[i] = val;
146  ++read_count;
147  }
148  weights.resetDimension(75);
149  for (size_t i = 0; i < weights.dimension(); ++i)
150  {
151  int val;
152  is >> val;
153  effectstate_weight[i] = val;
154  ++read_count;
155  }
156  weights.resetDimension(5625);
157  for (size_t i = 0; i < weights.dimension(); ++i)
158  {
159  int val;
160  is >> val;
161  attack5x5_x_weight[i] = val;
162  ++read_count;
163  }
164  weights.resetDimension(10125);
165  for (size_t i = 0; i < weights.dimension(); ++i)
166  {
167  int val;
168  is >> val;
169  attack5x5_y_weight[i] = val;
170  ++read_count;
171  }
172  weights.resetDimension(4284);
173  for (size_t i = 0; i < weights.dimension(); ++i)
174  {
175  int val;
176  is >> val;
177  king_relative_weight[i] = val;
178  ++read_count;
179  }
180  weights.resetDimension(262144);
181  for (size_t i = 0; i < weights.dimension(); ++i)
182  {
183  int val;
184  is >> val;
186  ++read_count;
187  }
188  weights.resetDimension(10);
189  for (size_t i = 0; i < weights.dimension(); ++i)
190  {
191  int val;
192  is >> val;
193  pawn_facing_weight[i] = val;
194  ++read_count;
195  }
196  weights.resetDimension(16);
197  for (size_t i = 0; i < weights.dimension(); ++i)
198  {
199  int val;
200  is >> val;
201  promotion37_weight[i] = val;
202  ++read_count;
203  }
204  weights.resetDimension(56);
205  for (size_t i = 0; i < weights.dimension(); ++i)
206  {
207  int val;
208  is >> val;
209  piecestand7_weight[i] = val;
210  ++read_count;
211  }
212  {
213  int val;
214  is >> val;
215  max_progress = val;
216  ++read_count;
217 #ifdef EVAL_QUAD
218  while (((max_progress/ProgressScale) % 3) && max_progress > 0)
219  --max_progress;
220 #endif
221  }
222  for(int king_x=1;king_x<=9;king_x++){
223  for(int king_y=1;king_y<=9;king_y++){
224  Square king(king_x,king_y);
225  int king_index=(king_x-1)*9+king_y-1;
227  const int min_x = center.x() - 2;
228  const int min_y = center.y() - 1;
229  int i=0;
230  for (int dx=0; dx<5; ++dx)
231  {
232  for (int dy=0; dy<3; ++dy,++i)
233  {
234  const Square target(min_x+dx,min_y+dy);
235  int index0=king_index*15+i;
236  int index_a=index0*10;
237  int index_d=index0*10;
238  attack_relative[index_a]=
239  effect_weight[index<BLACK>(king, target)] +
240  effect_x_weight[indexX<BLACK>(king, target)] +
241  effect_y_weight[indexY<BLACK>(king, target)];
242  defense_relative[index_d]=
243  effect_defense_weight[index<BLACK>(king, target)];
244  for(int count=0;count<=8;count++){
245  attack_relative[index_a+count+1]=
246  effect_per_effect[indexPerEffect<BLACK>(king, target, count)] +
247  effect_per_effect_y[indexPerEffectY<BLACK>(king, target, count)] +
248  effect_per_effect_x[indexPerEffectX<BLACK>(king, target, count)];
249  defense_relative[index_d+count+1]=
250  effect_per_effect_defense[indexPerEffect<BLACK>(king, target, count)];
251  }
252  }
253  }
254  }
255  }
256  for(int king_x=1;king_x<=5;king_x++)
257  for(int promoted=0;promoted<=4;promoted++)
258  for(int silver=0;silver<=4;silver++)
259  for(int gold=0;gold<=4;gold++)
260  for(int bishop=0;bishop<=2;bishop++)
261  for(int rook=0;rook<=2;rook++){
262  int index0=promoted + 5 * (silver + 5 * (gold + 5 * (bishop + 3 * rook)));
263  int index1=king_x - 1 + 5 * (promoted + 5 * (silver + 5 * (gold + 5 * (bishop + 3 * rook))));
264  attack5x5_x_weight[index1]+=attack5x5_weight[index0];
265  }
266  for (int i=0; i<PTYPE_SIZE*2*PTYPE_SIZE; ++i)
267  for (int j=i+1; j<PTYPE_SIZE*2*PTYPE_SIZE; ++j) {
270  }
271  // set sum of [1..i] into [i], keep [0] as is.
272  for (int i=2; i<10; ++i)
274 
275  initialized_flag = is;
276  if (!initialized_flag)
277  {
278  std::cerr << "Failed to load NewProgress data " << read_count
279  << " from file " << filename << std::endl;
280  }
281  return initialized_flag;
282 }
283 
285 {
286  return setUp(defaultFilename().c_str());
287 }
288 
290 {
291  std::string filename = OslConfig::home();
292  filename += "/data/progress.txt";
293  return filename;
294 }
295 
296 template <osl::Player P>
298  const NumEffectState &state, int &attack, int &defense)
299 {
300  const Square king = state.kingSquare<P>();
302  const int min_x = center.x() - 2;
303  const int min_y = center.y() - 1;
304 
305  attack = defense = 0;
306  Square kingRel=king;
307  if(P==WHITE){
308  kingRel=kingRel.rotate180();
309  }
310  int index0=((kingRel.x()-1)*9+kingRel.y()-1)*15;
311  int index_a=index0*10 + (P==WHITE ? 10*14 : 0);
312  for (int dx=0; dx<5; ++dx)
313  {
314  for (int dy=0; dy<3; ++dy)
315  {
316  const Square target(min_x+dx,min_y+dy);
317  const int attack_count =
318  state.countEffect(alt(P), target);
319  const int defense_count =
320  state.countEffect(P, target);
321  attack += attack_count *attack_relative[index_a]+
322  attack_relative[index_a+std::min(attack_count,8)+1];
323  defense +=
324  defense_count * defense_relative[index_a]+
325  defense_relative[index_a+std::min(defense_count,8)+1];
326  if(P==BLACK){
327  index_a+=10;
328  }
329  else{
330  index_a-=10;
331  }
332  }
333  }
334 }
335 
336 template <osl::Player P>
338  const NumEffectState &state)
339 {
340  const Square king = state.kingSquare<P>();
341  const int min_x = std::max(1, king.x() - 2);
342  const int max_x = std::min(9, king.x() + 2);
343  const int min_y = std::max(1, king.y() - 2);
344  const int max_y = std::min(9, king.y() + 2);
345  effect_progresses[P] = 0;
346 
347  PieceMask mask;
348  for (int y = min_y; y <= max_y; ++y)
349  {
350  for (int x = min_x; x <= max_x; ++x)
351  {
352  const Square target(x, y);
353  const NumBitmapEffect effect = state.effectSetAt(target);
354  const int effect_diff =
355  effect.countEffect(alt(P)) - effect.countEffect(P);
356  const int x_diff = std::abs(x - king.x());
357  const int y_diff = (P == WHITE ? king.y() - y : y - king.y());
358  int index = std::max(std::min(effect_diff, 2), -2) + 2 + 5 * x_diff +
359  5 * 3 * (y_diff + 2);
360  effect_progresses[P] += effectstate_weight[index];
361  mask |= effect;
362  }
363  }
364  updateAttack5x5Pieces<P>(mask, state);
365 }
366 
367 template <osl::Player P>
369  PieceMask mask, const NumEffectState& state)
370 {
371  const Player attack = PlayerTraits<P>::opponent;
372  mask &= state.piecesOnBoard(attack);
373 
374  rook[attack] = mask.selectBit<ROOK>().countBit();
375  bishop[attack] = mask.selectBit<BISHOP>().countBit();
376  gold[attack] = mask.selectBit<GOLD>().countBit();
377  silver[attack] =
378  (mask & ~state.promotedPieces()).selectBit<SILVER>().countBit();
379  PieceMask promoted_pieces = mask & state.promotedPieces();
380  promoted_pieces.clearBit<ROOK>();
381  promoted_pieces.clearBit<BISHOP>();
382  promoted[attack] =
383  std::min(promoted_pieces.countBit(), 4);
384 }
385 
386 template <osl::Player P>
388  const NumEffectState &state) const
389 {
390  const Player attack = PlayerTraits<P>::opponent;
391  int king_x = state.kingSquare<P>().x();
392  if (king_x > 5)
393  king_x = 10 - king_x;
394  const int king_y = (P == BLACK ? state.kingSquare<P>().y() :
395  10 - state.kingSquare<P>().y());
396  return (attack5x5_x_weight[index5x5x(
397  rook[attack] + state.countPiecesOnStand<ROOK>(attack),
398  bishop[attack] + state.countPiecesOnStand<BISHOP>(attack),
399  gold[attack] + state.countPiecesOnStand<GOLD>(attack),
400  silver[attack] + state.countPiecesOnStand<SILVER>(attack),
401  promoted[attack], king_x)] +
402  attack5x5_y_weight[index5x5y(
403  rook[attack] + state.countPiecesOnStand<ROOK>(attack),
404  bishop[attack] + state.countPiecesOnStand<BISHOP>(attack),
405  gold[attack] + state.countPiecesOnStand<GOLD>(attack),
406  silver[attack] + state.countPiecesOnStand<SILVER>(attack),
407  promoted[attack], king_y)]);
408 }
409 
410 void
412  const NumEffectState &state)
413 {
414  const CArray<Square,2> kings = {{
415  state.kingSquare(BLACK),
416  state.kingSquare(WHITE),
417  }};
418  king_relative_attack.fill(0);
419  king_relative_defense.fill(0);
420  for (int i = 0; i < Piece::SIZE; ++i)
421  {
422  const Piece piece = state.pieceOf(i);
423  if (piece.ptype() == osl::KING || !piece.isOnBoard())
424  continue;
425  Player pl = piece.owner();
426  const int index_attack = indexRelative(piece.owner(), kings[alt(pl)],
427  piece);
428  const int index_defense = indexRelative(piece.owner(), kings[pl],
429  piece) + 2142;
430  king_relative_attack[pl] += king_relative_weight[index_attack];
431  king_relative_defense[pl] += king_relative_weight[index_defense];
432  }
433 }
434 
435 template <osl::Player Owner>
437 updateNonPawnAttackedPtypePairOne(const NumEffectState& state)
438 {
439  PieceMask attacked = state.effectedMask(alt(Owner)) & state.piecesOnBoard(Owner);
440  attacked.reset(state.kingPiece<Owner>().number());
441  mask_t ppawn = state.promotedPieces().getMask<PAWN>() & attacked.selectBit<PAWN>();
442  attacked.clearBit<PAWN>();
443  attacked.orMask(PtypeFuns<PAWN>::indexNum, ppawn);
444  PieceVector pieces;
445  while (attacked.any())
446  {
447  const Piece piece = state.pieceOf(attacked.takeOneBit());
448  pieces.push_back(piece);
449  }
450  typedef eval::ml::NonPawnAttackedPtypePair feature_t;
451  int result = 0;
452  MultiInt result_eval;
453  for (size_t i=0; i<pieces.size(); ++i) {
454  const int i0 = feature_t::index1(state, pieces[i]);
455  result += attacked_ptype_pair_weight[feature_t::index2(0,i0)];
456  for (size_t j=i+1; j<pieces.size(); ++j) {
457  const int i1 = feature_t::index1(state, pieces[j]);
458  result += attacked_ptype_pair_weight[feature_t::index2(i0,i1)];
459  if (Owner == BLACK)
460  result_eval += feature_t::table[feature_t::index2(i0, i1)];
461  else
462  result_eval -= feature_t::table[feature_t::index2(i0, i1)];
463  }
464  }
465  non_pawn_ptype_attacked_pair[Owner] = result;
466  non_pawn_ptype_attacked_pair_eval[Owner] = result_eval;
467 }
468 
470 updateNonPawnAttackedPtypePair(const NumEffectState& state)
471 {
472  updateNonPawnAttackedPtypePairOne<BLACK>(state);
473  updateNonPawnAttackedPtypePairOne<WHITE>(state);
474 }
475 
477 updatePawnFacing(const NumEffectState& state)
478 {
479  PieceMask attacked = state.effectedMask(WHITE) & state.piecesOnBoard(BLACK);
480  mask_t pawn = attacked.selectBit<PAWN>()
481  & ~(state.promotedPieces().getMask<PAWN>());
482  int count = 0;
483  while (pawn.any()) {
484  const Piece p(state.pieceOf(pawn.takeOneBit()+PtypeFuns<PAWN>::indexNum*32));
485  if (state.hasEffectByPtypeStrict<PAWN>(WHITE, p.square()))
486  ++count;
487  }
488  pawn_facing = pawn_facing_weight[count];
489 }
490 
491 template <osl::Player P>
493 NewProgress::promotion37One(const NumEffectState& state, int rank)
494 {
495  typedef eval::ml::Promotion37 feature_t;
496  CArray<int,PTYPE_SIZE> count = {{ 0 }};
497  for (int x=1; x<=9; ++x) {
498  const Square target(x, rank);
499  if (! state[target].isEmpty())
500  continue;
501  int a = state.countEffect(P, target);
502  const int d = state.countEffect(alt(P), target);
503  if (a > 0 && a == d)
504  a += AdditionalEffect::hasEffect(state, target, P);
505  if (a < d)
506  continue;
507  const Ptype ptype = state.findCheapAttack(P, target).ptype();
508  if (isPiece(ptype) && ! isPromoted(ptype))
509  count[ptype]++;
510  }
511  for (int p=PTYPE_BASIC_MIN; p<=PTYPE_MAX; ++p) {
512  if (count[p] > 0) {
513  promotion37 += promotion37_weight[p];
514  promotion37_eval += feature_t::table[p]*playerToMul(P);
515  }
516  if (count[p] > 1) {
517  promotion37 += promotion37_weight[p-8]*(count[p]-1);
518  promotion37_eval += feature_t::table[p-8]*(playerToMul(P)*(count[p]-1));
519  }
520  }
521 }
522 
524 updatePromotion37(const NumEffectState& state)
525 {
526  promotion37 = 0;
527  promotion37_eval = MultiInt();
528  promotion37One<BLACK>(state, 3);
529  promotion37One<WHITE>(state, 7);
530 }
531 
533 updatePieceStand7(const NumEffectState& state)
534 {
535  piecestand7 = 0;
536  for (int z=0; z<2; ++z) {
537  CArray<int,7> stand = {{ 0 }};
538  int filled = 0;
539  BOOST_FOREACH(Ptype ptype, PieceStand::order)
540  if (state.hasPieceOnStand(indexToPlayer(z), ptype))
541  stand[filled++] = ptype-PTYPE_BASIC_MIN;
542  for (int i=0; i<std::min(7,filled+1); ++i)
543  piecestand7 += piecestand7_weight[stand[i] + 8*i];
544  }
545 }
546 
548  const NumEffectState &state)
549 {
550  assert(initialized_flag);
551 
552  progressOne<BLACK>(state,
553  progresses[BLACK],
554  defenses[WHITE]);
555  progressOne<WHITE>(state,
556  progresses[WHITE],
557  defenses[BLACK]);
558  updateAttack5x5PiecesAndState<BLACK>(state);
559  updateAttack5x5PiecesAndState<WHITE>(state);
560  attack5x5_progresses[BLACK] =
561  attack5x5Value<BLACK>(state);
562  attack5x5_progresses[WHITE] =
563  attack5x5Value<WHITE>(state);
564  stand_progresses.fill(0);
565  BOOST_FOREACH(Ptype ptype, PieceStand::order)
566  {
567  const int black_count =
568  state.countPiecesOnStand(BLACK, ptype);
569  const int white_count =
570  state.countPiecesOnStand(WHITE, ptype);
571  for (int j = 0; j < black_count; ++j)
572  {
573  stand_progresses[WHITE] +=
574  stand_weight[Ptype_Table.getIndexMin(ptype) + j];
575  }
576  for (int j = 0; j < white_count; ++j)
577  {
578  stand_progresses[BLACK] +=
579  stand_weight[Ptype_Table.getIndexMin(ptype) + j];
580  }
581  }
582  updatePieceKingRelativeBonus(state);
583  updateNonPawnAttackedPtypePair(state);
584  updatePawnFacing(state);
585  updatePromotion37(state);
586  updatePieceStand7(state);
587 }
588 
589 template<osl::Player P>
590 inline
592  const NumEffectState &new_state,
593  Move last_move)
594 {
596  assert(new_state.turn()==altP);
597  assert(last_move.player()==P);
598  const Square kb = new_state.kingSquare<BLACK>(), kw = new_state.kingSquare<WHITE>();
599  const BoardMask mb = new_state.changedEffects(BLACK), mw = new_state.changedEffects(WHITE);
600  const bool king_move = last_move.ptype() == KING;
601  if ((king_move && altP == BLACK) || mb.anyInRange(Board_Mask_Table5x3_Center.mask(kw)) || mw.anyInRange(Board_Mask_Table5x3_Center.mask(kw)))
602  {
603  progressOne<WHITE>(new_state,progresses[WHITE],defenses[BLACK]);
604  }
605  if ((king_move && altP == WHITE) || mw.anyInRange(Board_Mask_Table5x3_Center.mask(kb)) || mb.anyInRange(Board_Mask_Table5x3_Center.mask(kb)))
606  {
607  progressOne<BLACK>(new_state,progresses[BLACK],defenses[WHITE]);
608  }
609 
610  const Ptype captured = last_move.capturePtype();
611 
612  if (last_move.isDrop())
613  {
614  const int count =
615  new_state.countPiecesOnStand(P, last_move.ptype()) + 1;
616  const int value =
617  stand_weight[Ptype_Table.getIndexMin(last_move.ptype()) + count - 1];
618  stand_progresses[altP] -= value;
619  }
620  else if (captured != PTYPE_EMPTY)
621  {
622  Ptype ptype = unpromote(captured);
623  const int count = new_state.countPiecesOnStand(P, ptype);
624  const int value =
625  stand_weight[(Ptype_Table.getIndexMin(ptype) + count - 1)];
626  stand_progresses[altP] += value;
627  }
628 
629  if (king_move)
630  {
631  updatePieceKingRelativeBonus(new_state);
632  }
633  else
634  {
635  const CArray<Square,2> kings = {{
636  new_state.kingSquare(BLACK),
637  new_state.kingSquare(WHITE),
638  }};
639  if (!last_move.isDrop())
640  {
641  const int index_attack =
642  indexRelative<P>(kings[altP],
643  last_move.oldPtype(), last_move.from());
644  const int index_defense =
645  indexRelative<P>(kings[P],
646  last_move.oldPtype(), last_move.from()) + 2142;
647  king_relative_attack[P] -=
648  king_relative_weight[index_attack];
649  king_relative_defense[P] -=
650  king_relative_weight[index_defense];
651  }
652  {
653  const int index_attack =
654  indexRelative<P>(kings[altP],
655  last_move.ptype(), last_move.to());
656  const int index_defense =
657  indexRelative<P>(kings[P],
658  last_move.ptype(), last_move.to()) + 2142;
659  king_relative_attack[P] +=
660  king_relative_weight[index_attack];
661  king_relative_defense[P] +=
662  king_relative_weight[index_defense];
663  }
664  if (captured != PTYPE_EMPTY)
665  {
666  const int index_attack =
667  indexRelative<altP>(kings[P],
668  captured, last_move.to());
669  const int index_defense =
670  indexRelative<altP>(kings[altP],
671  captured, last_move.to()) + 2142;
672  king_relative_attack[altP] -=
673  king_relative_weight[index_attack];
674  king_relative_defense[altP] -=
675  king_relative_weight[index_defense];
676  }
677  }
678  updateNonPawnAttackedPtypePair(new_state);
679  updatePawnFacing(new_state);
680  updatePromotion37(new_state);
681  updatePieceStand7(new_state);
682 }
683 
684 template<osl::Player P>
686  const NumEffectState &new_state,
687  Move last_move)
688 {
690  assert(new_state.turn()==altP);
691  if (last_move.isPass())
692  return;
693  const Square kb = new_state.kingSquare<BLACK>(), kw = new_state.kingSquare<WHITE>();
694  const BoardMask mb = new_state.changedEffects(BLACK), mw = new_state.changedEffects(WHITE);
695  const bool king_move = last_move.ptype() == KING;
696  const Ptype captured = last_move.capturePtype();
697 
698  if ((king_move && altP == BLACK) ||
699  mb.anyInRange(Board_Mask_Table5x5.mask(kw)) ||
700  mw.anyInRange(Board_Mask_Table5x5.mask(kw)))
701  {
702  updateAttack5x5PiecesAndState<WHITE>(new_state);
703  attack5x5_progresses[WHITE] =
704  attack5x5Value<WHITE>(new_state);
705  }
706  else if (altP == WHITE &&(last_move.isDrop() || captured != PTYPE_EMPTY))
707  {
708  attack5x5_progresses[WHITE] =
709  attack5x5Value<WHITE>(new_state);
710  }
711  if ((king_move && altP == WHITE) ||
712  mw.anyInRange(Board_Mask_Table5x5.mask(kb)) ||
713  mb.anyInRange(Board_Mask_Table5x5.mask(kb)))
714  {
715  updateAttack5x5PiecesAndState<BLACK>(new_state);
716  attack5x5_progresses[BLACK] =
717  attack5x5Value<BLACK>(new_state);
718  }
719  else if (altP == BLACK && (last_move.isDrop() || captured != PTYPE_EMPTY))
720  {
721  attack5x5_progresses[BLACK] =
722  attack5x5Value<BLACK>(new_state);
723  }
724  updateMain<P>(new_state, last_move);
725 }
726 
728 {
730 
731  info.black_values[NewProgressDebugInfo::ATTACK_5X3] = progresses[0];
733  info.black_values[NewProgressDebugInfo::ATTACK5X5] = attack5x5_progresses[0];
734  info.black_values[NewProgressDebugInfo::STAND] = stand_progresses[0];
735  info.black_values[NewProgressDebugInfo::EFFECT5X5] = effect_progresses[0];
736  info.black_values[NewProgressDebugInfo::KING_RELATIVE_ATTACK] = king_relative_attack[0];
737  info.black_values[NewProgressDebugInfo::KING_RELATIVE_DEFENSE] = king_relative_defense[0];
738  info.black_values[NewProgressDebugInfo::NON_PAWN_ATTACKED_PAIR] = non_pawn_ptype_attacked_pair[0];
739 
740  info.white_values[NewProgressDebugInfo::ATTACK_5X3] = progresses[1];
742  info.white_values[NewProgressDebugInfo::ATTACK5X5] = attack5x5_progresses[1];
743  info.white_values[NewProgressDebugInfo::STAND] = stand_progresses[1];
744  info.white_values[NewProgressDebugInfo::EFFECT5X5] = effect_progresses[1];
745  info.white_values[NewProgressDebugInfo::KING_RELATIVE_ATTACK] = king_relative_attack[1];
746  info.white_values[NewProgressDebugInfo::KING_RELATIVE_DEFENSE] = king_relative_defense[1];
747  info.white_values[NewProgressDebugInfo::NON_PAWN_ATTACKED_PAIR] = non_pawn_ptype_attacked_pair[1];
748 
749  return info;
750 }
751 
752 namespace osl
753 {
754  namespace progress
755  {
756  namespace ml
757  {
758  template void osl::progress::ml::NewProgress::updateSub<osl::BLACK>(const NumEffectState &new_state,Move last_move);
759  template void osl::progress::ml::NewProgress::updateSub<osl::WHITE>(const NumEffectState &new_state,Move last_move);
760  }
761  }
762 }
763 
764 // ;;; Local Variables:
765 // ;;; mode:c++
766 // ;;; c-basic-offset:2
767 // ;;; End: