Class: Node

Node(constants)

MCTSのノードクラスです。

Constructor

new Node(constants)

MCTSのノードを生成します。
Parameters:
Name Type Description
constants BoardConstants
Source:

Members

edgeLength

着手候補数です。(名前のedgeはグラフ理論の枝のことです。)
Source:

evaluated

moves要素に対応する局面のニューラルネットワークを計算したか否かを保持します。
Source:

hashes

moves要素に対応するハッシュです。
Source:

moves

ポリシー確率の高い順並んだ着手候補です。
Source:

nodeIds

moves要素に対応するノードIDです。
Source:

probabilities

moves要素に対応するポリシー確率です。
Source:

totalActionValues

moves要素に対応する総アクションバリューです。ただしノードの手番から見ての値です。
Source:

values

moves要素に対応するバリューです。ただしノードの手番から見ての値です。
Source:

visitCounts

moves要素に対応する訪問回数です。
Source:

Methods

clear()

未使用状態にします。
Source:

getSortedIndices()

visitCountsの多い順のインデックスの配列を返します。
Source:

incrementVisitCount(index)

visitCountsを1増やし、sortedIndicesをクリアします。
Parameters:
Name Type Description
index Integer
Source:

initialize(hash, moveNumber, candidates, prob)

初期化します。
Parameters:
Name Type Description
hash Integer 現局面のハッシュです。
moveNumber Integer 現局面の手数です。
candidates Array.<UInt16> Boardが生成する候補手情報です。
prob Float32Array 着手確率(ニューラルネットワークのポリシー出力)です。
Source:

selectByUCB(c_puct) → {Array}

UCB評価で最善の着手情報を返します。
Parameters:
Name Type Description
c_puct number
Source:
Returns:
[UCB選択インデックス, 最善ブランチの子ノードID, 着手]
Type
Array

winrate(index) → {number}

indexのエッジの勝率を返します。
Parameters:
Name Type Description
index Integer
Source:
Returns:
Type
number