Simple data structure keeps an integer value for each point on a board. More...
#include <SgEvaluatedMoves.h>
Public Member Functions | |
SgEvaluatedMovesArray (const SgPointSet &relevant, int boardSize=SG_MAX_SIZE) | |
virtual | ~SgEvaluatedMovesArray () |
SgEvaluatedMovesArray (const SgEvaluatedMovesArray &original) | |
virtual void | AddMove (SgPoint move, int value) |
virtual void | ReduceMove (SgPoint move, int value) |
virtual void | Clear () |
void | Write () const |
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. | |
virtual void | AddMoves (const SgPointSet &moves, int value) |
virtual void | AddMoves (const SgVector< SgPoint > &moves, int value) |
SgPoint | BestMove () |
int | BestValue () |
const SgPointSet & | Relevant () const |
bool | IsRelevant (SgPoint p) const |
void | Disable (SgPoint p) |
void | Enable (SgPoint p) |
Protected Attributes | |
int | m_bestValue |
SgVector< SgPoint > | m_moveList |
SgPointSet | m_relevant |
Static Protected Attributes | |
static const int | s_minValue = INT_MIN + 1 |
Private Member Functions | |
SgPoint | SelectNextBest (SgVector< SgPoint > &bestSoFar) const |
Private Attributes | |
int | m_value [SG_MAXPOINT] |
int | m_boardSize |
Simple data structure keeps an integer value for each point on a board.
Definition at line 106 of file SgEvaluatedMoves.h.
SgEvaluatedMovesArray::SgEvaluatedMovesArray | ( | const SgPointSet & | relevant, | |
int | boardSize = SG_MAX_SIZE | |||
) | [explicit] |
Definition at line 60 of file SgEvaluatedMoves.cpp.
References m_value, and SG_MAXPOINT.
Referenced by Duplicate().
virtual SgEvaluatedMovesArray::~SgEvaluatedMovesArray | ( | ) | [virtual] |
Definition at line 113 of file SgEvaluatedMoves.h.
SgEvaluatedMovesArray::SgEvaluatedMovesArray | ( | const SgEvaluatedMovesArray & | original | ) |
Definition at line 116 of file SgEvaluatedMoves.h.
References m_value, and SG_MAXPOINT.
void SgEvaluatedMovesArray::AddMove | ( | SgPoint | move, | |
int | value | |||
) | [virtual] |
Reimplemented from SgEvaluatedMoves.
Definition at line 69 of file SgEvaluatedMoves.cpp.
References SgPointUtil::InBoardRange(), SgEvaluatedMoves::m_relevant, and m_value.
Referenced by ReduceMove().
void SgEvaluatedMoves::AddMoves | ( | const SgPointSet & | moves, | |
int | value | |||
) | [virtual, inherited] |
Definition at line 32 of file SgEvaluatedMoves.cpp.
References SgEvaluatedMoves::AddMove().
void SgEvaluatedMoves::AddMoves | ( | const SgVector< SgPoint > & | moves, | |
int | value | |||
) | [virtual, inherited] |
Definition at line 38 of file SgEvaluatedMoves.cpp.
References SgEvaluatedMoves::AddMove().
SgPoint SgEvaluatedMoves::BestMove | ( | ) | [inherited] |
Definition at line 44 of file SgEvaluatedMoves.cpp.
References SgRandom::Global(), SgRandom::Int(), SgVector< T >::IsEmpty(), SgVector< T >::Length(), SgEvaluatedMoves::m_moveList, and SG_PASS.
Compute list of the n best moves.
Reimplemented from SgEvaluatedMoves.
Definition at line 102 of file SgEvaluatedMoves.cpp.
References SgVector< T >::Clear(), SgVector< T >::PushBack(), and SelectNextBest().
int SgEvaluatedMoves::BestValue | ( | ) | [inherited] |
Definition at line 50 of file SgEvaluatedMoves.h.
References SgEvaluatedMoves::m_bestValue.
void SgEvaluatedMovesArray::Clear | ( | ) | [virtual] |
Reimplemented from SgEvaluatedMoves.
Definition at line 131 of file SgEvaluatedMoves.cpp.
References m_value, and SG_MAXPOINT.
void SgEvaluatedMoves::Disable | ( | SgPoint | p | ) | [inherited] |
Definition at line 65 of file SgEvaluatedMoves.h.
References SgPointSet::Exclude(), and SgEvaluatedMoves::m_relevant.
virtual SgEvaluatedMoves* SgEvaluatedMovesArray::Duplicate | ( | ) | const [virtual] |
Reimplemented from SgEvaluatedMoves.
Definition at line 132 of file SgEvaluatedMoves.h.
References SgEvaluatedMovesArray().
void SgEvaluatedMoves::Enable | ( | SgPoint | p | ) | [inherited] |
Definition at line 70 of file SgEvaluatedMoves.h.
References SgPointSet::Include(), and SgEvaluatedMoves::m_relevant.
virtual int SgEvaluatedMovesArray::GetEvaluation | ( | SgPoint | p | ) | const [virtual] |
Reimplemented from SgEvaluatedMoves.
Definition at line 137 of file SgEvaluatedMoves.h.
References m_value.
bool SgEvaluatedMoves::IsRelevant | ( | SgPoint | p | ) | const [inherited] |
Definition at line 60 of file SgEvaluatedMoves.h.
References SgEvaluatedMoves::m_relevant.
void SgEvaluatedMovesArray::ReduceMove | ( | SgPoint | move, | |
int | value | |||
) | [virtual] |
Definition at line 78 of file SgEvaluatedMoves.cpp.
References AddMove(), SgPointUtil::InBoardRange(), SgEvaluatedMoves::m_relevant, and m_value.
const SgPointSet& SgEvaluatedMoves::Relevant | ( | ) | const [inherited] |
Definition at line 55 of file SgEvaluatedMoves.h.
References SgEvaluatedMoves::m_relevant.
Definition at line 87 of file SgEvaluatedMoves.cpp.
References SgVector< T >::Contains(), m_value, SgEvaluatedMoves::s_minValue, and SG_MAXPOINT.
Referenced by BestMoves().
void SgEvaluatedMovesArray::Write | ( | ) | const |
Definition at line 113 of file SgEvaluatedMoves.cpp.
References SgPointUtil::Letter(), m_boardSize, m_value, SgPointUtil::Pt(), and SgDebug().
int SgEvaluatedMoves::m_bestValue [protected, inherited] |
Definition at line 92 of file SgEvaluatedMoves.h.
Referenced by SgEvaluatedMoves::AddMove(), SgEvaluatedMoves::BestValue(), SgEvaluatedMoves::Clear(), and SgEvaluatedMoves::GetEvaluation().
int SgEvaluatedMovesArray::m_boardSize [private] |
Definition at line 147 of file SgEvaluatedMoves.h.
Referenced by Write().
SgVector<SgPoint> SgEvaluatedMoves::m_moveList [protected, inherited] |
Definition at line 94 of file SgEvaluatedMoves.h.
Referenced by SgEvaluatedMoves::AddMove(), SgEvaluatedMoves::BestMove(), SgEvaluatedMoves::BestMoves(), SgEvaluatedMoves::Clear(), and SgEvaluatedMoves::GetEvaluation().
SgPointSet SgEvaluatedMoves::m_relevant [protected, inherited] |
Definition at line 96 of file SgEvaluatedMoves.h.
Referenced by AddMove(), SgEvaluatedMoves::AddMove(), SgEvaluatedMoves::Disable(), SgEvaluatedMoves::Enable(), SgEvaluatedMoves::IsRelevant(), ReduceMove(), and SgEvaluatedMoves::Relevant().
int SgEvaluatedMovesArray::m_value[SG_MAXPOINT] [private] |
Definition at line 145 of file SgEvaluatedMoves.h.
Referenced by AddMove(), Clear(), GetEvaluation(), ReduceMove(), SelectNextBest(), SgEvaluatedMovesArray(), and Write().
const int SgEvaluatedMoves::s_minValue = INT_MIN + 1 [static, protected, inherited] |
Definition at line 99 of file SgEvaluatedMoves.h.
Referenced by SgEvaluatedMoves::Clear(), and SelectNextBest().