Skip to content

Python API Reference

Full auto-generated reference for all public Python classes and functions.

Module

joltgym

JoltGym — MuJoCo-compatible physics simulation for RL, built on Jolt Physics.

JoltGym provides high-performance Gymnasium-compatible environments powered by the Jolt Physics engine with Vulkan rendering and zero-copy Python bindings.

Registered environments:

  • JoltGym/HalfCheetah-v0 — 2D planar cheetah (6 actuated joints)
  • JoltGym/Humanoid-v0 — 3D bipedal humanoid (17 actuated joints)
  • JoltGym/CheetahRace-v0 — N multi-agent cheetahs in a shared world

make(env_id: str, **kwargs)

Create a JoltGym environment by ID.

Wraps gymnasium.make() with JoltGym's registered environments.

Parameters:

Name Type Description Default
env_id str

Environment identifier, e.g. "JoltGym/HalfCheetah-v0".

required
**kwargs

Forwarded to the environment constructor.

{}

Returns:

Type Description

A Gymnasium environment instance.

Examples:

>>> import joltgym
>>> env = joltgym.make("JoltGym/HalfCheetah-v0")
>>> obs, info = env.reset(seed=42)
Source code in python/joltgym/__init__.py
def make(env_id: str, **kwargs):
    """Create a JoltGym environment by ID.

    Wraps `gymnasium.make()` with JoltGym's registered environments.

    Args:
        env_id: Environment identifier, e.g. `"JoltGym/HalfCheetah-v0"`.
        **kwargs: Forwarded to the environment constructor.

    Returns:
        A Gymnasium environment instance.

    Examples:
        >>> import joltgym
        >>> env = joltgym.make("JoltGym/HalfCheetah-v0")
        >>> obs, info = env.reset(seed=42)
    """
    import gymnasium as gym
    return gym.make(env_id, **kwargs)

Environments

HalfCheetahEnv

HalfCheetahEnv(render_mode=None, forward_reward_weight=1.0, ctrl_cost_weight=0.1, reset_noise_scale=0.1)

Bases: Env

2D planar cheetah locomotion environment powered by Jolt Physics.

A 4-legged cheetah with 6 actuated hinge joints (back thigh/shin/foot, front thigh/shin/foot) and a slide+hinge root. The goal is to run forward (positive X direction) as fast as possible.

Observation

Box(-inf, inf, (17,))qpos[1:] (skip root X) concatenated with qvel.

Index Dim Content
0 1 root Z position (height)
1 1 root Y rotation (torso angle)
2–7 6 joint angles: bthigh, bshin, bfoot, fthigh, fshin, ffoot
8–10 3 root velocities: vx, vz, angular vy
11–16 6 joint velocities
Action

Box(-1, 1, (6,)) — normalized joint torques scaled by gear ratios (120, 90, 60, 120, 60, 30).

Reward

forward_reward_weight * x_velocity - ctrl_cost_weight * sum(action²)

Attributes:

Name Type Description
observation_space

Gymnasium Box space of shape (17,).

action_space

Gymnasium Box space of shape (6,).

Initialize the HalfCheetah environment.

Parameters:

Name Type Description Default
render_mode

Rendering mode — "human" for window, "rgb_array" for pixel output, or None to disable.

None
forward_reward_weight

Multiplier on the forward velocity reward term.

1.0
ctrl_cost_weight

Multiplier on the control cost penalty term.

0.1
reset_noise_scale

Standard deviation of Gaussian noise added to joint positions and velocities on reset.

0.1
Source code in python/joltgym/envs/half_cheetah_v0.py
def __init__(self, render_mode=None, forward_reward_weight=1.0,
             ctrl_cost_weight=0.1, reset_noise_scale=0.1):
    """Initialize the HalfCheetah environment.

    Args:
        render_mode: Rendering mode — `"human"` for window, `"rgb_array"` for
            pixel output, or `None` to disable.
        forward_reward_weight: Multiplier on the forward velocity reward term.
        ctrl_cost_weight: Multiplier on the control cost penalty term.
        reset_noise_scale: Standard deviation of Gaussian noise added to joint
            positions and velocities on reset.
    """
    super().__init__()

    from joltgym import joltgym_native

    self._core = joltgym_native.HalfCheetahCore(
        model_path=_asset_path("half_cheetah.xml"),
        forward_reward_weight=forward_reward_weight,
        ctrl_cost_weight=ctrl_cost_weight,
    )
    self.render_mode = render_mode
    self._reset_noise_scale = reset_noise_scale

    obs_dim = self._core.get_obs_dim()
    act_dim = self._core.get_action_dim()

    self.observation_space = spaces.Box(
        low=-np.inf, high=np.inf, shape=(obs_dim,), dtype=np.float32
    )
    self.action_space = spaces.Box(
        low=-1.0, high=1.0, shape=(act_dim,), dtype=np.float32
    )

