Skip to main content

An environment for Gnomes at Night based on OpenAI gym.

Project description

Installation

You can install the package using pip:

pip install gnomes-at-night-gym

Usage

Here is an example of how to import and create the environment:

import gymnasium as gym
import gnomes_at_night_gym
env = gym.make("gnomes_at_night_gym:Board9-v0-multistep", render_mode="rgb_array", board_seed="A", round=1)

Then, we can use the environment by:

# Reset the environment
obs_n, info = env.reset(seed=1)
done = False

# Run the environment
while not done:
    action = env.action_space.sample()
    obs_n, reward, terminated, truncated, info = env.step(action)
    done = terminated or truncated
    env.render()
env.close()

Environment Details

Observation Space

Each player's observation space is a (149,) array containing:

  • current_player (1 value)
  • token_pos (2 values)
  • flattened_walls (144 values) → {horizontal_walls (8x9) + vertical_walls (9x8)}
  • treasure_pos (2 values)

Action Space

The action space allows the following actions:

  • -1: Switch turn
  • 0: Stay put
  • 1: Move right
  • 2: Move up
  • 3: Move left
  • 4: Move down

Coordinate System

The maze is zero-indexed, with coordinates (x, y) where:

  • x represents the vertical axis (row)
  • y represents the horizontal axis (column)
  • Similar to traditional matrix notation

Below is a visual representation of the coordinate system for a 3x3 section of the maze:

(x, y) 0 1 2
0 (0,0) (0,1) (0,2)
1 (1,0) (1,1) (1,2)
2 (2,0) (2,1) (2,2)

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

gnomes_at_night_gym-0.0.11.tar.gz (13.7 kB view details)

Uploaded Source

Built Distribution

gnomes_at_night_gym-0.0.11-py3-none-any.whl (22.3 kB view details)

Uploaded Python 3

File details

Details for the file gnomes_at_night_gym-0.0.11.tar.gz.

File metadata

  • Download URL: gnomes_at_night_gym-0.0.11.tar.gz
  • Upload date:
  • Size: 13.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for gnomes_at_night_gym-0.0.11.tar.gz
Algorithm Hash digest
SHA256 653fd7ec44dc6ccb023cb1e4a1a5602958579530d1083ed3af72596f9a5f2a65
MD5 76fd5aa14c540bc1be5f9729e8531fb9
BLAKE2b-256 67510213ed3e5f705ce22f89b6bb4223e6843c52cd12cd7210ff1ea98b7be744

See more details on using hashes here.

File details

Details for the file gnomes_at_night_gym-0.0.11-py3-none-any.whl.

File metadata

File hashes

Hashes for gnomes_at_night_gym-0.0.11-py3-none-any.whl
Algorithm Hash digest
SHA256 98d6f8369db08ddb49a123bb7707c6ab2e524bba94884a16b4b3ecdd8ebcb03a
MD5 c58819522fd605f38a5ba90cba16261b
BLAKE2b-256 1f2e51f2ea4bd6cf30f2fe19e661d2e3438d94f2eaad1a6a5a9acb96cb038ce4

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