增加空的评估函数

This commit is contained in:
CalciteM 2019-08-04 12:08:45 +08:00
parent a1239c14ae
commit 2ebb866685
2 changed files with 76 additions and 0 deletions

View File

@ -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对先手有利则增大对后手有利则减小

View File

@ -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);