https://github.com/cyprienc/padlock-env
A simple gymnasium environment where the agent must find the correct combination of symbols to unlock a 4-discs padlock.
https://github.com/cyprienc/padlock-env
gym gymnasium python reinforcement-learning
Last synced: 7 months ago
JSON representation
A simple gymnasium environment where the agent must find the correct combination of symbols to unlock a 4-discs padlock.
- Host: GitHub
- URL: https://github.com/cyprienc/padlock-env
- Owner: cyprienc
- License: apache-2.0
- Created: 2023-01-24T13:12:52.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-24T16:46:18.000Z (over 2 years ago)
- Last Synced: 2025-02-24T10:43:50.543Z (8 months ago)
- Topics: gym, gymnasium, python, reinforcement-learning
- Language: Python
- Homepage:
- Size: 33.2 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: HISTORY.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# Padlock Gymnasium Env
Padlock Gymnasium Env is a simple gymnasium environment that models a padlock with 4 discs, each with 4 symbols. The agent's goal is to find the secret combination of symbols to unlock the padlock.
The action space is a MultiDiscrete space with 2 dimensions, representing the selected disc and symbol. The observation space is a Box space of shape (4, 2) representing the current combination and a valid mask, where the valid mask is a binary array of shape (4,), with 1 indicating that the corresponding symbol in the current combination is correct and 0 indicating otherwise.
## Install it from PyPI
```bash
pip install padlock_env
```## Install it locally
```bash
pip install -e .
```## Usage
Here's an example of how to use the environment:
```python
import gymnasium
import padlock_envenv = gymnasium.make("PadlockEnv-v0")
observations, _ = env.reset()done = False
while not done:
action = env.action_space.sample()
observations, reward, done, _, _ = env.step(action)
print(f"Observations: {observations}, Reward: {reward}, Done: {done}")
```## Development
Read the [CONTRIBUTING.md](CONTRIBUTING.md) file.