Plays mostly to extend/reduce liberties. More...
#include <SpDumbTacticalPlayer.h>
Public Member Functions | |
SpDumbTacticalMoveGenerator (const GoBoard &board) | |
virtual void | GenerateMoves (SgEvaluatedMoves &eval, SgBlackWhite toPlay) |
virtual bool | ExecuteMoveForScoring () |
virtual int | Score (SgPoint p) |
int | EvaluateMove (SgPoint p) |
Static move evaluation. | |
Protected Attributes | |
const GoBoard & | m_board |
Reference to go board on which to play. | |
Private Member Functions | |
void | GenerateAttackMoves (SgEvaluatedMoves &eval) |
void | GenerateDefendMoves (SgEvaluatedMoves &eval) |
Private Attributes | |
bool | m_useLadders |
Plays mostly to extend/reduce liberties.
Plays the following, in priority order: 1. If own group has single liberty, play there 2. Amongst opponent groups without two eyes, find the one with the least libs, and fill the one with the most second order liberties. If there is a tie pick one at random. 3. Make a random move that doesn't fill own eye 4. Pass
Definition at line 22 of file SpDumbTacticalPlayer.h.
SpDumbTacticalMoveGenerator::SpDumbTacticalMoveGenerator | ( | const GoBoard & | board | ) | [explicit] |
Definition at line 20 of file SpDumbTacticalPlayer.cpp.
int SpStaticMoveGenerator::EvaluateMove | ( | SgPoint | p | ) | [virtual, inherited] |
Static move evaluation.
Implements SpMoveGenerator.
Definition at line 46 of file SpMoveGenerator.cpp.
References GoBoard::IsLegal(), SpMoveGenerator::m_board, and SpStaticMoveGenerator::Score().
virtual bool SpDumbTacticalMoveGenerator::ExecuteMoveForScoring | ( | ) | [virtual] |
Definition at line 30 of file SpDumbTacticalPlayer.h.
void SpDumbTacticalMoveGenerator::GenerateAttackMoves | ( | SgEvaluatedMoves & | eval | ) | [private] |
Definition at line 90 of file SpDumbTacticalPlayer.cpp.
References SgEvaluatedMoves::AddMove(), GoModBoard::Board(), GoBensonSolver::FindSafePoints(), GO_LADDER_CAPTURED, GoBoard::IsColor(), GoBoard::IsEmpty(), GoBoard::IsValidPoint(), LadderStatus(), SpMoveGenerator::m_board, m_useLadders, GoBoard::NumLiberties(), GoBoard::NumStones(), GoBoard::Opponent(), and GoBoard::ToPlay().
Referenced by GenerateMoves().
void SpDumbTacticalMoveGenerator::GenerateDefendMoves | ( | SgEvaluatedMoves & | eval | ) | [private] |
Definition at line 49 of file SpDumbTacticalPlayer.cpp.
References SgEvaluatedMoves::AddMove(), GO_LADDER_CAPTURED, GoBoard::InAtari(), GoBoard::IsColor(), LadderStatus(), SpMoveGenerator::m_board, m_useLadders, GoBoard::NumStones(), GoBoard::Opponent(), and GoBoard::TheLiberty().
Referenced by GenerateMoves().
void SpDumbTacticalMoveGenerator::GenerateMoves | ( | SgEvaluatedMoves & | eval, | |
SgBlackWhite | toPlay | |||
) | [virtual] |
Reimplemented from SpMoveGenerator.
Definition at line 33 of file SpDumbTacticalPlayer.cpp.
References GoModBoard::Board(), GenerateAttackMoves(), GenerateDefendMoves(), SpMoveGenerator::m_board, and GoBoard::SetToPlay().
int SpDumbTacticalMoveGenerator::Score | ( | SgPoint | p | ) | [virtual] |
Implements SpStaticMoveGenerator.
Definition at line 24 of file SpDumbTacticalPlayer.cpp.
References SG_ASSERT, and SG_UNUSED().
const GoBoard& SpMoveGenerator::m_board [protected, inherited] |
Reference to go board on which to play.
Definition at line 33 of file SpMoveGenerator.h.
Referenced by SpSafeMoveGenerator::Evaluate(), SpMinLibMoveGenerator::Evaluate(), SpMaxEyeMoveGenerator::Evaluate(), SpInfluenceMoveGenerator::Evaluate(), SpGreedyMoveGenerator::Evaluate(), SpCaptureMoveGenerator::Evaluate(), SpAverageMoveGenerator::Evaluate(), SpStaticMoveGenerator::EvaluateMove(), Sp1PlyMoveGenerator::EvaluateMove(), GenerateAttackMoves(), GenerateDefendMoves(), SpMoveGenerator::GenerateMoves(), SpLadderMoveGenerator::GenerateMoves(), GenerateMoves(), SpMaxEyeMoveGenerator::Heuristic(), SpMinLibMoveGenerator::LibertyMinimum(), SpRandomMoveGenerator::Score(), and SpLibertyMoveGenerator::Score().
bool SpDumbTacticalMoveGenerator::m_useLadders [private] |
Definition at line 38 of file SpDumbTacticalPlayer.h.
Referenced by GenerateAttackMoves(), and GenerateDefendMoves().