Skip to main content

Environments for reinforcement learning

Project description

rl-envs-forge

GitHub PyPI version License: MIT Code style: black

Lightweight environments for reinforcement learning applications.

Table of Contents

Installation

pip install rl-envs-forge

Environments

Labyrinth

Labyrinth is a classic maze-solving environment, where the goal is to navigate from a start point to a target. The maze layout is randomly generated based on a set of parametrizable arguments.

📖 Detailed Documentation: Click here to read more about the Labyrinth environment

Labyrinth rendered example

Labyrinth render GIF

KArmedBandit

KArmedBandit is a bandit environment, which returns a reward from a distribution associated with the chosen arm at each timestep. This implementation includes multiple distributions, and the possibility to shift the distribution parameters during sampling.

📖 Detailed Documentation: Click here to read more about the KArmedBandit environment

KArmedBandit rendered example

KArmedBandit render

GridWorld

GridWorld is a customizable grid-based environment for reinforcement learning, featuring adjustable grid size, start and terminal states, walls, and special transitions. Each action taken by the agent results in a transition within the grid, adhering to the defined rules and probabilities.

📖 Detailed Documentation: Click here to read more about the GridWorld environment

GridWorld rendered example

GridWorld render

ACML

The Adaptive Computation and Machine Learning (ACML) environments are toy environments proposed in Reinforcement Learning: An Introduction* (2nd ed.).

📖 Detailed Documentation: Click here to read more about the ACML environments

Inverted pendulum environments

Inverted pendulum environments where the objective is to apply forces to maintain the pendulum upright despite disturbances and the natural tendency to fall.

📖 Detailed Documentation: Click here to read more about the inverted pendulum envs

Inverted pendulums rendered examples

CartPole PendulumDisk
CartPole PendulumDisk

NetworkGraph

NetworkGraph is an environment simulating the current opinion in a social network.

📖 Detailed Documentation: Click here to read more about the NetworkGraph environment

NetworkGraph rendered example

NetworkGraph render

Usage

Example code on setting up and testing the Labyrinth environment.

Note, this code snippet produced the render visible in section Labyrinth

from time import sleep
from rl_envs_forge.envs.labyrinth.labyrinth import Labyrinth

env = Labyrinth(20, 20, seed=0)

done = False
quit_event = False
while not done and not quit_event:
    action = env.action_space.sample()  
    observation, reward, done, truncated, info = env.step(action)
    quit_event, _ = env.render()
    sleep(0.1)

Tests

Requirements: pytest and pytest-cov

Run the tests in the root folder with:

pytest tests

License

This project is licensed under the MIT License.

Contact & Support

For any queries or support, or if you would like to contribute to this project, reach out at marius.dragomir.dgm@gmail.com or raise an issue on our GitHub repository.

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

rl_envs_forge-5.21.0.tar.gz (67.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rl_envs_forge-5.21.0-py3-none-any.whl (86.1 kB view details)

Uploaded Python 3

File details

Details for the file rl_envs_forge-5.21.0.tar.gz.

File metadata

  • Download URL: rl_envs_forge-5.21.0.tar.gz
  • Upload date:
  • Size: 67.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Linux/6.14.0-1017-azure

File hashes

Hashes for rl_envs_forge-5.21.0.tar.gz
Algorithm Hash digest
SHA256 6e697615b4b1d42dc336bba5b8e548928289ac1201002cf246d252685d14e71d
MD5 c373fb5d1ed9890a1d25c962f8c8530f
BLAKE2b-256 600c46556947be1843570a6486456e92b45fc071f98cb2fcb5c635efc3a1ffbd

See more details on using hashes here.

File details

Details for the file rl_envs_forge-5.21.0-py3-none-any.whl.

File metadata

  • Download URL: rl_envs_forge-5.21.0-py3-none-any.whl
  • Upload date:
  • Size: 86.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.14.3 Linux/6.14.0-1017-azure

File hashes

Hashes for rl_envs_forge-5.21.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6edf55f58c68116d6d84a2b94c182af40c6dd8463b25db85e4fe863ee367296f
MD5 9032fbe848be3d8850d5695c5110e0d3
BLAKE2b-256 8408c70c0a5d2d9f3eab1f90624272fc579d22d7c0b101f69c7c684bd408ee88

See more details on using hashes here.

Supported by

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