- Kotlin 87%
- Shell 7%
- CSS 3.5%
- Batchfile 2.5%
Replace unsupported --assets-path with artifact URLs pointing at the build job outputs. Co-authored-by: Cursor <cursoragent@cursor.com> |
||
|---|---|---|
| .gradle | ||
| .idea | ||
| build | ||
| gradle/wrapper | ||
| resources | ||
| src | ||
| .gitignore | ||
| .gitlab-ci.yml | ||
| ARCHITECTURE.md | ||
| build.gradle.kts | ||
| gradlew | ||
| gradlew.bat | ||
| README.md | ||
| settings.gradle.kts | ||
| WMPredict.iml | ||
WMPredict
Monte Carlo prediction engine for the 2026 FIFA World Cup (48 teams, 12 groups, 32-team knockout). Built in Kotlin on the JVM with a JavaFX GUI and a CLI for scripting.
Features
- Match predictions — Poisson xG model from blended Elo ratings; score, fun score, W/D/L probabilities, plausibility
- Play-day schedule — 72 group fixtures across 17 calendar days (June 11–27)
- Live ratings — eloratings.net, FIFA world ranking points, bundled fallback
- Elo blending — scale-calibrated mean/median or primary-source mode
- Recorded results — update standings, Elo, and downstream predictions (upset cascades)
- Knockout bracket — official FIFA-style bracket from
brackets.json - Monte Carlo — champion probability simulation
- JavaFX GUI — tabs for predictions, recording results, match lookup, Elo, Monte Carlo, played results
Requirements
- JDK 21
- Display server for the GUI (or use CLI only)
Quick start
./gradlew run # JavaFX GUI (default)
./gradlew run --args="predict" # all predictions (CLI)
./gradlew run --args="predict playday 3" # one play day
./gradlew run --args="MATCH Germany France"
./gradlew run --args="record 7 1 2" # record group match M7
./gradlew run --args="elo" # Elo report
./gradlew run --args="monte-carlo 5000" # Monte Carlo simulation
Build without running:
./gradlew build
Project layout
src/
Main.kt # CLI entry
service/ # TournamentService (shared API)
ui/ # JavaFX application
prediction/ # Poisson model, tournament predictor
tournament/ # Groups, bracket, knockout engine
montecarlo/ # Simulation engine
rating/ # Elo sources, blending, adjustment
io/ # JSON loaders and live fetchers
model/ # Core data types
resources/
groups.json # 12 groups × 4 teams
schedule.json # 72 group fixtures
brackets.json # Knockout bracket
elo.json # Cached ratings fallback
results.json # User-recorded scores
team_aliases.json # Name normalisation
See ARCHITECTURE.md for design details.
Data files
| File | Purpose |
|---|---|
groups.json |
Tournament groups and team names |
schedule.json |
Match numbers, play days, dates, home/away |
brackets.json |
R32 → Final slot wiring |
elo.json |
Offline Elo fallback (~worldfootballrankings scale) |
results.json |
Played scores (matchNumber or matchId) |
team_aliases.json |
Maps external names → canonical tournament names |
Recorded results are written back to resources/results.json at runtime.
Elo sources
When Fetch live ratings is enabled:
- eloratings.net — World Football Elo (TSV)
- FIFA points —
api.fifa.commen's ranking - cached elo.json — bundled fallback
The Elo blend setting controls how a single Team.elo is derived (default: scale-calibrated mean). See ARCHITECTURE.md.
Prediction model (short)
- Elo difference → expected goals λ (Poisson)
- Outcome probabilities (home / draw / away)
- Most likely exact scoreline within the predicted outcome
- Fun score — rounded xG plus winner bonus tiers (display only)
- Plausibility — how likely the score is under the Poisson model
Knockout matches never use draw scorelines in predictions; ties are labelled “Level” (90 minutes).
CI/CD and releases (GitLab)
Pipelines run on merge requests, main, and version tags.
| Trigger | Jobs | Output |
|---|---|---|
MR / main push |
build |
Job artifacts (JAR + zip/tar), 30 days |
Tag v* (e.g. v1.0.0) |
build + release |
GitLab Release with attached assets |
Create a release:
git tag v1.0.0
git push origin v1.0.0
The tag (without the v prefix) becomes the Gradle project version, so assets are named e.g. WMPredict-1.0.0.zip.
Download artifacts from CI/CD → Pipelines → job → Browse artifacts, or from Deploy → Releases after tagging.
License
No license file is included yet. Treat as private unless otherwise stated.