From 00e0909d04c8ad62e67eac63a4793ea12db8361c Mon Sep 17 00:00:00 2001 From: Ronaldo e Silva Vieira Date: Wed, 9 Feb 2022 19:48:04 -0300 Subject: [PATCH] Normalize player features --- gym_locm/envs/base_env.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/gym_locm/envs/base_env.py b/gym_locm/envs/base_env.py index c0dd7bf..de9d1ca 100644 --- a/gym_locm/envs/base_env.py +++ b/gym_locm/envs/base_env.py @@ -366,10 +366,14 @@ def encode_enemy_card_on_board(card: Creature): @staticmethod def encode_players(current, opposing): - return current.health, current.mana, current.next_rune, \ - 1 + current.bonus_draw, opposing.health, \ - opposing.base_mana + opposing.bonus_mana, \ - opposing.next_rune, 1 + opposing.bonus_draw + return current.health / 30, \ + current.mana / 13, \ + current.next_rune / 30, \ + (1 + current.bonus_draw) / 6, \ + opposing.health / 30, \ + (opposing.base_mana + opposing.bonus_mana) / 13, \ + opposing.next_rune / 30, \ + (1 + opposing.bonus_draw) / 6 def encode_state(self): """ Encodes a state object into a numerical matrix. """