Skip to main content

StateNode

Classes

StateNode

Constants

stack : Array.<StateNode>

Functions

computeScore(move, totalPlayouts, totalUncertainPlayouts)number

StateNode

Kind: global class

stateNode.depth : number

How deep is the node in the tree

Kind: instance property of StateNode

stateNode.wins : number

Kind: instance property of StateNode

stateNode.losses : number

Number of leses in the subtree of this state

Kind: instance property of StateNode

stateNode.playouts : number

total number of explored playouts

Kind: instance property of StateNode

stateNode.heuristicValue : number

Kind: instance property of StateNode

stateNode.parent : null | StateNode

parent node, previous state

Kind: instance property of StateNode

stateNode.moves : null | Array.<MoveEdge>

Kind: instance property of StateNode

stateNode.type : StateType

Kind: instance property of StateNode

stateNode.aggregateHeuristicScore()

Aggregate heuristic score from children

Kind: instance method of StateNode

stateNode.expand(state, computeValidMoves, computeTerminalFlag) ⇒ number

Kind: instance method of StateNode
Returns: number - number of children

ParamType
state
computeValidMovesfunction
computeTerminalFlag

stateNode.addPlayouts(playouts, wins, losses)

Kind: instance method of StateNode

ParamType
playoutsnumber
winsnumber
lossesnumber

stateNode.isTerminal() ⇒ boolean

Whenever this is a terminal state or not (win/loss)

Kind: instance method of StateNode

stateNode.isExpanded() ⇒ boolean

Kind: instance method of StateNode

stateNode.pickBestMoves() ⇒ Array.<MoveEdge>

Kind: instance method of StateNode

stateNode.traverse(visitor)

Kind: instance method of StateNode

ParamType
visitorfunction

StateType : enum

Kind: global enum

stack : Array.<StateNode>

Kind: global constant

computeScore(move, totalPlayouts, totalUncertainPlayouts) ⇒ number

Kind: global function

ParamType
moveMoveEdge
totalPlayoutsnumber
totalUncertainPlayoutsnumber

computeScore~stateNode : StateNode

Kind: inner constant of computeScore