import { Node, SearchExit } from "../index.js"; import { GetScoresFunc } from "../tree/interfaces.js"; import { SearchTree } from "../tree/searchtree.js"; import { MaxnOpts, MaxnResult } from "./index.js"; /** * @alpha * Interface for performing a maxn search, * which can deal with games with an number of players. * * **Experimental, under development and undocumented**. * * @typeParam GS - The object representing the state of the game * @typeParam M - The object representing a move in the game * @typeParam D - Extra data used in evaluation not suitable for storing in the gamestate * @category Maxn */ export declare class Maxn extends SearchTree { /** * * @param root Root node to start the tree from * @param opts Optional options to configure the maxn algorithm */ constructor(root: Node, opts?: MaxnOpts); /** * Callback for getting all the score attached to the node. */ getScores: GetScoresFunc; /** * * @param depth Overwrite the {@link MaxnOpts.depth} option. * @returns */ protected evalDepth(depth?: number): MaxnResult; /** * Implements the negamax algorithm up to a given depth of search. * Recursively calls itself until `depth` is `0` or {@link NodeType.LEAF} * node is reached and evaluated. * * @param node Node to evaluate or search children * @param depth Depth to search from this node * @returns reason for concluded the search */ protected maxn(node: Node, depth: number): SearchExit; /** * * @param node node to assign values to * @param leaf * @returns */ protected assignNodeValue(node: Node, leaf: boolean): SearchExit.DEPTH | SearchExit.FULL_DEPTH; }