step(action)

Run one timestep (frame_skip=5 physics steps at dt=0.01s).

Parameters:

Name Type Description Default
action

Normalized joint torques, shape (6,), range [-1, 1].

required

Returns:

Name Type Description
obs

Observation array of shape (17,).

reward

Scalar reward (forward_vel - ctrl_cost).

terminated

Always False (HalfCheetah has no terminal state).

truncated

Always False.

info

Dict with keys x_position, x_velocity, reward_run, reward_ctrl.

Source code in python/joltgym/envs/half_cheetah_v0.py
def step(self, action):
    """Run one timestep (frame_skip=5 physics steps at dt=0.01s).

    Args:
        action: Normalized joint torques, shape `(6,)`, range `[-1, 1]`.

    Returns:
        obs: Observation array of shape `(17,)`.
        reward: Scalar reward (`forward_vel - ctrl_cost`).
        terminated: Always `False` (HalfCheetah has no terminal state).
        truncated: Always `False`.
        info: Dict with keys `x_position`, `x_velocity`, `reward_run`,
            `reward_ctrl`.
    """
    action = np.asarray(action, dtype=np.float32)
    obs, reward, terminated, truncated = self._core.step(action)

    info = {
        "x_position": self._core.get_root_x(),
        "x_velocity": self._core.get_x_velocity(),
        "reward_run": self._core.get_forward_reward(),
        "reward_ctrl": -self._core.get_ctrl_cost(),
    }

    return np.asarray(obs), float(reward), bool(terminated), bool(truncated), info

reset(*, seed=None, options=None)

Reset the environment to the initial state with optional noise.

Parameters:

Name Type Description Default
seed

Random seed for reproducible resets.

None
options

Unused, present for Gymnasium compatibility.

None

Returns:

Name Type Description
obs

Initial observation array of shape (17,).

info

Empty dict.

Source code in python/joltgym/envs/half_cheetah_v0.py
def reset(self, *, seed=None, options=None):
    """Reset the environment to the initial state with optional noise.

    Args:
        seed: Random seed for reproducible resets.
        options: Unused, present for Gymnasium compatibility.

    Returns:
        obs: Initial observation array of shape `(17,)`.
        info: Empty dict.
    """
    super().reset(seed=seed)

    if seed is not None:
        obs = self._core.reset(seed=seed, noise_scale=self._reset_noise_scale)
    else:
        obs = self._core.reset(noise_scale=self._reset_noise_scale)

    info = {}
    return np.asarray(obs), info

render()

Render the environment (not yet implemented).

Source code in python/joltgym/envs/half_cheetah_v0.py
def render(self):
    """Render the environment (not yet implemented)."""
    pass  # TODO: Integrate Vulkan renderer

close()

Shut down the underlying C++ physics engine.

Source code in python/joltgym/envs/half_cheetah_v0.py
def close(self):
    """Shut down the underlying C++ physics engine."""
    self._core.shutdown()

HumanoidEnv

HumanoidEnv(render_mode=None, forward_reward_weight=1.25, ctrl_cost_weight=0.1, healthy_reward=5.0, healthy_z_min=1.0, healthy_z_max=2.0, reset_noise_scale=0.005)

Bases: Env

3D bipedal humanoid locomotion environment powered by Jolt Physics.

A humanoid with 17 actuated joints (abdomen, hips, knees, shoulders, elbows) and a free 6DOF root body. The goal is to walk forward while staying upright.

Observation

Box(-inf, inf, (45,))qpos[2:] (skip root X, Y) concatenated with qvel.

Index Dim Content
0 1 root Z position (height)
1–4 4 root quaternion (w, x, y, z)
5–21 17 joint angles
22–24 3 root linear velocity (x, y, z)
25–27 3 root angular velocity (x, y, z)
28–44 17 joint velocities
Action

Box(-0.4, 0.4, (17,)) — normalized joint torques for 17 actuated joints: abdomen (3), right hip (3) + knee, left hip (3) + knee, right shoulder (2) + elbow, left shoulder (2) + elbow.

Reward

