fancy_gym.upgrade

fancy_gym.upgrade(id: str, mp_wrapper: ~fancy_gym.black_box.raw_interface_wrapper.RawInterfaceWrapper = <class 'fancy_gym.envs.registry.DefaultMPWrapper'>, add_mp_types: ~typing.List[str] = ['ProMP', 'DMP', 'ProDMP'], base_id: ~typing.Optional[str] = None, mp_config_override: ~typing.Dict[str, ~typing.Any] = {})[source]

Upgrades an existing Gymnasium environment to include Movement Primitives (MP) versions. We expect the raw step-based env to be already registered with gymnasium. Otherwise please use fancy_gym.register instead.

Args:

id (str): The unique identifier for the environment. mp_wrapper (RawInterfaceWrapper): The MP wrapper for the environment (default is DefaultMPWrapper). add_mp_types (List[str]): List of additional MP types to register (default is KNOWN_MPS). base_id (Optional[str]): The unique identifier for the environment to upgrade. Will use id if non is provided. Can be defined to allow multiple registrations of different versions for the same step-based environment. mp_config_override (Dict[str, Any]): Dictionary for overriding MP configuration.

Notes:
  • The id parameter should match the ID of the existing Gymnasium environment you wish to upgrade. You can also pick a new one, but then base_id needs to be provided.

  • The mp_wrapper parameter specifies the MP wrapper to use, allowing for customization.

  • add_mp_types can be used to specify additional MP types to register alongside the base environment.

  • The base_id parameter should match the ID of the existing Gymnasium environment you wish to upgrade.

  • mp_config_override allows for customizing MP configuration if needed.

Example:

To upgrade an existing environment with MP versions: >>> upgrade(“MyEnv-v0”, mp_wrapper=CustomMPWrapper)

To upgrade an existing environment with custom MP types and configuration: >>> upgrade(“MyEnv-v0”, mp_wrapper=CustomMPWrapper, add_mp_types=[“ProDMP”, “DMP”], mp_config_override={“param”: 42})