33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
|
|
/**
|
|||
|
|
* Golf / Qualifying Points Simulator
|
|||
|
|
*
|
|||
|
|
* TODO: Port the Python golf/majors simulator here.
|
|||
|
|
*
|
|||
|
|
* Input data available:
|
|||
|
|
* - Current QP standings: getQPStandings(sportsSeasonId)
|
|||
|
|
* Returns { participant.id, participant.name, totalQualifyingPoints, eventsScored }
|
|||
|
|
* - Remaining majors: sportsSeason.totalMajors - sportsSeason.majorsCompleted
|
|||
|
|
* - Per-major QP config: qualifyingPointConfig table (points per placement for each major)
|
|||
|
|
*
|
|||
|
|
* Expected output: SimulationResult[] — one entry per participant with
|
|||
|
|
* probabilities (0–1) for finishing 1st through 8th in the final QP standings.
|
|||
|
|
*
|
|||
|
|
* Algorithm sketch (replace with the Python model logic):
|
|||
|
|
* 1. Get current QP totals for all participants
|
|||
|
|
* 2. For each remaining major, model each participant's probability of
|
|||
|
|
* finishing at each placement (using world rankings, recent form, etc.)
|
|||
|
|
* 3. Monte Carlo: simulate remaining majors N times, add QP, tally final standings
|
|||
|
|
* 4. Convert tally counts → probabilities
|
|||
|
|
*/
|
|||
|
|
|
|||
|
|
import type { Simulator, SimulationResult } from "./types";
|
|||
|
|
|
|||
|
|
export class GolfSimulator implements Simulator {
|
|||
|
|
async simulate(_sportsSeasonId: string): Promise<SimulationResult[]> {
|
|||
|
|
throw new Error(
|
|||
|
|
"GolfSimulator not yet implemented. " +
|
|||
|
|
"Port the Python golf/majors model to TypeScript and implement this method."
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
}
|