glmcdona / LuxPythonEnvGym

Matching python environment code for Lux AI 2021 Kaggle competition, and a gym interface for RL models.
MIT License
73 stars 38 forks source link

Merge develop action sequences, turn heuristics, and road cell table #85

Closed glmcdona closed 2 years ago

glmcdona commented 2 years ago

Adds three main changes:

  1. ActionSequence() base class allows for complex actions for units or cities. The default ActionSequence allows you specify multiple actions for a unit, but you can override this class to assign tasks like move to nearest wood, etc.
  2. game.cells_with_roads is now a list of cells with non-zero roads on them. Speeds up map featurization that involves creating maps of where all roads are each turn.
  3. New agent callback turn_heurstics(), that allows for taking hardcoded logic actions. Eg, if you always want cities to build units if-able, otherwise research you can create a turn_heuristic. That way the RL agent won't be making decisions for cities.