Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

SgEvaluatedMoves Class Reference

#include <SgEvaluatedMoves.h>

Inheritance diagram for SgEvaluatedMoves:

Inheritance graph
[legend]
List of all members.

Detailed Description

Simple data structure keeps a best move value and a list of all moves with that value.

Todo:
Originally worked with any SgMove, but introduction of SgPointSet relevant now requires SgMove=SgPoint. Should be made independent of that again, otherwise, why not merge with SgEvaluatedMovesArray?

Definition at line 21 of file 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 SgPointSetRelevant () const
bool IsRelevant (SgPoint p) const
void Disable (SgPoint p)
void Enable (SgPoint p)
virtual SgEvaluatedMovesDuplicate () 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< SgPointm_moveList
SgPointSet m_relevant

Static Protected Attributes

static const int s_minValue = INT_MIN + 1


Constructor & Destructor Documentation

SgEvaluatedMoves::SgEvaluatedMoves ( const SgPointSet relevant  )  [explicit]

Definition at line 24 of file SgEvaluatedMoves.h.

Referenced by Duplicate().

SgEvaluatedMoves::SgEvaluatedMoves ( const SgEvaluatedMoves original  ) 

Definition at line 29 of file SgEvaluatedMoves.h.

virtual SgEvaluatedMoves::~SgEvaluatedMoves (  )  [virtual]

Definition at line 35 of file SgEvaluatedMoves.h.


Member Function Documentation

void SgEvaluatedMoves::AddMove ( SgPoint  move,
int  value 
) [virtual]

Reimplemented in SgEvaluatedMovesArray.

Definition at line 19 of file SgEvaluatedMoves.cpp.

References SgPointUtil::InBoardRange(), m_bestValue, m_moveList, and m_relevant.

Referenced by SgEvaluatedMovesArray::AddMove(), AddMoves(), and SgEvaluatedMovesArray::ReduceMove().

void SgEvaluatedMoves::AddMoves ( const SgVector< SgPoint > &  moves,
int  value 
) [virtual]

Definition at line 39 of file SgEvaluatedMoves.cpp.

References AddMove().

void SgEvaluatedMoves::AddMoves ( const SgPointSet moves,
int  value 
) [virtual]

Definition at line 33 of file SgEvaluatedMoves.cpp.

References AddMove().

SgPoint SgEvaluatedMoves::BestMove (  ) 

Definition at line 45 of file SgEvaluatedMoves.cpp.

References SgRandom::Global(), SgRandom::Int(), m_moveList, and SG_PASS.

void SgEvaluatedMoves::BestMoves ( SgVector< SgPoint > &  best,
int  nuMoves 
) const [virtual]

Compute list of the n best moves.

Reimplemented in SgEvaluatedMovesArray.

Definition at line 53 of file SgEvaluatedMoves.cpp.

References m_moveList, and SG_UNUSED().

int SgEvaluatedMoves::BestValue (  ) 

Definition at line 52 of file SgEvaluatedMoves.h.

References m_bestValue.

virtual void SgEvaluatedMoves::Clear (  )  [virtual]

Reimplemented in SgEvaluatedMovesArray.

Definition at line 44 of file SgEvaluatedMoves.h.

References m_bestValue, m_moveList, and s_minValue.

void SgEvaluatedMoves::Disable ( SgPoint  p  ) 

Definition at line 67 of file SgEvaluatedMoves.h.

References SgPointSet::Exclude(), and m_relevant.

virtual SgEvaluatedMoves* SgEvaluatedMoves::Duplicate (  )  const [virtual]

Reimplemented in SgEvaluatedMovesArray.

Definition at line 77 of file SgEvaluatedMoves.h.

References SgEvaluatedMoves().

void SgEvaluatedMoves::Enable ( SgPoint  p  ) 

Definition at line 72 of file SgEvaluatedMoves.h.

References SgPointSet::Include(), and m_relevant.

virtual int SgEvaluatedMoves::GetEvaluation ( SgPoint  p  )  const [virtual]

Reimplemented in SgEvaluatedMovesArray.

Definition at line 82 of file SgEvaluatedMoves.h.

References m_bestValue, and m_moveList.

bool SgEvaluatedMoves::IsRelevant ( SgPoint  p  )  const

Definition at line 62 of file SgEvaluatedMoves.h.

References m_relevant.

const SgPointSet& SgEvaluatedMoves::Relevant (  )  const

Definition at line 57 of file SgEvaluatedMoves.h.

References m_relevant.


Member Data Documentation

int SgEvaluatedMoves::m_bestValue [protected]

Definition at line 94 of file SgEvaluatedMoves.h.

Referenced by AddMove(), BestValue(), Clear(), and GetEvaluation().

SgVector<SgPoint> SgEvaluatedMoves::m_moveList [protected]

Definition at line 96 of file SgEvaluatedMoves.h.

Referenced by AddMove(), BestMove(), BestMoves(), Clear(), and GetEvaluation().

SgPointSet SgEvaluatedMoves::m_relevant [protected]

Definition at line 98 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 101 of file SgEvaluatedMoves.h.

Referenced by Clear(), and SgEvaluatedMovesArray::SelectNextBest().


The documentation for this class was generated from the following files:


17 Jun 2010 Doxygen 1.4.7