forward_reward_weight * x_velocity + healthy_reward * is_healthy - ctrl_cost_weight * sum(action²)

Termination

Episode ends when root Z position is outside [healthy_z_min, healthy_z_max].

Attributes:

Name Type Description
observation_space

Gymnasium Box space of shape (45,).

action_space

Gymnasium Box space of shape (17,).

Initialize the Humanoid environment.

Parameters:

Name Type Description Default
render_mode

Rendering mode — "human", "rgb_array", or None.

None
forward_reward_weight

Multiplier on the forward velocity reward.

1.25
ctrl_cost_weight

Multiplier on the control cost penalty.

0.1
healthy_reward

Bonus reward for staying upright each step.

5.0
healthy_z_min

Minimum root Z height to be considered healthy.

1.0
healthy_z_max

Maximum root Z height to be considered healthy.

2.0
reset_noise_scale

Standard deviation of noise added on reset.

0.005
Source code in python/joltgym/envs/humanoid_v0.py
def __init__(self, render_mode=None,
             forward_reward_weight=1.25,
             ctrl_cost_weight=0.1,
             healthy_reward=5.0,
             healthy_z_min=1.0,
             healthy_z_max=2.0,
             reset_noise_scale=0.005):
    """Initialize the Humanoid environment.

    Args:
        render_mode: Rendering mode — `"human"`, `"rgb_array"`, or `None`.
        forward_reward_weight: Multiplier on the forward velocity reward.
        ctrl_cost_weight: Multiplier on the control cost penalty.
        healthy_reward: Bonus reward for staying upright each step.
        healthy_z_min: Minimum root Z height to be considered healthy.
        healthy_z_max: Maximum root Z height to be considered healthy.
        reset_noise_scale: Standard deviation of noise added on reset.
    """
    super().__init__()

    from joltgym import joltgym_native

    self._core = joltgym_native.HumanoidCore(
        model_path=_asset_path("humanoid.xml"),
        forward_reward_weight=forward_reward_weight,
        ctrl_cost_weight=ctrl_cost_weight,
        healthy_reward=healthy_reward,
        healthy_z_min=healthy_z_min,
        healthy_z_max=healthy_z_max,
    )
    self.render_mode = render_mode
    self._reset_noise_scale = reset_noise_scale

    obs_dim = self._core.get_obs_dim()
    act_dim = self._core.get_action_dim()

    self.observation_space = spaces.Box(
        low=-np.inf, high=np.inf, shape=(obs_dim,), dtype=np.float32
    )
    self.action_space = spaces.Box(
        low=-0.4, high=0.4, shape=(act_dim,), dtype=np.float32
    )

step(action)

Run one timestep (frame_skip=5 physics steps at dt=0.003s).

Parameters:

Name Type Description Default
action

Normalized joint torques, shape (17,), range [-0.4, 0.4].

required

Returns:

Name Type Description
obs

Observation array of shape (45,).

reward

Scalar reward.

terminated

True when root Z leaves [healthy_z_min, healthy_z_max].

truncated

Always False.

info

Dict with keys x_position, z_position, x_velocity, reward_forward, reward_ctrl.

Source code in python/joltgym/envs/humanoid_v0.py
def step(self, action):
    """Run one timestep (frame_skip=5 physics steps at dt=0.003s).

    Args:
        action: Normalized joint torques, shape `(17,)`, range `[-0.4, 0.4]`.

    Returns:
        obs: Observation array of shape `(45,)`.
        reward: Scalar reward.
        terminated: `True` when root Z leaves `[healthy_z_min, healthy_z_max]`.
        truncated: Always `False`.
        info: Dict with keys `x_position`, `z_position`, `x_velocity`,
            `reward_forward`, `reward_ctrl`.
    """
    action = np.asarray(action, dtype=np.float32)
    obs, reward, terminated, truncated = self._core.step(action)

    info = {
        "x_position": self._core.get_root_x(),
        "z_position": self._core.get_root_z(),
        "x_velocity": self._core.get_x_velocity(),
        "reward_forward": self._core.get_forward_reward(),
        "reward_ctrl": -self._core.get_ctrl_cost(),
    }

    return np.asarray(obs), float(reward), bool(terminated), bool(truncated), info

reset(*, seed=None, options=None)

Reset the environment to the initial state with optional noise.

Parameters:

Name Type Description Default
seed

Random seed for reproducible resets.

None
options

Unused, present for Gymnasium compatibility.

None

Returns:

