test: combo snowball analysis — 60.4% rate, under 70% threshold
Simulated 1000 fights with 80% accuracy and equal speed. First-to-lead wins 60.4% of decided fights, confirming combo system is balanced. No decay or comeback mechanics needed. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.6
parent
9ad8f1f1eb
commit
929758ed1b
@@ -258,6 +258,59 @@ describe('scoring competitiveness analysis', () => {
|
|||||||
expect(true).toBe(true)
|
expect(true).toBe(true)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
it('RESEARCH: combo system snowball analysis — first-to-lead win rate', () => {
|
||||||
|
const N = 1000
|
||||||
|
let firstLeadWins = 0, nonFirstLeadWins = 0, draws = 0
|
||||||
|
|
||||||
|
for (let i = 0; i < N; i++) {
|
||||||
|
const result = simulateFight({
|
||||||
|
bothCorrect: false,
|
||||||
|
botAAccuracy: 0.8,
|
||||||
|
botBAccuracy: 0.8,
|
||||||
|
botASpeedMs: 1200,
|
||||||
|
botBSpeedMs: 1200,
|
||||||
|
speedVariance: 400,
|
||||||
|
rounds: 20,
|
||||||
|
})
|
||||||
|
|
||||||
|
// Determine who won the first non-draw round
|
||||||
|
let firstLeader: string | null = null
|
||||||
|
for (const r of result.rounds) {
|
||||||
|
if (r.winnerId) {
|
||||||
|
firstLeader = r.winnerId
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!result.winnerId) {
|
||||||
|
draws++
|
||||||
|
} else if (result.winnerId === firstLeader) {
|
||||||
|
firstLeadWins++
|
||||||
|
} else {
|
||||||
|
nonFirstLeadWins++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
const snowballRate = firstLeadWins / (firstLeadWins + nonFirstLeadWins) * 100
|
||||||
|
|
||||||
|
const section = [
|
||||||
|
'## Combo System Snowball Analysis (1000 fights, 80% accuracy, equal speed)',
|
||||||
|
'',
|
||||||
|
`- First-to-lead wins: ${firstLeadWins} (${snowballRate.toFixed(1)}% of decided fights)`,
|
||||||
|
`- Non-first-lead wins: ${nonFirstLeadWins}`,
|
||||||
|
`- Draws: ${draws}`,
|
||||||
|
`- Snowball rate: ${snowballRate.toFixed(1)}% (target: <70%)`,
|
||||||
|
'',
|
||||||
|
]
|
||||||
|
reportLines.push(...section)
|
||||||
|
|
||||||
|
console.log('\n=== COMBO SNOWBALL ANALYSIS ===')
|
||||||
|
section.forEach(l => console.log(` ${l}`))
|
||||||
|
|
||||||
|
// Soft assertion
|
||||||
|
expect(true).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
it('writes scoring analysis reports', () => {
|
it('writes scoring analysis reports', () => {
|
||||||
const __filename = fileURLToPath(import.meta.url)
|
const __filename = fileURLToPath(import.meta.url)
|
||||||
const projectRoot = resolve(dirname(__filename), '..', '..', '..')
|
const projectRoot = resolve(dirname(__filename), '..', '..', '..')
|
||||||
|
|||||||
Reference in New Issue
Block a user