Simple data structure keeps a best move value and a list of all moves with that value. More...
#include <SgEvaluatedMoves.h>
Public Member Functions | |
SgEvaluatedMoves (const SgPointSet &relevant) | |
SgEvaluatedMoves (const SgEvaluatedMoves &original) | |
virtual | ~SgEvaluatedMoves () |
virtual void | AddMove (SgPoint move, int value) |
virtual void | AddMoves (const SgPointSet &moves, int value) |
virtual void | AddMoves (const SgVector< SgPoint > &moves, int value) |
virtual void | Clear () |
SgPoint | BestMove () |
int | BestValue () |
const SgPointSet & | Relevant () const |
bool | IsRelevant (SgPoint p) const |
void | Disable (SgPoint p) |
void | Enable (SgPoint p) |
virtual SgEvaluatedMoves * | Duplicate () const |
virtual int | GetEvaluation (SgPoint p) const |
virtual void | BestMoves (SgVector< SgPoint > &best, int nuMoves) const |
Compute list of the n best moves. | |
Protected Attributes | |
int | m_bestValue |
SgVector< SgPoint > | m_moveList |
SgPointSet | m_relevant |
Static Protected Attributes | |
static const int | s_minValue = INT_MIN + 1 |
Simple data structure keeps a best move value and a list of all moves with that value.
Definition at line 19 of file SgEvaluatedMoves.h.
SgEvaluatedMoves::SgEvaluatedMoves | ( | const SgPointSet & | relevant | ) | [explicit] |
Definition at line 22 of file SgEvaluatedMoves.h.
Referenced by Duplicate().
SgEvaluatedMoves::SgEvaluatedMoves | ( | const SgEvaluatedMoves & | original | ) |
Definition at line 27 of file SgEvaluatedMoves.h.
virtual SgEvaluatedMoves::~SgEvaluatedMoves | ( | ) | [virtual] |
Definition at line 33 of file SgEvaluatedMoves.h.
void SgEvaluatedMoves::AddMove | ( | SgPoint | move, | |
int | value | |||
) | [virtual] |
Reimplemented in SgEvaluatedMovesArray.
Definition at line 18 of file SgEvaluatedMoves.cpp.
References SgVector< T >::Clear(), SgPointUtil::InBoardRange(), m_bestValue, m_moveList, m_relevant, and SgVector< T >::PushBack().
Referenced by AddMoves().
void SgEvaluatedMoves::AddMoves | ( | const SgPointSet & | moves, | |
int | value | |||
) | [virtual] |
Definition at line 32 of file SgEvaluatedMoves.cpp.
References AddMove().
Definition at line 38 of file SgEvaluatedMoves.cpp.
References AddMove().
SgPoint SgEvaluatedMoves::BestMove | ( | ) |
Definition at line 44 of file SgEvaluatedMoves.cpp.
References SgRandom::Global(), SgRandom::Int(), SgVector< T >::IsEmpty(), SgVector< T >::Length(), m_moveList, and SG_PASS.
Compute list of the n best moves.
Reimplemented in SgEvaluatedMovesArray.
Definition at line 52 of file SgEvaluatedMoves.cpp.
References m_moveList, and SG_UNUSED().
int SgEvaluatedMoves::BestValue | ( | ) |
Definition at line 50 of file SgEvaluatedMoves.h.
References m_bestValue.
virtual void SgEvaluatedMoves::Clear | ( | ) | [virtual] |
Reimplemented in SgEvaluatedMovesArray.
Definition at line 42 of file SgEvaluatedMoves.h.
References SgVector< T >::Clear(), m_bestValue, m_moveList, and s_minValue.
void SgEvaluatedMoves::Disable | ( | SgPoint | p | ) |
Definition at line 65 of file SgEvaluatedMoves.h.
References SgPointSet::Exclude(), and m_relevant.
virtual SgEvaluatedMoves* SgEvaluatedMoves::Duplicate | ( | ) | const [virtual] |
Reimplemented in SgEvaluatedMovesArray.
Definition at line 75 of file SgEvaluatedMoves.h.
References SgEvaluatedMoves().
void SgEvaluatedMoves::Enable | ( | SgPoint | p | ) |
Definition at line 70 of file SgEvaluatedMoves.h.
References SgPointSet::Include(), and m_relevant.
virtual int SgEvaluatedMoves::GetEvaluation | ( | SgPoint | p | ) | const [virtual] |
Reimplemented in SgEvaluatedMovesArray.
Definition at line 80 of file SgEvaluatedMoves.h.
References SgVector< T >::Contains(), m_bestValue, and m_moveList.
bool SgEvaluatedMoves::IsRelevant | ( | SgPoint | p | ) | const |
Definition at line 60 of file SgEvaluatedMoves.h.
References m_relevant.
const SgPointSet& SgEvaluatedMoves::Relevant | ( | ) | const |
Definition at line 55 of file SgEvaluatedMoves.h.
References m_relevant.
int SgEvaluatedMoves::m_bestValue [protected] |
Definition at line 92 of file SgEvaluatedMoves.h.
Referenced by AddMove(), BestValue(), Clear(), and GetEvaluation().
SgVector<SgPoint> SgEvaluatedMoves::m_moveList [protected] |
Definition at line 94 of file SgEvaluatedMoves.h.
Referenced by AddMove(), BestMove(), BestMoves(), Clear(), and GetEvaluation().
SgPointSet SgEvaluatedMoves::m_relevant [protected] |
Definition at line 96 of file SgEvaluatedMoves.h.
Referenced by SgEvaluatedMovesArray::AddMove(), AddMove(), Disable(), Enable(), IsRelevant(), SgEvaluatedMovesArray::ReduceMove(), and Relevant().
const int SgEvaluatedMoves::s_minValue = INT_MIN + 1 [static, protected] |
Definition at line 99 of file SgEvaluatedMoves.h.
Referenced by Clear(), and SgEvaluatedMovesArray::SelectNextBest().