핫스트릭 컴퓨터: 60레벨 시뮬레이션 400→200번. 400번이면 혼자서 한 수 최대 36ms라 전체 테스트를 병렬로 돌릴 때 서버의 컴퓨터 한 수 예산(50ms)을 넘어 'slow bot move' 경고로 bots.room.test가 가끔 실패했음. 봇 테스트 기준도 한 수 40ms 미만으로
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,7 +13,7 @@ const opts = (o: Partial<HotStreakOptions> = {}) => def.optionsSchema.parse({ ..
|
||||
describe('핫스트릭 컴퓨터', () => {
|
||||
test('시뮬레이션 횟수: 레벨 1은 30번, 60은 400번', () => {
|
||||
expect(runsFor(1)).toBe(30);
|
||||
expect(runsFor(60)).toBe(400);
|
||||
expect(runsFor(60)).toBe(200);
|
||||
expect(runsFor(30)).toBeGreaterThan(30);
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ describe('핫스트릭 컴퓨터', () => {
|
||||
const r = botPlayout(def, { players: seats(n, 0), seed: seedN(n + level), isBot, level, maxSteps: 20_000 });
|
||||
expect(r.finished).toBe(true);
|
||||
expect(r.botTimeouts).toBe(0);
|
||||
expect(r.maxBotMs).toBeLessThan(level === 60 ? 120 : 60);
|
||||
expect(r.maxBotMs).toBeLessThan(40);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/**
|
||||
* 핫스트릭 컴퓨터 (docs/games/hot-streak.md §8.7). Only its own view: it guesses the race deck from the face-up list,
|
||||
* the cards seen last race and its own hand, runs the race many times (레벨 1: 30번 … 60: 400번) and
|
||||
* the cards seen last race and its own hand, runs the race many times (레벨 1: 30번 … 60: 200번) and
|
||||
* - 티켓: 안전·위험(·거꾸로) 면의 기대 달러가 가장 큰 것, 마지막 경주 두 배는 기대값이 가장 큰 티켓,
|
||||
* - 카드 넣기: 넣었을 때 내 티켓 기대 수익이 가장 큰 카드(같은 셔플로 비교),
|
||||
* - 상금 나누기: 상금 기대값이 큰 마스코트 + 확률이 높은 쪽 YES/NO.
|
||||
@@ -17,10 +17,10 @@ import type { HotStreakView } from './index';
|
||||
type Act = HotStreakAction;
|
||||
const SCALE = { small: 1, critical: Infinity };
|
||||
|
||||
/** Simulated races for a decision at this level (1 → 30, 60 → 400). */
|
||||
/** Simulated races for a decision at this level (1 → 30, 60 → 200): even under load a move stays well inside the server's 50 ms bot budget. */
|
||||
export const runsFor = (level: number | undefined): number => {
|
||||
const l = Math.min(60, Math.max(1, level ?? 30));
|
||||
return Math.round(30 + ((l - 1) / 59) * 370);
|
||||
return Math.round(30 + ((l - 1) / 59) * 170);
|
||||
};
|
||||
|
||||
/** What the bot can tell about the coming race deck (public info + its own hand). */
|
||||
|
||||
Reference in New Issue
Block a user