- SnookerSimulator: Monte Carlo simulation of the 32-player World Championship bracket using per-frame Bernoulli win probabilities derived from Elo ratings (ELO_DIVISOR=700). Two paths: bracket- populated (respects completed matches) and pre-bracket (simulates qualifying, then seeds full draw). - Admin route /sports-seasons/:id/elo-ratings: bulk-import and per- player Elo entry with fuzzy name matching; saves ratings and auto- runs the simulation in one action. - schema: add snooker_bracket simulator type, source_elo column on participant_expected_values, unique index on (participant_id, sports_season_id). - Fix batchSaveSourceElos to use INSERT ... ON CONFLICT DO UPDATE instead of N+1 SELECT+UPDATE loop. - Fix existingElos returned as plain Record (Map doesn't survive JSON serialization through useLoaderData). - Fix "How It Works" formula to show correct divisor (700, not 400). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 lines
No EOL
164 B
SQL
2 lines
No EOL
164 B
SQL
ALTER TYPE "public"."simulator_type" ADD VALUE 'snooker_bracket';--> statement-breakpoint
|
|
ALTER TABLE "participant_expected_values" ADD COLUMN "source_elo" integer; |