gym-locm icon indicating copy to clipboard operation
gym-locm copied to clipboard

`LOCMEnv` sometimes returns `None` instead of a numerical state representation

Open Rattko opened this issue 1 year ago • 1 comments

Hey,

the function LOCMEnv.encode_state returns None when self.state.phase is neither Phase.DECK_BUILDING nor Phase.BATTLE. This happens precisely once in every game. When self.state.phase == Phase.ENDED, neither of the conditions is true and the function implicitly returns None.

https://github.com/ronaldosvieira/gym-locm/blob/270b55b7b5055e5c98065bf849a90ba216b817d8/gym_locm/envs/base_env.py#L486-L491

This problem is not noticeable in most cases, but RLlib crashes when the state representation is None and I think it would be better to return a vector full of 0s or -1s for example.

Rattko avatar Dec 07 '23 19:12 Rattko

Hi, @Rattko! Thank you a lot for reporting. I'll be sure to fix this in the next release later this year.

ronaldosvieira avatar Jan 15 '24 20:01 ronaldosvieira