Skip to content

Anonymi1ty/lux-ai-challenge-s3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

57 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Lux AI Challenge S3

Installation

conda create -n lux-s3 python==3.11 -y
conda activate lux-s3

# luxai-s3
pip install -e Lux-Design-S3/src
pip install pettingzoo supersuit
pip install -U "jax[cuda12]"
pip install pygame

# Tianshou (天授)
pip install tianshou

# Notebook
pip install jupyterlab

Quick Start

Env Usage

from luxai_s3.wrappers import LuxAIS3PettingZooEnv

env = LuxAIS3PettingZooEnv.env(render_mode="human")
env.reset(seed=42)

for agent in env.agent_iter():
    observation, reward, termination, truncation, info = env.last()

    if termination or truncation:
        action = None
    else:
        action = env.action_space(agent).sample() # this is where you would insert your policy

    env.step(action)
env.close()
from luxai_s3.wrappers import LuxAIS3PettingZooEnv

parallel_env = LuxAIS3PettingZooEnv.parallel_env(render_mode="human")
observations, infos = parallel_env.reset(seed=42)

while parallel_env.agents:
    # this is where you would insert your policy
    actions = {agent: parallel_env.action_space(agent).sample() for agent in parallel_env.agents}

    observations, rewards, terminations, truncations, infos = parallel_env.step(actions)
parallel_env.close()

See more usage in playground notebook.

Training

python code/train_tianshou.py

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors