Registration¶
These functions are available directly from the gymnax namespace, for example as
gymnax.make.
make ¶
Construct a registered environment and return it with its default parameters.
Parameters:
-
env_id(str) –ID of a built-in environment or one added with
register. All available IDs are listed inregistered_envs. -
**env_kwargs(Any, default:{}) –Keyword arguments forwarded to the environment constructor.
Returns:
-
tuple[Environment, EnvParams]–A tuple
(env, params)of the environment andenv.default_params.
Raises:
-
ValueError–If
env_idis not registered. -
TypeError–If the registered factory does not return an environment.
register ¶
Register a factory used by make to construct an environment.
Parameters:
-
env_id(str) –Unique public ID for the environment.
-
factory(EnvironmentFactory) –Callable that accepts the keyword arguments passed to
makeand returns a new environment instance. AnEnvironmentsubclass works as its own factory.
Raises:
-
TypeError–If the ID or factory has an invalid type.
-
ValueError–If the ID is empty or already registered.
registered_envs
module-attribute
¶
IDs of all environments that make can construct, updated in place by register.