ai-for-shogi-like-games
Version:
javascript library of A.I. algorithms for Shogi-like games
31 lines (24 loc) • 1.28 kB
Flow
import {GameBoard} from './board-lib.js';
import {EvaluationModel} from './eval-model.js';
import {Chick, Hen, Elephant, Giraffe, Lion} from './piece-set.js';
const model000: EvaluationModel = (function() {
const pieceValues: Map<IConcretePiece, number> = new Map();
pieceValues.set( Chick, 1);
pieceValues.set( Hen, 5);
pieceValues.set(Elephant, 4);
pieceValues.set( Giraffe, 8);
const offBoardMul =0.75; // wish to penalize off-board pieces but not too much as they can be dropped practically anywhere on the board
const bonusForEachPossibleMove = 1;
const malusForEachPossibleMoveOfTheOpponent = -1;
const royalDistanceFromPromotionZoneBonus = [100, 50, 10];
const multipliersForDistFromPromotionZone = [0.9, 0.5, 0.1];
return new EvaluationModel(pieceValues
, royalDistanceFromPromotionZoneBonus
, multipliersForDistFromPromotionZone
, offBoardMul
, bonusForEachPossibleMove
, malusForEachPossibleMoveOfTheOpponent
, 40
, -50);
})();
exports.model000 = model000;