carl.envs

Functions

check_spec(spec_name)

Check if the spec is installed

Interfaces

class carl.envs.CARLAcrobot(env=None, contexts=None, obs_context_features=None, obs_context_as_dict=True, context_selector=None, context_selector_kwargs=None, **kwargs)[source]

Bases: CARLGymnasiumEnv

static get_context_features()[source]

Get the context features

Defined per environment.

Returns:

Context feature definitions

Return type:

dict[str, ContextFeature]

reset(*, seed=None, options=None)[source]

Reset the environment.

First, we progress the instance, i.e. select a new context with the context selector. Then we update the context in the wrapped environment. Finally, we reset the underlying environment and add context information to the observation.

Parameters:
  • seed (int | None, optional) – Seed, by default None

  • options (dict[str, Any] | None, optional) – Options, by default None

Returns:

Observation, info.

Return type:

tuple[Any, dict[str, Any]]

class carl.envs.CARLCartPole(env=None, contexts=None, obs_context_features=None, obs_context_as_dict=True, context_selector=None, context_selector_kwargs=None, **kwargs)[source]

Bases: CARLGymnasiumEnv

static get_context_features()[source]

Get the context features

Defined per environment.

Returns:

Context feature definitions

Return type:

dict[str, ContextFeature]

reset(*, seed=None, options=None)[source]

Reset the environment.

First, we progress the instance, i.e. select a new context with the context selector. Then we update the context in the wrapped environment. Finally, we reset the underlying environment and add context information to the observation.

Parameters:
  • seed (int | None, optional) – Seed, by default None

  • options (dict[str, Any] | None, optional) – Options, by default None

Returns:

Observation, info.

Return type:

tuple[Any, dict[str, Any]]

class carl.envs.CARLMountainCar(env=None, contexts=None, obs_context_features=None, obs_context_as_dict=True, context_selector=None, context_selector_kwargs=None, **kwargs)[source]

Bases: CARLGymnasiumEnv

static get_context_features()[source]

Get the context features

Defined per environment.

Returns:

Context feature definitions

Return type:

dict[str, ContextFeature]

reset(*, seed=None, options=None)[source]

Reset the environment.

First, we progress the instance, i.e. select a new context with the context selector. Then we update the context in the wrapped environment. Finally, we reset the underlying environment and add context information to the observation.

Parameters:
  • seed (int | None, optional) – Seed, by default None

  • options (dict[str, Any] | None, optional) – Options, by default None

Returns:

Observation, info.

Return type:

tuple[Any, dict[str, Any]]

class carl.envs.CARLMountainCarContinuous(env=None, contexts=None, obs_context_features=None, obs_context_as_dict=True, context_selector=None, context_selector_kwargs=None, **kwargs)[source]

Bases: CARLGymnasiumEnv

static get_context_features()[source]

Get the context features

Defined per environment.

Returns:

Context feature definitions

Return type:

dict[str, ContextFeature]

reset(*, seed=None, options=None)[source]

Reset the environment.

First, we progress the instance, i.e. select a new context with the context selector. Then we update the context in the wrapped environment. Finally, we reset the underlying environment and add context information to the observation.

Parameters:
  • seed (int | None, optional) – Seed, by default None

  • options (dict[str, Any] | None, optional) – Options, by default None

Returns:

Observation, info.

Return type:

tuple[Any, dict[str, Any]]

class carl.envs.CARLPendulum(env=None, contexts=None, obs_context_features=None, obs_context_as_dict=True, context_selector=None, context_selector_kwargs=None, **kwargs)[source]

Bases: CARLGymnasiumEnv

static get_context_features()[source]

Get the context features

Defined per environment.

Returns:

Context feature definitions

Return type:

dict[str, ContextFeature]

reset(*, seed=None, options=None)[source]

Reset the environment.

First, we progress the instance, i.e. select a new context with the context selector. Then we update the context in the wrapped environment. Finally, we reset the underlying environment and add context information to the observation.

Parameters:
  • seed (int | None, optional) – Seed, by default None

  • options (dict[str, Any] | None, optional) – Options, by default None

Returns:

Observation, info.

Return type:

tuple[Any, dict[str, Any]]

Modules

carl.envs.carl_env

carl.envs.gymnasium

carl.envs.mario

carl.envs.rna