Default prior knowledge heuristic. More...
#include <GoUctDefaultPriorKnowledge.h>
Public Member Functions | |
GoUctDefaultPriorKnowledge (const GoBoard &bd, const GoUctPlayoutPolicyParam ¶m) | |
void | ProcessPosition (std::vector< SgUctMoveInfo > &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, SgUctValue value, SgUctValue count) |
void | Initialize (SgPoint p, SgUctValue value, SgUctValue count) |
void | ClearValues () |
void | TransferValues (std::vector< SgUctMoveInfo > &outmoves) const |
Protected Attributes | |
const GoBoard & | m_bd |
SgArray< SgStatisticsBase < SgUctValue, SgUctValue > , SG_PASS+1 > | m_values |
Private Member Functions | |
void | AddLocalityBonus (GoPointList &emptyPoints, bool isSmallBoard) |
Private Attributes | |
GoUctPlayoutPolicy< GoBoard > | m_policy |
Default prior knowledge heuristic.
Mainly uses GoUctPlayoutPolicy to generate prior knowledge.
Definition at line 41 of file GoUctDefaultPriorKnowledge.h.
GoUctDefaultPriorKnowledge::GoUctDefaultPriorKnowledge | ( | const GoBoard & | bd, | |
const GoUctPlayoutPolicyParam & | param | |||
) |
Definition at line 83 of file GoUctDefaultPriorKnowledge.cpp.
void GoUctKnowledge::Add | ( | SgPoint | p, | |
SgUctValue | value, | |||
SgUctValue | count | |||
) | [protected, inherited] |
Definition at line 49 of file GoUctDefaultPriorKnowledge.cpp.
References GoUctKnowledge::m_values.
Referenced by AddLocalityBonus().
void GoUctDefaultPriorKnowledge::AddLocalityBonus | ( | GoPointList & | emptyPoints, | |
bool | isSmallBoard | |||
) | [private] |
Definition at line 90 of file GoUctDefaultPriorKnowledge.cpp.
References GoUctKnowledge::Add(), GoBoardUtil::CfgDistance(), GoBoard::GetLastMove(), SgArrayList< SgPoint, SG_MAX_ONBOARD+1 >::Iterator, GoUctKnowledge::m_bd, SG_NULLMOVE, and SG_PASS.
Referenced by ProcessPosition().
void GoUctKnowledge::ClearValues | ( | ) | [protected, inherited] |
Definition at line 59 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.
[out] | pattern | |
[out] | atari | |
[out] | empty | As a side effect, this function finds all empty points on the board |
true
if any such moves was found Definition at line 127 of file GoUctDefaultPriorKnowledge.cpp.
References SgPointSet::Include(), GoBoard::IsEmpty(), SgArrayList< T, SIZE >::IsEmpty(), GoUctKnowledge::m_bd, m_policy, GoUctPlayoutPolicy< BOARD >::Patterns(), SgArrayList< T, SIZE >::PushBack(), and SG_ASSERT.
Referenced by GoUctCommands::CmdDefaultPolicy(), and ProcessPosition().
void GoUctKnowledge::Initialize | ( | SgPoint | p, | |
SgUctValue | value, | |||
SgUctValue | count | |||
) | [protected, inherited] |
Definition at line 54 of file GoUctDefaultPriorKnowledge.cpp.
References GoUctKnowledge::m_values.
Referenced by ProcessPosition().
void GoUctDefaultPriorKnowledge::ProcessPosition | ( | std::vector< SgUctMoveInfo > & | moves | ) | [virtual] |
Implements GoUctKnowledge.
Definition at line 154 of file GoUctDefaultPriorKnowledge.cpp.
References AddLocalityBonus(), GoUctPlayoutPolicy< BOARD >::EndPlayout(), FindGlobalPatternAndAtariMoves(), GoUctPlayoutPolicy< BOARD >::GenerateMove(), GoUctPlayoutPolicy< BOARD >::GetEquivalentBestMoves(), GOUCT_RANDOM, GoUctKnowledge::Initialize(), GoBoard::IsEmpty(), SgArrayList< SgPoint, SG_MAX_ONBOARD+1 >::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< SgUctMoveInfo > & | outmoves | ) | const [protected, inherited] |
Definition at line 65 of file GoUctDefaultPriorKnowledge.cpp.
References SgUctSearch::InverseEstimate(), and GoUctKnowledge::m_values.
Referenced by ProcessPosition().
const GoBoard& GoUctKnowledge::m_bd [protected, inherited] |
Definition at line 24 of file GoUctDefaultPriorKnowledge.h.
Referenced by AddLocalityBonus(), FindGlobalPatternAndAtariMoves(), and ProcessPosition().
Definition at line 55 of file GoUctDefaultPriorKnowledge.h.
Referenced by FindGlobalPatternAndAtariMoves(), and ProcessPosition().
SgArray<SgStatisticsBase<SgUctValue,SgUctValue>,SG_PASS+1> GoUctKnowledge::m_values [protected, inherited] |
Definition at line 26 of file GoUctDefaultPriorKnowledge.h.
Referenced by GoUctKnowledge::Add(), GoUctKnowledge::ClearValues(), GoUctKnowledge::Initialize(), ProcessPosition(), and GoUctKnowledge::TransferValues().