mirror of
https://github.com/syuilo/ai.git
synced 2024-11-24 22:01:07 +00:00
8*8のマップでは予め定義した価値マップを使うように
This commit is contained in:
parent
74ad33ef30
commit
25b06a9d16
17
src/back.ts
17
src/back.ts
|
@ -113,6 +113,19 @@ class Session {
|
|||
|
||||
//#region 各マスの価値を計算しておく
|
||||
|
||||
// 標準的な 8*8 のマップなら予め定義した価値マップを使用
|
||||
if (this.o.mapWidth == 8 && this.o.mapHeight == 8 && !this.o.map.some(p => p == 'null')) {
|
||||
this.cellWeights = [
|
||||
1 , -0.4, 0 , -0.1, -0.1, 0 , -0.4, 1 ,
|
||||
-0.4, -0.5, -0.2, -0.2, -0.2, -0.2, -0.5, -0.4,
|
||||
0 , -0.2, 0 , -0.1, -0.1, 0 , -0.2, 0 ,
|
||||
-0.1, -0.2, -0.1, -0.1, -0.1, -0.1, -0.2, -0.1,
|
||||
-0.1, -0.2, -0.1, -0.1, -0.1, -0.1, -0.2, -0.1,
|
||||
0 , -0.2, 0 , -0.1, -0.1, 0 , -0.2, 0 ,
|
||||
-0.4, -0.5, -0.2, -0.2, -0.2, -0.2, -0.5, -0.4,
|
||||
1 , -0.4, 0 , -0.1, -0.1, 0 , -0.4, 1
|
||||
];
|
||||
} else {
|
||||
//#region 隅
|
||||
this.cellWeights = this.o.map.map((pix, i) => {
|
||||
if (pix == 'null') return 0;
|
||||
|
@ -178,6 +191,8 @@ class Session {
|
|||
});
|
||||
//#endregion
|
||||
|
||||
}
|
||||
|
||||
//#endregion
|
||||
|
||||
this.botColor = this.game.user1Id == config.id && this.game.black == 1 || this.game.user2Id == config.id && this.game.black == 2;
|
||||
|
@ -388,10 +403,12 @@ class Session {
|
|||
console.log('Thinked:', pos);
|
||||
console.timeEnd('think');
|
||||
|
||||
setTimeout(() => {
|
||||
process.send({
|
||||
type: 'put',
|
||||
pos
|
||||
});
|
||||
}, 500);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue