UNPKG

tsgammon-core

Version:

A Backgammon library for Typescript, formerly developed as a part of tsgammon-ui

51 lines 1.76 kB
/** * * jGammonと同じく、入力198ノード・出力4ノード・三層構成のニューラルネットワークで評価を行うGammonEngine * * 評価のみで、学習機能は含まれない。 * * @module */ import { BoardState } from '../BoardState'; /** * 評価結果。ニューラルネットワークの出力値(4つ)と、それらの総合点 * * シングル勝ちの確率にはギャモン勝ちの確率が含まれているので、 * 両者を足せばそのまま勝利時の期待得点となる * (e.g. myWin=0.8、myGammon=0.3ならば、シングルでの勝ちは0.8 - 0.3 = 0.5 * * 獲得できる点数の期待値は、 * 0.5 + 0.3 * 2 = (0.5 + 0.3 ) + 0.3 = 0.8 + 0.3 = 1.1 ) * */ export declare type NNEval = { /** 獲得点数の期待値 */ e: number; /** シングル勝ち(ギャモン勝ちの確率を含む)の確率 */ myWin: number; /** ギャモン勝ちの確率 */ myGammon: number; /** シングル負け(ギャモン負けの確率を含む)の確率 */ oppWin: number; /** ギャモン負けの確率 */ oppGammon: number; }; /** * GammonEngineとして実装されたオブジェクト */ export declare const simpleNNEngine: import("./GammonEngine").GammonEngine; /** * 評価関数 * * @param board 盤面 */ export declare function evaluate(board: BoardState): NNEval; /** * テストのためのインターフェース * * @param pieces 駒の配置 * @param myBornOff 自分がすでにあげた駒の数 * @param oppBornOff 相手がすでにあげた駒の数 */ export declare function evalWithNN(pieces: number[], myBornOff: number, oppBornOff: number): number[]; //# sourceMappingURL=SimpleNNGammon.d.ts.map