删除残留的 ALPHABETA_AI 宏

并且把 SORT_MOVE_WITHT_HUMAN_KNOWLEDGES 改名为 SORT_MOVE_WITHOUT_HUMAN_KNOWLEDGES
并反向宏控制。
This commit is contained in:
Calcitem 2020-09-29 18:21:10 +08:00
parent c68c81ac40
commit 9cf8c7718a
5 changed files with 5 additions and 24 deletions

View File

@ -36,7 +36,6 @@
//#define UCT_DEMO
#define ALPHABETA_AI
//#define PVS_AI
#define MTDF_AI
@ -65,7 +64,7 @@
//#define TIME_STAT
//#define CYCLE_STAT
#define SORT_MOVE_WITH_HUMAN_KNOWLEDGES
//#define SORT_MOVE_WITHOUT_HUMAN_KNOWLEDGES
#define TRANSPOSITION_TABLE_ENABLE

View File

@ -162,9 +162,7 @@ Value Evaluation::value()
Value Eval::evaluate(Position &pos)
{
#ifdef ALPHABETA_AI
return Evaluation(pos).value();
#endif // ALPHABETA_AI
}
/// trace() is like evaluate(), but instead of returning a value, it returns

View File

@ -70,20 +70,16 @@ void MovePicker::score()
int nOurMills = pos.in_how_many_mills(sq, pos.sideToMove, sqsrc);
int nTheirMills = 0;
#ifdef SORT_MOVE_WITH_HUMAN_KNOWLEDGES
#ifndef SORT_MOVE_WITHOUT_HUMAN_KNOWLEDGES
// TODO: rule.allowRemoveMultiPiecesWhenCloseMultiMill adapt other rules
if (type_of(m) != MOVETYPE_REMOVE) {
// all phrase, check if place sq can close mill
if (nOurMills > 0) {
#ifdef ALPHABETA_AI
cur->value += RATING_ONE_MILL * nOurMills;
#endif
} else if (pos.get_phase() == PHASE_PLACING) {
// placing phrase, check if place sq can block their close mill
nTheirMills = pos.in_how_many_mills(sq, pos.them);
#ifdef ALPHABETA_AI
cur->value += RATING_BLOCK_ONE_MILL * nTheirMills;
#endif
}
#if 1
else if (pos.get_phase() == PHASE_MOVING) {
@ -98,27 +94,23 @@ void MovePicker::score()
pos.surrounded_pieces_count(sq, nOurPieces, nTheirPieces, nBanned, nEmpty);
#ifdef ALPHABETA_AI
if (sq % 2 == 0 && nTheirPieces == 3) {
cur->value += RATING_BLOCK_ONE_MILL * nTheirMills;
} else if (sq % 2 == 1 && nTheirPieces == 2 && rule.nTotalPiecesEachSide == 12) {
cur->value += RATING_BLOCK_ONE_MILL * nTheirMills;
}
#endif
}
}
#endif
//cur->value += nBanned; // placing phrase, place nearby ban point
// for 12 men, white 's 2nd move place star point is as important as close mill (TODO)
#ifdef ALPHABETA_AI
// for 12 men, white 's 2nd move place star point is as important as close mill (TODO)
if (rule.nTotalPiecesEachSide == 12 &&
pos.count<ON_BOARD>(WHITE) < 2 && // patch: only when white's 2nd move
Position::is_star_square(static_cast<Square>(m))) {
cur->value += RATING_STAR_SQUARE;
}
#endif
} else { // Remove
int nOurPieces = 0;
int nTheirPieces = 0;
@ -127,8 +119,7 @@ void MovePicker::score()
pos.surrounded_pieces_count(sq, nOurPieces, nTheirPieces, nBanned, nEmpty);
#ifdef ALPHABETA_AI
if (nOurMills > 0) {
if (nOurMills > 0) {
// remove point is in our mill
//cur->value += RATING_REMOVE_ONE_MILL * nOurMills;
@ -158,9 +149,8 @@ void MovePicker::score()
// prefer remove piece that mobility is strong
cur->value += nEmpty;
#endif
}
#endif // SORT_MOVE_WITH_HUMAN_KNOWLEDGES
#endif // !SORT_MOVE_WITHOUT_HUMAN_KNOWLEDGES
}
}

View File

@ -811,7 +811,6 @@ void AIAlgorithm::setPosition(Position *p)
//requiredQuit = false;
}
#ifdef ALPHABETA_AI
int AIAlgorithm::search()
{
Value value = VALUE_ZERO;
@ -922,9 +921,7 @@ int AIAlgorithm::search()
return 0;
}
#endif // ALPHABETA_AI
#ifdef ALPHABETA_AI
string AIAlgorithm::nextMove()
{
return UCI::move(bestMove);
@ -1003,7 +1000,6 @@ string AIAlgorithm::nextMove()
return UCI::move(bestMove).c_str();
#endif
}
#endif // ALPHABETA_AI
#ifdef ENDGAME_LEARNING
bool AIAlgorithm::findEndgameHash(key_t posKey, Endgame &endgame)

View File

@ -155,10 +155,8 @@ public:
#endif
}
#ifdef ALPHABETA_AI
int search();
string nextMove();
#endif // ALPHABETA_AI
void undo_move();