Skip to main content

3D ConnectX for OpenAI Gym.

Project description

3d-connect4-gym

BuildStatus PackageVersion PythonVersion Stable Format License

pattern1.gif

3D connectX repository, developed for the OpenAI Gym format.

Installation

The preferred installation of 3d-connectX-env is from pip:

pip install 3d-connectX-env

Usage

Python

from gym_3d_connectX.envs import AnyNumberInARow3dEnv

env = AnyNumberInARow3dEnv()
env.reset()

env.utils.win_reward = 100
env.utils.draw_penalty = 50
env.utils.lose_penalty = 100
env.utils.could_locate_reward = 10
env.utils.couldnt_locate_penalty = 10
env.utils.time_penalty = 1
env.player = 1
actions = [0, 0, 1, 1, 2, 2, 4, 4, 0, 0, 1, 1, 2, 2, 0, 3]

for action in actions:
    obs, reward, done, info = env.step(action)
    env.render(mode="plot")

Environments

The environments only send reward-able game-play frames to agents; No cut-scenes, loading screens, etc. are sent to an agent nor can an agent perform actions during these instances.

Environment: 3d-connectX-v0

Factor at initialization.

Key Type Description
num_grid int Length of a side.
num_win_seq int The number of sequence necessary for winning.
win_reward float The reward agent gets when win the game.
draw_penalty float The penalty agent gets when it draw the game.
lose_penalty float The penalty agent gets when it lose the game.
couldnt_locate_penalty float The penalty agent gets when it choose the location where the stone cannot be placed.
could_locate_reward float The additional reward for agent being able to put the stone.
time_penalty float The penalty agents gets along with timesteps.
first_player int Define which is the first player.

Step

Info about the rewards and info returned by the step method.

Key Type Description
turn int The number of the player at this step
winner int Value of the player on the winning side
is_couldnt_locate bool In this step the player chooses where to place the stone.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

3d-connectX-env-1.0.0.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

3d_connectX_env-1.0.0-py3-none-any.whl (3.5 kB view details)

Uploaded Python 3

File details

Details for the file 3d-connectX-env-1.0.0.tar.gz.

File metadata

  • Download URL: 3d-connectX-env-1.0.0.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.5

File hashes

Hashes for 3d-connectX-env-1.0.0.tar.gz
Algorithm Hash digest
SHA256 d563a3da864781c5c9c5c9fd668602bb6760fca4b031ae3252f368b9dcd5bc4c
MD5 26ee2f79b3b69c5d522eabe5b09225e4
BLAKE2b-256 51bd2ca2ac17428136ad400b03f32a02b53898cc700fb4fbf5d79d7963c69dc6

See more details on using hashes here.

File details

Details for the file 3d_connectX_env-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: 3d_connectX_env-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 3.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.9.5

File hashes

Hashes for 3d_connectX_env-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 659e7ac6cd4a21db4bfad0992e44b01b1d06c7e15ad15de5f5825ffaed261c93
MD5 bcf0f1c4ed81cd399d66fe7dfc507f5d
BLAKE2b-256 ad3af83a1a95efb90e3e16a33c9e40460602dedfb90c2e391db2f88c486c732e

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page