Skip to main content

Hybrid Platform

A Gymnasium environment for the Platform domain, featuring a parameterized (hybrid) action space. This environment is widely used for benchmarking Reinforcement Learning algorithms that must handle both discrete action choices and continuous parameters simultaneously.

This is a modern fork of the original gym-platform, fully updated to use the Gymnasium API and modern numpy.

gym-platform

Installation

You can install the package directly from PyPI:

pip install hybrid-platform

Usage

import gymnasium as gym
import gym_platform

# Create the environment
env = gym.make('Platform-v0', render_mode='human')

obs, info = env.reset()

for _ in range(100):
    # Action structure: (discrete_action_index, (param_0, param_1, param_2))
    # where param_X is an array of shape (1,)
    
    # Example: RUN (0) with speed 15.0
    action = (0, ([15.0], [0.0], [0.0]))
    
    obs, reward, terminated, truncated, info = env.step(action)
    
    env.render()

    if terminated or truncated:
        obs, info = env.reset()

env.close()

Action Space

The action space is spaces.Tuple((spaces.Discrete(3), spaces.Tuple((spaces.Box(1), spaces.Box(1), spaces.Box(1))))). It consists of:

  1. Discrete(3): The high-level action choice.
    • 0: Run (Move horizontally)
    • 1: Hop (Small jump to clear gaps)
    • 2: Leap (Large jump to clear larger gaps)
  2. Tuple(Box(1), Box(1), Box(1)): The continuous parameters for each action.
    • Parameter 0 (Run): Speed, range [0, 30]
    • Parameter 1 (Hop): Power, range [0, 720]
    • Parameter 2 (Leap): Power, range [0, 430]

When taking a step, the environment selects the parameter corresponding to the chosen discrete action index and ignores the others.

Observation Space

The observation space is a spaces.Tuple containing:

  1. Box(9,): The state vector (scaled).
    • Basic features: [player_x, player_vx, enemy_x, enemy_dx]
    • Platform features: [platform_width_1, platform_width_2, gap, platform_position, height_diff]
  2. Discrete(200): The current time step (used for time awareness).

Original Credits

  • Original Platform domain by Warwick Masson et al.
  • Original gym-platform implementation by Craig Bester.

Metadata

Release files for hybrid-platform 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hybrid-platform 0.1.0
File Size Uploaded Provenance
hybrid_platform-0.1.0.tar.gz 490.9 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hybrid-platform 0.1.0
File Interpreter ABI Platform
hybrid_platform-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 980.7 kB

Release files / hybrid_platform-0.1.0.tar.gz

Download URL hybrid_platform-0.1.0.tar.gz
Size 490.9 kB
Tags Source
SHA-256 checksum
How to use checksums
9669e2d57c828ba1ed535bcfd0aefef46fa4f313001a97eb95aa415b499359c1
BLAKE2b-256 checksum
How to use checksums
daae9fe674b963f5ca52748c9c6ea5e605b500552026aeb4138ff8297ff19979
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Release files / hybrid_platform-0.1.0-py3-none-any.whl

Download URL hybrid_platform-0.1.0-py3-none-any.whl
Size 489.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ac8aaccb4c5e3aa353a6fd0cb7c695ca4b91a3b47bb1d94bc14e8c86d52edfd2
BLAKE2b-256 checksum
How to use checksums
43c4057e0d7a85ed662cdb9aca89e17e72a0c071d8dc9927c3c163a9bd9a62fd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.2

Security for hybrid-platform 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page