Index   Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

GoUctDefaultPriorKnowledge Class Reference

#include <GoUctDefaultPriorKnowledge.h>

Inheritance diagram for GoUctDefaultPriorKnowledge:

Inheritance graph
[legend]
List of all members.

Detailed Description

Default prior knowledge heuristic.

Mainly uses GoUctPlayoutPolicy to generate prior knowledge.

Definition at line 42 of file GoUctDefaultPriorKnowledge.h.

Public Member Functions

 GoUctDefaultPriorKnowledge (const GoBoard &bd, const GoUctPlayoutPolicyParam &param)
void ProcessPosition (std::vector< SgMoveInfo > &moves)
bool FindGlobalPatternAndAtariMoves (SgPointSet &pattern, SgPointSet &atari, GoPointList &empty) const
 Find global moves that match a playout pattern or set a block into atari.

Protected Member Functions

void Add (SgPoint p, float value, std::size_t count)
void Initialize (SgPoint p, float value, std::size_t count)
void ClearValues ()
void TransferValues (std::vector< SgMoveInfo > &outmoves) const

Protected Attributes

const GoBoardm_bd
SgArray< SgStatisticsBase<
float, std::size_t >, SG_PASS+1 > 
m_values

Private Member Functions

void AddLocalityBonus (GoPointList &emptyPoints, bool isSmallBoard)

Private Attributes

GoUctPlayoutPolicy< GoBoardm_policy


Constructor & Destructor Documentation

GoUctDefaultPriorKnowledge::GoUctDefaultPriorKnowledge ( const GoBoard bd,
const GoUctPlayoutPolicyParam param 
)

Definition at line 84 of file GoUctDefaultPriorKnowledge.cpp.


Member Function Documentation

void GoUctKnowledge::Add ( SgPoint  p,
float  value,
std::size_t  count 
) [protected, inherited]

Referenced by AddLocalityBonus().

void GoUctDefaultPriorKnowledge::AddLocalityBonus ( GoPointList emptyPoints,
bool  isSmallBoard 
) [private]

Definition at line 91 of file GoUctDefaultPriorKnowledge.cpp.

References GoUctKnowledge::Add(), GoBoardUtil::CfgDistance(), GoBoard::GetLastMove(), SgSList< T, SIZE >::Iterator, GoUctKnowledge::m_bd, SG_NULLMOVE, and SG_PASS.

Referenced by ProcessPosition().

void GoUctKnowledge::ClearValues (  )  [protected, inherited]

Definition at line 60 of file GoUctDefaultPriorKnowledge.cpp.

References GoUctKnowledge::m_values, and SG_PASS.

bool GoUctDefaultPriorKnowledge::FindGlobalPatternAndAtariMoves ( SgPointSet pattern,
SgPointSet atari,
GoPointList empty 
) const

Find global moves that match a playout pattern or set a block into atari.

Parameters:
[out] pattern 
[out] atari 
[out] empty As a side effect, this function finds all empty points on the board
Returns:
true if any such moves was found

Definition at line 129 of file GoUctDefaultPriorKnowledge.cpp.

References SgPointSet::Include(), GoBoard::IsEmpty(), SgSList< T, SIZE >::IsEmpty(), GoUctKnowledge::m_bd, m_policy, GoUctPlayoutPolicy< BOARD >::Patterns(), SgSList< T, SIZE >::PushBack(), SetsAtari(), and SG_ASSERT.

Referenced by GoUctCommands::CmdDefaultPolicy(), and ProcessPosition().

void GoUctKnowledge::Initialize ( SgPoint  p,
float  value,
std::size_t  count 
) [protected, inherited]

Referenced by ProcessPosition().

void GoUctDefaultPriorKnowledge::ProcessPosition ( std::vector< SgMoveInfo > &  moves  )  [virtual]

Implements GoUctKnowledge.

Definition at line 156 of file GoUctDefaultPriorKnowledge.cpp.

References AddLocalityBonus(), GoUctPlayoutPolicy< BOARD >::EndPlayout(), FindGlobalPatternAndAtariMoves(), GoUctPlayoutPolicy< BOARD >::GenerateMove(), GoUctPlayoutPolicy< BOARD >::GetEquivalentBestMoves(), GOUCT_FILLBOARD, GOUCT_RANDOM, GoUctKnowledge::Initialize(), GoBoard::IsEmpty(), SgSList< T, SIZE >::Iterator, GoUctKnowledge::m_bd, m_policy, GoUctKnowledge::m_values, GoUctPlayoutPolicy< BOARD >::MoveType(), GoBoardUtil::SelfAtari(), SG_PASS, GoBoard::Size(), GoUctPlayoutPolicy< BOARD >::StartPlayout(), and GoUctKnowledge::TransferValues().

Referenced by GoUctGlobalSearchState< POLICY >::GenerateAllMoves().

void GoUctKnowledge::TransferValues ( std::vector< SgMoveInfo > &  outmoves  )  const [protected, inherited]

Definition at line 66 of file GoUctDefaultPriorKnowledge.cpp.

References SgUctSearch::InverseEval(), and GoUctKnowledge::m_values.

Referenced by ProcessPosition().


Member Data Documentation

const GoBoard& GoUctKnowledge::m_bd [protected, inherited]

Definition at line 24 of file GoUctDefaultPriorKnowledge.h.

Referenced by AddLocalityBonus(), FindGlobalPatternAndAtariMoves(), and ProcessPosition().

GoUctPlayoutPolicy<GoBoard> GoUctDefaultPriorKnowledge::m_policy [private]

Definition at line 56 of file GoUctDefaultPriorKnowledge.h.

Referenced by FindGlobalPatternAndAtariMoves(), and ProcessPosition().

SgArray<SgStatisticsBase<float,std::size_t>,SG_PASS+1> GoUctKnowledge::m_values [protected, inherited]

Definition at line 26 of file GoUctDefaultPriorKnowledge.h.

Referenced by GoUctKnowledge::ClearValues(), ProcessPosition(), and GoUctKnowledge::TransferValues().


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


17 Jun 2010 Doxygen 1.4.7