Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  
Public Member Functions | Protected Attributes | Static Protected Attributes | Private Member Functions | Private Attributes

SgEvaluatedMovesArray Class Reference

Simple data structure keeps an integer value for each point on a board. More...

#include <SgEvaluatedMoves.h>

Inheritance diagram for SgEvaluatedMovesArray:
Inheritance graph
[legend]

List of all members.

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 SgEvaluatedMovesDuplicate () 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 SgPointSetRelevant () const
bool IsRelevant (SgPoint p) const
void Disable (SgPoint p)
void Enable (SgPoint p)

Protected Attributes

int m_bestValue
SgVector< SgPointm_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

Detailed Description

Simple data structure keeps an integer value for each point on a board.

Todo:
better name: SgEvaluatedPoints?

Definition at line 106 of file SgEvaluatedMoves.h.


Constructor & Destructor Documentation

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.


Member Function Documentation

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]
void SgEvaluatedMovesArray::BestMoves ( SgVector< SgPoint > &  best,
int  nuMoves 
) const [virtual]

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]
const SgPointSet& SgEvaluatedMoves::Relevant (  )  const [inherited]

Definition at line 55 of file SgEvaluatedMoves.h.

References SgEvaluatedMoves::m_relevant.

SgPoint SgEvaluatedMovesArray::SelectNextBest ( SgVector< SgPoint > &  bestSoFar  )  const [private]

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

Member Data Documentation

int SgEvaluatedMoves::m_bestValue [protected, inherited]

Definition at line 147 of file SgEvaluatedMoves.h.

Referenced by Write().

SgPointSet SgEvaluatedMoves::m_relevant [protected, inherited]
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().


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


Sun Mar 13 2011 Doxygen 1.7.1