Fix MLB simulator: projected wins drive seeding, perf fix, + surface simulate errors #65
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "fix/simulate-route-error-handling"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
p_div/p_wcprobability draws with Binomial regular-season simulation. Admin-entered projected wins (via Elo) now drive both playoff qualification odds and in-bracket game win probability, not just the latter.getRegularSeasonStandingsis called so syncedwins/gamesPlayedfeed into each simulation iteration's projected final standings.sampleBinomialnow uses a Box-Muller normal approximation forn ≥ 30, dropping the seeding phase from ~243M to ~3MMath.random()calls per 50K-sim run (pre-season, 162 remaining games × 30 teams).logger.warnnow surfaces which teams are falling back to 0 wins / 162 remaining instead of silently distorting seeding.eloToRDifcallsrawWinRateFromEloinstead of inlining the same formula.intent="simulate"so errors display inline rather than crashing to an error page.Test plan
npm run test:run -- mlb-simulator— 49 tests passnpm run typecheck— clean🤖 Generated with Claude Code