Skip to content

EvoJAX

Import this adapter from its module, gymnax.wrappers.evojax. It requires evojax.

GymnaxToEvoJaxTask

GymnaxToEvoJaxTask(env_name: str, max_steps: int = 1000, test: bool = False)

Bases: VectorizedTask

Wrap a registered Gymnax environment as a vectorized EvoJAX task.

Importing this module requires evojax. The environment must define obs_shape.

Parameters:

  • env_name (str) –

    ID of the environment, as passed to gymnax.make.

  • max_steps (int, default: 1000 ) –

    Number of steps after which episodes are truncated.

  • test (bool, default: False ) –

    Stored as self.test; not used by the wrapper itself.

reset

reset(key: Array) -> GymState

Reset a batch of environments, one per key.

step

step(state, action)

Step a batch of environments and return (state, reward, done).

GymState

Bases: TaskState

Task state of GymnaxToEvoJaxTask.

Attributes:

  • state (EnvState) –

    Environment state.

  • obs (Array) –

    Current observation.

  • key (Array) –

    PRNG key used for the next step.