00001 #include "osl/progress/ml/newProgress.h"
00002 #include "osl/eval/ml/weights.h"
00003 #include "osl/eval/ml/midgame.h"
00004 #include "osl/eval/ml/minorPiece.h"
00005 #include "osl/pieceStand.h"
00006 #include "osl/oslConfig.h"
00007 #include <boost/foreach.hpp>
00008 #include <iostream>
00009 #include <fstream>
00010
00011 bool osl::progress::ml::
00012 operator==(const NewProgressData& l, const NewProgressData& r)
00013 {
00014 return l.progresses == r.progresses
00015 && l.attack5x5_progresses == r.attack5x5_progresses
00016 && l.stand_progresses == r.stand_progresses
00017 && l.effect_progresses == r.effect_progresses
00018 && l.defenses == r.defenses
00019 && l.rook == r.rook && l.bishop == r.bishop && l.gold == r.gold
00020 && l.silver == r.silver && l.promoted == r.promoted
00021 && l.king_relative_attack == r.king_relative_attack
00022 && l.king_relative_defense == r.king_relative_defense
00023 && l.non_pawn_ptype_attacked_pair == r.non_pawn_ptype_attacked_pair
00024 && l.non_pawn_ptype_attacked_pair_eval == r.non_pawn_ptype_attacked_pair_eval;
00025 }
00026
00027 osl::misc::CArray<int, 81*15*10>
00028 osl::progress::ml::NewProgress::attack_relative;
00029 osl::misc::CArray<int, 81*15*10>
00030 osl::progress::ml::NewProgress::defense_relative;
00031 osl::misc::CArray<int, osl::Piece::SIZE>
00032 osl::progress::ml::NewProgress::stand_weight;
00033 osl::misc::CArray<int, 1125>
00034 osl::progress::ml::NewProgress::attack5x5_weight;
00035 osl::misc::CArray<int, 5625>
00036 osl::progress::ml::NewProgress::attack5x5_x_weight;
00037 osl::misc::CArray<int, 10125>
00038 osl::progress::ml::NewProgress::attack5x5_y_weight;
00039 osl::misc::CArray<int, 75>
00040 osl::progress::ml::NewProgress::effectstate_weight;
00041 osl::misc::CArray<int, 4284>
00042 osl::progress::ml::NewProgress::king_relative_weight;
00043 osl::CArray<int, 262144>
00044 osl::progress::ml::NewProgress::attacked_ptype_pair_weight;
00045 int osl::progress::ml::NewProgress::max_progress;
00046 bool osl::progress::ml::NewProgress::initialized_flag;
00047
00048 bool osl::progress::ml::NewProgress::setUp(const char *filename)
00049 {
00050 if (initialized_flag)
00051 return true;
00052
00053 static CArray<int, 25> effect_weight;
00054 static CArray<int, 225> effect_x_weight, effect_y_weight;
00055 static CArray<int, 25> effect_defense_weight;
00056 static CArray<int, 225> effect_per_effect;
00057 static CArray<int, 225> effect_per_effect_defense;
00058 static CArray<int, 2025> effect_per_effect_y, effect_per_effect_x;
00059 std::ifstream is(filename);
00060 int read_count = 0;
00061
00062 osl::eval::ml::Weights weights(25);
00063 for (size_t i = 0; i < weights.dimension(); ++i)
00064 {
00065 int val;
00066 is >> val;
00067 effect_weight[i] = val;
00068 ++read_count;
00069 }
00070 for (size_t i = 0; i < 225; ++i)
00071 {
00072 int val;
00073 is >> val;
00074 effect_x_weight[i] = val;
00075 ++read_count;
00076 }
00077 for (size_t i = 0; i < 225; ++i)
00078 {
00079 int val;
00080 is >> val;
00081 effect_y_weight[i] = val;
00082 ++read_count;
00083 }
00084 weights.resetDimension(25);
00085 for (size_t i = 0; i < weights.dimension(); ++i)
00086 {
00087 int val;
00088 is >> val;
00089 effect_defense_weight[i] = val;
00090 ++read_count;
00091 }
00092 weights.resetDimension(225);
00093 for (size_t i = 0; i < weights.dimension(); ++i)
00094 {
00095 int val;
00096 is >> val;
00097 effect_per_effect[i] = val;
00098 ++read_count;
00099 }
00100 weights.resetDimension(225);
00101 for (size_t i = 0; i < weights.dimension(); ++i)
00102 {
00103 int val;
00104 is >> val;
00105 effect_per_effect_defense[i] = val;
00106 ++read_count;
00107 }
00108
00109 weights.resetDimension(2025);
00110 for (size_t i = 0; i < weights.dimension(); ++i)
00111 {
00112 int val;
00113 is >> val;
00114 effect_per_effect_y[i] = val;
00115 ++read_count;
00116 }
00117 weights.resetDimension(2025);
00118 for (size_t i = 0; i < weights.dimension(); ++i)
00119 {
00120 int val;
00121 is >> val;
00122 effect_per_effect_x[i] = val;
00123 ++read_count;
00124 }
00125 weights.resetDimension(Piece::SIZE);
00126 for (size_t i = 0; i < weights.dimension(); ++i)
00127 {
00128 int val;
00129 is >> val;
00130 stand_weight[i] = val;
00131 ++read_count;
00132 }
00133 weights.resetDimension(1125);
00134 for (size_t i = 0; i < weights.dimension(); ++i)
00135 {
00136 int val;
00137 is >> val;
00138 attack5x5_weight[i] = val;
00139 ++read_count;
00140 }
00141 weights.resetDimension(75);
00142 for (size_t i = 0; i < weights.dimension(); ++i)
00143 {
00144 int val;
00145 is >> val;
00146 effectstate_weight[i] = val;
00147 ++read_count;
00148 }
00149 weights.resetDimension(5625);
00150 for (size_t i = 0; i < weights.dimension(); ++i)
00151 {
00152 int val;
00153 is >> val;
00154 attack5x5_x_weight[i] = val;
00155 ++read_count;
00156 }
00157 weights.resetDimension(10125);
00158 for (size_t i = 0; i < weights.dimension(); ++i)
00159 {
00160 int val;
00161 is >> val;
00162 attack5x5_y_weight[i] = val;
00163 ++read_count;
00164 }
00165 weights.resetDimension(4284);
00166 for (size_t i = 0; i < weights.dimension(); ++i)
00167 {
00168 int val;
00169 is >> val;
00170 king_relative_weight[i] = val;
00171 ++read_count;
00172 }
00173 weights.resetDimension(262144);
00174 for (size_t i = 0; i < weights.dimension(); ++i)
00175 {
00176 int val;
00177 is >> val;
00178 attacked_ptype_pair_weight[i] = val;
00179 ++read_count;
00180 }
00181 {
00182 int val;
00183 is >> val;
00184 max_progress = val;
00185 ++read_count;
00186 #ifdef EVAL_QUAD
00187 while (((max_progress/ProgressScale) % 3) && max_progress > 0)
00188 --max_progress;
00189 #endif
00190 }
00191 for(int king_x=1;king_x<=9;king_x++){
00192 for(int king_y=1;king_y<=9;king_y++){
00193 Square king(king_x,king_y);
00194 int king_index=(king_x-1)*9+king_y-1;
00195 const Square center = Centering5x3::adjustCenter(king);
00196 const int min_x = center.x() - 2;
00197 const int min_y = center.y() - 1;
00198 int i=0;
00199 for (int dx=0; dx<5; ++dx)
00200 {
00201 for (int dy=0; dy<3; ++dy,++i)
00202 {
00203 const Square target(min_x+dx,min_y+dy);
00204 int index0=king_index*15+i;
00205 int index_a=index0*10;
00206 int index_d=index0*10;
00207 attack_relative[index_a]=
00208 effect_weight[index<BLACK>(king, target)] +
00209 effect_x_weight[indexX<BLACK>(king, target)] +
00210 effect_y_weight[indexY<BLACK>(king, target)];
00211 defense_relative[index_d]=
00212 effect_defense_weight[index<BLACK>(king, target)];
00213 for(int count=0;count<=8;count++){
00214 attack_relative[index_a+count+1]=
00215 effect_per_effect[indexPerEffect<BLACK>(king, target, count)] +
00216 effect_per_effect_y[indexPerEffectY<BLACK>(king, target, count)] +
00217 effect_per_effect_x[indexPerEffectX<BLACK>(king, target, count)];
00218 defense_relative[index_d+count+1]=
00219 effect_per_effect_defense[indexPerEffect<BLACK>(king, target, count)];
00220 }
00221 }
00222 }
00223 }
00224 }
00225 for(int king_x=1;king_x<=5;king_x++)
00226 for(int promoted=0;promoted<=4;promoted++)
00227 for(int silver=0;silver<=4;silver++)
00228 for(int gold=0;gold<=4;gold++)
00229 for(int bishop=0;bishop<=2;bishop++)
00230 for(int rook=0;rook<=2;rook++){
00231 int index0=promoted + 5 * (silver + 5 * (gold + 5 * (bishop + 3 * rook)));
00232 int index1=king_x - 1 + 5 * (promoted + 5 * (silver + 5 * (gold + 5 * (bishop + 3 * rook))));
00233 attack5x5_x_weight[index1]+=attack5x5_weight[index0];
00234 }
00235 for (int i=0; i<PTYPE_SIZE*2*PTYPE_SIZE; ++i)
00236 for (int j=i+1; j<PTYPE_SIZE*2*PTYPE_SIZE; ++j) {
00237 attacked_ptype_pair_weight[eval::ml::NonPawnAttackedPtypePair::index2(j,i)]
00238 = attacked_ptype_pair_weight[eval::ml::NonPawnAttackedPtypePair::index2(i,j)];
00239 }
00240
00241
00242 initialized_flag = is;
00243 if (!initialized_flag)
00244 {
00245 std::cerr << "Failed to load NewProgress data " << read_count << std::endl;
00246 }
00247 return initialized_flag;
00248 }
00249
00250 bool osl::progress::ml::NewProgress::setUp()
00251 {
00252 return setUp(defaultFilename().c_str());
00253 }
00254
00255 std::string osl::progress::ml::NewProgress::defaultFilename()
00256 {
00257 std::string filename = OslConfig::home();
00258 filename += "/data/progress.txt";
00259 return filename;
00260 }
00261
00262 template <osl::Player P>
00263 void osl::progress::ml::NewProgress::progressOne(
00264 const NumEffectState &state, int &attack, int &defense)
00265 {
00266 const Square king = state.kingSquare<P>();
00267 const Square center = Centering5x3::adjustCenter(king);
00268 const int min_x = center.x() - 2;
00269 const int min_y = center.y() - 1;
00270
00271 attack = defense = 0;
00272 Square kingRel=king;
00273 if(P==WHITE){
00274 kingRel=kingRel.rotate180();
00275 }
00276 int index0=((kingRel.x()-1)*9+kingRel.y()-1)*15;
00277 int index_a=index0*10 + (P==WHITE ? 10*14 : 0);
00278 for (int dx=0; dx<5; ++dx)
00279 {
00280 for (int dy=0; dy<3; ++dy)
00281 {
00282 const Square target(min_x+dx,min_y+dy);
00283 const int attack_count =
00284 state.countEffect(alt(P), target);
00285 const int defense_count =
00286 state.countEffect(P, target);
00287 attack += attack_count *attack_relative[index_a]+
00288 attack_relative[index_a+std::min(attack_count,8)+1];
00289 defense +=
00290 defense_count * defense_relative[index_a]+
00291 defense_relative[index_a+std::min(defense_count,8)+1];
00292 if(P==BLACK){
00293 index_a+=10;
00294 }
00295 else{
00296 index_a-=10;
00297 }
00298 }
00299 }
00300 }
00301
00302 template <osl::Player P>
00303 void osl::progress::ml::NewProgress::updateAttack5x5PiecesAndState(
00304 const NumEffectState &state)
00305 {
00306 const Square king = state.kingSquare<P>();
00307 const int min_x = std::max(1, king.x() - 2);
00308 const int max_x = std::min(9, king.x() + 2);
00309 const int min_y = std::max(1, king.y() - 2);
00310 const int max_y = std::min(9, king.y() + 2);
00311 effect_progresses[P] = 0;
00312
00313 PieceMask mask;
00314 for (int y = min_y; y <= max_y; ++y)
00315 {
00316 for (int x = min_x; x <= max_x; ++x)
00317 {
00318 const Square target(x, y);
00319 const NumBitmapEffect effect = state.effectSetAt(target);
00320 const int effect_diff =
00321 effect.countEffect(alt(P)) - effect.countEffect(P);
00322 const int x_diff = std::abs(x - king.x());
00323 const int y_diff = (P == WHITE ? king.y() - y : y - king.y());
00324 int index = std::max(std::min(effect_diff, 2), -2) + 2 + 5 * x_diff +
00325 5 * 3 * (y_diff + 2);
00326 effect_progresses[P] += effectstate_weight[index];
00327 mask |= effect;
00328 }
00329 }
00330 updateAttack5x5Pieces<P>(mask, state);
00331 }
00332
00333 template <osl::Player P>
00334 void osl::progress::ml::NewProgress::updateAttack5x5Pieces(
00335 PieceMask mask, const NumEffectState& state)
00336 {
00337 const Player attack = PlayerTraits<P>::opponent;
00338 mask &= state.piecesOnBoard(attack);
00339
00340 rook[attack] = mask.selectBit<ROOK>().countBit();
00341 bishop[attack] = mask.selectBit<BISHOP>().countBit();
00342 gold[attack] = mask.selectBit<GOLD>().countBit();
00343 silver[attack] =
00344 (mask & ~state.promotedPieces()).selectBit<SILVER>().countBit();
00345 PieceMask promoted_pieces = mask & state.promotedPieces();
00346 promoted_pieces.clearBit<ROOK>();
00347 promoted_pieces.clearBit<BISHOP>();
00348 promoted[attack] =
00349 std::min(promoted_pieces.countBit(), 4);
00350 }
00351
00352 template <osl::Player P>
00353 int osl::progress::ml::NewProgress::attack5x5Value(
00354 const NumEffectState &state) const
00355 {
00356 const Player attack = PlayerTraits<P>::opponent;
00357 int king_x = state.kingSquare<P>().x();
00358 if (king_x > 5)
00359 king_x = 10 - king_x;
00360 const int king_y = (P == BLACK ? state.kingSquare<P>().y() :
00361 10 - state.kingSquare<P>().y());
00362 return (attack5x5_x_weight[index5x5x(
00363 rook[attack] + state.countPiecesOnStand<ROOK>(attack),
00364 bishop[attack] + state.countPiecesOnStand<BISHOP>(attack),
00365 gold[attack] + state.countPiecesOnStand<GOLD>(attack),
00366 silver[attack] + state.countPiecesOnStand<SILVER>(attack),
00367 promoted[attack], king_x)] +
00368 attack5x5_y_weight[index5x5y(
00369 rook[attack] + state.countPiecesOnStand<ROOK>(attack),
00370 bishop[attack] + state.countPiecesOnStand<BISHOP>(attack),
00371 gold[attack] + state.countPiecesOnStand<GOLD>(attack),
00372 silver[attack] + state.countPiecesOnStand<SILVER>(attack),
00373 promoted[attack], king_y)]);
00374 }
00375
00376 void
00377 osl::progress::ml::NewProgress::updatePieceKingRelativeBonus(
00378 const NumEffectState &state)
00379 {
00380 const CArray<Square,2> kings = {{
00381 state.kingSquare(BLACK),
00382 state.kingSquare(WHITE),
00383 }};
00384 king_relative_attack.fill(0);
00385 king_relative_defense.fill(0);
00386 for (int i = 0; i < Piece::SIZE; ++i)
00387 {
00388 const Piece piece = state.pieceOf(i);
00389 if (piece.ptype() == osl::KING || !piece.isOnBoard())
00390 continue;
00391 Player pl = piece.owner();
00392 const int index_attack = indexRelative(piece.owner(), kings[alt(pl)],
00393 piece);
00394 const int index_defense = indexRelative(piece.owner(), kings[pl],
00395 piece) + 2142;
00396 king_relative_attack[pl] += king_relative_weight[index_attack];
00397 king_relative_defense[pl] += king_relative_weight[index_defense];
00398 }
00399 }
00400
00401 template <osl::Player Owner>
00402 void osl::progress::ml::NewProgress::
00403 updateNonPawnAttackedPtypePairOne(const NumEffectState& state)
00404 {
00405 PieceMask attacked = state.effectedMask(alt(Owner)) & state.piecesOnBoard(Owner);
00406 attacked.reset(state.kingPiece<Owner>().number());
00407 mask_t ppawn = state.promotedPieces().getMask<PAWN>() & attacked.selectBit<PAWN>();
00408 attacked.clearBit<PAWN>();
00409 attacked.orMask(PtypeFuns<PAWN>::indexNum, ppawn);
00410 PieceVector pieces;
00411 while (attacked.any())
00412 {
00413 const Piece piece = state.pieceOf(attacked.takeOneBit());
00414 pieces.push_back(piece);
00415 }
00416 typedef eval::ml::NonPawnAttackedPtypePair feature_t;
00417 int result = 0;
00418 MultiInt result_eval;
00419 for (size_t i=0; i+1<pieces.size(); ++i) {
00420 const int i0 = feature_t::index1(state, pieces[i]);
00421 for (size_t j=i+1; j<pieces.size(); ++j) {
00422 const int i1 = feature_t::index1(state, pieces[j]);
00423 result += attacked_ptype_pair_weight[feature_t::index2(i0,i1)];
00424 if (Owner == BLACK)
00425 result_eval += feature_t::table[feature_t::index2(i0, i1)];
00426 else
00427 result_eval -= feature_t::table[feature_t::index2(i0, i1)];
00428 }
00429 }
00430 non_pawn_ptype_attacked_pair[Owner] = result;
00431 non_pawn_ptype_attacked_pair_eval[Owner] = result_eval;
00432 }
00433
00434 void osl::progress::ml::NewProgress::
00435 updateNonPawnAttackedPtypePair(const NumEffectState& state)
00436 {
00437 updateNonPawnAttackedPtypePairOne<BLACK>(state);
00438 updateNonPawnAttackedPtypePairOne<WHITE>(state);
00439 }
00440
00441 osl::progress::ml::NewProgress::NewProgress(
00442 const NumEffectState &state)
00443 {
00444 assert(initialized_flag);
00445
00446 progressOne<BLACK>(state,
00447 progresses[BLACK],
00448 defenses[WHITE]);
00449 progressOne<WHITE>(state,
00450 progresses[WHITE],
00451 defenses[BLACK]);
00452 updateAttack5x5PiecesAndState<BLACK>(state);
00453 updateAttack5x5PiecesAndState<WHITE>(state);
00454 attack5x5_progresses[BLACK] =
00455 attack5x5Value<BLACK>(state);
00456 attack5x5_progresses[WHITE] =
00457 attack5x5Value<WHITE>(state);
00458 stand_progresses.fill(0);
00459 BOOST_FOREACH(Ptype ptype, PieceStand::order)
00460 {
00461 const int black_count =
00462 state.countPiecesOnStand(BLACK, ptype);
00463 const int white_count =
00464 state.countPiecesOnStand(WHITE, ptype);
00465 for (int j = 0; j < black_count; ++j)
00466 {
00467 stand_progresses[WHITE] +=
00468 stand_weight[Ptype_Table.getIndexMin(ptype) + j];
00469 }
00470 for (int j = 0; j < white_count; ++j)
00471 {
00472 stand_progresses[BLACK] +=
00473 stand_weight[Ptype_Table.getIndexMin(ptype) + j];
00474 }
00475 }
00476 updatePieceKingRelativeBonus(state);
00477 updateNonPawnAttackedPtypePair(state);
00478 }
00479
00480 template<osl::Player P>
00481 inline
00482 void osl::progress::ml::NewProgress::updateMain(
00483 const NumEffectState &new_state,
00484 Move last_move)
00485 {
00486 const Player altP=PlayerTraits<P>::opponent;
00487 assert(new_state.turn()==altP);
00488 assert(last_move.player()==P);
00489 const Square kb = new_state.kingSquare<BLACK>(), kw = new_state.kingSquare<WHITE>();
00490 const BoardMask mb = new_state.changedEffects(BLACK), mw = new_state.changedEffects(WHITE);
00491 const bool king_move = last_move.ptype() == KING;
00492 if ((king_move && altP == BLACK) || mb.anyInRange(Board_Mask_Table5x3_Center.mask(kw)) || mw.anyInRange(Board_Mask_Table5x3_Center.mask(kw)))
00493 {
00494 progressOne<WHITE>(new_state,progresses[WHITE],defenses[BLACK]);
00495 }
00496 if ((king_move && altP == WHITE) || mw.anyInRange(Board_Mask_Table5x3_Center.mask(kb)) || mb.anyInRange(Board_Mask_Table5x3_Center.mask(kb)))
00497 {
00498 progressOne<BLACK>(new_state,progresses[BLACK],defenses[WHITE]);
00499 }
00500
00501 const Ptype captured = last_move.capturePtype();
00502
00503 if (last_move.isDrop())
00504 {
00505 const int count =
00506 new_state.countPiecesOnStand(P, last_move.ptype()) + 1;
00507 const int value =
00508 stand_weight[Ptype_Table.getIndexMin(last_move.ptype()) + count - 1];
00509 stand_progresses[altP] -= value;
00510 }
00511 else if (captured != PTYPE_EMPTY)
00512 {
00513 Ptype ptype = unpromote(captured);
00514 const int count = new_state.countPiecesOnStand(P, ptype);
00515 const int value =
00516 stand_weight[(Ptype_Table.getIndexMin(ptype) + count - 1)];
00517 stand_progresses[altP] += value;
00518 }
00519
00520 if (king_move)
00521 {
00522 updatePieceKingRelativeBonus(new_state);
00523 }
00524 else
00525 {
00526 const CArray<Square,2> kings = {{
00527 new_state.kingSquare(BLACK),
00528 new_state.kingSquare(WHITE),
00529 }};
00530 if (!last_move.isDrop())
00531 {
00532 const int index_attack =
00533 indexRelative<P>(kings[altP],
00534 last_move.oldPtype(), last_move.from());
00535 const int index_defense =
00536 indexRelative<P>(kings[P],
00537 last_move.oldPtype(), last_move.from()) + 2142;
00538 king_relative_attack[P] -=
00539 king_relative_weight[index_attack];
00540 king_relative_defense[P] -=
00541 king_relative_weight[index_defense];
00542 }
00543 {
00544 const int index_attack =
00545 indexRelative<P>(kings[altP],
00546 last_move.ptype(), last_move.to());
00547 const int index_defense =
00548 indexRelative<P>(kings[P],
00549 last_move.ptype(), last_move.to()) + 2142;
00550 king_relative_attack[P] +=
00551 king_relative_weight[index_attack];
00552 king_relative_defense[P] +=
00553 king_relative_weight[index_defense];
00554 }
00555 if (captured != PTYPE_EMPTY)
00556 {
00557 const int index_attack =
00558 indexRelative<altP>(kings[P],
00559 captured, last_move.to());
00560 const int index_defense =
00561 indexRelative<altP>(kings[altP],
00562 captured, last_move.to()) + 2142;
00563 king_relative_attack[altP] -=
00564 king_relative_weight[index_attack];
00565 king_relative_defense[altP] -=
00566 king_relative_weight[index_defense];
00567 }
00568 }
00569 updateNonPawnAttackedPtypePair(new_state);
00570 }
00571
00572 template<osl::Player P>
00573 void osl::progress::ml::NewProgress::updateSub(
00574 const NumEffectState &new_state,
00575 Move last_move)
00576 {
00577 const Player altP=PlayerTraits<P>::opponent;
00578 assert(new_state.turn()==altP);
00579 if (last_move.isPass())
00580 return;
00581 const Square kb = new_state.kingSquare<BLACK>(), kw = new_state.kingSquare<WHITE>();
00582 const BoardMask mb = new_state.changedEffects(BLACK), mw = new_state.changedEffects(WHITE);
00583 const bool king_move = last_move.ptype() == KING;
00584 const Ptype captured = last_move.capturePtype();
00585
00586 if ((king_move && altP == BLACK) ||
00587 mb.anyInRange(Board_Mask_Table5x5.mask(kw)) ||
00588 mw.anyInRange(Board_Mask_Table5x5.mask(kw)))
00589 {
00590 updateAttack5x5PiecesAndState<WHITE>(new_state);
00591 attack5x5_progresses[WHITE] =
00592 attack5x5Value<WHITE>(new_state);
00593 }
00594 else if (altP == WHITE &&(last_move.isDrop() || captured != PTYPE_EMPTY))
00595 {
00596 attack5x5_progresses[WHITE] =
00597 attack5x5Value<WHITE>(new_state);
00598 }
00599 if ((king_move && altP == WHITE) ||
00600 mw.anyInRange(Board_Mask_Table5x5.mask(kb)) ||
00601 mb.anyInRange(Board_Mask_Table5x5.mask(kb)))
00602 {
00603 updateAttack5x5PiecesAndState<BLACK>(new_state);
00604 attack5x5_progresses[BLACK] =
00605 attack5x5Value<BLACK>(new_state);
00606 }
00607 else if (altP == BLACK && (last_move.isDrop() || captured != PTYPE_EMPTY))
00608 {
00609 attack5x5_progresses[BLACK] =
00610 attack5x5Value<BLACK>(new_state);
00611 }
00612 updateMain<P>(new_state, last_move);
00613 }
00614
00615 namespace osl
00616 {
00617 namespace progress
00618 {
00619 namespace ml
00620 {
00621 template void osl::progress::ml::NewProgress::updateSub<osl::BLACK>(const NumEffectState &new_state,Move last_move);
00622 template void osl::progress::ml::NewProgress::updateSub<osl::WHITE>(const NumEffectState &new_state,Move last_move);
00623 }
00624 }
00625 }
00626
00627
00628
00629
00630