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.3.tar.gz (58.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.3-py3-none-any.whl (34.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: i151_arena_sdk-0.2.3.tar.gz
  • Upload date:
  • Size: 58.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.3.tar.gz
Algorithm Hash digest
SHA256 075c919198ed02856ed6f6718526a695328ef3e88b33d242d3047d9605fe9f7f
MD5 b969f689ec77ee645b5413d7ccbbaeeb
BLAKE2b-256 58be7d8d7aab9167250f36c112a78c5045d0c7e99b7d27ffd882d9b078cca2a6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: i151_arena_sdk-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 34.4 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 9a478ded3cffca7f896904375f0aaa6e1ac7a0f4f979a80362039d246e2c370e
MD5 4021dcec80712cc3324276b767422886
BLAKE2b-256 20ee8419b094c341d2972398ac5912811bf1cbdeb303dee636ad9752009dbf14

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