Rename to gymnasium
2
.github/workflows/build.yml
vendored
@@ -14,4 +14,4 @@ jobs:
|
||||
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
|
||||
--tag gym-docker .
|
||||
- name: Run tests
|
||||
run: docker run gym-docker pytest
|
||||
run: docker run gymnasium-docker pytest
|
||||
|
@@ -15,7 +15,7 @@ repos:
|
||||
hooks:
|
||||
- id: flake8
|
||||
args:
|
||||
- '--per-file-ignores=*/__init__.py:F401 gym/envs/registration.py:E704'
|
||||
- '--per-file-ignores=*/__init__.py:F401 gymnasium/envs/registration.py:E704'
|
||||
- --ignore=E203,W503,E741
|
||||
- --max-complexity=30
|
||||
- --max-line-length=456
|
||||
@@ -30,7 +30,7 @@ repos:
|
||||
rev: 6.1.1 # pick a git hash / tag to point to
|
||||
hooks:
|
||||
- id: pydocstyle
|
||||
exclude: ^(gym/version.py)|(gym/envs/)|(tests/)
|
||||
exclude: ^(gymnasium/version.py)|(gymnasium/envs/)|(tests/)
|
||||
args:
|
||||
- --source
|
||||
- --explain
|
||||
|
@@ -1,21 +1,15 @@
|
||||
# Gym Contribution Guidelines
|
||||
# Gymnasium Contribution Guidelines
|
||||
|
||||
At this time we are currently accepting the current forms of contributions:
|
||||
|
||||
- Bug reports (keep in mind that changing environment behavior should be minimized as that requires releasing a new version of the environment and makes results hard to compare across versions)
|
||||
- Pull requests for bug fixes
|
||||
- Documentation improvements
|
||||
- Features
|
||||
|
||||
Notably, we are not accepting these forms of contributions:
|
||||
|
||||
- New environments
|
||||
- New features
|
||||
|
||||
This may change in the future.
|
||||
If you wish to make a Gym environment, follow the instructions in [Creating Environments](https://github.com/openai/gym/blob/master/docs/creating_environments.md). When your environment works, you can make a PR to add it to the bottom of the [List of Environments](https://github.com/openai/gym/blob/master/docs/third_party_environments.md).
|
||||
|
||||
|
||||
Edit July 27, 2021: Please see https://github.com/openai/gym/issues/2259 for new contributing standards
|
||||
|
||||
# Development
|
||||
This section contains technical instructions & hints for the contributors.
|
||||
|
@@ -25,13 +25,13 @@ We support Python 3.7, 3.8, 3.9 and 3.10 on Linux and macOS. We will accept PRs
|
||||
The Gym API's API models environments as simple Python `env` classes. Creating environment instances and interacting with them is very simple- here's an example using the "CartPole-v1" environment:
|
||||
|
||||
```python
|
||||
import gym
|
||||
import gymnasium as gym
|
||||
env = gym.make("CartPole-v1")
|
||||
observation, info = env.reset(seed=42)
|
||||
|
||||
for _ in range(1000):
|
||||
action = env.action_space.sample()
|
||||
observation, reward, terminated, truncarted, info = env.step(action)
|
||||
observation, reward, terminated, truncated, info = env.step(action)
|
||||
|
||||
if terminated or truncated:
|
||||
observation, info = env.reset()
|
||||
@@ -43,7 +43,7 @@ env.close()
|
||||
* [Stable Baselines 3](https://github.com/DLR-RM/stable-baselines3) is a learning library based on the Gym API. It is designed to cater to complete beginners in the field who want to start learning things quickly.
|
||||
* [RL Baselines3 Zoo](https://github.com/DLR-RM/rl-baselines3-zoo) builds upon SB3, containing optimal hyperparameters for Gym environments as well as code to easily find new ones.
|
||||
* [Tianshou](https://github.com/thu-ml/tianshou) is a learning library that's geared towards very experienced users and is design to allow for ease in complex algorithm modifications.
|
||||
* [RLlib](https://docs.ray.io/en/latest/rllib/index.html) is a learning library that allows for distributed training and inferencing and supports an extraordinarily large number of features throughout the reinforcement learning space.
|
||||
* [RLlib](https://docs.ray.io/en/latest/rllib/index.html) is a learning library that allows for distributed training and inference and supports an extraordinarily large number of features throughout the reinforcement learning space.
|
||||
* [PettingZoo](https://github.com/Farama-Foundation/PettingZoo) is like Gym, but for environments with multiple agents.
|
||||
|
||||
## Environment Versioning
|
||||
@@ -70,4 +70,4 @@ A whitepaper from when Gym just came out is available https://arxiv.org/pdf/1606
|
||||
|
||||
## Release Notes
|
||||
|
||||
There used to be release notes for all the new Gym versions here. New release notes are being moved to [releases page](https://github.com/openai/gym/releases) on GitHub, like most other libraries do. Old notes can be viewed [here](https://github.com/openai/gym/blob/31be35ecd460f670f0c4b653a14c9996b7facc6c/README.rst).
|
||||
There used to be release notes for all the new Gym versions here. New release notes are being moved to [releases page](https://github.com/Farama-Foundation/Gymnasium/releases) on GitHub, like most other libraries do.
|
||||
|
@@ -1,3 +0,0 @@
|
||||
from gym.envs.box2d.bipedal_walker import BipedalWalker, BipedalWalkerHardcore
|
||||
from gym.envs.box2d.car_racing import CarRacing
|
||||
from gym.envs.box2d.lunar_lander import LunarLander, LunarLanderContinuous
|
@@ -1,5 +0,0 @@
|
||||
from gym.envs.classic_control.acrobot import AcrobotEnv
|
||||
from gym.envs.classic_control.cartpole import CartPoleEnv
|
||||
from gym.envs.classic_control.continuous_mountain_car import Continuous_MountainCarEnv
|
||||
from gym.envs.classic_control.mountain_car import MountainCarEnv
|
||||
from gym.envs.classic_control.pendulum import PendulumEnv
|
@@ -1,19 +0,0 @@
|
||||
from gym.envs.mujoco.mujoco_env import MujocoEnv, MuJocoPyEnv # isort:skip
|
||||
from gym.envs.mujoco.mujoco_rendering import ( # isort:skip
|
||||
RenderContextOffscreen,
|
||||
Viewer,
|
||||
)
|
||||
|
||||
# ^^^^^ so that user gets the correct error
|
||||
# message if mujoco is not installed correctly
|
||||
from gym.envs.mujoco.ant import AntEnv
|
||||
from gym.envs.mujoco.half_cheetah import HalfCheetahEnv
|
||||
from gym.envs.mujoco.hopper import HopperEnv
|
||||
from gym.envs.mujoco.humanoid import HumanoidEnv
|
||||
from gym.envs.mujoco.humanoidstandup import HumanoidStandupEnv
|
||||
from gym.envs.mujoco.inverted_double_pendulum import InvertedDoublePendulumEnv
|
||||
from gym.envs.mujoco.inverted_pendulum import InvertedPendulumEnv
|
||||
from gym.envs.mujoco.pusher import PusherEnv
|
||||
from gym.envs.mujoco.reacher import ReacherEnv
|
||||
from gym.envs.mujoco.swimmer import SwimmerEnv
|
||||
from gym.envs.mujoco.walker2d import Walker2dEnv
|
@@ -1,4 +0,0 @@
|
||||
from gym.envs.toy_text.blackjack import BlackjackEnv
|
||||
from gym.envs.toy_text.cliffwalking import CliffWalkingEnv
|
||||
from gym.envs.toy_text.frozen_lake import FrozenLakeEnv
|
||||
from gym.envs.toy_text.taxi import TaxiEnv
|
@@ -1,23 +0,0 @@
|
||||
"""Module for gym vector utils."""
|
||||
from gym.vector.utils.misc import CloudpickleWrapper, clear_mpi_env_vars
|
||||
from gym.vector.utils.numpy_utils import concatenate, create_empty_array
|
||||
from gym.vector.utils.shared_memory import (
|
||||
create_shared_memory,
|
||||
read_from_shared_memory,
|
||||
write_to_shared_memory,
|
||||
)
|
||||
from gym.vector.utils.spaces import _BaseGymSpaces # pyright: reportPrivateUsage=false
|
||||
from gym.vector.utils.spaces import BaseGymSpaces, batch_space, iterate
|
||||
|
||||
__all__ = [
|
||||
"CloudpickleWrapper",
|
||||
"clear_mpi_env_vars",
|
||||
"concatenate",
|
||||
"create_empty_array",
|
||||
"create_shared_memory",
|
||||
"read_from_shared_memory",
|
||||
"write_to_shared_memory",
|
||||
"BaseGymSpaces",
|
||||
"batch_space",
|
||||
"iterate",
|
||||
]
|
@@ -1,23 +0,0 @@
|
||||
"""Module of wrapper classes."""
|
||||
from gym import error
|
||||
from gym.wrappers.atari_preprocessing import AtariPreprocessing
|
||||
from gym.wrappers.autoreset import AutoResetWrapper
|
||||
from gym.wrappers.clip_action import ClipAction
|
||||
from gym.wrappers.filter_observation import FilterObservation
|
||||
from gym.wrappers.flatten_observation import FlattenObservation
|
||||
from gym.wrappers.frame_stack import FrameStack, LazyFrames
|
||||
from gym.wrappers.gray_scale_observation import GrayScaleObservation
|
||||
from gym.wrappers.human_rendering import HumanRendering
|
||||
from gym.wrappers.normalize import NormalizeObservation, NormalizeReward
|
||||
from gym.wrappers.order_enforcing import OrderEnforcing
|
||||
from gym.wrappers.record_episode_statistics import RecordEpisodeStatistics
|
||||
from gym.wrappers.record_video import RecordVideo, capped_cubic_video_schedule
|
||||
from gym.wrappers.render_collection import RenderCollection
|
||||
from gym.wrappers.rescale_action import RescaleAction
|
||||
from gym.wrappers.resize_observation import ResizeObservation
|
||||
from gym.wrappers.step_api_compatibility import StepAPICompatibility
|
||||
from gym.wrappers.time_aware_observation import TimeAwareObservation
|
||||
from gym.wrappers.time_limit import TimeLimit
|
||||
from gym.wrappers.transform_observation import TransformObservation
|
||||
from gym.wrappers.transform_reward import TransformReward
|
||||
from gym.wrappers.vector_list_info import VectorListInfo
|
@@ -1,21 +1,21 @@
|
||||
"""Root __init__ of the gym module setting the __all__ of gym modules."""
|
||||
"""Root __init__ of the gymnasium module setting the __all__ of gymnasium modules."""
|
||||
# isort: skip_file
|
||||
|
||||
from gym import error
|
||||
from gym.version import VERSION as __version__
|
||||
from gymnasium import error
|
||||
from gymnasium.version import VERSION as __version__
|
||||
|
||||
from gym.core import (
|
||||
from gymnasium.core import (
|
||||
Env,
|
||||
Wrapper,
|
||||
ObservationWrapper,
|
||||
ActionWrapper,
|
||||
RewardWrapper,
|
||||
)
|
||||
from gym.spaces import Space
|
||||
from gym.envs import make, spec, register
|
||||
from gym import logger
|
||||
from gym import vector
|
||||
from gym import wrappers
|
||||
from gymnasium.spaces import Space
|
||||
from gymnasium.envs import make, spec, register
|
||||
from gymnasium import logger
|
||||
from gymnasium import vector
|
||||
from gymnasium import wrappers
|
||||
import os
|
||||
import sys
|
||||
|
@@ -15,12 +15,12 @@ from typing import (
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import spaces
|
||||
from gym.logger import warn
|
||||
from gym.utils import seeding
|
||||
from gymnasium import spaces
|
||||
from gymnasium.logger import warn
|
||||
from gymnasium.utils import seeding
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from gym.envs.registration import EnvSpec
|
||||
from gymnasium.envs.registration import EnvSpec
|
||||
|
||||
if sys.version_info[0:2] == (3, 6):
|
||||
warn(
|
||||
@@ -51,7 +51,7 @@ class Env(Generic[ObsType, ActType]):
|
||||
- :attr:`action_space` - The Space object corresponding to valid actions
|
||||
- :attr:`observation_space` - The Space object corresponding to valid observations
|
||||
- :attr:`reward_range` - A tuple corresponding to the minimum and maximum possible rewards
|
||||
- :attr:`spec` - An environment spec that contains the information used to initialise the environment from `gym.make`
|
||||
- :attr:`spec` - An environment spec that contains the information used to initialise the environment from `gymnasium.make`
|
||||
- :attr:`metadata` - The metadata of the environment, i.e. render modes
|
||||
- :attr:`np_random` - The random number generator for the environment
|
||||
|
||||
@@ -188,7 +188,7 @@ class Env(Generic[ObsType, ActType]):
|
||||
"""Returns the base non-wrapped environment.
|
||||
|
||||
Returns:
|
||||
Env: The base non-wrapped gym.Env instance
|
||||
Env: The base non-wrapped gymnasium.Env instance
|
||||
"""
|
||||
return self
|
||||
|
||||
@@ -362,7 +362,7 @@ class ObservationWrapper(Wrapper):
|
||||
``observation["target_position"] - observation["agent_position"]``. For this, you could implement an
|
||||
observation wrapper like this::
|
||||
|
||||
class RelativePosition(gym.ObservationWrapper):
|
||||
class RelativePosition(gymnasium.ObservationWrapper):
|
||||
def __init__(self, env):
|
||||
super().__init__(env)
|
||||
self.observation_space = Box(shape=(2,), low=-np.inf, high=np.inf)
|
||||
@@ -402,7 +402,7 @@ class RewardWrapper(Wrapper):
|
||||
because it is intrinsic), we want to clip the reward to a range to gain some numerical stability.
|
||||
To do that, we could, for instance, implement the following wrapper::
|
||||
|
||||
class ClipReward(gym.RewardWrapper):
|
||||
class ClipReward(gymnasium.RewardWrapper):
|
||||
def __init__(self, env, min_reward, max_reward):
|
||||
super().__init__(env)
|
||||
self.min_reward = min_reward
|
||||
@@ -433,10 +433,10 @@ class ActionWrapper(Wrapper):
|
||||
In that case, you need to specify the new action space of the wrapper by setting :attr:`self.action_space` in
|
||||
the :meth:`__init__` method of your wrapper.
|
||||
|
||||
Let’s say you have an environment with action space of type :class:`gym.spaces.Box`, but you would only like
|
||||
Let’s say you have an environment with action space of type :class:`gymnasium.spaces.Box`, but you would only like
|
||||
to use a finite subset of actions. Then, you might want to implement the following wrapper::
|
||||
|
||||
class DiscreteActions(gym.ActionWrapper):
|
||||
class DiscreteActions(gymnasium.ActionWrapper):
|
||||
def __init__(self, env, disc_to_cont):
|
||||
super().__init__(env)
|
||||
self.disc_to_cont = disc_to_cont
|
||||
@@ -446,7 +446,7 @@ class ActionWrapper(Wrapper):
|
||||
return self.disc_to_cont[act]
|
||||
|
||||
if __name__ == "__main__":
|
||||
env = gym.make("LunarLanderContinuous-v2")
|
||||
env = gymnasium.make("LunarLanderContinuous-v2")
|
||||
wrapped_env = DiscreteActions(env, [np.array([1,0]), np.array([-1,0]),
|
||||
np.array([0,1]), np.array([0,-1])])
|
||||
print(wrapped_env.action_space) #Discrete(4)
|
@@ -1,5 +1,5 @@
|
||||
from gym.envs.registration import load_env_plugins as _load_env_plugins
|
||||
from gym.envs.registration import make, register, registry, spec
|
||||
from gymnasium.envs.registration import load_env_plugins as _load_env_plugins
|
||||
from gymnasium.envs.registration import make, register, registry, spec
|
||||
|
||||
# Hook to load plugins from entry points
|
||||
_load_env_plugins()
|
||||
@@ -10,41 +10,41 @@ _load_env_plugins()
|
||||
|
||||
register(
|
||||
id="CartPole-v0",
|
||||
entry_point="gym.envs.classic_control.cartpole:CartPoleEnv",
|
||||
entry_point="gymnasium.envs.classic_control.cartpole:CartPoleEnv",
|
||||
max_episode_steps=200,
|
||||
reward_threshold=195.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="CartPole-v1",
|
||||
entry_point="gym.envs.classic_control.cartpole:CartPoleEnv",
|
||||
entry_point="gymnasium.envs.classic_control.cartpole:CartPoleEnv",
|
||||
max_episode_steps=500,
|
||||
reward_threshold=475.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="MountainCar-v0",
|
||||
entry_point="gym.envs.classic_control.mountain_car:MountainCarEnv",
|
||||
entry_point="gymnasium.envs.classic_control.mountain_car:MountainCarEnv",
|
||||
max_episode_steps=200,
|
||||
reward_threshold=-110.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="MountainCarContinuous-v0",
|
||||
entry_point="gym.envs.classic_control.continuous_mountain_car:Continuous_MountainCarEnv",
|
||||
entry_point="gymnasium.envs.classic_control.continuous_mountain_car:Continuous_MountainCarEnv",
|
||||
max_episode_steps=999,
|
||||
reward_threshold=90.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Pendulum-v1",
|
||||
entry_point="gym.envs.classic_control.pendulum:PendulumEnv",
|
||||
entry_point="gymnasium.envs.classic_control.pendulum:PendulumEnv",
|
||||
max_episode_steps=200,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Acrobot-v1",
|
||||
entry_point="gym.envs.classic_control.acrobot:AcrobotEnv",
|
||||
entry_point="gymnasium.envs.classic_control.acrobot:AcrobotEnv",
|
||||
reward_threshold=-100.0,
|
||||
max_episode_steps=500,
|
||||
)
|
||||
@@ -54,14 +54,14 @@ register(
|
||||
|
||||
register(
|
||||
id="LunarLander-v2",
|
||||
entry_point="gym.envs.box2d.lunar_lander:LunarLander",
|
||||
entry_point="gymnasium.envs.box2d.lunar_lander:LunarLander",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=200,
|
||||
)
|
||||
|
||||
register(
|
||||
id="LunarLanderContinuous-v2",
|
||||
entry_point="gym.envs.box2d.lunar_lander:LunarLander",
|
||||
entry_point="gymnasium.envs.box2d.lunar_lander:LunarLander",
|
||||
kwargs={"continuous": True},
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=200,
|
||||
@@ -69,14 +69,14 @@ register(
|
||||
|
||||
register(
|
||||
id="BipedalWalker-v3",
|
||||
entry_point="gym.envs.box2d.bipedal_walker:BipedalWalker",
|
||||
entry_point="gymnasium.envs.box2d.bipedal_walker:BipedalWalker",
|
||||
max_episode_steps=1600,
|
||||
reward_threshold=300,
|
||||
)
|
||||
|
||||
register(
|
||||
id="BipedalWalkerHardcore-v3",
|
||||
entry_point="gym.envs.box2d.bipedal_walker:BipedalWalker",
|
||||
entry_point="gymnasium.envs.box2d.bipedal_walker:BipedalWalker",
|
||||
kwargs={"hardcore": True},
|
||||
max_episode_steps=2000,
|
||||
reward_threshold=300,
|
||||
@@ -84,7 +84,7 @@ register(
|
||||
|
||||
register(
|
||||
id="CarRacing-v2",
|
||||
entry_point="gym.envs.box2d.car_racing:CarRacing",
|
||||
entry_point="gymnasium.envs.box2d.car_racing:CarRacing",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=900,
|
||||
)
|
||||
@@ -94,13 +94,13 @@ register(
|
||||
|
||||
register(
|
||||
id="Blackjack-v1",
|
||||
entry_point="gym.envs.toy_text.blackjack:BlackjackEnv",
|
||||
entry_point="gymnasium.envs.toy_text.blackjack:BlackjackEnv",
|
||||
kwargs={"sab": True, "natural": False},
|
||||
)
|
||||
|
||||
register(
|
||||
id="FrozenLake-v1",
|
||||
entry_point="gym.envs.toy_text.frozen_lake:FrozenLakeEnv",
|
||||
entry_point="gymnasium.envs.toy_text.frozen_lake:FrozenLakeEnv",
|
||||
kwargs={"map_name": "4x4"},
|
||||
max_episode_steps=100,
|
||||
reward_threshold=0.70, # optimum = 0.74
|
||||
@@ -108,7 +108,7 @@ register(
|
||||
|
||||
register(
|
||||
id="FrozenLake8x8-v1",
|
||||
entry_point="gym.envs.toy_text.frozen_lake:FrozenLakeEnv",
|
||||
entry_point="gymnasium.envs.toy_text.frozen_lake:FrozenLakeEnv",
|
||||
kwargs={"map_name": "8x8"},
|
||||
max_episode_steps=200,
|
||||
reward_threshold=0.85, # optimum = 0.91
|
||||
@@ -116,12 +116,12 @@ register(
|
||||
|
||||
register(
|
||||
id="CliffWalking-v0",
|
||||
entry_point="gym.envs.toy_text.cliffwalking:CliffWalkingEnv",
|
||||
entry_point="gymnasium.envs.toy_text.cliffwalking:CliffWalkingEnv",
|
||||
)
|
||||
|
||||
register(
|
||||
id="Taxi-v3",
|
||||
entry_point="gym.envs.toy_text.taxi:TaxiEnv",
|
||||
entry_point="gymnasium.envs.toy_text.taxi:TaxiEnv",
|
||||
reward_threshold=8, # optimum = 8.46
|
||||
max_episode_steps=200,
|
||||
)
|
||||
@@ -133,119 +133,119 @@ register(
|
||||
|
||||
register(
|
||||
id="Reacher-v2",
|
||||
entry_point="gym.envs.mujoco:ReacherEnv",
|
||||
entry_point="gymnasium.envs.mujoco:ReacherEnv",
|
||||
max_episode_steps=50,
|
||||
reward_threshold=-3.75,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Reacher-v4",
|
||||
entry_point="gym.envs.mujoco.reacher_v4:ReacherEnv",
|
||||
entry_point="gymnasium.envs.mujoco.reacher_v4:ReacherEnv",
|
||||
max_episode_steps=50,
|
||||
reward_threshold=-3.75,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Pusher-v2",
|
||||
entry_point="gym.envs.mujoco:PusherEnv",
|
||||
entry_point="gymnasium.envs.mujoco:PusherEnv",
|
||||
max_episode_steps=100,
|
||||
reward_threshold=0.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Pusher-v4",
|
||||
entry_point="gym.envs.mujoco.pusher_v4:PusherEnv",
|
||||
entry_point="gymnasium.envs.mujoco.pusher_v4:PusherEnv",
|
||||
max_episode_steps=100,
|
||||
reward_threshold=0.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="InvertedPendulum-v2",
|
||||
entry_point="gym.envs.mujoco:InvertedPendulumEnv",
|
||||
entry_point="gymnasium.envs.mujoco:InvertedPendulumEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=950.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="InvertedPendulum-v4",
|
||||
entry_point="gym.envs.mujoco.inverted_pendulum_v4:InvertedPendulumEnv",
|
||||
entry_point="gymnasium.envs.mujoco.inverted_pendulum_v4:InvertedPendulumEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=950.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="InvertedDoublePendulum-v2",
|
||||
entry_point="gym.envs.mujoco:InvertedDoublePendulumEnv",
|
||||
entry_point="gymnasium.envs.mujoco:InvertedDoublePendulumEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=9100.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="InvertedDoublePendulum-v4",
|
||||
entry_point="gym.envs.mujoco.inverted_double_pendulum_v4:InvertedDoublePendulumEnv",
|
||||
entry_point="gymnasium.envs.mujoco.inverted_double_pendulum_v4:InvertedDoublePendulumEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=9100.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="HalfCheetah-v2",
|
||||
entry_point="gym.envs.mujoco:HalfCheetahEnv",
|
||||
entry_point="gymnasium.envs.mujoco:HalfCheetahEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=4800.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="HalfCheetah-v3",
|
||||
entry_point="gym.envs.mujoco.half_cheetah_v3:HalfCheetahEnv",
|
||||
entry_point="gymnasium.envs.mujoco.half_cheetah_v3:HalfCheetahEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=4800.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="HalfCheetah-v4",
|
||||
entry_point="gym.envs.mujoco.half_cheetah_v4:HalfCheetahEnv",
|
||||
entry_point="gymnasium.envs.mujoco.half_cheetah_v4:HalfCheetahEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=4800.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Hopper-v2",
|
||||
entry_point="gym.envs.mujoco:HopperEnv",
|
||||
entry_point="gymnasium.envs.mujoco:HopperEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=3800.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Hopper-v3",
|
||||
entry_point="gym.envs.mujoco.hopper_v3:HopperEnv",
|
||||
entry_point="gymnasium.envs.mujoco.hopper_v3:HopperEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=3800.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Hopper-v4",
|
||||
entry_point="gym.envs.mujoco.hopper_v4:HopperEnv",
|
||||
entry_point="gymnasium.envs.mujoco.hopper_v4:HopperEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=3800.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Swimmer-v2",
|
||||
entry_point="gym.envs.mujoco:SwimmerEnv",
|
||||
entry_point="gymnasium.envs.mujoco:SwimmerEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=360.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Swimmer-v3",
|
||||
entry_point="gym.envs.mujoco.swimmer_v3:SwimmerEnv",
|
||||
entry_point="gymnasium.envs.mujoco.swimmer_v3:SwimmerEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=360.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Swimmer-v4",
|
||||
entry_point="gym.envs.mujoco.swimmer_v4:SwimmerEnv",
|
||||
entry_point="gymnasium.envs.mujoco.swimmer_v4:SwimmerEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=360.0,
|
||||
)
|
||||
@@ -253,68 +253,68 @@ register(
|
||||
register(
|
||||
id="Walker2d-v2",
|
||||
max_episode_steps=1000,
|
||||
entry_point="gym.envs.mujoco:Walker2dEnv",
|
||||
entry_point="gymnasium.envs.mujoco:Walker2dEnv",
|
||||
)
|
||||
|
||||
register(
|
||||
id="Walker2d-v3",
|
||||
max_episode_steps=1000,
|
||||
entry_point="gym.envs.mujoco.walker2d_v3:Walker2dEnv",
|
||||
entry_point="gymnasium.envs.mujoco.walker2d_v3:Walker2dEnv",
|
||||
)
|
||||
|
||||
register(
|
||||
id="Walker2d-v4",
|
||||
max_episode_steps=1000,
|
||||
entry_point="gym.envs.mujoco.walker2d_v4:Walker2dEnv",
|
||||
entry_point="gymnasium.envs.mujoco.walker2d_v4:Walker2dEnv",
|
||||
)
|
||||
|
||||
register(
|
||||
id="Ant-v2",
|
||||
entry_point="gym.envs.mujoco:AntEnv",
|
||||
entry_point="gymnasium.envs.mujoco:AntEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=6000.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Ant-v3",
|
||||
entry_point="gym.envs.mujoco.ant_v3:AntEnv",
|
||||
entry_point="gymnasium.envs.mujoco.ant_v3:AntEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=6000.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Ant-v4",
|
||||
entry_point="gym.envs.mujoco.ant_v4:AntEnv",
|
||||
entry_point="gymnasium.envs.mujoco.ant_v4:AntEnv",
|
||||
max_episode_steps=1000,
|
||||
reward_threshold=6000.0,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Humanoid-v2",
|
||||
entry_point="gym.envs.mujoco:HumanoidEnv",
|
||||
entry_point="gymnasium.envs.mujoco:HumanoidEnv",
|
||||
max_episode_steps=1000,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Humanoid-v3",
|
||||
entry_point="gym.envs.mujoco.humanoid_v3:HumanoidEnv",
|
||||
entry_point="gymnasium.envs.mujoco.humanoid_v3:HumanoidEnv",
|
||||
max_episode_steps=1000,
|
||||
)
|
||||
|
||||
register(
|
||||
id="Humanoid-v4",
|
||||
entry_point="gym.envs.mujoco.humanoid_v4:HumanoidEnv",
|
||||
entry_point="gymnasium.envs.mujoco.humanoid_v4:HumanoidEnv",
|
||||
max_episode_steps=1000,
|
||||
)
|
||||
|
||||
register(
|
||||
id="HumanoidStandup-v2",
|
||||
entry_point="gym.envs.mujoco:HumanoidStandupEnv",
|
||||
entry_point="gymnasium.envs.mujoco:HumanoidStandupEnv",
|
||||
max_episode_steps=1000,
|
||||
)
|
||||
|
||||
register(
|
||||
id="HumanoidStandup-v4",
|
||||
entry_point="gym.envs.mujoco.humanoidstandup_v4:HumanoidStandupEnv",
|
||||
entry_point="gymnasium.envs.mujoco.humanoidstandup_v4:HumanoidStandupEnv",
|
||||
max_episode_steps=1000,
|
||||
)
|
3
gymnasium/envs/box2d/__init__.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from gymnasium.envs.box2d.bipedal_walker import BipedalWalker, BipedalWalkerHardcore
|
||||
from gymnasium.envs.box2d.car_racing import CarRacing
|
||||
from gymnasium.envs.box2d.lunar_lander import LunarLander, LunarLanderContinuous
|
@@ -5,10 +5,10 @@ from typing import TYPE_CHECKING, List, Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import error, spaces
|
||||
from gym.error import DependencyNotInstalled
|
||||
from gym.utils import EzPickle
|
||||
import gymnasium
|
||||
from gymnasium import error, spaces
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
from gymnasium.utils import EzPickle
|
||||
|
||||
try:
|
||||
import Box2D
|
||||
@@ -21,7 +21,7 @@ try:
|
||||
revoluteJointDef,
|
||||
)
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled("box2D is not installed, run `pip install gym[box2d]`")
|
||||
raise DependencyNotInstalled("box2D is not installed, run `pip install gymnasium[box2d]`")
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -98,7 +98,7 @@ class ContactDetector(contactListener):
|
||||
leg.ground_contact = False
|
||||
|
||||
|
||||
class BipedalWalker(gym.Env, EzPickle):
|
||||
class BipedalWalker(gymnasium.Env, EzPickle):
|
||||
"""
|
||||
### Description
|
||||
This is a simple 4-joint walker robot environment.
|
||||
@@ -112,7 +112,7 @@ class BipedalWalker(gym.Env, EzPickle):
|
||||
A heuristic is provided for testing. It's also useful to get demonstrations
|
||||
to learn from. To run the heuristic:
|
||||
```
|
||||
python gym/envs/box2d/bipedal_walker.py
|
||||
python gymnasium/envs/box2d/bipedal_walker.py
|
||||
```
|
||||
|
||||
### Action Space
|
||||
@@ -142,8 +142,8 @@ class BipedalWalker(gym.Env, EzPickle):
|
||||
To use to the _hardcore_ environment, you need to specify the
|
||||
`hardcore=True` argument like below:
|
||||
```python
|
||||
import gym
|
||||
env = gym.make("BipedalWalker-v3", hardcore=True)
|
||||
import gymnasium
|
||||
env = gymnasium.make("BipedalWalker-v3", hardcore=True)
|
||||
```
|
||||
|
||||
### Version History
|
||||
@@ -611,7 +611,7 @@ class BipedalWalker(gym.Env, EzPickle):
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[box2d]`"
|
||||
"pygame is not installed, run `pip install gymnasium[box2d]`"
|
||||
)
|
||||
|
||||
if self.screen is None and self.render_mode == "human":
|
||||
@@ -758,8 +758,8 @@ class BipedalWalkerHardcore:
|
||||
raise error.Error(
|
||||
"Error initializing BipedalWalkerHardcore Environment.\n"
|
||||
"Currently, we do not support initializing this mode of environment by calling the class directly.\n"
|
||||
"To use this environment, instead create it by specifying the hardcore keyword in gym.make, i.e.\n"
|
||||
'gym.make("BipedalWalker-v3", hardcore=True)'
|
||||
"To use this environment, instead create it by specifying the hardcore keyword in gymnasium.make, i.e.\n"
|
||||
'gymnasium.make("BipedalWalker-v3", hardcore=True)'
|
||||
)
|
||||
|
||||
|
@@ -12,12 +12,12 @@ import math
|
||||
import Box2D
|
||||
import numpy as np
|
||||
|
||||
from gym.error import DependencyNotInstalled
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
try:
|
||||
from Box2D.b2 import fixtureDef, polygonShape, revoluteJointDef
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled("box2D is not installed, run `pip install gym[box2d]`")
|
||||
raise DependencyNotInstalled("box2D is not installed, run `pip install gymnasium[box2d]`")
|
||||
|
||||
|
||||
SIZE = 0.02
|
@@ -5,17 +5,17 @@ from typing import Optional, Union
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import spaces
|
||||
from gym.envs.box2d.car_dynamics import Car
|
||||
from gym.error import DependencyNotInstalled, InvalidAction
|
||||
from gym.utils import EzPickle
|
||||
import gymnasium
|
||||
from gymnasium import spaces
|
||||
from gymnasium.envs.box2d.car_dynamics import Car
|
||||
from gymnasium.error import DependencyNotInstalled, InvalidAction
|
||||
from gymnasium.utils import EzPickle
|
||||
|
||||
try:
|
||||
import Box2D
|
||||
from Box2D.b2 import contactListener, fixtureDef, polygonShape
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled("box2D is not installed, run `pip install gym[box2d]`")
|
||||
raise DependencyNotInstalled("box2D is not installed, run `pip install gymnasium[box2d]`")
|
||||
|
||||
try:
|
||||
# As pygame is necessary for using the environment (reset and step) even without a render mode
|
||||
@@ -24,7 +24,7 @@ try:
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[box2d]`"
|
||||
"pygame is not installed, run `pip install gymnasium[box2d]`"
|
||||
)
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ class FrictionDetector(contactListener):
|
||||
obj.tiles.remove(tile)
|
||||
|
||||
|
||||
class CarRacing(gym.Env, EzPickle):
|
||||
class CarRacing(gymnasium.Env, EzPickle):
|
||||
"""
|
||||
### Description
|
||||
The easiest control task to learn from pixels - a top-down
|
||||
@@ -113,7 +113,7 @@ class CarRacing(gym.Env, EzPickle):
|
||||
steering wheel position, and gyroscope.
|
||||
To play yourself (it's rather fast for humans), type:
|
||||
```
|
||||
python gym/envs/box2d/car_racing.py
|
||||
python gymnasium/envs/box2d/car_racing.py
|
||||
```
|
||||
Remember: it's a powerful rear-wheel drive car - don't press the accelerator
|
||||
and turn at the same time.
|
||||
@@ -157,7 +157,7 @@ class CarRacing(gym.Env, EzPickle):
|
||||
`domain_randomize` must be `True` on init for this argument to work.
|
||||
Example usage:
|
||||
```py
|
||||
env = gym.make("CarRacing-v1", domain_randomize=True)
|
||||
env = gymnasium.make("CarRacing-v1", domain_randomize=True)
|
||||
|
||||
# normal reset, this changes the colour scheme by default
|
||||
env.reset()
|
@@ -6,11 +6,11 @@ from typing import TYPE_CHECKING, Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import error, spaces
|
||||
from gym.error import DependencyNotInstalled
|
||||
from gym.utils import EzPickle, colorize
|
||||
from gym.utils.step_api_compatibility import step_api_compatibility
|
||||
import gymnasium
|
||||
from gymnasium import error, spaces
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
from gymnasium.utils import EzPickle, colorize
|
||||
from gymnasium.utils.step_api_compatibility import step_api_compatibility
|
||||
|
||||
try:
|
||||
import Box2D
|
||||
@@ -23,7 +23,7 @@ try:
|
||||
revoluteJointDef,
|
||||
)
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled("box2d is not installed, run `pip install gym[box2d]`")
|
||||
raise DependencyNotInstalled("box2d is not installed, run `pip install gymnasium[box2d]`")
|
||||
|
||||
|
||||
if TYPE_CHECKING:
|
||||
@@ -72,7 +72,7 @@ class ContactDetector(contactListener):
|
||||
self.env.legs[i].ground_contact = False
|
||||
|
||||
|
||||
class LunarLander(gym.Env, EzPickle):
|
||||
class LunarLander(gymnasium.Env, EzPickle):
|
||||
"""
|
||||
### Description
|
||||
This environment is a classic rocket trajectory optimization problem.
|
||||
@@ -88,7 +88,7 @@ class LunarLander(gym.Env, EzPickle):
|
||||
|
||||
To see a heuristic landing, run:
|
||||
```
|
||||
python gym/envs/box2d/lunar_lander.py
|
||||
python gymnasium/envs/box2d/lunar_lander.py
|
||||
```
|
||||
<!-- To play yourself, run: -->
|
||||
<!-- python examples/agents/keyboard_agent.py LunarLander-v2 -->
|
||||
@@ -139,8 +139,8 @@ class LunarLander(gym.Env, EzPickle):
|
||||
To use to the _continuous_ environment, you need to specify the
|
||||
`continuous=True` argument like below:
|
||||
```python
|
||||
import gym
|
||||
env = gym.make(
|
||||
import gymnasium
|
||||
env = gymnasium.make(
|
||||
"LunarLander-v2",
|
||||
continuous: bool = False,
|
||||
gravity: float = -10.0,
|
||||
@@ -605,7 +605,7 @@ class LunarLander(gym.Env, EzPickle):
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[box2d]`"
|
||||
"pygame is not installed, run `pip install gymnasium[box2d]`"
|
||||
)
|
||||
|
||||
if self.screen is None and self.render_mode == "human":
|
||||
@@ -800,8 +800,8 @@ class LunarLanderContinuous:
|
||||
raise error.Error(
|
||||
"Error initializing LunarLanderContinuous Environment.\n"
|
||||
"Currently, we do not support initializing this mode of environment by calling the class directly.\n"
|
||||
"To use this environment, instead create it by specifying the continuous keyword in gym.make, i.e.\n"
|
||||
'gym.make("LunarLander-v2", continuous=True)'
|
||||
"To use this environment, instead create it by specifying the continuous keyword in gymnasium.make, i.e.\n"
|
||||
'gymnasium.make("LunarLander-v2", continuous=True)'
|
||||
)
|
||||
|
||||
|
5
gymnasium/envs/classic_control/__init__.py
Normal file
@@ -0,0 +1,5 @@
|
||||
from gymnasium.envs.classic_control.acrobot import AcrobotEnv
|
||||
from gymnasium.envs.classic_control.cartpole import CartPoleEnv
|
||||
from gymnasium.envs.classic_control.continuous_mountain_car import Continuous_MountainCarEnv
|
||||
from gymnasium.envs.classic_control.mountain_car import MountainCarEnv
|
||||
from gymnasium.envs.classic_control.pendulum import PendulumEnv
|
@@ -4,8 +4,8 @@ from typing import Optional
|
||||
import numpy as np
|
||||
from numpy import cos, pi, sin
|
||||
|
||||
from gym import core, spaces
|
||||
from gym.error import DependencyNotInstalled
|
||||
from gymnasium import core, spaces
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
__copyright__ = "Copyright 2013, RLPy http://acl.mit.edu/RLPy"
|
||||
__credits__ = [
|
||||
@@ -20,7 +20,7 @@ __author__ = "Christoph Dann <cdann@cdann.de>"
|
||||
|
||||
# SOURCE:
|
||||
# https://github.com/rlpy/rlpy/blob/master/rlpy/Domains/Acrobot.py
|
||||
from gym.envs.classic_control import utils
|
||||
from gymnasium.envs.classic_control import utils
|
||||
|
||||
|
||||
class AcrobotEnv(core.Env):
|
||||
@@ -97,7 +97,7 @@ class AcrobotEnv(core.Env):
|
||||
No additional arguments are currently supported.
|
||||
|
||||
```
|
||||
env = gym.make('Acrobot-v1')
|
||||
env = gymnasium.make('Acrobot-v1')
|
||||
```
|
||||
|
||||
By default, the dynamics of the acrobot follow those described in Sutton and Barto's book
|
||||
@@ -126,7 +126,7 @@ class AcrobotEnv(core.Env):
|
||||
- v1: Maximum number of steps increased from 200 to 500. The observation space for v0 provided direct readings of
|
||||
`theta1` and `theta2` in radians, having a range of `[-pi, pi]`. The v1 observation space as described here provides the
|
||||
sine and cosine of each angle instead.
|
||||
- v0: Initial versions release (1.0.0) (removed from gym for v1)
|
||||
- v0: Initial versions release (1.0.0) (removed from gymnasium for v1)
|
||||
|
||||
### References
|
||||
- Sutton, R. S. (1996). Generalization in Reinforcement Learning: Successful Examples Using Sparse Coarse Coding.
|
||||
@@ -282,7 +282,7 @@ class AcrobotEnv(core.Env):
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[classic_control]`"
|
||||
"pygame is not installed, run `pip install gymnasium[classic_control]`"
|
||||
)
|
||||
|
||||
if self.screen is None:
|
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
@@ -8,13 +8,13 @@ from typing import Optional, Union
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import logger, spaces
|
||||
from gym.envs.classic_control import utils
|
||||
from gym.error import DependencyNotInstalled
|
||||
import gymnasium
|
||||
from gymnasium import logger, spaces
|
||||
from gymnasium.envs.classic_control import utils
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
|
||||
class CartPoleEnv(gym.Env[np.ndarray, Union[int, np.ndarray]]):
|
||||
class CartPoleEnv(gymnasium.Env[np.ndarray, Union[int, np.ndarray]]):
|
||||
"""
|
||||
### Description
|
||||
|
||||
@@ -75,7 +75,7 @@ class CartPoleEnv(gym.Env[np.ndarray, Union[int, np.ndarray]]):
|
||||
### Arguments
|
||||
|
||||
```
|
||||
gym.make('CartPole-v1')
|
||||
gymnasium.make('CartPole-v1')
|
||||
```
|
||||
|
||||
No additional arguments are currently supported.
|
||||
@@ -212,7 +212,7 @@ class CartPoleEnv(gym.Env[np.ndarray, Union[int, np.ndarray]]):
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[classic_control]`"
|
||||
"pygame is not installed, run `pip install gymnasium[classic_control]`"
|
||||
)
|
||||
|
||||
if self.screen is None:
|
@@ -7,7 +7,7 @@ A merge between two sources:
|
||||
of Jose Antonio Martin H. (version 1.0), adapted by 'Tom Schaul, tom@idsia.ch'
|
||||
and then modified by Arnaud de Broissia
|
||||
|
||||
* the gym MountainCar environment
|
||||
* the gymnasium MountainCar environment
|
||||
itself from
|
||||
http://incompleteideas.net/sutton/MountainCar/MountainCar1.cp
|
||||
permalink: https://perma.cc/6Z2N-PFWC
|
||||
@@ -18,13 +18,13 @@ from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import spaces
|
||||
from gym.envs.classic_control import utils
|
||||
from gym.error import DependencyNotInstalled
|
||||
import gymnasium
|
||||
from gymnasium import spaces
|
||||
from gymnasium.envs.classic_control import utils
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
|
||||
class Continuous_MountainCarEnv(gym.Env):
|
||||
class Continuous_MountainCarEnv(gymnasium.Env):
|
||||
"""
|
||||
### Description
|
||||
|
||||
@@ -32,7 +32,7 @@ class Continuous_MountainCarEnv(gym.Env):
|
||||
at the bottom of a sinusoidal valley, with the only possible actions being the accelerations
|
||||
that can be applied to the car in either direction. The goal of the MDP is to strategically
|
||||
accelerate the car to reach the goal state on top of the right hill. There are two versions
|
||||
of the mountain car domain in gym: one with discrete actions and one with continuous.
|
||||
of the mountain car domain in gymnasium: one with discrete actions and one with continuous.
|
||||
This version is the one with continuous actions.
|
||||
|
||||
This MDP first appeared in [Andrew Moore's PhD Thesis (1990)](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-209.pdf)
|
||||
@@ -92,7 +92,7 @@ class Continuous_MountainCarEnv(gym.Env):
|
||||
### Arguments
|
||||
|
||||
```
|
||||
gym.make('MountainCarContinuous-v0')
|
||||
gymnasium.make('MountainCarContinuous-v0')
|
||||
```
|
||||
|
||||
### Version History
|
||||
@@ -112,7 +112,7 @@ class Continuous_MountainCarEnv(gym.Env):
|
||||
self.max_position = 0.6
|
||||
self.max_speed = 0.07
|
||||
self.goal_position = (
|
||||
0.45 # was 0.5 in gym, 0.45 in Arnaud de Broissia's version
|
||||
0.45 # was 0.5 in gymnasium, 0.45 in Arnaud de Broissia's version
|
||||
)
|
||||
self.goal_velocity = goal_velocity
|
||||
self.power = 0.0015
|
||||
@@ -194,7 +194,7 @@ class Continuous_MountainCarEnv(gym.Env):
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[classic_control]`"
|
||||
"pygame is not installed, run `pip install gymnasium[classic_control]`"
|
||||
)
|
||||
|
||||
if self.screen is None:
|
@@ -7,13 +7,13 @@ from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import spaces
|
||||
from gym.envs.classic_control import utils
|
||||
from gym.error import DependencyNotInstalled
|
||||
import gymnasium
|
||||
from gymnasium import spaces
|
||||
from gymnasium.envs.classic_control import utils
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
|
||||
class MountainCarEnv(gym.Env):
|
||||
class MountainCarEnv(gymnasium.Env):
|
||||
"""
|
||||
### Description
|
||||
|
||||
@@ -21,7 +21,7 @@ class MountainCarEnv(gym.Env):
|
||||
at the bottom of a sinusoidal valley, with the only possible actions being the accelerations
|
||||
that can be applied to the car in either direction. The goal of the MDP is to strategically
|
||||
accelerate the car to reach the goal state on top of the right hill. There are two versions
|
||||
of the mountain car domain in gym: one with discrete actions and one with continuous.
|
||||
of the mountain car domain in gymnasium: one with discrete actions and one with continuous.
|
||||
This version is the one with discrete actions.
|
||||
|
||||
This MDP first appeared in [Andrew Moore's PhD Thesis (1990)](https://www.cl.cam.ac.uk/techreports/UCAM-CL-TR-209.pdf)
|
||||
@@ -87,7 +87,7 @@ class MountainCarEnv(gym.Env):
|
||||
### Arguments
|
||||
|
||||
```
|
||||
gym.make('MountainCar-v0')
|
||||
gymnasium.make('MountainCar-v0')
|
||||
```
|
||||
|
||||
### Version History
|
||||
@@ -172,7 +172,7 @@ class MountainCarEnv(gym.Env):
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[classic_control]`"
|
||||
"pygame is not installed, run `pip install gymnasium[classic_control]`"
|
||||
)
|
||||
|
||||
if self.screen is None:
|
@@ -5,16 +5,16 @@ from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import spaces
|
||||
from gym.envs.classic_control import utils
|
||||
from gym.error import DependencyNotInstalled
|
||||
import gymnasium
|
||||
from gymnasium import spaces
|
||||
from gymnasium.envs.classic_control import utils
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
DEFAULT_X = np.pi
|
||||
DEFAULT_Y = 1.0
|
||||
|
||||
|
||||
class PendulumEnv(gym.Env):
|
||||
class PendulumEnv(gymnasium.Env):
|
||||
"""
|
||||
### Description
|
||||
|
||||
@@ -77,7 +77,7 @@ class PendulumEnv(gym.Env):
|
||||
The default value is g = 10.0 .
|
||||
|
||||
```
|
||||
gym.make('Pendulum-v1', g=9.81)
|
||||
gymnasium.make('Pendulum-v1', g=9.81)
|
||||
```
|
||||
|
||||
### Version History
|
||||
@@ -110,7 +110,7 @@ class PendulumEnv(gym.Env):
|
||||
high = np.array([1.0, 1.0, self.max_speed], dtype=np.float32)
|
||||
# This will throw a warning in tests/envs/test_envs in utils/env_checker.py as the space is not symmetric
|
||||
# or normalised as max_torque == 2 by default. Ignoring the issue here as the default settings are too old
|
||||
# to update to follow the openai gym api
|
||||
# to update to follow the openai gymnasium api
|
||||
self.action_space = spaces.Box(
|
||||
low=-self.max_torque, high=self.max_torque, shape=(1,), dtype=np.float32
|
||||
)
|
||||
@@ -168,7 +168,7 @@ class PendulumEnv(gym.Env):
|
||||
from pygame import gfxdraw
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[classic_control]`"
|
||||
"pygame is not installed, run `pip install gymnasium[classic_control]`"
|
||||
)
|
||||
|
||||
if self.screen is None:
|
19
gymnasium/envs/mujoco/__init__.py
Normal file
@@ -0,0 +1,19 @@
|
||||
from gymnasium.envs.mujoco.mujoco_env import MujocoEnv, MuJocoPyEnv # isort:skip
|
||||
from gymnasium.envs.mujoco.mujoco_rendering import ( # isort:skip
|
||||
RenderContextOffscreen,
|
||||
Viewer,
|
||||
)
|
||||
|
||||
# ^^^^^ so that user gets the correct error
|
||||
# message if mujoco is not installed correctly
|
||||
from gymnasium.envs.mujoco.ant import AntEnv
|
||||
from gymnasium.envs.mujoco.half_cheetah import HalfCheetahEnv
|
||||
from gymnasium.envs.mujoco.hopper import HopperEnv
|
||||
from gymnasium.envs.mujoco.humanoid import HumanoidEnv
|
||||
from gymnasium.envs.mujoco.humanoidstandup import HumanoidStandupEnv
|
||||
from gymnasium.envs.mujoco.inverted_double_pendulum import InvertedDoublePendulumEnv
|
||||
from gymnasium.envs.mujoco.inverted_pendulum import InvertedPendulumEnv
|
||||
from gymnasium.envs.mujoco.pusher import PusherEnv
|
||||
from gymnasium.envs.mujoco.reacher import ReacherEnv
|
||||
from gymnasium.envs.mujoco.swimmer import SwimmerEnv
|
||||
from gymnasium.envs.mujoco.walker2d import Walker2dEnv
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class AntEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"distance": 4.0,
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"distance": 4.0,
|
||||
@@ -143,13 +143,13 @@ class AntEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported in v2 and lower.
|
||||
|
||||
```
|
||||
env = gym.make('Ant-v2')
|
||||
env = gymnasium.make('Ant-v2')
|
||||
```
|
||||
|
||||
v3 and v4 take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
v3 and v4 take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
```
|
||||
env = gym.make('Ant-v4', ctrl_cost_weight=0.1, ...)
|
||||
env = gymnasium.make('Ant-v4', ctrl_cost_weight=0.1, ...)
|
||||
```
|
||||
|
||||
| Parameter | Type | Default |Description |
|
||||
@@ -166,7 +166,7 @@ class AntEnv(MujocoEnv, utils.EzPickle):
|
||||
|
||||
### Version History
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -1,121 +1,121 @@
|
||||
<mujoco model="humanoid">
|
||||
<compiler angle="degree" inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="1" damping="1" limited="true"/>
|
||||
<geom conaffinity="1" condim="1" contype="1" margin="0.001" material="geom" rgba="0.8 0.6 .4 1"/>
|
||||
<motor ctrllimited="true" ctrlrange="-.4 .4"/>
|
||||
</default>
|
||||
<option integrator="RK4" iterations="50" solver="PGS" timestep="0.003">
|
||||
<!-- <flags solverstat="enable" energy="enable"/>-->
|
||||
</option>
|
||||
<size nkey="5" nuser_geom="1"/>
|
||||
<visual>
|
||||
<map fogend="5" fogstart="3"/>
|
||||
</visual>
|
||||
<asset>
|
||||
<texture builtin="gradient" height="100" rgb1=".4 .5 .6" rgb2="0 0 0" type="skybox" width="100"/>
|
||||
<!-- <texture builtin="gradient" height="100" rgb1="1 1 1" rgb2="0 0 0" type="skybox" width="100"/>-->
|
||||
<texture builtin="flat" height="1278" mark="cross" markrgb="1 1 1" name="texgeom" random="0.01" rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" type="cube" width="127"/>
|
||||
<texture builtin="checker" height="100" name="texplane" rgb1="0 0 0" rgb2="0.8 0.8 0.8" type="2d" width="100"/>
|
||||
<material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
|
||||
<material name="geom" texture="texgeom" texuniform="true"/>
|
||||
</asset>
|
||||
<worldbody>
|
||||
<light cutoff="100" diffuse="1 1 1" dir="-0 0 -1.3" directional="true" exponent="1" pos="0 0 1.3" specular=".1 .1 .1"/>
|
||||
<geom condim="3" friction="1 .1 .1" material="MatPlane" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="20 20 0.125" type="plane"/>
|
||||
<!-- <geom condim="3" material="MatPlane" name="floor" pos="0 0 0" size="10 10 0.125" type="plane"/>-->
|
||||
<body name="torso" pos="0 0 1.4">
|
||||
<camera name="track" mode="trackcom" pos="0 -4 0" xyaxes="1 0 0 0 0 1"/>
|
||||
<joint armature="0" damping="0" limited="false" name="root" pos="0 0 0" stiffness="0" type="free"/>
|
||||
<geom fromto="0 -.07 0 0 .07 0" name="torso1" size="0.07" type="capsule"/>
|
||||
<geom name="head" pos="0 0 .19" size=".09" type="sphere" user="258"/>
|
||||
<geom fromto="-.01 -.06 -.12 -.01 .06 -.12" name="uwaist" size="0.06" type="capsule"/>
|
||||
<body name="lwaist" pos="-.01 0 -0.260" quat="1.000 0 -0.002 0">
|
||||
<geom fromto="0 -.06 0 0 .06 0" name="lwaist" size="0.06" type="capsule"/>
|
||||
<joint armature="0.02" axis="0 0 1" damping="5" name="abdomen_z" pos="0 0 0.065" range="-45 45" stiffness="20" type="hinge"/>
|
||||
<joint armature="0.02" axis="0 1 0" damping="5" name="abdomen_y" pos="0 0 0.065" range="-75 30" stiffness="10" type="hinge"/>
|
||||
<body name="pelvis" pos="0 0 -0.165" quat="1.000 0 -0.002 0">
|
||||
<joint armature="0.02" axis="1 0 0" damping="5" name="abdomen_x" pos="0 0 0.1" range="-35 35" stiffness="10" type="hinge"/>
|
||||
<geom fromto="-.02 -.07 0 -.02 .07 0" name="butt" size="0.09" type="capsule"/>
|
||||
<body name="right_thigh" pos="0 -0.1 -0.04">
|
||||
<joint armature="0.01" axis="1 0 0" damping="5" name="right_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 1" damping="5" name="right_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.0080" axis="0 1 0" damping="5" name="right_hip_y" pos="0 0 0" range="-110 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 0.01 -.34" name="right_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="right_shin" pos="0 0.01 -0.403">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="right_knee" pos="0 0 .02" range="-160 -2" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 0 -.3" name="right_shin1" size="0.049" type="capsule"/>
|
||||
<body name="right_foot" pos="0 0 -0.45">
|
||||
<geom name="right_foot" pos="0 0 0.1" size="0.075" type="sphere" user="0"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_thigh" pos="0 0.1 -0.04">
|
||||
<joint armature="0.01" axis="-1 0 0" damping="5" name="left_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 -1" damping="5" name="left_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 1 0" damping="5" name="left_hip_y" pos="0 0 0" range="-110 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 -0.01 -.34" name="left_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="left_shin" pos="0 -0.01 -0.403">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="left_knee" pos="0 0 .02" range="-160 -2" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 0 -.3" name="left_shin1" size="0.049" type="capsule"/>
|
||||
<body name="left_foot" pos="0 0 -0.45">
|
||||
<geom name="left_foot" type="sphere" size="0.075" pos="0 0 0.1" user="0" />
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="right_upper_arm" pos="0 -0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 1 1" name="right_shoulder1" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 -1 1" name="right_shoulder2" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 -.16 -.16" name="right_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="right_lower_arm" pos=".18 -.18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 1" name="right_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 0.01 0.01 .17 .17 .17" name="right_larm" size="0.031" type="capsule"/>
|
||||
<geom name="right_hand" pos=".18 .18 .18" size="0.04" type="sphere"/>
|
||||
<camera pos="0 0 0"/>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_upper_arm" pos="0 0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 -1 1" name="left_shoulder1" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 1 1" name="left_shoulder2" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 .16 -.16" name="left_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="left_lower_arm" pos=".18 .18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 -1" name="left_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 -0.01 0.01 .17 -.17 .17" name="left_larm" size="0.031" type="capsule"/>
|
||||
<geom name="left_hand" pos=".18 -.18 .18" size="0.04" type="sphere"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</worldbody>
|
||||
<tendon>
|
||||
<fixed name="left_hipknee">
|
||||
<joint coef="-1" joint="left_hip_y"/>
|
||||
<joint coef="1" joint="left_knee"/>
|
||||
</fixed>
|
||||
<fixed name="right_hipknee">
|
||||
<joint coef="-1" joint="right_hip_y"/>
|
||||
<joint coef="1" joint="right_knee"/>
|
||||
</fixed>
|
||||
</tendon>
|
||||
|
||||
<actuator>
|
||||
<motor gear="100" joint="abdomen_y" name="abdomen_y"/>
|
||||
<motor gear="100" joint="abdomen_z" name="abdomen_z"/>
|
||||
<motor gear="100" joint="abdomen_x" name="abdomen_x"/>
|
||||
<motor gear="100" joint="right_hip_x" name="right_hip_x"/>
|
||||
<motor gear="100" joint="right_hip_z" name="right_hip_z"/>
|
||||
<motor gear="300" joint="right_hip_y" name="right_hip_y"/>
|
||||
<motor gear="200" joint="right_knee" name="right_knee"/>
|
||||
<motor gear="100" joint="left_hip_x" name="left_hip_x"/>
|
||||
<motor gear="100" joint="left_hip_z" name="left_hip_z"/>
|
||||
<motor gear="300" joint="left_hip_y" name="left_hip_y"/>
|
||||
<motor gear="200" joint="left_knee" name="left_knee"/>
|
||||
<motor gear="25" joint="right_shoulder1" name="right_shoulder1"/>
|
||||
<motor gear="25" joint="right_shoulder2" name="right_shoulder2"/>
|
||||
<motor gear="25" joint="right_elbow" name="right_elbow"/>
|
||||
<motor gear="25" joint="left_shoulder1" name="left_shoulder1"/>
|
||||
<motor gear="25" joint="left_shoulder2" name="left_shoulder2"/>
|
||||
<motor gear="25" joint="left_elbow" name="left_elbow"/>
|
||||
</actuator>
|
||||
</mujoco>
|
||||
<mujoco model="humanoid">
|
||||
<compiler angle="degree" inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="1" damping="1" limited="true"/>
|
||||
<geom conaffinity="1" condim="1" contype="1" margin="0.001" material="geom" rgba="0.8 0.6 .4 1"/>
|
||||
<motor ctrllimited="true" ctrlrange="-.4 .4"/>
|
||||
</default>
|
||||
<option integrator="RK4" iterations="50" solver="PGS" timestep="0.003">
|
||||
<!-- <flags solverstat="enable" energy="enable"/>-->
|
||||
</option>
|
||||
<size nkey="5" nuser_geom="1"/>
|
||||
<visual>
|
||||
<map fogend="5" fogstart="3"/>
|
||||
</visual>
|
||||
<asset>
|
||||
<texture builtin="gradient" height="100" rgb1=".4 .5 .6" rgb2="0 0 0" type="skybox" width="100"/>
|
||||
<!-- <texture builtin="gradient" height="100" rgb1="1 1 1" rgb2="0 0 0" type="skybox" width="100"/>-->
|
||||
<texture builtin="flat" height="1278" mark="cross" markrgb="1 1 1" name="texgeom" random="0.01" rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" type="cube" width="127"/>
|
||||
<texture builtin="checker" height="100" name="texplane" rgb1="0 0 0" rgb2="0.8 0.8 0.8" type="2d" width="100"/>
|
||||
<material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
|
||||
<material name="geom" texture="texgeom" texuniform="true"/>
|
||||
</asset>
|
||||
<worldbody>
|
||||
<light cutoff="100" diffuse="1 1 1" dir="-0 0 -1.3" directional="true" exponent="1" pos="0 0 1.3" specular=".1 .1 .1"/>
|
||||
<geom condim="3" friction="1 .1 .1" material="MatPlane" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="20 20 0.125" type="plane"/>
|
||||
<!-- <geom condim="3" material="MatPlane" name="floor" pos="0 0 0" size="10 10 0.125" type="plane"/>-->
|
||||
<body name="torso" pos="0 0 1.4">
|
||||
<camera name="track" mode="trackcom" pos="0 -4 0" xyaxes="1 0 0 0 0 1"/>
|
||||
<joint armature="0" damping="0" limited="false" name="root" pos="0 0 0" stiffness="0" type="free"/>
|
||||
<geom fromto="0 -.07 0 0 .07 0" name="torso1" size="0.07" type="capsule"/>
|
||||
<geom name="head" pos="0 0 .19" size=".09" type="sphere" user="258"/>
|
||||
<geom fromto="-.01 -.06 -.12 -.01 .06 -.12" name="uwaist" size="0.06" type="capsule"/>
|
||||
<body name="lwaist" pos="-.01 0 -0.260" quat="1.000 0 -0.002 0">
|
||||
<geom fromto="0 -.06 0 0 .06 0" name="lwaist" size="0.06" type="capsule"/>
|
||||
<joint armature="0.02" axis="0 0 1" damping="5" name="abdomen_z" pos="0 0 0.065" range="-45 45" stiffness="20" type="hinge"/>
|
||||
<joint armature="0.02" axis="0 1 0" damping="5" name="abdomen_y" pos="0 0 0.065" range="-75 30" stiffness="10" type="hinge"/>
|
||||
<body name="pelvis" pos="0 0 -0.165" quat="1.000 0 -0.002 0">
|
||||
<joint armature="0.02" axis="1 0 0" damping="5" name="abdomen_x" pos="0 0 0.1" range="-35 35" stiffness="10" type="hinge"/>
|
||||
<geom fromto="-.02 -.07 0 -.02 .07 0" name="butt" size="0.09" type="capsule"/>
|
||||
<body name="right_thigh" pos="0 -0.1 -0.04">
|
||||
<joint armature="0.01" axis="1 0 0" damping="5" name="right_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 1" damping="5" name="right_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.0080" axis="0 1 0" damping="5" name="right_hip_y" pos="0 0 0" range="-110 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 0.01 -.34" name="right_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="right_shin" pos="0 0.01 -0.403">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="right_knee" pos="0 0 .02" range="-160 -2" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 0 -.3" name="right_shin1" size="0.049" type="capsule"/>
|
||||
<body name="right_foot" pos="0 0 -0.45">
|
||||
<geom name="right_foot" pos="0 0 0.1" size="0.075" type="sphere" user="0"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_thigh" pos="0 0.1 -0.04">
|
||||
<joint armature="0.01" axis="-1 0 0" damping="5" name="left_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 -1" damping="5" name="left_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 1 0" damping="5" name="left_hip_y" pos="0 0 0" range="-110 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 -0.01 -.34" name="left_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="left_shin" pos="0 -0.01 -0.403">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="left_knee" pos="0 0 .02" range="-160 -2" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 0 0 -.3" name="left_shin1" size="0.049" type="capsule"/>
|
||||
<body name="left_foot" pos="0 0 -0.45">
|
||||
<geom name="left_foot" type="sphere" size="0.075" pos="0 0 0.1" user="0" />
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="right_upper_arm" pos="0 -0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 1 1" name="right_shoulder1" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 -1 1" name="right_shoulder2" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 -.16 -.16" name="right_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="right_lower_arm" pos=".18 -.18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 1" name="right_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 0.01 0.01 .17 .17 .17" name="right_larm" size="0.031" type="capsule"/>
|
||||
<geom name="right_hand" pos=".18 .18 .18" size="0.04" type="sphere"/>
|
||||
<camera pos="0 0 0"/>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_upper_arm" pos="0 0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 -1 1" name="left_shoulder1" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 1 1" name="left_shoulder2" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 .16 -.16" name="left_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="left_lower_arm" pos=".18 .18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 -1" name="left_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 -0.01 0.01 .17 -.17 .17" name="left_larm" size="0.031" type="capsule"/>
|
||||
<geom name="left_hand" pos=".18 -.18 .18" size="0.04" type="sphere"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</worldbody>
|
||||
<tendon>
|
||||
<fixed name="left_hipknee">
|
||||
<joint coef="-1" joint="left_hip_y"/>
|
||||
<joint coef="1" joint="left_knee"/>
|
||||
</fixed>
|
||||
<fixed name="right_hipknee">
|
||||
<joint coef="-1" joint="right_hip_y"/>
|
||||
<joint coef="1" joint="right_knee"/>
|
||||
</fixed>
|
||||
</tendon>
|
||||
|
||||
<actuator>
|
||||
<motor gear="100" joint="abdomen_y" name="abdomen_y"/>
|
||||
<motor gear="100" joint="abdomen_z" name="abdomen_z"/>
|
||||
<motor gear="100" joint="abdomen_x" name="abdomen_x"/>
|
||||
<motor gear="100" joint="right_hip_x" name="right_hip_x"/>
|
||||
<motor gear="100" joint="right_hip_z" name="right_hip_z"/>
|
||||
<motor gear="300" joint="right_hip_y" name="right_hip_y"/>
|
||||
<motor gear="200" joint="right_knee" name="right_knee"/>
|
||||
<motor gear="100" joint="left_hip_x" name="left_hip_x"/>
|
||||
<motor gear="100" joint="left_hip_z" name="left_hip_z"/>
|
||||
<motor gear="300" joint="left_hip_y" name="left_hip_y"/>
|
||||
<motor gear="200" joint="left_knee" name="left_knee"/>
|
||||
<motor gear="25" joint="right_shoulder1" name="right_shoulder1"/>
|
||||
<motor gear="25" joint="right_shoulder2" name="right_shoulder2"/>
|
||||
<motor gear="25" joint="right_elbow" name="right_elbow"/>
|
||||
<motor gear="25" joint="left_shoulder1" name="left_shoulder1"/>
|
||||
<motor gear="25" joint="left_shoulder2" name="left_shoulder2"/>
|
||||
<motor gear="25" joint="left_elbow" name="left_elbow"/>
|
||||
</actuator>
|
||||
</mujoco>
|
@@ -1,121 +1,121 @@
|
||||
<mujoco model="humanoidstandup">
|
||||
<compiler angle="degree" inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="1" damping="1" limited="true"/>
|
||||
<geom conaffinity="1" condim="1" contype="1" margin="0.001" material="geom" rgba="0.8 0.6 .4 1"/>
|
||||
<motor ctrllimited="true" ctrlrange="-.4 .4"/>
|
||||
</default>
|
||||
<option integrator="RK4" iterations="50" solver="PGS" timestep="0.003">
|
||||
<!-- <flags solverstat="enable" energy="enable"/>-->
|
||||
</option>
|
||||
<size nkey="5" nuser_geom="1"/>
|
||||
<visual>
|
||||
<map fogend="5" fogstart="3"/>
|
||||
</visual>
|
||||
<asset>
|
||||
<texture builtin="gradient" height="100" rgb1=".4 .5 .6" rgb2="0 0 0" type="skybox" width="100"/>
|
||||
<!-- <texture builtin="gradient" height="100" rgb1="1 1 1" rgb2="0 0 0" type="skybox" width="100"/>-->
|
||||
<texture builtin="flat" height="1278" mark="cross" markrgb="1 1 1" name="texgeom" random="0.01" rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" type="cube" width="127"/>
|
||||
<texture builtin="checker" height="100" name="texplane" rgb1="0 0 0" rgb2="0.8 0.8 0.8" type="2d" width="100"/>
|
||||
<material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
|
||||
<material name="geom" texture="texgeom" texuniform="true"/>
|
||||
</asset>
|
||||
<worldbody>
|
||||
<light cutoff="100" diffuse="1 1 1" dir="-0 0 -1.3" directional="true" exponent="1" pos="0 0 1.3" specular=".1 .1 .1"/>
|
||||
<geom condim="3" friction="1 .1 .1" material="MatPlane" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="20 20 0.125" type="plane"/>
|
||||
<!-- <geom condim="3" material="MatPlane" name="floor" pos="0 0 0" size="10 10 0.125" type="plane"/>-->
|
||||
<body name="torso" pos="0 0 .105">
|
||||
<camera name="track" mode="trackcom" pos="0 -3 .5" xyaxes="1 0 0 0 0 1"/>
|
||||
<joint armature="0" damping="0" limited="false" name="root" pos="0 0 0" stiffness="0" type="free"/>
|
||||
<geom fromto="0 -.07 0 0 .07 0" name="torso1" size="0.07" type="capsule"/>
|
||||
<geom name="head" pos="-.15 0 0" size=".09" type="sphere" user="258"/>
|
||||
<geom fromto=".11 -.06 0 .11 .06 0" name="uwaist" size="0.06" type="capsule"/>
|
||||
<body name="lwaist" pos=".21 0 0" quat="1.000 0 -0.002 0">
|
||||
<geom fromto="0 -.06 0 0 .06 0" name="lwaist" size="0.06" type="capsule"/>
|
||||
<joint armature="0.02" axis="0 0 1" damping="5" name="abdomen_z" pos="0 0 0.065" range="-45 45" stiffness="20" type="hinge"/>
|
||||
<joint armature="0.02" axis="0 1 0" damping="5" name="abdomen_y" pos="0 0 0.065" range="-75 30" stiffness="10" type="hinge"/>
|
||||
<body name="pelvis" pos="0.165 0 0" quat="1.000 0 -0.002 0">
|
||||
<joint armature="0.02" axis="1 0 0" damping="5" name="abdomen_x" pos="0 0 0.1" range="-35 35" stiffness="10" type="hinge"/>
|
||||
<geom fromto="-.02 -.07 0 -.02 .07 0" name="butt" size="0.09" type="capsule"/>
|
||||
<body name="right_thigh" pos="0 -0.1 0">
|
||||
<joint armature="0.01" axis="1 0 0" damping="5" name="right_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 1" damping="5" name="right_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.0080" axis="0 1 0" damping="5" name="right_hip_y" pos="0 0 0" range="-110 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.34 0.01 0" name="right_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="right_shin" pos="0.403 0.01 0">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="right_knee" pos="0 0 .02" range="-160 -2" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.3 0 0" name="right_shin1" size="0.049" type="capsule"/>
|
||||
<body name="right_foot" pos="0.35 0 -.10">
|
||||
<geom name="right_foot" pos="0 0 0.1" size="0.075" type="sphere" user="0"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_thigh" pos="0 0.1 0">
|
||||
<joint armature="0.01" axis="-1 0 0" damping="5" name="left_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 -1" damping="5" name="left_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 1 0" damping="5" name="left_hip_y" pos="0 0 0" range="-120 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.34 -0.01 0" name="left_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="left_shin" pos="0.403 -0.01 0">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="left_knee" pos="0 0 .02" range="-160 -2" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.3 0 0" name="left_shin1" size="0.049" type="capsule"/>
|
||||
<body name="left_foot" pos="0.35 0 -.1">
|
||||
<geom name="left_foot" type="sphere" size="0.075" pos="0 0 0.1" user="0" />
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="right_upper_arm" pos="0 -0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 1 1" name="right_shoulder1" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 -1 1" name="right_shoulder2" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 -.16 -.16" name="right_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="right_lower_arm" pos=".18 -.18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 1" name="right_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 0.01 0.01 .17 .17 .17" name="right_larm" size="0.031" type="capsule"/>
|
||||
<geom name="right_hand" pos=".18 .18 .18" size="0.04" type="sphere"/>
|
||||
<camera pos="0 0 0"/>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_upper_arm" pos="0 0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 -1 1" name="left_shoulder1" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 1 1" name="left_shoulder2" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 .16 -.16" name="left_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="left_lower_arm" pos=".18 .18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 -1" name="left_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 -0.01 0.01 .17 -.17 .17" name="left_larm" size="0.031" type="capsule"/>
|
||||
<geom name="left_hand" pos=".18 -.18 .18" size="0.04" type="sphere"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</worldbody>
|
||||
<tendon>
|
||||
<fixed name="left_hipknee">
|
||||
<joint coef="-1" joint="left_hip_y"/>
|
||||
<joint coef="1" joint="left_knee"/>
|
||||
</fixed>
|
||||
<fixed name="right_hipknee">
|
||||
<joint coef="-1" joint="right_hip_y"/>
|
||||
<joint coef="1" joint="right_knee"/>
|
||||
</fixed>
|
||||
</tendon>
|
||||
|
||||
<actuator>
|
||||
<motor gear="100" joint="abdomen_y" name="abdomen_y"/>
|
||||
<motor gear="100" joint="abdomen_z" name="abdomen_z"/>
|
||||
<motor gear="100" joint="abdomen_x" name="abdomen_x"/>
|
||||
<motor gear="100" joint="right_hip_x" name="right_hip_x"/>
|
||||
<motor gear="100" joint="right_hip_z" name="right_hip_z"/>
|
||||
<motor gear="300" joint="right_hip_y" name="right_hip_y"/>
|
||||
<motor gear="200" joint="right_knee" name="right_knee"/>
|
||||
<motor gear="100" joint="left_hip_x" name="left_hip_x"/>
|
||||
<motor gear="100" joint="left_hip_z" name="left_hip_z"/>
|
||||
<motor gear="300" joint="left_hip_y" name="left_hip_y"/>
|
||||
<motor gear="200" joint="left_knee" name="left_knee"/>
|
||||
<motor gear="25" joint="right_shoulder1" name="right_shoulder1"/>
|
||||
<motor gear="25" joint="right_shoulder2" name="right_shoulder2"/>
|
||||
<motor gear="25" joint="right_elbow" name="right_elbow"/>
|
||||
<motor gear="25" joint="left_shoulder1" name="left_shoulder1"/>
|
||||
<motor gear="25" joint="left_shoulder2" name="left_shoulder2"/>
|
||||
<motor gear="25" joint="left_elbow" name="left_elbow"/>
|
||||
</actuator>
|
||||
</mujoco>
|
||||
<mujoco model="humanoidstandup">
|
||||
<compiler angle="degree" inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="1" damping="1" limited="true"/>
|
||||
<geom conaffinity="1" condim="1" contype="1" margin="0.001" material="geom" rgba="0.8 0.6 .4 1"/>
|
||||
<motor ctrllimited="true" ctrlrange="-.4 .4"/>
|
||||
</default>
|
||||
<option integrator="RK4" iterations="50" solver="PGS" timestep="0.003">
|
||||
<!-- <flags solverstat="enable" energy="enable"/>-->
|
||||
</option>
|
||||
<size nkey="5" nuser_geom="1"/>
|
||||
<visual>
|
||||
<map fogend="5" fogstart="3"/>
|
||||
</visual>
|
||||
<asset>
|
||||
<texture builtin="gradient" height="100" rgb1=".4 .5 .6" rgb2="0 0 0" type="skybox" width="100"/>
|
||||
<!-- <texture builtin="gradient" height="100" rgb1="1 1 1" rgb2="0 0 0" type="skybox" width="100"/>-->
|
||||
<texture builtin="flat" height="1278" mark="cross" markrgb="1 1 1" name="texgeom" random="0.01" rgb1="0.8 0.6 0.4" rgb2="0.8 0.6 0.4" type="cube" width="127"/>
|
||||
<texture builtin="checker" height="100" name="texplane" rgb1="0 0 0" rgb2="0.8 0.8 0.8" type="2d" width="100"/>
|
||||
<material name="MatPlane" reflectance="0.5" shininess="1" specular="1" texrepeat="60 60" texture="texplane"/>
|
||||
<material name="geom" texture="texgeom" texuniform="true"/>
|
||||
</asset>
|
||||
<worldbody>
|
||||
<light cutoff="100" diffuse="1 1 1" dir="-0 0 -1.3" directional="true" exponent="1" pos="0 0 1.3" specular=".1 .1 .1"/>
|
||||
<geom condim="3" friction="1 .1 .1" material="MatPlane" name="floor" pos="0 0 0" rgba="0.8 0.9 0.8 1" size="20 20 0.125" type="plane"/>
|
||||
<!-- <geom condim="3" material="MatPlane" name="floor" pos="0 0 0" size="10 10 0.125" type="plane"/>-->
|
||||
<body name="torso" pos="0 0 .105">
|
||||
<camera name="track" mode="trackcom" pos="0 -3 .5" xyaxes="1 0 0 0 0 1"/>
|
||||
<joint armature="0" damping="0" limited="false" name="root" pos="0 0 0" stiffness="0" type="free"/>
|
||||
<geom fromto="0 -.07 0 0 .07 0" name="torso1" size="0.07" type="capsule"/>
|
||||
<geom name="head" pos="-.15 0 0" size=".09" type="sphere" user="258"/>
|
||||
<geom fromto=".11 -.06 0 .11 .06 0" name="uwaist" size="0.06" type="capsule"/>
|
||||
<body name="lwaist" pos=".21 0 0" quat="1.000 0 -0.002 0">
|
||||
<geom fromto="0 -.06 0 0 .06 0" name="lwaist" size="0.06" type="capsule"/>
|
||||
<joint armature="0.02" axis="0 0 1" damping="5" name="abdomen_z" pos="0 0 0.065" range="-45 45" stiffness="20" type="hinge"/>
|
||||
<joint armature="0.02" axis="0 1 0" damping="5" name="abdomen_y" pos="0 0 0.065" range="-75 30" stiffness="10" type="hinge"/>
|
||||
<body name="pelvis" pos="0.165 0 0" quat="1.000 0 -0.002 0">
|
||||
<joint armature="0.02" axis="1 0 0" damping="5" name="abdomen_x" pos="0 0 0.1" range="-35 35" stiffness="10" type="hinge"/>
|
||||
<geom fromto="-.02 -.07 0 -.02 .07 0" name="butt" size="0.09" type="capsule"/>
|
||||
<body name="right_thigh" pos="0 -0.1 0">
|
||||
<joint armature="0.01" axis="1 0 0" damping="5" name="right_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 1" damping="5" name="right_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.0080" axis="0 1 0" damping="5" name="right_hip_y" pos="0 0 0" range="-110 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.34 0.01 0" name="right_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="right_shin" pos="0.403 0.01 0">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="right_knee" pos="0 0 .02" range="-160 -2" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.3 0 0" name="right_shin1" size="0.049" type="capsule"/>
|
||||
<body name="right_foot" pos="0.35 0 -.10">
|
||||
<geom name="right_foot" pos="0 0 0.1" size="0.075" type="sphere" user="0"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_thigh" pos="0 0.1 0">
|
||||
<joint armature="0.01" axis="-1 0 0" damping="5" name="left_hip_x" pos="0 0 0" range="-25 5" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 0 -1" damping="5" name="left_hip_z" pos="0 0 0" range="-60 35" stiffness="10" type="hinge"/>
|
||||
<joint armature="0.01" axis="0 1 0" damping="5" name="left_hip_y" pos="0 0 0" range="-120 20" stiffness="20" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.34 -0.01 0" name="left_thigh1" size="0.06" type="capsule"/>
|
||||
<body name="left_shin" pos="0.403 -0.01 0">
|
||||
<joint armature="0.0060" axis="0 -1 0" name="left_knee" pos="0 0 .02" range="-160 -2" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.3 0 0" name="left_shin1" size="0.049" type="capsule"/>
|
||||
<body name="left_foot" pos="0.35 0 -.1">
|
||||
<geom name="left_foot" type="sphere" size="0.075" pos="0 0 0.1" user="0" />
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<body name="right_upper_arm" pos="0 -0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 1 1" name="right_shoulder1" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 -1 1" name="right_shoulder2" pos="0 0 0" range="-85 60" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 -.16 -.16" name="right_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="right_lower_arm" pos=".18 -.18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 1" name="right_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 0.01 0.01 .17 .17 .17" name="right_larm" size="0.031" type="capsule"/>
|
||||
<geom name="right_hand" pos=".18 .18 .18" size="0.04" type="sphere"/>
|
||||
<camera pos="0 0 0"/>
|
||||
</body>
|
||||
</body>
|
||||
<body name="left_upper_arm" pos="0 0.17 0.06">
|
||||
<joint armature="0.0068" axis="2 -1 1" name="left_shoulder1" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<joint armature="0.0051" axis="0 1 1" name="left_shoulder2" pos="0 0 0" range="-60 85" stiffness="1" type="hinge"/>
|
||||
<geom fromto="0 0 0 .16 .16 -.16" name="left_uarm1" size="0.04 0.16" type="capsule"/>
|
||||
<body name="left_lower_arm" pos=".18 .18 -.18">
|
||||
<joint armature="0.0028" axis="0 -1 -1" name="left_elbow" pos="0 0 0" range="-90 50" stiffness="0" type="hinge"/>
|
||||
<geom fromto="0.01 -0.01 0.01 .17 -.17 .17" name="left_larm" size="0.031" type="capsule"/>
|
||||
<geom name="left_hand" pos=".18 -.18 .18" size="0.04" type="sphere"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
</worldbody>
|
||||
<tendon>
|
||||
<fixed name="left_hipknee">
|
||||
<joint coef="-1" joint="left_hip_y"/>
|
||||
<joint coef="1" joint="left_knee"/>
|
||||
</fixed>
|
||||
<fixed name="right_hipknee">
|
||||
<joint coef="-1" joint="right_hip_y"/>
|
||||
<joint coef="1" joint="right_knee"/>
|
||||
</fixed>
|
||||
</tendon>
|
||||
|
||||
<actuator>
|
||||
<motor gear="100" joint="abdomen_y" name="abdomen_y"/>
|
||||
<motor gear="100" joint="abdomen_z" name="abdomen_z"/>
|
||||
<motor gear="100" joint="abdomen_x" name="abdomen_x"/>
|
||||
<motor gear="100" joint="right_hip_x" name="right_hip_x"/>
|
||||
<motor gear="100" joint="right_hip_z" name="right_hip_z"/>
|
||||
<motor gear="300" joint="right_hip_y" name="right_hip_y"/>
|
||||
<motor gear="200" joint="right_knee" name="right_knee"/>
|
||||
<motor gear="100" joint="left_hip_x" name="left_hip_x"/>
|
||||
<motor gear="100" joint="left_hip_z" name="left_hip_z"/>
|
||||
<motor gear="300" joint="left_hip_y" name="left_hip_y"/>
|
||||
<motor gear="200" joint="left_knee" name="left_knee"/>
|
||||
<motor gear="25" joint="right_shoulder1" name="right_shoulder1"/>
|
||||
<motor gear="25" joint="right_shoulder2" name="right_shoulder2"/>
|
||||
<motor gear="25" joint="right_elbow" name="right_elbow"/>
|
||||
<motor gear="25" joint="left_shoulder1" name="left_shoulder1"/>
|
||||
<motor gear="25" joint="left_shoulder2" name="left_shoulder2"/>
|
||||
<motor gear="25" joint="left_elbow" name="left_elbow"/>
|
||||
</actuator>
|
||||
</mujoco>
|
@@ -1,27 +1,27 @@
|
||||
<mujoco model="inverted pendulum">
|
||||
<compiler inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="0" damping="1" limited="true"/>
|
||||
<geom contype="0" friction="1 0.1 0.1" rgba="0.7 0.7 0 1"/>
|
||||
<tendon/>
|
||||
<motor ctrlrange="-3 3"/>
|
||||
</default>
|
||||
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.02"/>
|
||||
<size nstack="3000"/>
|
||||
<worldbody>
|
||||
<!--geom name="ground" type="plane" pos="0 0 0" /-->
|
||||
<geom name="rail" pos="0 0 0" quat="0.707 0 0.707 0" rgba="0.3 0.3 0.7 1" size="0.02 1" type="capsule"/>
|
||||
<body name="cart" pos="0 0 0">
|
||||
<joint axis="1 0 0" limited="true" name="slider" pos="0 0 0" range="-1 1" type="slide"/>
|
||||
<geom name="cart" pos="0 0 0" quat="0.707 0 0.707 0" size="0.1 0.1" type="capsule"/>
|
||||
<body name="pole" pos="0 0 0">
|
||||
<joint axis="0 1 0" name="hinge" pos="0 0 0" range="-90 90" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.001 0 0.6" name="cpole" rgba="0 0.7 0.7 1" size="0.049 0.3" type="capsule"/>
|
||||
<!-- <body name="pole2" pos="0.001 0 0.6"><joint name="hinge2" type="hinge" pos="0 0 0" axis="0 1 0"/><geom name="cpole2" type="capsule" fromto="0 0 0 0 0 0.6" size="0.05 0.3" rgba="0.7 0 0.7 1"/><site name="tip2" pos="0 0 .6"/></body>-->
|
||||
</body>
|
||||
</body>
|
||||
</worldbody>
|
||||
<actuator>
|
||||
<motor ctrllimited="true" ctrlrange="-3 3" gear="100" joint="slider" name="slide"/>
|
||||
</actuator>
|
||||
<mujoco model="inverted pendulum">
|
||||
<compiler inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="0" damping="1" limited="true"/>
|
||||
<geom contype="0" friction="1 0.1 0.1" rgba="0.7 0.7 0 1"/>
|
||||
<tendon/>
|
||||
<motor ctrlrange="-3 3"/>
|
||||
</default>
|
||||
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.02"/>
|
||||
<size nstack="3000"/>
|
||||
<worldbody>
|
||||
<!--geom name="ground" type="plane" pos="0 0 0" /-->
|
||||
<geom name="rail" pos="0 0 0" quat="0.707 0 0.707 0" rgba="0.3 0.3 0.7 1" size="0.02 1" type="capsule"/>
|
||||
<body name="cart" pos="0 0 0">
|
||||
<joint axis="1 0 0" limited="true" name="slider" pos="0 0 0" range="-1 1" type="slide"/>
|
||||
<geom name="cart" pos="0 0 0" quat="0.707 0 0.707 0" size="0.1 0.1" type="capsule"/>
|
||||
<body name="pole" pos="0 0 0">
|
||||
<joint axis="0 1 0" name="hinge" pos="0 0 0" range="-90 90" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.001 0 0.6" name="cpole" rgba="0 0.7 0.7 1" size="0.049 0.3" type="capsule"/>
|
||||
<!-- <body name="pole2" pos="0.001 0 0.6"><joint name="hinge2" type="hinge" pos="0 0 0" axis="0 1 0"/><geom name="cpole2" type="capsule" fromto="0 0 0 0 0 0.6" size="0.05 0.3" rgba="0.7 0 0.7 1"/><site name="tip2" pos="0 0 .6"/></body>-->
|
||||
</body>
|
||||
</body>
|
||||
</worldbody>
|
||||
<actuator>
|
||||
<motor ctrllimited="true" ctrlrange="-3 3" gear="100" joint="slider" name="slide"/>
|
||||
</actuator>
|
||||
</mujoco>
|
@@ -1,39 +1,39 @@
|
||||
<mujoco model="reacher">
|
||||
<compiler angle="radian" inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="1" damping="1" limited="true"/>
|
||||
<geom contype="0" friction="1 0.1 0.1" rgba="0.7 0.7 0 1"/>
|
||||
</default>
|
||||
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.01"/>
|
||||
<worldbody>
|
||||
<!-- Arena -->
|
||||
<geom conaffinity="0" contype="0" name="ground" pos="0 0 0" rgba="0.9 0.9 0.9 1" size="1 1 10" type="plane"/>
|
||||
<geom conaffinity="0" fromto="-.3 -.3 .01 .3 -.3 .01" name="sideS" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<geom conaffinity="0" fromto=" .3 -.3 .01 .3 .3 .01" name="sideE" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<geom conaffinity="0" fromto="-.3 .3 .01 .3 .3 .01" name="sideN" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<geom conaffinity="0" fromto="-.3 -.3 .01 -.3 .3 .01" name="sideW" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<!-- Arm -->
|
||||
<geom conaffinity="0" contype="0" fromto="0 0 0 0 0 0.02" name="root" rgba="0.9 0.4 0.6 1" size=".011" type="cylinder"/>
|
||||
<body name="body0" pos="0 0 .01">
|
||||
<geom fromto="0 0 0 0.1 0 0" name="link0" rgba="0.0 0.4 0.6 1" size=".01" type="capsule"/>
|
||||
<joint axis="0 0 1" limited="false" name="joint0" pos="0 0 0" type="hinge"/>
|
||||
<body name="body1" pos="0.1 0 0">
|
||||
<joint axis="0 0 1" limited="true" name="joint1" pos="0 0 0" range="-3.0 3.0" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.1 0 0" name="link1" rgba="0.0 0.4 0.6 1" size=".01" type="capsule"/>
|
||||
<body name="fingertip" pos="0.11 0 0">
|
||||
<geom contype="0" name="fingertip" pos="0 0 0" rgba="0.0 0.8 0.6 1" size=".01" type="sphere"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<!-- Target -->
|
||||
<body name="target" pos=".1 -.1 .01">
|
||||
<joint armature="0" axis="1 0 0" damping="0" limited="true" name="target_x" pos="0 0 0" range="-.27 .27" ref=".1" stiffness="0" type="slide"/>
|
||||
<joint armature="0" axis="0 1 0" damping="0" limited="true" name="target_y" pos="0 0 0" range="-.27 .27" ref="-.1" stiffness="0" type="slide"/>
|
||||
<geom conaffinity="0" contype="0" name="target" pos="0 0 0" rgba="0.9 0.2 0.2 1" size=".009" type="sphere"/>
|
||||
</body>
|
||||
</worldbody>
|
||||
<actuator>
|
||||
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="joint0"/>
|
||||
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="joint1"/>
|
||||
</actuator>
|
||||
</mujoco>
|
||||
<mujoco model="reacher">
|
||||
<compiler angle="radian" inertiafromgeom="true"/>
|
||||
<default>
|
||||
<joint armature="1" damping="1" limited="true"/>
|
||||
<geom contype="0" friction="1 0.1 0.1" rgba="0.7 0.7 0 1"/>
|
||||
</default>
|
||||
<option gravity="0 0 -9.81" integrator="RK4" timestep="0.01"/>
|
||||
<worldbody>
|
||||
<!-- Arena -->
|
||||
<geom conaffinity="0" contype="0" name="ground" pos="0 0 0" rgba="0.9 0.9 0.9 1" size="1 1 10" type="plane"/>
|
||||
<geom conaffinity="0" fromto="-.3 -.3 .01 .3 -.3 .01" name="sideS" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<geom conaffinity="0" fromto=" .3 -.3 .01 .3 .3 .01" name="sideE" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<geom conaffinity="0" fromto="-.3 .3 .01 .3 .3 .01" name="sideN" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<geom conaffinity="0" fromto="-.3 -.3 .01 -.3 .3 .01" name="sideW" rgba="0.9 0.4 0.6 1" size=".02" type="capsule"/>
|
||||
<!-- Arm -->
|
||||
<geom conaffinity="0" contype="0" fromto="0 0 0 0 0 0.02" name="root" rgba="0.9 0.4 0.6 1" size=".011" type="cylinder"/>
|
||||
<body name="body0" pos="0 0 .01">
|
||||
<geom fromto="0 0 0 0.1 0 0" name="link0" rgba="0.0 0.4 0.6 1" size=".01" type="capsule"/>
|
||||
<joint axis="0 0 1" limited="false" name="joint0" pos="0 0 0" type="hinge"/>
|
||||
<body name="body1" pos="0.1 0 0">
|
||||
<joint axis="0 0 1" limited="true" name="joint1" pos="0 0 0" range="-3.0 3.0" type="hinge"/>
|
||||
<geom fromto="0 0 0 0.1 0 0" name="link1" rgba="0.0 0.4 0.6 1" size=".01" type="capsule"/>
|
||||
<body name="fingertip" pos="0.11 0 0">
|
||||
<geom contype="0" name="fingertip" pos="0 0 0" rgba="0.0 0.8 0.6 1" size=".01" type="sphere"/>
|
||||
</body>
|
||||
</body>
|
||||
</body>
|
||||
<!-- Target -->
|
||||
<body name="target" pos=".1 -.1 .01">
|
||||
<joint armature="0" axis="1 0 0" damping="0" limited="true" name="target_x" pos="0 0 0" range="-.27 .27" ref=".1" stiffness="0" type="slide"/>
|
||||
<joint armature="0" axis="0 1 0" damping="0" limited="true" name="target_y" pos="0 0 0" range="-.27 .27" ref="-.1" stiffness="0" type="slide"/>
|
||||
<geom conaffinity="0" contype="0" name="target" pos="0 0 0" rgba="0.9 0.2 0.2 1" size=".009" type="sphere"/>
|
||||
</body>
|
||||
</worldbody>
|
||||
<actuator>
|
||||
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="joint0"/>
|
||||
<motor ctrllimited="true" ctrlrange="-1.0 1.0" gear="200.0" joint="joint1"/>
|
||||
</actuator>
|
||||
</mujoco>
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class HalfCheetahEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -2,9 +2,9 @@ __credits__ = ["Rushiv Arora"]
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"distance": 4.0,
|
@@ -2,9 +2,9 @@ __credits__ = ["Rushiv Arora"]
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"distance": 4.0,
|
||||
@@ -106,13 +106,13 @@ class HalfCheetahEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported in v2 and lower.
|
||||
|
||||
```
|
||||
env = gym.make('HalfCheetah-v2')
|
||||
env = gymnasium.make('HalfCheetah-v2')
|
||||
```
|
||||
|
||||
v3 and v4 take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
v3 and v4 take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
```
|
||||
env = gym.make('HalfCheetah-v4', ctrl_cost_weight=0.1, ....)
|
||||
env = gymnasium.make('HalfCheetah-v4', ctrl_cost_weight=0.1, ....)
|
||||
```
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
@@ -126,7 +126,7 @@ class HalfCheetahEnv(MujocoEnv, utils.EzPickle):
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class HopperEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -2,9 +2,9 @@ __credits__ = ["Rushiv Arora"]
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"trackbodyid": 2,
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"trackbodyid": 2,
|
||||
@@ -107,13 +107,13 @@ class HopperEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported in v2 and lower.
|
||||
|
||||
```
|
||||
env = gym.make('Hopper-v2')
|
||||
env = gymnasium.make('Hopper-v2')
|
||||
```
|
||||
|
||||
v3 and v4 take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
v3 and v4 take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
```
|
||||
env = gym.make('Hopper-v4', ctrl_cost_weight=0.1, ....)
|
||||
env = gymnasium.make('Hopper-v4', ctrl_cost_weight=0.1, ....)
|
||||
```
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
@@ -132,7 +132,7 @@ class HopperEnv(MujocoEnv, utils.EzPickle):
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
def mass_center(model, sim):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"trackbodyid": 1,
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"trackbodyid": 1,
|
||||
@@ -182,13 +182,13 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported in v2 and lower.
|
||||
|
||||
```
|
||||
env = gym.make('Humanoid-v4')
|
||||
env = gymnasium.make('Humanoid-v4')
|
||||
```
|
||||
|
||||
v3 and v4 take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
v3 and v4 take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
```
|
||||
env = gym.make('Humanoid-v4', ctrl_cost_weight=0.1, ....)
|
||||
env = gymnasium.make('Humanoid-v4', ctrl_cost_weight=0.1, ....)
|
||||
```
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
@@ -206,7 +206,7 @@ class HumanoidEnv(MujocoEnv, utils.EzPickle):
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class HumanoidStandupEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class HumanoidStandupEnv(MujocoEnv, utils.EzPickle):
|
||||
@@ -162,17 +162,17 @@ class HumanoidStandupEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported.
|
||||
|
||||
```
|
||||
env = gym.make('HumanoidStandup-v4')
|
||||
env = gymnasium.make('HumanoidStandup-v4')
|
||||
```
|
||||
|
||||
There is no v3 for HumanoidStandup, unlike the robot environments where a v3 and
|
||||
beyond take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
beyond take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class InvertedDoublePendulumEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class InvertedDoublePendulumEnv(MujocoEnv, utils.EzPickle):
|
||||
@@ -97,16 +97,16 @@ class InvertedDoublePendulumEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported.
|
||||
|
||||
```
|
||||
env = gym.make('InvertedDoublePendulum-v4')
|
||||
env = gymnasium.make('InvertedDoublePendulum-v4')
|
||||
```
|
||||
There is no v3 for InvertedPendulum, unlike the robot environments where a v3 and
|
||||
beyond take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
beyond take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks (including inverted pendulum)
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class InvertedPendulumEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class InvertedPendulumEnv(MujocoEnv, utils.EzPickle):
|
||||
@@ -68,16 +68,16 @@ class InvertedPendulumEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported.
|
||||
|
||||
```
|
||||
env = gym.make('InvertedPendulum-v4')
|
||||
env = gymnasium.make('InvertedPendulum-v4')
|
||||
```
|
||||
There is no v3 for InvertedPendulum, unlike the robot environments where a
|
||||
v3 and beyond take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
v3 and beyond take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks (including inverted pendulum)
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -3,9 +3,9 @@ from typing import Optional, Union
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import error, logger, spaces
|
||||
from gym.spaces import Space
|
||||
import gymnasium
|
||||
from gymnasium import error, logger, spaces
|
||||
from gymnasium.spaces import Space
|
||||
|
||||
MUJOCO_PY_NOT_INSTALLED = False
|
||||
MUJOCO_NOT_INSTALLED = False
|
||||
@@ -26,7 +26,7 @@ except ImportError as e:
|
||||
DEFAULT_SIZE = 480
|
||||
|
||||
|
||||
class BaseMujocoEnv(gym.Env):
|
||||
class BaseMujocoEnv(gymnasium.Env):
|
||||
"""Superclass for all MuJoCo environments."""
|
||||
|
||||
def __init__(
|
||||
@@ -395,15 +395,15 @@ class MujocoEnv(BaseMujocoEnv):
|
||||
|
||||
def _get_viewer(
|
||||
self, mode
|
||||
) -> Union["gym.envs.mujoco.Viewer", "gym.envs.mujoco.RenderContextOffscreen"]:
|
||||
) -> Union["gymnasium.envs.mujoco.Viewer", "gymnasium.envs.mujoco.RenderContextOffscreen"]:
|
||||
self.viewer = self._viewers.get(mode)
|
||||
if self.viewer is None:
|
||||
if mode == "human":
|
||||
from gym.envs.mujoco import Viewer
|
||||
from gymnasium.envs.mujoco import Viewer
|
||||
|
||||
self.viewer = Viewer(self.model, self.data)
|
||||
elif mode in {"rgb_array", "depth_array"}:
|
||||
from gym.envs.mujoco import RenderContextOffscreen
|
||||
from gymnasium.envs.mujoco import RenderContextOffscreen
|
||||
|
||||
self.viewer = RenderContextOffscreen(self.model, self.data)
|
||||
else:
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class PusherEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class PusherEnv(MujocoEnv, utils.EzPickle):
|
||||
@@ -113,11 +113,11 @@ class PusherEnv(MujocoEnv, utils.EzPickle):
|
||||
(or by changing the path to a modified XML file in another folder)..
|
||||
|
||||
```
|
||||
env = gym.make('Pusher-v4')
|
||||
env = gymnasium.make('Pusher-v4')
|
||||
```
|
||||
|
||||
There is no v3 for Pusher, unlike the robot environments where a v3 and
|
||||
beyond take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
beyond take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
|
||||
### Version History
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class ReacherEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class ReacherEnv(MujocoEnv, utils.EzPickle):
|
||||
@@ -103,11 +103,11 @@ class ReacherEnv(MujocoEnv, utils.EzPickle):
|
||||
(or by changing the path to a modified XML file in another folder)..
|
||||
|
||||
```
|
||||
env = gym.make('Reacher-v4')
|
||||
env = gymnasium.make('Reacher-v4')
|
||||
```
|
||||
|
||||
There is no v3 for Reacher, unlike the robot environments where a v3 and
|
||||
beyond take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
beyond take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
|
||||
### Version History
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class SwimmerEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -2,9 +2,9 @@ __credits__ = ["Rushiv Arora"]
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {}
|
||||
|
@@ -2,9 +2,9 @@ __credits__ = ["Rushiv Arora"]
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {}
|
||||
|
||||
@@ -97,13 +97,13 @@ class SwimmerEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported in v2 and lower.
|
||||
|
||||
```
|
||||
gym.make('Swimmer-v4')
|
||||
gymnasium.make('Swimmer-v4')
|
||||
```
|
||||
|
||||
v3 and v4 take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
v3 and v4 take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
```
|
||||
env = gym.make('Swimmer-v4', ctrl_cost_weight=0.1, ....)
|
||||
env = gymnasium.make('Swimmer-v4', ctrl_cost_weight=0.1, ....)
|
||||
```
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
@@ -118,7 +118,7 @@ class SwimmerEnv(MujocoEnv, utils.EzPickle):
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
|
||||
class Walker2dEnv(MuJocoPyEnv, utils.EzPickle):
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MuJocoPyEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MuJocoPyEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"trackbodyid": 2,
|
@@ -1,8 +1,8 @@
|
||||
import numpy as np
|
||||
|
||||
from gym import utils
|
||||
from gym.envs.mujoco import MujocoEnv
|
||||
from gym.spaces import Box
|
||||
from gymnasium import utils
|
||||
from gymnasium.envs.mujoco import MujocoEnv
|
||||
from gymnasium.spaces import Box
|
||||
|
||||
DEFAULT_CAMERA_CONFIG = {
|
||||
"trackbodyid": 2,
|
||||
@@ -112,13 +112,13 @@ class Walker2dEnv(MujocoEnv, utils.EzPickle):
|
||||
No additional arguments are currently supported in v2 and lower.
|
||||
|
||||
```
|
||||
env = gym.make('Walker2d-v4')
|
||||
env = gymnasium.make('Walker2d-v4')
|
||||
```
|
||||
|
||||
v3 and beyond take gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
v3 and beyond take gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc.
|
||||
|
||||
```
|
||||
env = gym.make('Walker2d-v4', ctrl_cost_weight=0.1, ....)
|
||||
env = gymnasium.make('Walker2d-v4', ctrl_cost_weight=0.1, ....)
|
||||
```
|
||||
|
||||
| Parameter | Type | Default | Description |
|
||||
@@ -137,7 +137,7 @@ class Walker2dEnv(MujocoEnv, utils.EzPickle):
|
||||
### Version History
|
||||
|
||||
* v4: all mujoco environments now use the mujoco bindings in mujoco>=2.1.3
|
||||
* v3: support for gym.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v3: support for gymnasium.make kwargs such as xml_file, ctrl_cost_weight, reset_noise_scale etc. rgb rendering comes from tracking camera (so agent does not run away from screen)
|
||||
* v2: All continuous control environments now use mujoco_py >= 1.50
|
||||
* v1: max_time_steps raised to 1000 for robot based tasks. Added reward_threshold to environments.
|
||||
* v0: Initial versions release (1.0.0)
|
@@ -21,15 +21,15 @@ from typing import (
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym.wrappers import (
|
||||
from gymnasium.wrappers import (
|
||||
AutoResetWrapper,
|
||||
HumanRendering,
|
||||
OrderEnforcing,
|
||||
RenderCollection,
|
||||
TimeLimit,
|
||||
)
|
||||
from gym.wrappers.compatibility import EnvCompatibility
|
||||
from gym.wrappers.env_checker import PassiveEnvChecker
|
||||
from gymnasium.wrappers.compatibility import EnvCompatibility
|
||||
from gymnasium.wrappers.env_checker import PassiveEnvChecker
|
||||
|
||||
if sys.version_info < (3, 10):
|
||||
import importlib_metadata as metadata # type: ignore
|
||||
@@ -41,7 +41,7 @@ if sys.version_info >= (3, 8):
|
||||
else:
|
||||
from typing_extensions import Literal
|
||||
|
||||
from gym import Env, error, logger
|
||||
from gymnasium import Env, error, logger
|
||||
|
||||
ENV_ID_RE = re.compile(
|
||||
r"^(?:(?P<namespace>[\w:-]+)\/)?(?:(?P<name>[\w:.-]+?))(?:-v(?P<version>\d+))?$"
|
||||
@@ -116,17 +116,17 @@ def get_env_id(ns: Optional[str], name: str, version: Optional[int]) -> str:
|
||||
|
||||
@dataclass
|
||||
class EnvSpec:
|
||||
"""A specification for creating environments with `gym.make`.
|
||||
"""A specification for creating environments with `gymnasium.make`.
|
||||
|
||||
* id: The string used to create the environment with `gym.make`
|
||||
* id: The string used to create the environment with `gymnasium.make`
|
||||
* entry_point: The location of the environment to create from
|
||||
* reward_threshold: The reward threshold for completing the environment.
|
||||
* nondeterministic: If the observation of an environment cannot be repeated with the same initial state, random number generator state and actions.
|
||||
* max_episode_steps: The max number of steps that the environment can take before truncation
|
||||
* order_enforce: If to enforce the order of `reset` before `step` and `render` functions
|
||||
* autoreset: If to automatically reset the environment on episode end
|
||||
* disable_env_checker: If to disable the environment checker wrapper in `gym.make`, by default False (runs the environment checker)
|
||||
* kwargs: Additional keyword arguments passed to the environments through `gym.make`
|
||||
* disable_env_checker: If to disable the environment checker wrapper in `gymnasium.make`, by default False (runs the environment checker)
|
||||
* kwargs: Additional keyword arguments passed to the environments through `gymnasium.make`
|
||||
"""
|
||||
|
||||
id: str
|
||||
@@ -263,7 +263,7 @@ def find_highest_version(ns: Optional[str], name: str) -> Optional[int]:
|
||||
return max(version, default=None)
|
||||
|
||||
|
||||
def load_env_plugins(entry_point: str = "gym.envs") -> None:
|
||||
def load_env_plugins(entry_point: str = "gymnasium.envs") -> None:
|
||||
# Load third-party environments
|
||||
for plugin in metadata.entry_points(group=entry_point):
|
||||
# Python 3.8 doesn't support plugin.module, plugin.attr
|
||||
@@ -414,7 +414,7 @@ def _check_spec_register(spec: EnvSpec):
|
||||
f"`{spec.id}` when the versioned environment "
|
||||
f"`{latest_versioned_spec.id}` of the same name "
|
||||
f"already exists. Note: the default behavior is "
|
||||
f"that `gym.make` with the unversioned environment "
|
||||
f"that `gymnasium.make` with the unversioned environment "
|
||||
f"will return the latest versioned environment"
|
||||
)
|
||||
|
||||
@@ -443,7 +443,7 @@ def register(
|
||||
apply_api_compatibility: bool = False,
|
||||
**kwargs,
|
||||
):
|
||||
"""Register an environment with gym.
|
||||
"""Register an environment with gymnasium.
|
||||
|
||||
The `id` parameter corresponds to the name of the environment, with the syntax as follows:
|
||||
`(namespace)/(env_name)-v(version)` where `namespace` is optional.
|
||||
@@ -509,7 +509,7 @@ def make(
|
||||
) -> Env:
|
||||
"""Create an environment according to the given ID.
|
||||
|
||||
To find all available environments use `gym.envs.registry.keys()` for all valid ids.
|
||||
To find all available environments use `gymnasium.envs.registry.keys()` for all valid ids.
|
||||
|
||||
Args:
|
||||
id: Name of the environment. Optionally, a module to import can be included, eg. 'module:Env-v0'
|
4
gymnasium/envs/toy_text/__init__.py
Normal file
@@ -0,0 +1,4 @@
|
||||
from gymnasium.envs.toy_text.blackjack import BlackjackEnv
|
||||
from gymnasium.envs.toy_text.cliffwalking import CliffWalkingEnv
|
||||
from gymnasium.envs.toy_text.frozen_lake import FrozenLakeEnv
|
||||
from gymnasium.envs.toy_text.taxi import TaxiEnv
|
@@ -3,9 +3,9 @@ from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
import gym
|
||||
from gym import spaces
|
||||
from gym.error import DependencyNotInstalled
|
||||
import gymnasium
|
||||
from gymnasium import spaces
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
|
||||
def cmp(a, b):
|
||||
@@ -46,7 +46,7 @@ def is_natural(hand): # Is this hand a natural blackjack?
|
||||
return sorted(hand) == [1, 10]
|
||||
|
||||
|
||||
class BlackjackEnv(gym.Env):
|
||||
class BlackjackEnv(gymnasium.Env):
|
||||
"""
|
||||
Blackjack is a card game where the goal is to beat the dealer by obtaining cards
|
||||
that sum to closer to 21 (without going over 21) than the dealers cards.
|
||||
@@ -94,7 +94,7 @@ class BlackjackEnv(gym.Env):
|
||||
### Arguments
|
||||
|
||||
```
|
||||
gym.make('Blackjack-v1', natural=False, sab=False)
|
||||
gymnasium.make('Blackjack-v1', natural=False, sab=False)
|
||||
```
|
||||
|
||||
<a id="nat">`natural=False`</a>: Whether to give an additional reward for
|
||||
@@ -194,7 +194,7 @@ class BlackjackEnv(gym.Env):
|
||||
import pygame
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[toy_text]`"
|
||||
"pygame is not installed, run `pip install gymnasium[toy_text]`"
|
||||
)
|
||||
|
||||
player_sum, dealer_card_value, usable_ace = self._get_obs()
|
@@ -5,9 +5,9 @@ from typing import Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import Env, spaces
|
||||
from gym.envs.toy_text.utils import categorical_sample
|
||||
from gym.error import DependencyNotInstalled
|
||||
from gymnasium import Env, spaces
|
||||
from gymnasium.envs.toy_text.utils import categorical_sample
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
UP = 0
|
||||
RIGHT = 1
|
||||
@@ -55,7 +55,7 @@ class CliffWalkingEnv(Env):
|
||||
### Arguments
|
||||
|
||||
```
|
||||
gym.make('CliffWalking-v0')
|
||||
gymnasium.make('CliffWalking-v0')
|
||||
```
|
||||
|
||||
### Version History
|
||||
@@ -173,7 +173,7 @@ class CliffWalkingEnv(Env):
|
||||
import pygame
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[toy_text]`"
|
||||
"pygame is not installed, run `pip install gymnasium[toy_text]`"
|
||||
)
|
||||
if self.window_surface is None:
|
||||
pygame.init()
|
@@ -5,9 +5,9 @@ from typing import List, Optional
|
||||
|
||||
import numpy as np
|
||||
|
||||
from gym import Env, spaces, utils
|
||||
from gym.envs.toy_text.utils import categorical_sample
|
||||
from gym.error import DependencyNotInstalled
|
||||
from gymnasium import Env, spaces, utils
|
||||
from gymnasium.envs.toy_text.utils import categorical_sample
|
||||
from gymnasium.error import DependencyNotInstalled
|
||||
|
||||
LEFT = 0
|
||||
DOWN = 1
|
||||
@@ -105,7 +105,7 @@ class FrozenLakeEnv(Env):
|
||||
### Arguments
|
||||
|
||||
```
|
||||
gym.make('FrozenLake-v1', desc=None, map_name="4x4", is_slippery=True)
|
||||
gymnasium.make('FrozenLake-v1', desc=None, map_name="4x4", is_slippery=True)
|
||||
```
|
||||
|
||||
`desc`: Used to specify custom map for frozen lake. For example,
|
||||
@@ -115,9 +115,9 @@ class FrozenLakeEnv(Env):
|
||||
A random generated map can be specified by calling the function `generate_random_map`. For example,
|
||||
|
||||
```
|
||||
from gym.envs.toy_text.frozen_lake import generate_random_map
|
||||
from gymnasium.envs.toy_text.frozen_lake import generate_random_map
|
||||
|
||||
gym.make('FrozenLake-v1', desc=generate_random_map(size=8))
|
||||
gymnasium.make('FrozenLake-v1', desc=generate_random_map(size=8))
|
||||
```
|
||||
|
||||
`map_name`: ID to use any of the preloaded maps.
|
||||
@@ -277,7 +277,7 @@ class FrozenLakeEnv(Env):
|
||||
import pygame
|
||||
except ImportError:
|
||||
raise DependencyNotInstalled(
|
||||
"pygame is not installed, run `pip install gym[toy_text]`"
|
||||
"pygame is not installed, run `pip install gymnasium[toy_text]`"
|
||||
)
|
||||
|
||||
if self.window_surface is None:
|
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 6.8 KiB After Width: | Height: | Size: 6.8 KiB |
Before Width: | Height: | Size: 6.9 KiB After Width: | Height: | Size: 6.9 KiB |
Before Width: | Height: | Size: 7.8 KiB After Width: | Height: | Size: 7.8 KiB |
Before Width: | Height: | Size: 8.3 KiB After Width: | Height: | Size: 8.3 KiB |
Before Width: | Height: | Size: 8.5 KiB After Width: | Height: | Size: 8.5 KiB |
Before Width: | Height: | Size: 9.6 KiB After Width: | Height: | Size: 9.6 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 10 KiB |
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 43 KiB |
Before Width: | Height: | Size: 5.8 KiB After Width: | Height: | Size: 5.8 KiB |
Before Width: | Height: | Size: 6.3 KiB After Width: | Height: | Size: 6.3 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 6.5 KiB |
Before Width: | Height: | Size: 7.3 KiB After Width: | Height: | Size: 7.3 KiB |
Before Width: | Height: | Size: 7.7 KiB After Width: | Height: | Size: 7.7 KiB |
Before Width: | Height: | Size: 7.9 KiB After Width: | Height: | Size: 7.9 KiB |
Before Width: | Height: | Size: 8.8 KiB After Width: | Height: | Size: 8.8 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 9.3 KiB |
Before Width: | Height: | Size: 6.1 KiB After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |