SDK étudiant pour la compétition IA i151
Project description
i151-arena-sdk
SDK étudiant pour la compétition IA i151 — développez, testez et emballez votre bot sans cloner le dépôt.
Le moteur de jeu i151-engine est installé automatiquement.
Prérequis : Python 3.11+
Installation
python3 -m venv .venv && source .venv/bin/activate
pip install i151-arena-sdk
Vérifier :
arena --help
Option ML local : pip install "i151-arena-sdk[ml]" (ajoute numpy).
Démarrage rapide
arena init mon-bot
cd mon-bot
pip install -r requirements.txt
arena test bot.py
arena match bot.py --vs random --seed 42
arena pack .
arena pack produit un ZIP prêt pour le dashboard (inscription → upload).
Interface bot
Votre bot.py doit définir :
from arena_sdk import PlayerView, Action
def decide(view: PlayerView, legal_actions: list[Action], time_left_ms: int) -> Action:
return legal_actions[0]
Fonctions optionnelles pour charger un modèle ML :
from pathlib import Path
def setup(submission_dir: Path) -> None:
...
def teardown() -> None:
...
Retournez toujours une action de legal_actions, sinon forfait.
CLI
| Commande | Description |
|---|---|
arena init [dossier] |
Créer un projet (bot.py, requirements.txt, …) |
arena test bot.py |
Smoke test vs builtin:random |
arena match bot.py --vs random |
Match complet (jusqu'à 151 pts) |
arena match bot.py --vs basic |
Affronter l'exemple glouton |
arena match bot.py --replay-out replay.json |
Enregistrer le replay JSON |
arena pack . |
ZIP de soumission (bot.py + imports locaux + requirements + modèles) |
arena pack . --entry ml_bot.py --model champion.pt |
Entry et modèle explicites (champion.pt → model.pt dans le ZIP) |
Options utiles pour arena match : --seed, --target-score, --cards-per-player, --json.
Exemples inclus dans le package
| Alias | Description |
|---|---|
starter |
Première action légale |
basic |
Heuristique gloutonne |
arena test starter
arena match basic --vs random --seed 42
Adversaires CLI : random, starter, basic, builtin:random, ou chemin vers bot.py.
ML (local)
from arena_sdk.features import encode_view, action_from_index
Entraînement en local ; seule l'inférence est autorisée en match. Packages pip autorisés : voir la whitelist.
API réexportée
Depuis i151-engine : PlayerView, Action, ActionType, MatchConfig, MatchResult, play_match.
Documentation
| Ressource | Lien |
|---|---|
| Plateforme (inscription, matchs, ELO) | i151.djamma.dev |
| Tutoriel complet | docs/tutorial |
| Règlement | docs/reglement |
Architecture (PlayerView, replays) |
docs/architecture |
Classement
Les matchs contre builtin:random ne comptent pas au classement (calibration). Les matchs bot vs bot entre équipes sont notés (Elo initial 1500).
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file i151_arena_sdk-0.2.1.tar.gz.
File metadata
- Download URL: i151_arena_sdk-0.2.1.tar.gz
- Upload date:
- Size: 37.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
07a0c9df38580253ef1f2af9c082952e0417e9e12eeb47b0cf8a5e3747e5dc75
|
|
| MD5 |
531ad430c2e0e8866cfe11ffd1068c11
|
|
| BLAKE2b-256 |
c25cb916884b4e66721e163f746ec4c233a9e34bcef49362d76499b64302c109
|
File details
Details for the file i151_arena_sdk-0.2.1-py3-none-any.whl.
File metadata
- Download URL: i151_arena_sdk-0.2.1-py3-none-any.whl
- Upload date:
- Size: 20.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7b2110fb13edafd4cfa0bd1a58065e0016ce98e1bd1407c284e2b253bcab9c56
|
|
| MD5 |
e950100b255073912abb9188c9b7452c
|
|
| BLAKE2b-256 |
0f4c1763082b1c78e4dbf038ff400265c4effc83b5a5db618480908e34347360
|