Code Monkey home page Code Monkey logo

lux-ai-challenge / lux-design-s2 Goto Github PK

View Code? Open in Web Editor NEW
406.0 406.0 145.0 8.62 MB

Repository for the Lux AI Challenge, season 2 (NeurIPS 23). Hosted on @kaggle

Home Page: https://www.kaggle.com/competitions/lux-ai-season-2-neurips-stage-2

License: Apache License 2.0

Python 5.72% HTML 0.03% TypeScript 1.70% JavaScript 0.30% C++ 0.74% CMake 0.02% Dockerfile 0.02% Shell 0.08% Jupyter Notebook 89.19% Java 0.51% Batchfile 0.10% Makefile 0.01% Rust 1.57%
ai competition environment reinforcement-learning

lux-design-s2's People

Contributors

agenlu avatar amonucf avatar arturbloch avatar bovard avatar duanwilliam avatar harmbuisman avatar itswin avatar jackmin801 avatar jmerle avatar lefiz avatar liqimai avatar logan9312 avatar looseterrifyingspacemonkey avatar mountainorc avatar mvpatel2000 avatar paradite avatar programjames avatar royerk avatar saitodev avatar seamooo avatar stonet2000 avatar themmj avatar zbenmo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lux-design-s2's Issues

Update JS kits with new constants, and updated API

New API removes can_x functions as submitting an action queue incurs power as well so it could be confusing.

Moreover, default random agent should check move_cost is not null and move_cost + action_queue_cost <= unit.power

PettingZoo error on validation

I'm not sure if this is a lux AI bug or a pettingzoo, but when I attempt to run the validate code to make sure everything is installed correctly, I'm met with an error.

I have tried uninstalling and reinstalling pettingzoo with no success

Code:
luxai2022 my_bot/main.py my_other_bot/main.py -v 2 -o replay.json

Error:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\lgntr\AppData\Local\Programs\Python\Python311\Scripts\luxai2022.exe\__main__.py", line 4, in <module>
  File "C:\Users\lgntr\AppData\Local\Programs\Python\Python311\Lib\site-packages\luxai_runner\cli.py", line 3, in <module>
    from luxai_runner.bot import Bot
  File "C:\Users\lgntr\AppData\Local\Programs\Python\Python311\Lib\site-packages\luxai_runner\bot.py", line 9, in <module>
    from luxai_runner.logger import Logger
  File "C:\Users\lgntr\AppData\Local\Programs\Python\Python311\Lib\site-packages\luxai_runner\logger.py", line 3, in <module>
    from luxai2022.globals import TERM_COLORS
  File "C:\Users\lgntr\AppData\Local\Programs\Python\Python311\Lib\site-packages\luxai2022\__init__.py", line 1, in <module>
    from .env import LuxAI2022
  File "C:\Users\lgntr\AppData\Local\Programs\Python\Python311\Lib\site-packages\luxai2022\env.py", line 7, in <module>
    from pettingzoo import ParallelEnv
ImportError: cannot import name 'ParallelEnv' from 'pettingzoo' (C:\Users\lgntr\AppData\Local\Programs\Python\Python311\Lib\site-packages\pettingzoo\__init__.py)

Errors when trying to validate installation

If I run the getting started steps from the manual I get the following error when trying to validate my installation:

Both using (https://github.com/Lux-AI-Challenge/Lux-Design-2022):
luxai2022 my_bot/main.py my_other_bot/main.py -v 2 -o replay.json

and (https://github.com/Lux-AI-Challenge/Lux-Design-2022/tree/main/kits/python)
luxai2022 main.py main.py --out=replay.json

Version info:
python 3.7.13
luxai2022 1.0.4

The errors are:
Task exception was never retrieved
future: <Task finished coro=<BotProcess.start() done, defined at DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\process.py:33> exception=NotImplementedError()>
Traceback (most recent call last):
File "DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\process.py", line 47, in start
limit=1024 * 128
File "DIR\Anaconda3\envs\lux\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "DIR\Anaconda3\envs\lux\lib\asyncio\base_events.py", line 1544, in subprocess_exec
bufsize, **kwargs)
File "DIR\Anaconda3\envs\lux\lib\asyncio\base_events.py", line 462, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError

Task exception was never retrieved
future: <Task finished coro=<BotProcess.start() done, defined at DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\process.py:33> exception=NotImplementedError()>
Traceback (most recent call last):
File "DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\process.py", line 47, in start
limit=1024 * 128
File "DIR\Anaconda3\envs\lux\lib\asyncio\subprocess.py", line 217, in create_subprocess_exec
stderr=stderr, **kwds)
File "DIR\Anaconda3\envs\lux\lib\asyncio\base_events.py", line 1544, in subprocess_exec
bufsize, **kwargs)
File "DIR\Anaconda3\envs\lux\lib\asyncio\base_events.py", line 462, in _make_subprocess_transport
raise NotImplementedError
NotImplementedError
Traceback (most recent call last):
File "DIR\Anaconda3\envs\lux\lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "DIR\Anaconda3\envs\lux\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "DIR\Anaconda3\envs\lux\Scripts\luxai2022.exe_main
.py", line 7, in
File "DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\cli.py", line 83, in main
asyncio.run(eps.run())
File "DIR\Anaconda3\envs\lux\lib\asyncio\runners.py", line 43, in run
return loop.run_until_complete(main)
File "DIR\Anaconda3\envs\lux\lib\asyncio\base_events.py", line 587, in run_until_complete
return future.result()
File "DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\episode.py", line 109, in run
resolved_actions = await asyncio.gather(*action_coros)
File "DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\bot.py", line 54, in step
action, stderr = await asyncio.wait_for(self.proc.write(f"{data}\n"), timeout=self.remainingOverageTime + self.time_per_step)
File "DIR\Anaconda3\envs\lux\lib\asyncio\tasks.py", line 442, in wait_for
return fut.result()
File "DIR\Anaconda3\envs\lux\lib\site-packages\luxai_runner\process.py", line 72, in write
self._agent_process.stdin.write(msg.encode())
AttributeError: 'BotProcess' object has no attribute '_agent_process'

Basic Visualizer Boilerplate

  • Basic 2D grid visuals, fast and renders new states quickly
  • Replay scrubber (speed up speed down, play and stop)
  • Button to upload a replay file
  • Setup distribution. (build files should include an html file that can then request all the built js files)

Factories can overlap

It is possible to build factories that overlap.
image

I think this should lead to an error instead?

Invalid action masker / valid uniform action sampler

An issue posed by some competitors in season 1 that is more likely to be a more problematic season 2 as the action space has more dimensions and a lot of them are useless depending on certain values due to the human-friendly parameterization of all possible actions.

Update C++ kit and JS kit with "simple logic"

Python kit currently does simple strategy

  • Bid nothing and randomly spawn factories with 100 metal and water
  • Build heavy unit as soon as possible
  • Each unit moves to closest ice tile and mines until it has 100 ice
  • Units move to closest factory tile, transfer it to factory, repeat.

Improve embedded visualizer

Improve the pygame visualizer (useful for quick inspection of map changes / progress)

Right now it doesn't render the timestep...
Does not render team colors correctly, units correctly...

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.