From 25ce1bf543ce424c08f878c1f59bad024d5becd0 Mon Sep 17 00:00:00 2001 From: fauzisho Date: Sun, 9 Jun 2024 19:19:43 +0200 Subject: [PATCH] up version and demo --- README.md | 13 ++++++++++--- gymconnectx/__init__.py | 4 +++- gymconnectx/assets/__init__.py | 0 gymconnectx/assets/imgBase64.py => imgBase64.py | 0 pyproject.toml | 2 +- setup.py | 2 +- 6 files changed, 15 insertions(+), 6 deletions(-) delete mode 100644 gymconnectx/assets/__init__.py rename gymconnectx/assets/imgBase64.py => imgBase64.py (100%) diff --git a/README.md b/README.md index 995e6d9..7f42ed2 100644 --- a/README.md +++ b/README.md @@ -35,11 +35,17 @@ def run_game_env(): env = gymconnectx.gym.make('gymconnectx/ConnectGameEnv', connect=4, width=7, - height=7, + height=6, reward_winner=1, reward_loser=-1, - living_reward=0, max_steps=100, delay=100, square_size=100, - avatar_player_1='img_cat.png', avatar_player_2='img_dog.png') + reward_living=0, + reward_draw=0.5, + reward_hell=-0.5, + max_steps=100, + delay=100, + square_size=100, + avatar_player_1='img_cat.png', + avatar_player_2='img_dog.png') env.reset() while not env.is_done and env.current_step < env.max_steps: @@ -49,6 +55,7 @@ def run_game_env(): env.render(mode='terminal_display') env.render(mode='gui_update_display') + print(f'Observation: {observations}') print(f"Step: {env.current_step}, " f"Move: {move}, " f"Rewards: {rewards}, " diff --git a/gymconnectx/__init__.py b/gymconnectx/__init__.py index ea79f1b..2163805 100644 --- a/gymconnectx/__init__.py +++ b/gymconnectx/__init__.py @@ -14,7 +14,9 @@ 'height': 7, 'reward_winner': 1, 'reward_loser': -1, - 'living_reward': 0, + 'reward_living': 0, + 'reward_draw': 0.5, + 'reward_hell': -0.5, 'max_steps': 100, 'delay': 100, 'square_size': 100, diff --git a/gymconnectx/assets/__init__.py b/gymconnectx/assets/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/gymconnectx/assets/imgBase64.py b/imgBase64.py similarity index 100% rename from gymconnectx/assets/imgBase64.py rename to imgBase64.py diff --git a/pyproject.toml b/pyproject.toml index f02689b..b2feeb0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "gymconnectx" -version = "1.2.0" +version = "1.2.1" description = "An OpenAI Gym Environment Connect X Game with GUI. ConnectX is a game for two players that is based on the well-known Connect 4. The goal is to place X coins in a row, column, or diagonal on a board with dimensions M by N." readme = "README.md" authors = [{ name = "Fauzi Sholichin" }] diff --git a/setup.py b/setup.py index 6e84144..0d116d2 100644 --- a/setup.py +++ b/setup.py @@ -2,7 +2,7 @@ setup( name='gymconnectx', - version='1.2.0', + version='1.2.1', description='ConnectX is a game for two players that is based on the well-known Connect 4. The goal is to place X coins in a row, column, or diagonal on a board with dimensions M by N.', url='https://github.com/fauzisho/GymConnectX', author='Fauzi Sholichin',