Skip to content

Commit

Permalink
Normalize player features
Browse files Browse the repository at this point in the history
  • Loading branch information
ronaldosvieira committed Feb 9, 2022
1 parent 256b3d0 commit 00e0909
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions gym_locm/envs/base_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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. """
Expand Down

0 comments on commit 00e0909

Please sign in to comment.