SimplePlayer has one move generator. More...
#include <SpSimplePlayer.h>
Public Member Functions | |
virtual | ~SpSimplePlayer () |
SgPoint | GenMove (const SgTimeRecord &time, SgBlackWhite toPlay) |
virtual int | MoveValue (SgPoint p) |
GoBoard & | Board () |
const GoBoard & | Board () const |
virtual std::string | Name () const |
SgNode * | CurrentNode () const |
void | ClearSearchTraces () |
SgNode * | TransferSearchTraces () |
virtual void | OnGameFinished () |
virtual void | OnNewGame () |
virtual void | Ponder () |
int | Variant () const |
void | SetVariant (int variant) |
void | SetSubscriber (GoBoard &subscriber) |
void | UpdateSubscriber () |
Protected Member Functions | |
SpSimplePlayer (const GoBoard &board, SpMoveGenerator *generator) | |
virtual void | OnBoardChange () |
virtual void | PrePlay (GoPlayerMove move) |
virtual void | OnPlay (GoPlayerMove move) |
virtual void | PreUndo () |
virtual void | OnUndo () |
Protected Attributes | |
SgNode * | m_currentNode |
Private Member Functions | |
virtual bool | UseFilter () const |
Don't play on safe points. | |
Private Attributes | |
SpMoveGenerator * | m_generator |
Move generator. | |
SpRandomMoveGenerator * | m_randomGenerator |
Use random generator if no other move found. |
SimplePlayer has one move generator.
It generates random moves if no other move is found.
Definition at line 20 of file SpSimplePlayer.h.
SpSimplePlayer::~SpSimplePlayer | ( | ) | [virtual] |
Definition at line 33 of file SpSimplePlayer.cpp.
References m_generator, m_randomGenerator, and SG_ASSERT.
SpSimplePlayer::SpSimplePlayer | ( | const GoBoard & | board, | |
SpMoveGenerator * | generator | |||
) | [protected] |
Definition at line 25 of file SpSimplePlayer.cpp.
SgPoint SpSimplePlayer::GenMove | ( | const SgTimeRecord & | time, | |
SgBlackWhite | toPlay | |||
) | [virtual] |
Implements GoPlayer.
Definition at line 61 of file SpSimplePlayer.cpp.
References SgEvaluatedMovesArray::BestMove(), GoPlayer::Board(), SpMoveGenerator::GenerateMoves(), SpUtil::GetRelevantMoves(), m_generator, m_randomGenerator, SG_PASS, SG_UNUSED(), and UseFilter().
int SpSimplePlayer::MoveValue | ( | SgPoint | p | ) | [virtual] |
Reimplemented from GoPlayer.
Definition at line 43 of file SpSimplePlayer.cpp.
References GoBoard::AllEmpty(), GoPlayer::Board(), SpMoveGenerator::EvaluateMove(), GoSafetySolver::FindSafePoints(), m_generator, SG_BLACK, SG_WHITE, and UseFilter().
virtual bool SpSimplePlayer::UseFilter | ( | ) | const [private, virtual] |
Don't play on safe points.
Reimplemented in SpAveragePlayer, SpMinLibPlayer, and SpRandomPlayer.
Definition at line 41 of file SpSimplePlayer.h.
Referenced by GenMove(), and MoveValue().
SpMoveGenerator* SpSimplePlayer::m_generator [private] |
Move generator.
Definition at line 35 of file SpSimplePlayer.h.
Referenced by GenMove(), MoveValue(), and ~SpSimplePlayer().
Use random generator if no other move found.
Definition at line 38 of file SpSimplePlayer.h.
Referenced by GenMove(), and ~SpSimplePlayer().