Name Type Description
obs

Initial observation array of shape (45,).

info

Empty dict.

Source code in python/joltgym/envs/humanoid_v0.py
def reset(self, *, seed=None, options=None):
    """Reset the environment to the initial state with optional noise.

    Args:
        seed: Random seed for reproducible resets.
        options: Unused, present for Gymnasium compatibility.

    Returns:
        obs: Initial observation array of shape `(45,)`.
        info: Empty dict.
    """
    super().reset(seed=seed)

    if seed is not None:
        obs = self._core.reset(seed=seed, noise_scale=self._reset_noise_scale)
    else:
        obs = self._core.reset(noise_scale=self._reset_noise_scale)

    info = {}
    return np.asarray(obs), info

render()

Render the environment (not yet implemented).

Source code in python/joltgym/envs/humanoid_v0.py
def render(self):
    """Render the environment (not yet implemented)."""
    pass  # TODO: Integrate Vulkan renderer

close()

Shut down the underlying C++ physics engine.

Source code in python/joltgym/envs/humanoid_v0.py
def close(self):
    """Shut down the underlying C++ physics engine."""
    self._core.shutdown()

CheetahRaceEnv

CheetahRaceEnv(num_agents=2, render_mode=None, agent_spacing=3.0, forward_reward_weight=1.0, ctrl_cost_weight=0.1, reset_noise_scale=0.1)

Bases: Env

Multi-agent cheetah race in a shared physics world.

N cheetahs are placed side-by-side (Y-offset) and race forward (X-axis). All agents share the same PhysicsWorld, so they can physically collide and interact.

This wraps all agents into a single Gymnasium env suitable for independent-learner multi-agent training with parameter sharing. Observations and actions are flat concatenations of per-agent vectors.

Observation

Box(-inf, inf, (N*17,)) — concatenation of each agent's qpos[1:] + qvel.

Action

Box(-1, 1, (N*6,)) — concatenation of each agent's normalized joint torques.

Reward

Sum of all agents' individual rewards (forward_velocity - ctrl_cost per agent).

Attributes:

Name Type Description
num_agents

Number of cheetahs in the race.

observation_space

Gymnasium Box space of shape (num_agents * 17,).

action_space

Gymnasium Box space of shape (num_agents * 6,).

Initialize the CheetahRace environment.

Parameters:

Name Type Description Default
num_agents

Number of cheetahs in the race.

2
render_mode

Rendering mode — "human", "rgb_array", or None.

None
agent_spacing

Y-axis distance between adjacent agents.

3.0
forward_reward_weight

Multiplier on forward velocity reward.

1.0
ctrl_cost_weight

Multiplier on control cost penalty.

0.1
reset_noise_scale

Standard deviation of noise added on reset.

0.1
Source code in python/joltgym/envs/cheetah_race_v0.py
def __init__(self, num_agents=2, render_mode=None,
             agent_spacing=3.0,
             forward_reward_weight=1.0,
             ctrl_cost_weight=0.1,
             reset_noise_scale=0.1):
    """Initialize the CheetahRace environment.

    Args:
        num_agents: Number of cheetahs in the race.
        render_mode: Rendering mode — `"human"`, `"rgb_array"`, or `None`.
        agent_spacing: Y-axis distance between adjacent agents.
        forward_reward_weight: Multiplier on forward velocity reward.
        ctrl_cost_weight: Multiplier on control cost penalty.
        reset_noise_scale: Standard deviation of noise added on reset.
    """
    super().__init__()

    from joltgym import joltgym_native

    self.num_agents = num_agents
    self._core = joltgym_native.MultiAgentEnv(
        num_agents=num_agents,
        model_path=_asset_path("half_cheetah.xml"),
        agent_spacing=agent_spacing,
        forward_reward_weight=forward_reward_weight,
        ctrl_cost_weight=ctrl_cost_weight,
    )
    self.render_mode = render_mode
    self._reset_noise_scale = reset_noise_scale
    self._step_count = 0

    obs_dim = self._core.obs_dim
    act_dim = self._core.act_dim

    # Flat observation/action spaces (all agents concatenated)
    self.observation_space = spaces.Box(
        low=-np.inf, high=np.inf,
        shape=(num_agents * obs_dim,), dtype=np.float32
    )
    self.action_space = spaces.Box(
        low=-1.0, high=1.0,
        shape=(num_agents * act_dim,), dtype=np.float32
    )

    self._per_agent_obs_dim = obs_dim
    self._per_agent_act_dim = act_dim

step(action)

Run one timestep for all agents simultaneously.

Parameters:

Name Type Description Default
action

Flat array of shape (num_agents * 6,).

required

Returns:

Name Type Description
obs

Flat observation of shape (num_agents * 17,).

reward

Scalar total reward (sum of all agents).

terminated

Always False.

truncated

Always False.

info

Dict with per_agent_reward array, and per-agent agent_{i}_x / agent_{i}_xvel keys.

Source code in python/joltgym/envs/cheetah_race_v0.py
def step(self, action):
    """Run one timestep for all agents simultaneously.

    Args:
        action: Flat array of shape `(num_agents * 6,)`.

    Returns:
        obs: Flat observation of shape `(num_agents * 17,)`.
        reward: Scalar total reward (sum of all agents).
        terminated: Always `False`.
        truncated: Always `False`.
        info: Dict with `per_agent_reward` array, and per-agent
            `agent_{i}_x` / `agent_{i}_xvel` keys.
    """
    action = np.asarray(action, dtype=np.float32).reshape(
        self.num_agents, self._per_agent_act_dim)
    obs, rewards = self._core.step(action)

    self._step_count += 1

    info = {
        "per_agent_reward": rewards.copy(),
    }
    for i in range(self.num_agents):
        info[f"agent_{i}_x"] = self._core.get_agent_x(i)
        info[f"agent_{i}_xvel"] = self._core.get_agent_x_velocity(i)

    total_reward = float(rewards.sum())

    return (obs.flatten().astype(np.float32),
            total_reward, False, False, info)

reset(*, seed=None, options=None)

Reset all agents to their initial positions.

Parameters:

Name Type Description Default
seed

Random seed for reproducible resets.

None
options

Unused, present for Gymnasium compatibility.

None

Returns:

Name Type Description
obs

Flat initial observation of shape (num_agents * 17,).

info

Empty dict.

Source code in python/joltgym/envs/cheetah_race_v0.py
def reset(self, *, seed=None, options=None):
    """Reset all agents to their initial positions.

    Args:
        seed: Random seed for reproducible resets.
        options: Unused, present for Gymnasium compatibility.

    Returns:
        obs: Flat initial observation of shape `(num_agents * 17,)`.
        info: Empty dict.
    """
    super().reset(seed=seed)
    self._step_count = 0

    obs = self._core.reset_all(
        seed=seed if seed is not None else None,
        noise_scale=self._reset_noise_scale,
    )

    return obs.flatten().astype(np.float32), {}

render()

Render the environment (not yet implemented).

Source code in python/joltgym/envs/cheetah_race_v0.py
def render(self):
    """Render the environment (not yet implemented)."""
    pass

close()

Clean up resources.

Source code in python/joltgym/envs/cheetah_race_v0.py
def close(self):
    """Clean up resources."""
    pass

get_per_agent_obs(flat_obs)

Split a flat observation into per-agent arrays.

Parameters:

Name Type Description Default
flat_obs

Flat observation of shape (num_agents * 17,).

required

Returns:

Type Description

Per-agent observations of shape (num_agents, 17).

Source code in python/joltgym/envs/cheetah_race_v0.py
def get_per_agent_obs(self, flat_obs):
    """Split a flat observation into per-agent arrays.

    Args:
        flat_obs: Flat observation of shape `(num_agents * 17,)`.

    Returns:
        Per-agent observations of shape `(num_agents, 17)`.
    """
    return flat_obs.reshape(self.num_agents, self._per_agent_obs_dim)

get_per_agent_actions(flat_action)

Split a flat action into per-agent arrays.

Parameters:

Name Type Description Default
flat_action

Flat action of shape (num_agents * 6,).

required

Returns:

Type Description

Per-agent actions of shape (num_agents, 6).

Source code in python/joltgym/envs/cheetah_race_v0.py
def get_per_agent_actions(self, flat_action):
    """Split a flat action into per-agent arrays.

    Args:
        flat_action: Flat action of shape `(num_agents * 6,)`.

    Returns:
        Per-agent actions of shape `(num_agents, 6)`.
    """
    return flat_action.reshape(self.num_agents, self._per_agent_act_dim)

Vectorized

JoltVectorEnv

JoltVectorEnv(num_envs, model_path, **kwargs)

N parallel HalfCheetah environments stepped in C++ threads.

Wraps the C++ WorldPool class for maximum throughput. All N PhysicsSystem instances are stepped in parallel via native OS threads with the GIL released — the entire hot loop (action apply, physics step, observation extraction, reward computation) runs in C++.

Achieves ~73K env-steps/sec at 256 environments on Apple Silicon.

Attributes:

Name Type Description
num_envs

Number of parallel environments.

observation_space

Batched observation space (num_envs, obs_dim).

action_space

Batched action space (num_envs, act_dim).

single_observation_space

Single-env observation space (obs_dim,).

single_action_space

Single-env action space (act_dim,).

Initialize the vectorized environment pool.

Parameters:

Name Type Description Default
num_envs

Number of parallel environments to create.

required
model_path

Path to the MJCF XML model file.

required
**kwargs

Forwarded to WorldPool (e.g. forward_reward_weight, ctrl_cost_weight).

{}
Source code in python/joltgym/vector/jolt_vector_env.py
def __init__(self, num_envs, model_path, **kwargs):
    """Initialize the vectorized environment pool.

    Args:
        num_envs: Number of parallel environments to create.
        model_path: Path to the MJCF XML model file.
        **kwargs: Forwarded to `WorldPool` (e.g. `forward_reward_weight`,
            `ctrl_cost_weight`).
    """
    from joltgym import joltgym_native

    self._pool = joltgym_native.WorldPool(
        num_envs=num_envs,
        model_path=model_path,
        **kwargs,
    )
    self.num_envs = num_envs

    obs_dim = self._pool.obs_dim
    act_dim = self._pool.act_dim

    self.single_observation_space = spaces.Box(-np.inf, np.inf, (obs_dim,), np.float32)
    self.single_action_space = spaces.Box(-1.0, 1.0, (act_dim,), np.float32)
    self.observation_space = spaces.Box(-np.inf, np.inf, (num_envs, obs_dim), np.float32)
    self.action_space = spaces.Box(-1.0, 1.0, (num_envs, act_dim), np.float32)

step(actions)

Step all environments in parallel.

The GIL is released for the entire duration of the C++ computation. Environments that reach a terminal state are auto-reset.

Parameters:

Name Type Description Default
actions

Array of shape (num_envs, act_dim), dtype float32.

required

Returns:

Name Type Description
obs

Observations, shape (num_envs, obs_dim).

rewards

Rewards, shape (num_envs,).

dones

Terminal flags, shape (num_envs,). True indicates the environment was auto-reset.

truncs

Truncation flags, shape (num_envs,) (always False).

infos

List of empty dicts.

Source code in python/joltgym/vector/jolt_vector_env.py
def step(self, actions):
    """Step all environments in parallel.

    The GIL is released for the entire duration of the C++ computation.
    Environments that reach a terminal state are auto-reset.

    Args:
        actions: Array of shape `(num_envs, act_dim)`, dtype `float32`.

    Returns:
        obs: Observations, shape `(num_envs, obs_dim)`.
        rewards: Rewards, shape `(num_envs,)`.
        dones: Terminal flags, shape `(num_envs,)`. `True` indicates
            the environment was auto-reset.
        truncs: Truncation flags, shape `(num_envs,)` (always `False`).
        infos: List of empty dicts.
    """
    actions = np.asarray(actions, dtype=np.float32)
    obs, rewards, dones = self._pool.step_all(actions)
    infos = [{} for _ in range(self.num_envs)]
    truncs = np.zeros(self.num_envs, dtype=bool)
    return obs, rewards, dones, truncs, infos

reset(*, seed=None, options=None)

Reset all environments in parallel.

Parameters:

Name Type Description Default
seed

Optional base seed. Environment i receives seed + i.

None
options

Unused, present for compatibility.

None

Returns:

Name Type Description
obs

Initial observations, shape (num_envs, obs_dim).

infos

List of empty dicts.

Source code in python/joltgym/vector/jolt_vector_env.py
def reset(self, *, seed=None, options=None):
    """Reset all environments in parallel.

    Args:
        seed: Optional base seed. Environment *i* receives `seed + i`.
        options: Unused, present for compatibility.

    Returns:
        obs: Initial observations, shape `(num_envs, obs_dim)`.
        infos: List of empty dicts.
    """
    obs = self._pool.reset_all(seed=seed)
    infos = [{} for _ in range(self.num_envs)]
    return obs, infos

close()

Clean up resources (no-op, pool is managed by C++).

Source code in python/joltgym/vector/jolt_vector_env.py
def close(self):
    """Clean up resources (no-op, pool is managed by C++)."""
    pass