@woosh/meep-engine
Version:
Pure JavaScript game engine. Fully featured and production ready.
61 lines • 1.61 kB
TypeScript
/**
* @template S
* @author Alex Goldring
* @copyright Company Named Limited (c) 2025
*/
export class MonteCarloTreeSearch<S> {
/**
*
* @type {S}
*/
rootState: S;
/**
*
* @type {StateNode|null}
*/
root: StateNode<any, any> | null;
/**
*
* @type {function(state:S, source:StateNode):MoveEdge[]}
*/
computeValidMoves: (arg0: state) => S;
/**
*
* @type {function(state:S):StateType}
*/
computeTerminalFlag: (arg0: state) => S;
/**
* Depth to which plays will be explored
* @type {number}
*/
maxExplorationDepth: number;
/**
*
* @type {Function}
*/
random: Function;
/**
* @param {S} rootState
* @param {function(state:S, source:StateNode):MoveEdge[]} computeValidMoves
* @param {function(state:S):StateType} computeTerminalFlag
* @param {function(S):S} cloneState
* @param {function(StateNode, S):number} heuristic Estimation function for evaluation of intermediate stated, guides exploration
*/
initialize({ rootState, computeValidMoves, computeTerminalFlag, cloneState, heuristic }: S): void;
cloneState: any;
heuristic: any;
/**
*
* @param {StateNode} node
* @param {S} state
* @returns {StateNode}
*/
selectRandom(node: StateNode<any, any>, state: S): StateNode<any, any>;
/**
* Perform a playout from the root node
* @returns {S} final state of the playout
*/
playout(): S;
}
import { StateNode } from "./StateNode.js";
//# sourceMappingURL=MonteCarlo.d.ts.map