From 2ebb866685e6a7418d066cfea38461b44706fe18 Mon Sep 17 00:00:00 2001 From: CalciteM Date: Sun, 4 Aug 2019 12:08:45 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=A9=BA=E7=9A=84=E8=AF=84?= =?UTF-8?q?=E4=BC=B0=E5=87=BD=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- NineChess/src/ninechessai_ab.cpp | 53 ++++++++++++++++++++++++++++++++ NineChess/src/ninechessai_ab.h | 23 ++++++++++++++ 2 files changed, 76 insertions(+) diff --git a/NineChess/src/ninechessai_ab.cpp b/NineChess/src/ninechessai_ab.cpp index 5c554590..62624997 100644 --- a/NineChess/src/ninechessai_ab.cpp +++ b/NineChess/src/ninechessai_ab.cpp @@ -437,6 +437,59 @@ void NineChessAi_ab::setChess(const NineChess &chess) #endif } +// 评估子力 +#ifdef EVALUATE_ENABLE + +#ifdef EVALUATE_MATERIAL +int NineChessAi_ab::evaluateMaterial(Node *node) +{ + return 0; +} +#endif + +#ifdef EVALUATE_SPACE +int NineChessAi_ab::evaluateSpace(Node *node) +{ + return 0; +} +#endif + +#ifdef EVALUATE_MOBILITY +int NineChessAi_ab::evaluateMobility(Node *node) +{ + return 0; +} +#endif + +#ifdef EVALUATE_TEMPO +int NineChessAi_ab::evaluateTempo(Node *node) +{ + return 0; +} +#endif + +#ifdef EVALUATE_THREAT +int NineChessAi_ab::evaluateThreat(Node *node) +{ + return 0; +} +#endif + +#ifdef EVALUATE_SHAPE +int NineChessAi_ab::evaluateShape(Node *node) +{ + return 0; +} +#endif + +#ifdef EVALUATE_MOTIF +int NineChessAi_ab::evaluateMotif(Node *node) +{ + return 0; +} +#endif +#endif /* EVALUATE_ENABLE */ + int NineChessAi_ab::evaluate(Node *node) { // 初始评估值为0,对先手有利则增大,对后手有利则减小 diff --git a/NineChess/src/ninechessai_ab.h b/NineChess/src/ninechessai_ab.h index adcae781..6febe7fc 100644 --- a/NineChess/src/ninechessai_ab.h +++ b/NineChess/src/ninechessai_ab.h @@ -169,6 +169,29 @@ protected: // 评价函数 int evaluate(Node *node); +#ifdef EVALUATE_ENABLE +#ifdef EVALUATE_MATERIAL + int evaluateMaterial(Node *node); +#endif +#ifdef EVALUATE_SPACE + int evaluateSpace(Node *node); +#endif +#ifdef EVALUATE_MOBILITY + int evaluateMobility(Node *node); +#endif +#ifdef EVALUATE_TEMPO + int evaluateTempo(Node *node); +#endif +#ifdef EVALUATE_THREAT + int evaluateThreat(Node *node); +#endif +#ifdef EVALUATE_SHAPE + int evaluateShape(Node *node); +#endif +#ifdef EVALUATE_MOTIF + int evaluateMotif(Node *node); +#endif +#endif /* EVALUATE_ENABLE */ // Alpha-Beta剪枝算法 int alphaBetaPruning(int depth, int alpha, int beta, Node *node);