brackt/app/services/simulations
Chris Parsons 6f5ea35952
Add NHL playoff simulator and fix simulator dropdown (#166)
Closes #115

- Add `NHLSimulator` using NHL's divisional bracket format (top 3 per
  division + 2 wildcards per conference, best-of-7 series, parity
  factor 800). Elo ratings and seeding probabilities sourced from
  elo.harvitronix.com/nhl/2025-2026 as of March 18, 2026.
- Add `nhl_bracket` to `simulatorTypeEnum` with migration.
- Register `NHLSimulator` in the simulator registry.
- Fix simulator type dropdown in admin to auto-generate from the
  registry instead of a hardcoded list, so new simulators appear
  automatically without a separate UI change.

Code review fixes applied to the simulator:
- Narrow `weightedPick` key type to the five seeding probability fields
  (was `keyof NhlTeamData`, allowing `"elo"` which would silently
  corrupt results)
- Remove uniform-random fallback in `weightedPick` — zero-weight draws
  now return `undefined` and are skipped, preventing eliminated teams
  from becoming wildcards
- Exclude unrecognized participants entirely (with a console warning)
  instead of silently routing them into the Eastern wildcard pool
- Replace the confusing for-of loop over both conferences (with unused
  `champ` variable and `!`-suppressed unitialized vars) with two
  explicit sequential East/West blocks
- Track `effectiveN` for skipped degenerate draws so probability
  denominators stay accurate; throw if all iterations are skipped

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-18 01:23:53 -07:00
..
__tests__ Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
auto-racing-simulator.ts Consolidate F1/IndyCar simulators into shared AutoRacingSimulator class (#151) 2026-03-16 12:22:08 -07:00
bracket-simulator.ts User/chris/ev f1 framework (#93) 2026-03-09 15:34:31 -07:00
golf-simulator.ts User/chris/ev f1 framework (#93) 2026-03-09 15:34:31 -07:00
nba-simulator.ts Add NBA playoff bracket Monte Carlo simulator (#154) 2026-03-16 21:43:39 -07:00
ncaam-simulator.ts Add NCAAM and NCAAW bracket Monte Carlo simulators (#150) 2026-03-15 23:31:47 -07:00
ncaaw-simulator.ts Fix UConn in NCAAW sim 2026-03-15 23:43:46 -07:00
nhl-simulator.ts Add NHL playoff simulator and fix simulator dropdown (#166) 2026-03-18 01:23:53 -07:00
registry.ts Add NHL playoff simulator and fix simulator dropdown (#166) 2026-03-18 01:23:53 -07:00
types.ts User/chris/ev f1 framework (#93) 2026-03-09 15:34:31 -07:00
ucl-simulator.ts feat: add UCL bracket Monte Carlo simulator (#131) 2026-03-10 23:04:51 -07:00