pvs: PVS 相关代码用宏控制

This commit is contained in:
Calcitem 2020-05-04 15:02:19 +08:00
parent 335b218d85
commit 02380b64bd
2 changed files with 10 additions and 1 deletions

View File

@ -35,6 +35,7 @@
//#define UCT_DEMO //#define UCT_DEMO
#define ALPHABETA_AI #define ALPHABETA_AI
#define PVS_AI
//#define MTDF_AI //#define MTDF_AI
//#define MCTS_AI //#define MCTS_AI

View File

@ -994,6 +994,7 @@ value_t AIAlgorithm::search(depth_t depth, value_t alpha, value_t beta, Node *no
epsilon = 0; epsilon = 0;
} }
#ifdef PVS_AI
if (i == 0) { if (i == 0) {
if (after != before) { if (after != before) {
value = -search(depth - 1 + epsilon, -beta, -alpha, node->children[0]); value = -search(depth - 1 + epsilon, -beta, -alpha, node->children[0]);
@ -1017,6 +1018,13 @@ value_t AIAlgorithm::search(depth_t depth, value_t alpha, value_t beta, Node *no
} }
} }
} }
#else
if (after != before) {
value = -search(depth - 1 + epsilon, -beta, -alpha, node->children[i]);
} else {
value = search(depth - 1 + epsilon, alpha, beta, node->children[i]);
}
#endif // PVS_AI
undoMove(); undoMove();