Skip to main content

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.ptmodel.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
medium Basic+ (scoring contextuel, pression couleurs)
arena test starter
arena match basic --vs random --seed 42
arena match medium --vs basic --seed 42

Adversaires CLI : random, starter, basic, medium, 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

i151_arena_sdk-0.2.2.tar.gz (55.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

i151_arena_sdk-0.2.2-py3-none-any.whl (33.6 kB view details)

Uploaded Python 3

File details

Details for the file i151_arena_sdk-0.2.2.tar.gz.

File metadata

  • Download URL: i151_arena_sdk-0.2.2.tar.gz
  • Upload date:
  • Size: 55.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for i151_arena_sdk-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ee99708f938a428e493ff88a76185bf1107569b84fbfbeb4dcd51b5143be0bde
MD5 b600974740f70e85b6a8286df5e0c26b
BLAKE2b-256 e27f2238474f30815561b3f67b9a018cd13150bd4cda1d1f1224728b9f2b812a

See more details on using hashes here.

File details

Details for the file i151_arena_sdk-0.2.2-py3-none-any.whl.

File metadata

  • Download URL: i151_arena_sdk-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 33.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.6

File hashes

Hashes for i151_arena_sdk-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 1fd32d2b6275c3c01002c52e49bc2712333f1f0e9119e9003cb3fc44f7e6684c
MD5 3cc5c4b3d00901f4a3d1e73a0d30ce9b
BLAKE2b-256 e91587b8148c227456f5960bc49e100f508d072850c3b9f2a256bc44fbc000be

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page