Gymnasium wrapper for PySTK2
Project description
PySuperTuxKart gymnasium wrapper
warning: pystk2-gymnasium is in alpha stage - the environments might change abruptly!
Environments
After importing pystk2_gymnasium
, the following environments are available:
supertuxkart-v0
is the main environment containing complete observationssupertuxkart-simple-v0
is a simplified environment with fixed size observationssupertuxkart-flattened-v0
has observation and action spaces simplified at the maximum (onlydiscrete
andcontinuous
keys)supertuxkart-flattened-discrete-v0
is like the previous one, but with fully discretized actions
Example
import gymnasium as gym
import pystk2_gymnasium
# Use a a flattened version of the observation and action spaces
# In both case, this corresponds to a dictionary with two keys:
# - `continuous` is a vector corresponding to the continuous observations
# - `discrete` is a vector (of integers) corresponding to discrete observations
env = gym.make("supertuxkart-flattened-v0", render_mode="human", use_ai=False)
ix = 0
done = False
state, *_ = env.reset()
while not done:
ix += 1
action = env.action_space.sample()
state, reward, terminated, truncated, _ = env.step(action)
done = truncated or terminated
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
pystk2_gymnasium-0.1.0.tar.gz
(19.4 kB
view hashes)
Built Distribution
Close
Hashes for pystk2_gymnasium-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7b8589deac7d98eb9aa2461286de4cd18bf2410dae5fd06625c206370876edbe |
|
MD5 | 2a4629376f5cb224a3353a32c2197d75 |
|
BLAKE2b-256 | 6c43758528393bf94ee8a5acf8f491fd15be50e2fe545b81fc71669f597a0f0a |