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

[Enhancement] Reset in Agent #57

Closed Jonathan2021 closed 3 years ago

Jonathan2021 commented 3 years ago

Agent base class should probably have a reset method that would be called when the env is reset. This would allow to re-initialize agent variables each time a game is started. Reset in the env would call reset for the learning agent and opponent.

glmcdona commented 3 years ago

Added a new Agent callback on start of each game. This is automatically called on env.reset().

Callback added that you can override:

def game_start(self, game):
        """
        This funciton is called at the start of each game. Use this to
        reset and initialize per game. Note that self.team may have
        been changed since last game. The game map has been created
        and starting units placed.

        Args:
            game ([type]): Game.
        """
        pass