[ENVIRONMENT] Connect4 Environment #101
Open
+729
−19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add Connect4 Environment and Supporting Models to OpenEnv
Summary
This pull request introduces a new Connect4 Environment to the OpenEnv framework, expanding its suite of interactive learning environments.
The Connect4 environment follows OpenEnv’s modular design and integrates seamlessly with the existing
Environment,Action, andObservationinterfaces.🔑 Key Features
🧠 New Environment
resetandsteplifecycle.uuid.⚙️ Model Additions
Connect4Action– Defines valid column selections as agent actions.Connect4State– Represents board state, active player, and step count.Connect4Observation– Encapsulates board view, legal actions, reward signal, and done status.🎮 Gameplay Logic
(vertical, horizontal, diagonal-down, diagonal-up).🧩 Visualization Support
Testing out the env
To test out the environment, open two terminals
On terminal 1:
Run the following from root dir (
OpenEnv/)cd srcThen start the server:
-
python -m envs.connect4_env.server.appOn the terminal 2:
Run
python examples/connect4.pyfrom root directory (OpenEnv/)This is an example of the output:
