Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Swimmer

State and action spaces

The default 8-value observation concatenates qpos[2..] with all qvel, omitting root x/y. Keeping those positions produces 10 values. The default action is two controls in \([-1,1]\).

Dynamics and reward

\[ v_x=\frac{x_{t+1}-x_t}{\Delta t},\qquad r=w_fv_x-w_u\lVert u\rVert_2^2. \]

Info contains x position and the forward/control reward components.

Episode end

There is no state termination. The horizon truncates.

Configuration

FieldDefaultMeaning
xml_file, frame_skipembedded, 4Model and action duration
forward_reward_weight1Velocity reward coefficient
ctrl_cost_weight0.0001Control penalty coefficient
reset_noise_scale0.1Uniform qpos/qvel reset noise
exclude_current_positions_from_observationtrueOmit root x/y
max_episode_steps1000Horizon

Reference: Gymnasium Swimmer.