PACE-Bench / tasks /primitives_api.json
YuhaoZhan's picture
Upload PACE-Bench executable tasks (part 2)
121e234 verified
Raw
History Blame Contribute Delete
99.6 kB
{
"C_01": {
"APPLY_CART_FORCE": "### Apply Cart Force\n```python\nsandbox.apply_cart_force(f: float)\n```\n- `f`: Horizontal force in Newtons (N). Positive is right, negative is left.\n- **Actuator Limits**: Clamped to [-450, 450] N each simulation step (no additional rate limit or actuation delay in the environment).\n- **Function**: Applies force to the cart body to move it along the track.",
"GET_CART_BODY": "### Get Cart Body\n```python\ncart = sandbox.get_cart_body()\n```\n- **Returns**: The `b2Body` object representing the cart. Useful for reading internal physics state like `cart.position.x`.",
"GET_POLE_BODY": "### Get Pole Body\n```python\npole = sandbox.get_pole_body()\n```\n- **Returns**: The `b2Body` object representing the pole. Useful for reading internal physics state.",
"GET_CART_POSITION": "### Get Cart Position\n```python\nx = sandbox.get_cart_position() -> float\n```\n- **Returns**: The horizontal X-coordinate of the cart's center in meters (m). The track center for this run is `sandbox.TRACK_CENTER_X` (see the task description for the nominal value).",
"GET_CART_VELOCITY": "### Get Cart Velocity\n```python\nvx = sandbox.get_cart_velocity() -> float\n```\n- **Returns**: The current horizontal velocity of the cart in meters per second (m/s).",
"GET_POLE_ANGLE": "### Get Pole Angle\n```python\nangle = sandbox.get_pole_angle() -> float\n```\n- **Returns**: The tilt angle of the pole in radians (rad). `0` is perfectly upright, `pi` is hanging down. Range: [-pi, pi]. Behavior matches **Sensor reporting (angle)** in the task description (may lag true state when that delay is non-zero); there is no artificial noise added to the signal.",
"GET_POLE_ANGULAR_VELOCITY": "### Get Pole Angular Velocity\n```python\nomega = sandbox.get_pole_angular_velocity() -> float\n```\n- **Returns**: The angular velocity of the pole in radians per second (rad/s). Same reporting behavior as `get_pole_angle`, per **Sensor reporting (angular velocity)** in the task description.",
"GET_WORLD": "### Get Physics World\n```python\nworld = sandbox.world\n```\n- **Returns**: The `b2World` object. For this task, infer effective weighting and dynamics from motion and closed-loop behavior rather than reading internal simulator fields to shortcut mutated environments.",
"TRACK_CENTER_X": "### Track Center X\n- `sandbox.TRACK_CENTER_X`: float. The target X-coordinate for centering the cart on this run (matches the task description).",
"SAFE_HALF_RANGE": "### Safe Half Range\n- `sandbox.SAFE_HALF_RANGE`: float. The maximum distance the cart can deviate from `TRACK_CENTER_X` before failing (matches the task description)."
},
"C_02": {
"APPLY_THRUST": "### Apply Thrust\n```python\nsandbox.apply_thrust(f1, f2)\n```\n- `f1`: Main engine thrust magnitude along the craft's **body-up** axis (world +y when the hull is upright).\n- `f2`: Steering torque.\n- **Function**: Primary propulsion and orientation control for the lander.",
"GET_GROUND_Y_TOP": "### Get Ground Y Top\n```python\ny = sandbox.get_ground_y_top()\n```\n- **Returns**: The Y-coordinate of the landing surface.",
"GET_LANDER_ANGLE": "### Get Lander Angle\n```python\nangle = sandbox.get_lander_angle()\n```\n- **Returns**: Current rotation of the lander in radians.",
"GET_LANDER_ANGULAR_VELOCITY": "### Get Lander Angular Velocity\n```python\nomega = sandbox.get_lander_angular_velocity()\n```\n- **Returns**: Rotation speed of the lander in rad/s.",
"GET_LANDER_BODY": "### Get Lander Body\n```python\nlander = sandbox.get_lander_body()\n```\n- **Returns**: The Box2D body object of the lander craft.",
"GET_LANDER_POSITION": "### Get Lander Position\n```python\npos = sandbox.get_lander_position()\n```\n- **Returns**: `(x, y)` position of the lander.",
"GET_LANDER_SIZE": "### Get Lander Size\n```python\nhalf_width, half_height = sandbox.get_lander_size()\n```\n- **Returns**: Half-dimensions of the lander's collision box.",
"GET_REMAINING_FUEL": "### Get Remaining Fuel\n```python\nfuel = sandbox.get_remaining_fuel()\n```\n- **Returns**: The remaining impulse budget (N\u00b7s) for thrust.",
"GET_THRUST_DELAY": "### Get Thrust Delay\n```python\nn = sandbox.get_thrust_delay_steps()\n```\n- **Returns**: Integer steps between issuing thrust/torque and their effect\u2014the same quantity stated under **Control Latency** in the task description.",
"GET_WORLD": "### Get Physics World\n```python\nworld = sandbox.world\n```\n- **Returns**: The `b2World` object for low-level debugging only. Prefer documented `sandbox.get_*` helpers; infer unmodeled dynamics and contact variability from motion and feedback rather than reading internal world fields unless debugging."
},
"C_03": {
"APPLY_SEEKER_FORCE": "### Apply Seeker Force\n```python\nsandbox.apply_seeker_force(fx, fy)\n```\n- `fx, fy`: Force vector components (Newtons).\n- **Function**: Primary control input for maneuvering the seeker.",
"GET_CORRIDOR_BOUNDS": "### Get Corridor Bounds\n```python\nx_min, x_max = sandbox.get_corridor_bounds()\n```\n- **Returns**: The horizontal boundaries of the traversable tunnel.",
"GET_REMAINING_IMPULSE_BUDGET": "### Get Remaining Impulse Budget\n```python\nbudget = sandbox.get_remaining_impulse_budget()\n```\n- **Returns**: The remaining amount of fuel/impulse allowed.",
"GET_SEEKER_BODY": "### Get Seeker Body\n```python\nseeker = sandbox.get_seeker_body()\n```\n- **Returns**: The Box2D body of the seeker agent.",
"GET_SEEKER_HEADING": "### Get Seeker Heading\n```python\nangle = sandbox.get_seeker_heading()\n```\n- **Returns**: The current orientation/heading of the seeker in radians.",
"GET_SEEKER_POSITION": "### Get Seeker Position\n```python\npos = sandbox.get_seeker_position()\n```\n- **Returns**: `(x, y)` position of the seeker.",
"GET_SEEKER_VELOCITY": "### Get Seeker Velocity\n```python\nvel = sandbox.get_seeker_velocity()\n```\n- **Returns**: `(vx, vy)` velocity vector.",
"GET_TARGET_POSITION": "### Get Target Position\n```python\npos = sandbox.get_target_position()\n```\n- **Returns**: `(x, y)` coordinates of the target (may be delayed).",
"GET_RENDEZVOUS_SLOTS": "### Get Rendezvous Slots\n```python\nslots = sandbox.get_rendezvous_slots()\n```\n- **Returns**: List of `(step_lo, step_hi)` intervals (phase-1 bands then phase-2 bands) that count toward rendezvous; matches the evaluator for this run (including curriculum mutations).",
"GET_TERRAIN_OBSTACLES": "### Get Terrain Obstacles\n```python\nobstacles = sandbox.get_terrain_obstacles()\n```\n- **Returns**: A list of current obstacles.",
"GET_LINEAR_DAMPING": "### Get Linear Damping\n- `agent_body.linearDamping`: The coefficient of environmental resistance to translation.",
"GET_ANGULAR_DAMPING": "### Get Angular Damping\n- `agent_body.angularDamping`: The coefficient of environmental resistance to rotation.",
"GET_WORLD": "### Get Physics World\n```python\nworld = sandbox.world\n```\n- **Returns**: The `b2World` object. For this task, treat gravity as something to infer from motion; do not rely on raw `world.gravity` as a substitute for physical reasoning."
},
"C_04": {
"APPLY_AGENT_FORCE": "### Apply Agent Force\n```python\nsandbox.apply_agent_force(fx, fy)\n```\n- `fx, fy`: Force components (Newtons). No explicit clamp in this task; use reasonable magnitudes to respect the structural impulse limit.\n- **Function**: Standard movement control for the bot.",
"GET_AGENT_BODY": "### Get Agent Body\n```python\nagent = sandbox.get_agent_body()\n```\n- **Returns**: The main Box2D body object of the agent.",
"GET_AGENT_POSITION": "### Get Agent Position\n```python\npos = sandbox.get_agent_position()\n```\n- **Returns**: `(x, y)` **reported** coordinates (may lag true pose when position report delay > 0; matches exit/unlock evaluation).",
"GET_AGENT_VELOCITY": "### Get Agent Velocity\n```python\nvel = sandbox.get_agent_velocity()\n```\n- **Returns**: `(vx, vy)` **instantaneous** linear velocity of the agent body.",
"GET_WHISKER_READINGS": "### Get Whisker Readings\n```python\nfront, up, down = sandbox.get_whisker_readings()\n```\n- **Returns**: Three distances (m) along **+x**, **+y**, **-y** from the agent center to the nearest wall (max range 3 m). Lower values mean obstacles are closer. In whisker-blind x-bands (if configured), readings may be saturated.",
"GET_LINEAR_DAMPING": "### Get Linear Damping\n- `agent_body.linearDamping`: The coefficient of environmental resistance to translation.",
"GET_WORLD": "### Get Physics World\n```python\nworld = sandbox.world\n```\n- **Returns**: The `b2World` object. `world.gravity.y` is the authoritative **gravitational vertical acceleration** (m/s\u00b2) for this run. The task description does **not** print its numeric value\u2014read `world.gravity.y` when you need the exact runtime value, or infer it from motion."
},
"C_05": {
"APPLY_AGENT_FORCE": "### Apply Agent Force\n```python\nsandbox.apply_agent_force(fx, fy)\n```\n- `fx, fy`: Force components in **Newtons (N)**\u2014the same unit used for in-zone force limits and repulsion scales in the task description.\n- **Function**: Standard movement control for the bot.",
"GET_AGENT_BODY": "### Get Agent Body\n```python\nagent = sandbox.get_agent_body()\n```\n- **Returns**: The main Box2D body object of the agent.",
"GET_AGENT_POSITION": "### Get Agent Position\n```python\npos = sandbox.get_agent_position()\n```\n- **Returns**: `(x, y)` coordinate tuple.",
"GET_AGENT_VELOCITY": "### Get Agent Velocity\n```python\nvel = sandbox.get_agent_velocity()\n```\n- **Returns**: `(vx, vy)` velocity vector.",
"GET_BARRIER_DELAY_STEPS": "### Get Barrier Delay Steps\n```python\ndelay = sandbox.get_barrier_delay_steps()\n```\n- **Returns**: Simulation steps between zone A triggering and removal of the vertical barrier (timed gate).",
"GET_BARRIER_X": "### Get Barrier X\n```python\nbx = sandbox.get_barrier_x()\n```\n- **Returns**: World x (m) of the barrier centerline; gate spans the y-range described in the task text.",
"GET_COOLDOWN_REMAINING": "### Get Cooldown Remaining\n```python\ntime = sandbox.get_cooldown_remaining()\n```\n- **Returns**: Steps remaining before the next interaction is permitted.",
"GET_NEXT_REQUIRED_SWITCH": "### Get Next Required Switch\n```python\nnext_sw = sandbox.get_next_required_switch()\n```\n- **Returns**: The next target identifier (`'A'`, `'B'`, `'C'`) or `None` if the sequence is complete or invalid.",
"GET_STEPS_IN_CURRENT_ZONE": "### Get Steps in Current Zone\n```python\nn = sandbox.get_steps_in_current_zone()\n```\n- **Returns**: Current consecutive dwell count toward triggering the **next required** switch (resets on leave or if speed/force/temporal rules fail).",
"GET_STEPS_REQUIRED_TO_TRIGGER": "### Get Steps Required to Trigger\n```python\nneed = sandbox.get_steps_required_to_trigger()\n```\n- **Returns**: Required consecutive in-zone steps for a trigger (matches **Activation duration** in the task description).",
"GET_TRIGGERED_SWITCHES": "### Get Triggered Switches\n```python\nswitches = sandbox.get_triggered_switches()\n```\n- **Returns**: List of switches successfully activated in sequence."
},
"C_06": {
"APPLY_MOTOR_TORQUE": "### Apply Motor Torque\n```python\nsandbox.apply_motor_torque(torque)\n```\n- `torque`: Requested torque in N\u00b7m; magnitude is clamped to the actuator limit for that step.\n- **Function**: Applies the requested torque to the wheel for that step; close the loop using `get_target_speed()` and the angular velocity API.",
"GET_TARGET_SPEED": "### Get Target Speed\n```python\ntarget = sandbox.get_target_speed()\n```\n- **Returns**: The desired setpoint for angular velocity (rad/s); may change over the episode\u2014query each step.",
"GET_WHEEL_ANGULAR_VELOCITY": "### Get Wheel Angular Velocity\n```python\nomega = sandbox.get_wheel_angular_velocity()\n```\n- **Returns**: Reported wheel angular velocity (rad/s) for use in your controller."
},
"D_01": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.1, 5.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2)\n```\n- `body`: The target Box2D body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"ADD_JOINT_PIVOT": "### Add Joint (Pivot)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body, or `None` to anchor `body_a` to the ground at `anchor_point`.\n- `anchor_point`: The (x, y) world coordinates of the rotation axis.\n- `type`: Must be `'pivot'`.\n- **Function**: Creates a Revolute joint allowing rotation about the anchor point.\n- **Returns**: A Box2D joint object.",
"ADD_SPRING_DYNAMICS": "### Add Spring\n```python\nspring = sandbox.add_spring(body_a, body_b, anchor_a, anchor_b, rest_length=None, stiffness=500.0, damping_ratio=0.5)\n```\n- `body_a, body_b`: The two bodies to connect.\n- `anchor_a, anchor_b`: World-space (x, y) coordinates of the attachment point on each body.\n- `rest_length`: The natural length of the spring (meters). If `None`, defaults to the distance at creation.\n- `stiffness`: Spring stiffness in N/m. **Enforced by environment**: clamped to [10, 3000] N/m.\n- `damping_ratio`: Damping ratio (0.0 = no damping, 1.0 = critical damping).\n- **Function**: Creates a dynamic spring-damper for energy storage, suspension, or launching.",
"GET_GROUND": "### Get Ground\n```python\nground = sandbox.get_ground()\n```\n- **Returns**: The static ground body object. Useful for attaching springs or anchors.",
"GET_PROJECTILE": "### Get Projectile\n```python\nprojectile = sandbox.get_projectile()\n```\n- **Returns**: The Box2D body object representing the projectile to be launched.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all created joint objects.",
"SPRINGS_LIST": "### Springs List\n- `sandbox.springs`: List of all created spring (distance joint) objects."
},
"D_02": {
"CONTROLLABLE_ENTITY_NOTE": "### Designated Controllable Entity (D-02)\n- The **jumper** is this task's designated controllable entity. The only sanctioned way to control its launch is `sandbox.set_jumper_velocity(vx, vy)` in `agent_action`. You may read its state via `sandbox.get_jumper()`. The prohibition on modifying \"environmental bodies\" applies to terrain and static bodies (platforms, barriers); it does not apply to using the documented `set_jumper_velocity` API for the jumper.",
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.1, 4.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Returns**: A Box2D joint object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2)\n```\n- `body`: The target Box2D body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"GET_JUMPER": "### Get Jumper\n```python\njumper = sandbox.get_jumper()\n```\n- **Returns**: The Box2D body object representing the jumper to be launched (the task's designated controllable entity).",
"GET_BODY_POSITION": "### Get Body Position\n```python\npos = sandbox.get_body_position()\n```\n- **Returns**: `(x, y)` position of the main body in exotic environments (Alias for jumper position).",
"SET_JUMPER_VELOCITY": "### Set Jumper Velocity\n```python\nsandbox.set_jumper_velocity(vx, vy)\n```\n- `vx, vy`: Horizontal and vertical velocity components in m/s.\n- **Function**: Instantly sets the velocity of the jumper. This is the only sanctioned way to control the jumper's launch. Call in `agent_action` for launch.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"BUILD_ZONE": "### Build Zone (read-only)\n- `sandbox.BUILD_ZONE_X_MIN`, `sandbox.BUILD_ZONE_X_MAX`: Horizontal bounds (meters) for beam centers.\n- `sandbox.BUILD_ZONE_Y_MIN`, `sandbox.BUILD_ZONE_Y_MAX`: Vertical bounds (meters) for beam centers.\n- All beam centers must lie within x in [BUILD_ZONE_X_MIN, BUILD_ZONE_X_MAX] and y in [BUILD_ZONE_Y_MIN, BUILD_ZONE_Y_MAX]."
},
"D_03": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.08, 2.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_PIVOT": "### Add Joint (Pivot)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot')\n```\n- `body_a, body_b`: The two bodies to connect (neither may be `None` in this task).\n- `anchor_point`: The (x, y) coordinates of the rotation axis.\n- `type`: Must be `'pivot'`.\n- **Function**: Creates a Revolute joint allowing rotation about the anchor point. In D_03 no motor or angle limits are exposed.\n- **Returns**: A Box2D joint object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect (e.g. the vehicle cabin from `get_vehicle_cabin()`).\n- `body_b`: The second body to connect (e.g. a beam from `add_beam`). **In this task ground anchoring is not allowed**: `body_b` cannot be `None`; attach beams to the cart only.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Returns**: A Box2D joint object.",
"GET_VEHICLE_CABIN": "### Get Vehicle Cabin\n```python\ncabin = sandbox.get_vehicle_cabin()\n```\n- **Returns**: The Box2D body object representing the main compartment of the vehicle.\n- **Example**: Use as `body_a` in `add_joint(cabin, beam, (x, y), type='rigid')` to attach beams to the cart; you may also pass `cabin` to `apply_force` in `agent_action` for velocity control.",
"GET_VEHICLE_POSITION": "### Get Vehicle Position\n```python\npos = sandbox.get_vehicle_position()\n```\n- **Returns**: Tuple `(x, y)` containing the current center coordinates of the vehicle cabin.",
"GET_VEHICLE_VELOCITY": "### Get Vehicle Velocity\n```python\nvel = sandbox.get_vehicle_velocity()\n```\n- **Returns**: Tuple `(vx, vy)` containing the current linear velocity of the vehicle cabin.",
"APPLY_FORCE": "### Apply Force\n```python\nsandbox.apply_force(body, force_vector)\n```\n- `body`: The target Box2D body (the vehicle cabin from `get_vehicle_cabin()` or an agent-created beam).\n- `force_vector`: Tuple `(fx, fy)` representing the force vector in Newtons.\n- **Function**: Applies a linear force to the center of the specified body. Use in `agent_action` to control the vehicle or parts of your structure.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all created joint objects. Use to iterate over mechanisms."
},
"D_04": {
"APPLY_FORCE_TO_SEAT": "### Apply Force to Seat\n```python\nsandbox.apply_force_to_seat(fx, fy)\n```\n- `fx, fy`: Force components (Newtons). Clamped per step to the task's pump force limit (e.g. 42 N); use within that range for horizontal and/or vertical pumping.\n- **Function**: Applies force to the swing seat center each step. Use with `get_swing_seat()` state to implement pumping (e.g. `sandbox.apply_force_to_seat(fx, 0)` or `(fx, fy)`).",
"APPLY_IMPULSE_TO_SEAT": "### Apply Impulse to Seat\n```python\nsandbox.apply_impulse_to_seat(ix, iy)\n```\n- `ix, iy`: Impulse components in N\u00b7s (Newton-seconds).\n- **Function**: Applies an instantaneous change in momentum to the swing seat.",
"GET_SIM_TIME": "### Get Simulation Time\n```python\nt = sandbox.get_sim_time()\n```\n- **Returns**: Current elapsed simulation time in seconds.",
"GET_SWING_SEAT": "### Get Swing Seat\n```python\nseat = sandbox.get_swing_seat()\npos = seat.position\nvel = seat.linearVelocity\n```\n- **Returns**: The Box2D body object representing the seat of the swing.\n- **State feedback**: Use `seat.position` (x, y in m) and `seat.linearVelocity` (vx, vy in m/s) to read current state for control (e.g. pumping timing and direction).",
"GET_WIND_FORCE_AT_TIME": "### Get Wind Force at Time\n```python\nfx = sandbox.get_wind_force_at_time(t)\n```\n- `t`: The time in seconds.\n- **Returns**: Predicted horizontal wind force at that time."
},
"D_05": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.1, 4.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_PIVOT": "### Add Joint (Pivot)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot', **kwargs)\n```\n- `body_a, body_b`: The two bodies to connect. If `body_b` is `None`, the joint anchors `body_a` to the static environment (ground).\n- `anchor_point`: The (x, y) coordinates of the rotation axis.\n- `type`: Must be `'pivot'`.\n- `**kwargs`:\n - `lower_limit, upper_limit`: (Optional) Rotation limits in radians.\n - `enable_motor`: (Optional) Set to `True` to enable the motor.\n - `motor_speed`: (Optional) Target angular velocity (rad/s).\n - `max_motor_torque`: (Optional) Maximum torque (N\u00b7m).\n- **Function**: Creates a Revolute joint allowing rotation about the anchor point.\n- **Returns**: A Box2D joint object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2)\n```\n- `body`: The target Box2D body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all created joint objects.",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects. Use indices (e.g. `sandbox.bodies[0]`) to obtain references for control.\n- **Body state and control (agent-created bodies only)**: Bodies in this list may be read and modified in `agent_action` to drive the mechanism. **Read**: `body.position`, `body.linearVelocity`, `body.angle`, `body.angularVelocity`. **Write**: e.g. `body.angularVelocity = omega` (rad/s) or `body.linearVelocity = (vx, vy)` to apply control. Only modify bodies you created; do not modify terrain or environment bodies."
},
"D_06": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.1, 3.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: **2D task**: areal density in simulation units (kg per unit area in the Box2D world). Mass scales with beam area.\n- **Damping defaults**: New beams start with the world\u2019s default linear and angular damping (baseline **0.0** each for D-06 unless the runner sets `physics_config`). Use `set_damping` to change them after creation.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"ADD_JOINT_PIVOT": "### Add Joint (Pivot)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot')\n```\n- `body_a, body_b`: The two bodies to connect. Neither may be `None` for a pivot (use rigid with `body_b=None` to anchor to ground).\n- `anchor_point`: The (x, y) coordinates of the rotation axis.\n- `type`: Must be `'pivot'`.\n- **Function**: Creates a Revolute joint allowing free rotation about the anchor point. In D-06 no motor or angle limits are supported; the joint is passive only.\n- **Returns**: A Box2D joint object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2)\n```\n- `body`: The target Box2D body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"SET_DAMPING": "### Set Damping\n```python\nsandbox.set_damping(body, linear=None, angular=None)\n```\n- `body`: The target Box2D body object.\n- `linear`: (Optional) Linear damping coefficient (high values = molasses effect).\n- `angular`: (Optional) Angular damping coefficient.\n- **Function**: Adjusts environmental resistance for a specific structural component.",
"GET_WORLD": "### Get Physics World\n```python\nworld = sandbox.world\n```\n- **Returns**: The `b2World` object. Prefer task metrics, evaluator feedback, and physical interaction to infer environment behavior; avoid relying on low-level world state as a substitute for reasoning about this task.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"MAX_BEAM_COUNT": "### Max Beam Count\n- `sandbox.MAX_BEAM_COUNT`: The maximum number of beam components allowed for this task.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all created joint objects. Use to iterate over mechanisms.",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects."
},
"E_01": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"GET_ARENA_BOUNDS": "### Get Arena Bounds\n```python\nmin_x, max_x, min_y, max_y = sandbox.get_arena_bounds()\n```\n- **Returns**: The limits of the simulation world. Staying within these avoids out-of-bounds failures.",
"GET_BUILD_ZONE": "### Get Build Zone\n```python\nmin_x, max_x, min_y, max_y = sandbox.get_build_zone()\n```\n- **Returns**: Four floats defining the bounding box of the construction area.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget."
},
"E_02": {
"APPLY_THRUST": "### Apply Thrust\n```python\nsandbox.apply_thrust(f1, f2)\n```\n- `f1, f2`: Control inputs.\n- **Usage**:\n - In Lunar Lander: `f1` is main engine thrust (vertical), `f2` is steering torque.\n - In Exotic Racer: `f1, f2` are horizontal and vertical thrust components.\n- **Function**: Task-specific abstraction for agent propulsion.",
"GET_CRAFT_POSITION": "### Get Craft Position\n```python\npos = sandbox.get_craft_position()\n```\n- **Returns**: `(x, y)` position of the spacecraft.",
"GET_HEAT": "### Get Heat\n```python\nh = sandbox.get_heat()\n```\n- **Returns**: Current heat accumulation value.",
"GET_OVERHEAT_LIMIT": "### Get Overheat Limit\n```python\nlimit = sandbox.get_overheat_limit()\n```\n- **Returns**: Threshold value where overheating starts.",
"GET_STEP_COUNT": "### Get Step Count\n```python\nn = sandbox.get_step_count()\n```\n- **Returns**: Total number of physics steps executed so far.",
"IS_OVERHEATED": "### Is Overheated\n```python\nstatus = sandbox.is_overheated()\n```\n- **Returns**: `True` if thermal damage is occurring."
},
"E_03": {
"APPLY_THRUST": "### Apply Thrust\n```python\nsandbox.apply_thrust(f1, f2)\n```\n- `f1, f2`: Control inputs.\n- **Usage**:\n - In Lunar Lander: `f1` is main engine thrust (vertical), `f2` is steering torque.\n - In Exotic Racer: `f1, f2` are horizontal and vertical thrust components.\n- **Function**: Task-specific abstraction for agent propulsion.",
"GET_CHECKPOINT_A_REACHED": "### Get Checkpoint A Reached\n```python\nstatus = sandbox.get_checkpoint_a_reached()\n```\n- **Returns**: `True` if the first intermediate goal (Checkpoint A) has been satisfied.",
"GET_CHECKPOINT_B_REACHED": "### Get Checkpoint B Reached\n```python\nstatus = sandbox.get_checkpoint_b_reached()\n```\n- **Returns**: `True` if the second intermediate goal (Checkpoint B) has been satisfied.",
"GET_CHECKPOINT_REACHED": "### Get Checkpoint Reached\n```python\nstatus = sandbox.get_checkpoint_reached()\n```\n- **Returns**: `True` only if both checkpoint A and B have been reached in order.",
"GET_SLED_POSITION": "### Get Sled Position\n```python\npos = sandbox.get_sled_position()\n```\n- **Returns**: `(x, y)` position of the sled.",
"GET_SLED_VELOCITY": "### Get Sled Velocity\n```python\nvel = sandbox.get_sled_velocity()\n```\n- **Returns**: `(vx, vy)` velocity vector."
},
"E_04": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.1, 4.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"ADD_JOINT_PIVOT": "### Add Joint (Pivot)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot', **kwargs)\n```\n- `body_a, body_b`: The two bodies to connect.\n- `anchor_point`: The (x, y) coordinates of the rotation axis.\n- `type`: Must be `'pivot'`.\n- `**kwargs`:\n - `lower_limit, upper_limit`: (Optional) Rotation limits in radians.\n - `enable_motor`: (Optional) Set to `True` to enable the motor.\n - `motor_speed`: (Optional) Target angular velocity (rad/s).\n - `max_motor_torque`: (Optional) Maximum torque (N\u00b7m).\n- **Function**: Creates a Revolute joint allowing rotation about the anchor point.\n- **Returns**: A Box2D joint object.",
"GET_BUILD_ZONE": "### Get Build Zone\n```python\nmin_x, max_x, min_y, max_y = sandbox.get_build_zone()\n```\n- **Returns**: Four floats defining the bounding box of the construction area.",
"GET_GROUND_Y_TOP": "### Get Ground Y Top\n```python\ny = sandbox.get_ground_y_top()\n```\n- **Returns**: The Y-coordinate of the top surface of the ground.",
"GET_MIN_BEAMS": "### Get Min Beams\n```python\nmin_n = sandbox.get_min_beams()\n```\n- **Returns**: The minimum number of beam components required for a valid submission.",
"GET_MIN_JOINTS": "### Get Min Joints\n```python\nmin_j = sandbox.get_min_joints()\n```\n- **Returns**: The minimum number of joints required for a valid submission.",
"GET_SPAN_BOUNDS": "### Get Span Bounds\n```python\nleft, right = sandbox.get_span_bounds()\n```\n- **Returns**: The X-coordinates of the left and right edges of the gap or void.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"GET_STRUCTURE_MASS_LIMIT": "### Get Structure Mass Limit\n```python\nlimit = sandbox.get_structure_mass_limit()\n```\n- **Returns**: The numerical value (kg) of the maximum allowed mass for this task.",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all created joint objects. Use to iterate over mechanisms."
},
"E_05": {
"APPLY_THRUST": "### Apply Thrust\n```python\nsandbox.apply_thrust(f1, f2)\n```\n- `f1, f2`: Control inputs.\n- **Usage**:\n - In Lunar Lander: `f1` is main engine thrust (vertical), `f2` is steering torque.\n - In Exotic Racer: `f1, f2` are horizontal and vertical thrust components.\n- **Function**: Task-specific abstraction for agent propulsion.",
"GET_BODY_POSITION": "### Get Body Position\n```python\npos = sandbox.get_body_position()\n```\n- **Returns**: `(x, y)` position of the main body in exotic environments.",
"GET_BODY_VELOCITY": "### Get Body Velocity\n```python\nvel = sandbox.get_body_velocity()\n```\n- **Returns**: `(vx, vy)` velocity vector.",
"GET_STEP_COUNT": "### Get Step Count\n```python\nn = sandbox.get_step_count()\n```\n- **Returns**: Total number of physics steps executed so far.",
"GET_PHYSICS_PARAMS": "### Get Physics Parameters\n```python\nparams = sandbox.get_physics_params()\n```\n- **Returns**: Dictionary with physics configuration:\n - `gravity_x`, `gravity_y`: Gravitational acceleration components (m/s\u00b2).\n - `linear_damping`: Linear damping coefficient.\n - `max_thrust`: Maximum thrust magnitude cap (N).\n - `magnet_count`: Number of magnetic field sources.\n- **Usage**: Read to adapt thrust and gravity compensation to the specific environment variant."
},
"E_06": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"GET_BUILD_ZONE": "### Get Build Zone\n```python\nmin_x, max_x, min_y, max_y = sandbox.get_build_zone()\n```\n- **Returns**: Four floats defining the bounding box of the construction area.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"GET_STRUCTURE_MASS_LIMIT": "### Get Structure Mass Limit\n```python\nlimit = sandbox.get_structure_mass_limit()\n```\n- **Returns**: The numerical value (kg) of the maximum allowed mass for this task.",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all created joint objects. Use to iterate over mechanisms."
},
"F_01": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=500.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: clamped to [MIN_BEAM_SIZE, MAX_BEAM_SIZE] and to at most MAX_BEAM_WIDTH and MAX_BEAM_HEIGHT.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: Areal density in kg/m\u00b2 for this 2D task (default 500.0); fixture mass scales with beam area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. **F-01**: Terrain anchoring is not allowed (MAX_TERRAIN_ANCHORS is 0); body_b must be another agent-created beam, never None.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.1)\n```\n- `body`: The target Box2D body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"SET_DAMPING": "### Set Damping\n```python\nsandbox.set_damping(body, linear=None, angular=None)\n```\n- `body`: The target Box2D body object.\n- `linear`: (Optional) Linear damping coefficient (high values = molasses effect).\n- `angular`: (Optional) Angular damping coefficient.\n- **Function**: Adjusts environmental resistance for a specific structural component.",
"APPLY_FORCE": "### Apply Force\n```python\nsandbox.apply_force(body, force_vector)\n```\n- `body`: The target Box2D body object. Apply only to agent-created bodies (e.g. from sandbox.bodies); do not apply to terrain or environment bodies.\n- `force_vector`: Tuple `(fx, fy)` representing the force vector in Newtons.\n- **Function**: Applies a linear force to the center of the specified body.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"GET_TERRAIN_BOUNDS": "### Get Terrain Bounds\n```python\nbounds = sandbox.get_terrain_bounds()\n```\n- **Returns**: A dictionary containing coordinates for the reservoir, build zones, and flood limits. Use this so each beam **center** lies within a disjoint strip, matching design validation.",
"GET_TERRAIN_JOINT_COUNT": "### Get Terrain Joint Count\n```python\ncount = sandbox.get_terrain_joint_count()\n```\n- **Returns**: The current number of joints that connect structural components to the terrain.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"MAX_BEAM_COUNT": "### Max Beam Count\n- `sandbox.MAX_BEAM_COUNT`: The maximum number of beam components allowed for this task.",
"MAX_TERRAIN_ANCHORS": "### Max Terrain Anchors\n- `sandbox.MAX_TERRAIN_ANCHORS`: The maximum number of joints allowed to connect to the static ground.",
"MAX_JOINT_COUNT": "### Max Joint Count\n- `sandbox.MAX_JOINT_COUNT`: The maximum number of beam-to-beam joints allowed.",
"MAX_BEAM_WIDTH": "### Max Beam Width\n- `sandbox.MAX_BEAM_WIDTH`: The maximum width (meters) allowed for any single beam.",
"MAX_BEAM_HEIGHT": "### Max Beam Height\n- `sandbox.MAX_BEAM_HEIGHT`: The maximum height (meters) allowed for any single beam.",
"MIN_BEAM_BOTTOM_Y": "### Min Beam Bottom Y\n- `sandbox.MIN_BEAM_BOTTOM_Y`: The minimum Y-coordinate allowed for the bottom edge of any beam (mandatory underflow gap).",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects. **Readable attributes** (agent-created bodies): body.position (body.position.x, body.position.y), body.mass. Use for joint anchor math and force scaling.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all created joint objects."
},
"F_02": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.15, 2.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.1)\n```\n- `body`: The target Box2D body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"GET_VEHICLE_FRONT_X": "### Get Vehicle Front X\n```python\nx = sandbox.get_vehicle_front_x()\n```\n- **Returns**: The current X-coordinate of the vehicle's front bumper.",
"APPLY_FORCE": "### Apply Force\n```python\nsandbox.apply_force(body, fx, fy, step_count=None)\n```\n- `body`: The Box2D body object to apply force to.\n- `fx, fy`: The force components in Newtons.\n- `step_count`: (Optional) The current simulation step count. Used for calculating cooldowns in tasks where propulsion is limited.\n- **Actuator limit**: Force magnitude per body is clamped to 520 N per step.\n- **Function**: Applies a world-space force to the center of the body.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects (your vehicle components).\n- **Read-only state** (allowed): Each body supports `body.position` (e.g. `body.position.x`, `body.position.y`), `body.linearVelocity` (e.g. `body.linearVelocity.x`), `body.angularVelocity`, and `body.active` for feedback and control logic.\n- **Allowed writes** (tool manipulation only): You may set `body.linearVelocity` and `body.angularVelocity` on bodies in this list to control your vehicle. Do not modify terrain or environment bodies."
},
"F_03": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=300.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_ANCHORED_BASE": "### Add Anchored Base\n```python\nbase = sandbox.add_anchored_base(x, y, width, height, angle=0, density=400.0)\n```\n- `x, y`: Center coordinates. Per task spec, the primary base must be fixed at x=-2.0, y=0.0.\n- `width, height`: Dimensions of the base component.\n- **Function**: Adds a rectangular body that is rigidly anchored to the floor at the specified position.\n- **Returns**: A Box2D body object.",
"ADD_SCOOP": "### Add Scoop\n```python\nscoop = sandbox.add_scoop(x, y, width, height, angle=0, density=280.0)\n```\n- `x, y`: The hinge corner position where the scoop connects to the arm.\n- `width`: The width of the L-shaped scoop.\n- `height`: The height of the scoop's back wall.\n- **Function**: Adds an L-shaped scoop (back wall + floor) optimized for carrying granular material. The hinge point is at the body's local origin (0,0).\n- **Returns**: The scoop body object. Registered as a carrier for particles.",
"ADD_JOINT": "### Add Joint (Rigid/Weld)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point)\n```\n- `body_a, body_b`: The two bodies to connect. If `body_b` is `None`, anchors `body_a` to the floor.\n- `anchor_point`: The (x, y) coordinates in world space for the weld point.\n- **Function**: Creates a rigid connection (Weld joint) between two bodies, preventing relative motion.",
"ADD_REVOLUTE_JOINT": "### Add Revolute Joint (Motorized)\n```python\njoint = sandbox.add_revolute_joint(body_a, body_b, anchor_point, enable_motor=False, motor_speed=0.0, max_motor_torque=100.0)\n```\n- `body_a, body_b`: The two bodies to connect.\n- `anchor_point`: The rotation axis point in world space.\n- `enable_motor`: Set to `True` to allow active control of the joint.\n- `max_motor_torque`: The maximum torque limit (N\u00b7m) for the actuator.\n- **Function**: Creates a motorized hinge joint. Control `joint.motorSpeed` in `agent_action` to move the arm segments.\n- **Attributes**: \n - `joint.motorSpeed`: Set target angular velocity (rad/s).\n - `joint.motorEnabled`: Boolean to toggle the actuator.\n - `joint.angle`: Read current rotation (rad).",
"HAS_CENTRAL_WALL": "### Has Central Wall\n```python\nexists = sandbox.has_central_wall() -> bool\n```\n- **Returns**: `True` if the central obstacle wall is present in the current environment.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: Total mass (kg) of all components created. Budget is 800.0 kg.",
"GET_INITIAL_PARTICLE_COUNT": "### Get Initial Particle Count\n```python\ncount = sandbox.get_initial_particle_count()\n```\n- **Returns**: The number of sand particles spawned in the pit at the start.",
"GET_WORLD": "### Get Physics World\n```python\nworld = sandbox.world\n```\n- **Returns**: The `b2World` object. Access `world.gravity.y` to check environmental gravity."
},
"F_04": {
"ADD_BEAM": "### Add Beam (Dynamic)\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=200.0)\n```\n- `x, y`: Center coordinates (meters).\n- `width, height`: Dimensions (meters). **Enforced by environment**: each dimension is clamped to [0.08, 1.0] m.\n- `angle`: Rotation in radians.\n- `density`: Areal density (kg/m\u00b2) in this 2D simulation; fixture mass = density \u00d7 area. Default matches the environment.\n- **Function**: Creates a **dynamic** rectangular body (moves under gravity and collisions). For fixed filter decks, prefer `add_static_beam` unless you intentionally need movable structure.\n- **Returns**: A Box2D dynamic body object.",
"ADD_STATIC_BEAM": "### Add Static Beam\n```python\nbeam = sandbox.add_static_beam(x, y, width, height, angle=0, density=200.0)\n```\n- `x, y`: Center coordinates (meters).\n- `width, height`: Dimensions (meters). **Enforced by environment**: each dimension is clamped to [0.08, 1.0] m.\n- `angle`: Rotation in radians.\n- `density`: Areal density (kg/m\u00b2) in this 2D simulation; bookkeeping mass = density \u00d7 width \u00d7 height (matches `get_structure_mass`). Default matches the environment.\n- **Function**: Adds a rectangular body that is IMMOVABLE (fixed in space). Use this for permanent structural supports or fixed obstacles that don't need to be anchored via joints.\n- **Returns**: A Box2D static body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`, `body_b`: Bodies to weld together (e.g. static beams). If `body_b` is `None`, `body_a` is welded to the **static floor** at `anchor_point`.\n- `anchor_point`: World `(x, y)` coordinates of the weld.\n- `type`: Must be `'rigid'` (other values are treated as rigid in this environment).\n- **Function**: Creates a weld joint. Losing joints during the run is scored as structural failure.\n- **Returns**: A Box2D joint object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.1)\n```\n- `body`: The target body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic; default matches the environment).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"APPLY_FORCE": "### Apply Force\n```python\nsandbox.apply_force(body, force)\n```\n- `body`: The target body (e.g., a particle or agent beam).\n- `force`: A tuple `(fx, fy)` representing the force vector in Newtons.\n- **Function**: Applies a linear force to the center of the specified body to influence its motion.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"GET_PARTICLES_SMALL": "### Get Particles Small\n```python\nparticles = sandbox.get_particles_small()\n```\n- **Returns**: A list of small granular particle bodies.\n- **Object Attributes**:\n - `p.active`: Boolean (True if particle is in simulation).\n - `p.position.y`: Vertical Y-coordinate (m).",
"GET_PARTICLES_MEDIUM": "### Get Particles Medium\n```python\nparticles = sandbox.get_particles_medium()\n```\n- **Returns**: A list of medium-sized granular particle bodies.\n- **Object Attributes**:\n - `p.active`: Boolean (True if particle is in simulation).\n - `p.position.y`: Vertical Y-coordinate (m).",
"GET_TERRAIN_BOUNDS": "### Get Terrain Bounds\n```python\nbounds = sandbox.get_terrain_bounds()\n```\n- **Returns**: Dictionary of environmental boundaries.",
"GET_INITIAL_PARTICLE_COUNT": "### Get Planned Total Particle Count\n```python\ncount = sandbox.get_initial_particle_count()\n```\n- **Returns**: The **planned** total number of granular particle bodies after **all** scheduled release waves have spawned (constant for a given configuration; not the live count mid-episode).",
"GET_SPAWNED_PARTICLE_COUNT": "### Get Spawned Particle Count (live)\n```python\ncount = sandbox.get_spawned_particle_count()\n```\n- **Returns**: The number of **active** particle bodies currently in the simulation (grows as delayed waves spawn). This is the denominator used for **classification purity** during the run.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"MAX_BEAMS": "### Max Beam Count\n- `sandbox.MAX_BEAMS`: The maximum number of beam components allowed (default 6; may vary in mutated stages). Use `len(sandbox.bodies)` to check current count against this limit.",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all created Box2D body objects."
},
"F_05": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=150.0)\n```\n- `x, y`: The coordinates (meters) for the **center** of the beam. **Enforced by environment**: the center must lie inside the build zone from the task description (numeric bounds may differ in variants) or a `ValueError` is raised.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.1, 1.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b2-equivalent for the beam body (default **150.0**). Mass is automatically calculated from area \u00d7 density.\n- **Friction**: Beam fixtures use the same **deck friction** coefficient as the hull as configured in the simulator. Use the **Hull & beam deck friction** line in the task description for the current numeric value (variants may override; it is also updated there when the curriculum changes deck traction). Infer effective traction at contacts with cargo, floor, and rocks from interaction and feedback.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect (e.g. a beam from add_beam).\n- `body_b`: The second body. If `None`, the joint welds `body_a` to the **boat hull**. **`anchor_point` must always lie inside the build zone stated in the task description** (hull welds and beam\u2013beam welds; numeric bounds may differ in variants) or a `ValueError` is raised.\n- `anchor_point`: The (x, y) world coordinates where the connection occurs.\n- `type`: Must be `'rigid'`; any other value raises `ValueError`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.1)\n```\n- `body`: The target Box2D body object.\n- `restitution`: The bounciness coefficient (0.0 = no bounce, 1.0 = perfect elastic).\n- **Function**: Updates the physical surface properties of all fixtures on a body.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: The maximum allowable mass (kg) for the constructed mechanism.",
"GET_BOAT_BODY": "### Get Boat Body\n```python\nboat = sandbox.get_boat_body()\n```\n- **Returns**: The Box2D body object of the boat hull.",
"GET_BOAT_POSITION": "### Get Boat Position\n```python\npos = sandbox.get_boat_position()\n```\n- **Returns**: A tuple `(x, y)` containing the current center coordinates of the boat.",
"GET_BOAT_ANGLE": "### Get Boat Angle\n```python\nangle = sandbox.get_boat_angle()\n```\n- **Returns**: The current tilt angle of the boat in radians.",
"GET_INITIAL_CARGO_COUNT": "### Get Initial Cargo Count\n```python\ncount = sandbox.get_initial_cargo_count()\n```\n- **Returns**: The number of cargo particles at the start of the task.",
"GET_CARGO_IN_WATER_COUNT": "### Get Cargo Below Loss-Plane Count\n```python\ncount = sandbox.get_cargo_below_loss_plane_count()\n# Alias: sandbox.get_cargo_in_water_count()\n```\n- **Returns**: After the grace window (first `cargo_loss_grace_steps` physics steps, default 120), the number of cargo particles whose center is **currently** below the evaluator loss-plane height `CARGO_WATER_Y` (not restricted to the water x-band). During the grace window, returns **0** so this matches grace-gated retention semantics.\n- **Note**: Episode **success** uses whether the center **ever** crossed the loss plane **after** that same window (`cargo_ever_below_loss_plane`). Use evaluator metrics for the authoritative criterion."
},
"S_01": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0, friction=0.5)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. Each dimension is clamped by the environment to [0.1, 10.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The 2D material density in kg/m\u00b2-equivalent. Mass is calculated as fixture area \u00d7 density.\n- `friction`: Non-negative surface friction coefficient for this agent-created beam; default 0.5.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a, body_b`: The two bodies to connect. If `body_b` is `None`, anchors `body_a` to the cliff at the `anchor_point`.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Either `'rigid'` (Weld joint, no relative motion) or `'pivot'` (Revolute joint, rotation about the anchor).\n- **Function**: Creates a Weld joint (rigid) or Revolute joint (pivot) between the bodies.\n- **Returns**: A Box2D joint object.",
"APPLY_VEHICLE_FORCE": "### Apply Vehicle Force\n```python\nsandbox.apply_vehicle_force(fx, fy)\n```\n- `fx`, `fy`: Finite force components in Newtons applied to the dynamic test-vehicle chassis. Components are clamped to [-8000, 8000] N horizontally and [-20000, 20000] N vertically.\n- **Function**: The sanctioned vehicle-control primitive. It does not expose or permit mutation of terrain, world, physics configuration, or other environment bodies.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget."
},
"S_02": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Enforced by environment**: each dimension is clamped to [0.1, 10.0] m; values outside this range are rejected.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive). Default 0.\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor, type='rigid')\n```\n- `body_a, body_b`: The two bodies to connect. If `body_b` is `None`, anchors `body_a` to the ground at `anchor`.\n- `anchor`: The (x, y) world coordinates where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"ADD_SPRING": "### Add Spring\n```python\nspring = sandbox.add_spring(body_a, body_b, anchor_a, anchor_b, stiffness, damping)\n```\n- `body_a, body_b`: The two bodies to connect.\n- `anchor_a, anchor_b`: (x, y) world coordinates of the attachment point on each body.\n- `stiffness`: Spring stiffness (frequency in Hz). Recommended range: [1.0, 30.0].\n- `damping`: Damping ratio (0.0 to 1.0). Values near 1.0 give critical damping.\n- **Function**: Creates a distance joint acting as a spring-damper to dissipate vibrational energy.\n- **Returns**: A Box2D distance joint object.",
"GET_FOUNDATION": "### Get Foundation\n```python\nfoundation = sandbox.get_foundation()\n```\n- **Returns**: The read-only Box2D body handle for the oscillating kinematic foundation.\n- **Usage**: Pass this handle to `add_joint` or `add_spring` to connect agent-created components. Do not mutate the foundation body."
},
"S_03": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. Each dimension is clamped to [0.1, 15.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor, type='rigid')\n```\n- `body_a, body_b`: The two agent-created bodies to connect. Use `body_b=None` to anchor `body_a` to the wall at `anchor`.\n- `anchor`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'` (Weld joint).\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget."
},
"S_04": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0, friction=None)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. **Clamped by the environment**: width to [0.1, 7.0] m, height to [0.1, 2.0] m.\n- `angle`: The initial rotation of the beam in radians.\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- `friction`: (Optional) The friction coefficient. If omitted, the environment default is used.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a, body_b`: The two agent-created bodies to connect. Use `body_b=None` to anchor `body_a` to the central static fulcrum.\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: \n - `'rigid'`: Creates a Weld joint that prevents all relative motion between the two bodies.\n - `'pivot'`: Creates a Revolute joint allowing rotation about the anchor point.\n- **Returns**: A Box2D joint object.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget."
},
"S_05": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam.\n- `width, height`: The full width and height (meters) of the rectangular beam. Task constraints: each dimension in [0.1, 10.0] m.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive).\n- `density`: The material density in kg/m\u00b3. Mass is automatically calculated based on area.\n- **Constraints (enforced at build time)**: Beam center must be at least 1.3 m from the core center (keep-out zone). Beam center y must not exceed the structure height limit (7.5 m).\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions.\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor, type='rigid')\n```\n- `body_a`: The first body to connect.\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static floor.\n- `anchor`: The (x, y) coordinates in the world where the connection occurs. Anchor y must not exceed the structure height limit (7.5 m).\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget."
},
"S_06": {
"ADD_BLOCK": "### Add Block\n```python\nsandbox.add_block(x, y, width, height, angle=0, density=None)\n```\n- `x, y`: The coordinates (meters) for the center of the block. The center must lie within the permitted build access zone (task-dependent; see spawn zone in the task description).\n- `width, height`: The dimensions (meters) of the rectangular block. **Constraints**: width \u2264 1.0 m, height \u2264 0.2 m. Total block count must not exceed 100.\n- `angle`: (Optional) Initial rotation of the block in radians. Default 0.\n- `density`: (Optional) Material density in kg/m\u00b3. Mass = density \u00d7 area. If omitted, the environment default is used (e.g. 1.0).\n- **Function**: Adds a dynamic, un-jointed block to the simulation. Blocks rely on gravity and friction; no joints or bonding.\n- **Returns**: A Box2D body object.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent.\n- **Function**: Used to monitor compliance with the task's mass budget."
},
"F_06": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=250.0)\n```\n- `x, y`: The coordinates (meters) for the center of the beam. Must lie within the build zone (see task description).\n- `width, height`: The full width and height (meters) of the rectangular beam. **Constraints (enforced by environment)**: 0.1 \u2264 width, height \u2264 1.2 m; values outside this range are clamped.\n- `angle`: The initial rotation of the beam in radians (clockwise is positive). Default 0.\n- `density`: The material density in kg/m\u00b3 (default 250.0). Mass is automatically calculated from area \u00d7 density.\n- **Function**: Creates a dynamic rectangular body that responds to gravity and collisions. Use for pipeline structure; anchor to the ground with add_joint(..., body_b=None).\n- **Returns**: A Box2D body object.",
"ADD_JOINT_RIGID": "### Add Joint (Rigid)\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\n```\n- `body_a`: The first body to connect (e.g. a beam from add_beam).\n- `body_b`: The second body to connect. If `None`, the joint anchors `body_a` to the static environment (floor).\n- `anchor_point`: The (x, y) coordinates in the world where the connection occurs.\n- `type`: Must be `'rigid'`.\n- **Function**: Creates a Weld joint that prevents all relative motion between the two bodies.\n- **Returns**: A Box2D joint object.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: The total mass (kg) of all components created by the agent (add_beam).\n- **Function**: Used to monitor compliance with the task's mass budget (e.g. sandbox.MAX_STRUCTURE_MASS).",
"GET_FLUID_PARTICLES": "### Get Fluid Particles\n```python\nparticles = sandbox.get_fluid_particles()\n```\n- **Returns**: A list of Box2D body objects, each representing a single fluid particle (active only; particles in pits are excluded).\n- **Read-only state**: You may read `body.position.x`, `body.position.y`, `body.linearVelocity.x`, `body.linearVelocity.y` to observe state. Do not call `body.ApplyForceToCenter`; apply forces only via `sandbox.apply_force_to_particle(particle, fx, fy)` so the per-step force budget is enforced.",
"APPLY_FORCE_TO_PARTICLE": "### Apply Force to Particle\n```python\nsandbox.apply_force_to_particle(particle, fx, fy)\n```\n- `particle`: A particle body from `sandbox.get_fluid_particles()`.\n- `fx, fy`: Force components in Newtons (world-space).\n- **Function**: Applies force to the particle's center. The magnitude \u221a(fx\u00b2 + fy\u00b2) is counted against the per-step force budget (`sandbox.FORCE_BUDGET_PER_STEP`). If the remaining budget is insufficient, the call has no effect (or is scaled down by the environment). You must use this API rather than `particle.ApplyForceToCenter` so the budget limit is respected.\n- **Returns**: None.",
"FORCE_BUDGET_PER_STEP": "### Force Budget Per Step (read-only)\n- `sandbox.FORCE_BUDGET_PER_STEP`: float. Maximum total force magnitude (N) that may be applied to particles in a single simulation step. The sum of \u221a(fx\u00b2 + fy\u00b2) over all `apply_force_to_particle` calls in one step must not exceed this value; the environment enforces this. Default 12000.0; may differ in mutated stages. Use in agent_action to cap or scale forces so you stay within the budget."
},
"K_01": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: Center coordinates (meters).\n- `width, height`: Dimensions (meters). **Constraints (enforced at build time)**: 0.05 \u2264 width, height \u2264 5.0 m.\n- `angle`: Initial rotation in radians.\n- `density`: Material density in kg/m\u00b3. Mass is computed from area \u00d7 density.\n- **Function**: Creates a dynamic rectangular body for the walker structure.\n- **Returns**: Box2D body object.",
"ADD_WHEEL": "### Add Wheel\n```python\nwheel = sandbox.add_wheel(x, y, radius=0.2, density=0.6)\n```\n- `x, y`: Center position (meters).\n- `radius`: Wheel radius in meters. **Constraint**: 0.05 \u2264 radius \u2264 0.8 m.\n- `density`: Material density in kg/m\u00b3.\n- **Function**: Creates a circular rigid body. Attach with add_joint(..., type='pivot') and drive with set_motor.\n- **Returns**: Box2D body object.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2, friction=None)\n```\n- `body`: The target Box2D body (from add_beam or add_wheel).\n- `restitution`: Bounciness (0.0 = no bounce, 1.0 = fully elastic).\n- `friction`: Optional friction coefficient; if omitted only restitution is set. In mutated stages the environment may cap friction.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot', lower_limit=None, upper_limit=None)\n```\n- `body_a, body_b`: Bodies to connect (from add_beam/add_wheel). Neither may be None.\n- `anchor_point`: (x, y) world coordinates of the connection point.\n- `type`: `'pivot'` (Revolute, for motor-driven legs) or `'rigid'` (Weld, no relative rotation).\n- `lower_limit`, `upper_limit`: Optional angle limits in radians for pivot joints; when omitted, mutated stages may inject default limits. Specified limits are clamped to [-\u03c0, \u03c0].\n- **Returns**: Joint object; use with sandbox.set_motor for pivot joints.",
"AGENT_STATE": "### Agent State\n- `build_agent` may return a dictionary containing the primary body and joint references returned by `add_joint`; that same dictionary is passed as `agent_body` to `agent_action`. This keeps controller state separate from the sandbox.",
"SET_MOTOR": "### Set Motor\n```python\nsandbox.set_motor(joint, motor_speed, max_torque=100.0)\n```\n- `joint`: A Revolute joint (from add_joint type='pivot').\n- `motor_speed`: Target angular velocity in rad/s (positive = counterclockwise).\n- `max_torque`: Maximum motor torque in N\u00b7m; default 100.0.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: Total mass (kg) of all bodies created by the agent (add_beam, add_wheel).\n- **Function**: Use to stay within the task mass budget; compare with sandbox.MAX_STRUCTURE_MASS.",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: float. Maximum allowed total mass (kg) for the walker structure. Default 100.0; may vary in mutated stages.",
"SET_FIXED_ROTATION": "### Set Fixed Rotation\n```python\nsandbox.set_fixed_rotation(body, fixed=True)\n```\n- `body`: Box2D body to lock or unlock rotation.\n- `fixed`: If True, the body will not rotate under torques."
},
"K_02": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: Center coordinates (meters) for the beam. Must lie within the build zone (see BUILD_ZONE).\n- `width, height`: Full width and height (meters). **Constraints (enforced by environment)**: 0.05 \u2264 width, height \u2264 3.0 m.\n- `angle`: Initial rotation in radians (default 0).\n- `density`: Material density in kg/m\u00b3 (default 1.0). Mass = area \u00d7 density.\n- **Function**: Creates a dynamic rectangular body for the climber structure. Responds to gravity and collisions.\n- **Returns**: Box2D body object.",
"ADD_PAD": "### Add Pad\n```python\npad = sandbox.add_pad(x, y, radius=0.12, density=0.8)\n```\n- `x, y`: Center position (meters). Place near the wall for adhesion.\n- `radius`: Pad radius in meters. **Constraints (enforced by environment)**: 0.05 \u2264 radius \u2264 0.25 m. Default 0.12.\n- `density`: Material density in kg/m\u00b3 (default 0.8).\n- **Function**: Creates a circular suction/adhesion pad. When active (via set_pad_active), it pulls toward the wall; each pad has an internal max load limit.\n- **Returns**: Box2D body object. Pass this body to set_pad_active in agent_action.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot', lower_limit=None, upper_limit=None)\n```\n- `body_a, body_b`: The two bodies to connect (from add_beam or add_pad). Neither may be None.\n- `anchor_point`: (x, y) world coordinates of the connection point.\n- `type`: `'rigid'` (Weld joint, no relative rotation) or `'pivot'` (Revolute joint, for motor-driven segments).\n- `lower_limit`, `upper_limit`: Optional; angle limits in radians for pivot joints only. If both provided, they are clamped to [-\u03c0, \u03c0]. Omit for free rotation.\n- **Function**: Connects two bodies. Use rigid for fixed links, pivot for the driving joint (then control with set_motor).\n- **Returns**: Box2D joint object (b2RevoluteJoint for pivot, b2WeldJoint for rigid).",
"AGENT_STATE": "### Agent State\n- `build_agent` may return a dictionary containing the primary body, pad bodies, joint references, and controller constants; that same dictionary is passed as `agent_body` to `agent_action`. This keeps controller state separate from the sandbox.",
"SET_PAD_ACTIVE": "### Set Pad Active\n```python\nsandbox.set_pad_active(pad_body, active)\n```\n- `pad_body`: A pad body returned by sandbox.add_pad.\n- `active`: True to enable adhesion (pull toward wall), False to release. Call in agent_action to alternate which pads grip during climbing.",
"SET_MOTOR": "### Set Motor\n```python\nsandbox.set_motor(joint, motor_speed, max_torque=100.0)\n```\n- `joint`: A Revolute joint from add_joint(..., type='pivot').\n- `motor_speed`: Target angular velocity in rad/s (positive = counterclockwise).\n- `max_torque`: Maximum motor torque in N\u00b7m (default 100.0). In mutated stages, joint breakage may occur if reaction forces/torques exceed environment limits.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: Total mass (kg) of all bodies created by the agent (add_beam, add_pad).\n- **Function**: Use to stay within the task mass budget; compare with sandbox.MAX_STRUCTURE_MASS (and sandbox.MIN_STRUCTURE_MASS in mutated stages).",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: float. Maximum allowed total mass (kg) for the climber structure. Default 50.0; may vary in mutated stages. Total from get_structure_mass() must be less than this.",
"MIN_STRUCTURE_MASS": "### Min Structure Mass\n- `sandbox.MIN_STRUCTURE_MASS`: float. Minimum required total mass (kg) in some mutated stages; default 0.0. get_structure_mass() must be \u2265 this when the stage enforces a minimum.",
"BUILD_ZONE": "### Build Zone\n- `sandbox.BUILD_ZONE_X_MIN`, `sandbox.BUILD_ZONE_X_MAX`, `sandbox.BUILD_ZONE_Y_MIN`, `sandbox.BUILD_ZONE_Y_MAX`: floats. All component positions must lie within x in [BUILD_ZONE_X_MIN, BUILD_ZONE_X_MAX] and y in [BUILD_ZONE_Y_MIN, BUILD_ZONE_Y_MAX]. Default x=[0, 5], y=[0, 25]; y_max may vary in mutated stages."
},
"K_03": {
"GET_ANCHOR_FOR_GRIPPER": "### Get Anchor for Gripper\n```python\ngantry = sandbox.get_anchor_for_gripper()\n```\n- **Returns**: The static gantry body (or None if absent). Use as body_a in add_joint with type='rigid' to attach your gripper base so it does not fall; then build slider and fingers from that base.",
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x`, `y`: Center position in meters (m). Must lie within the build zone.\n- `width`, `height`: Full width and height in meters. **Constraint**: 0.05 <= width, height <= 2.0; values are clamped to this range.\n- `angle`: Initial rotation in radians (default 0).\n- `density`: Material density in kg/m\u00b3 (default 1.0). Mass = width * height * density.\n- **Returns**: Box2D dynamic body. Use for base, slider, and finger beams.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid', ...)\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='slider', axis=(0,-1), lower_translation=0, upper_translation=7, enable_motor=True, motor_speed=0, max_motor_force=10000)\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot', enable_motor=True, motor_speed=0, max_motor_torque=5000, lower_limit=None, upper_limit=None)\n```\n- `body_a`, `body_b`: Box2D bodies (e.g. gantry and base, or slider and finger). Cannot be None.\n- `anchor_point`: (x, y) in world coordinates for the joint location.\n- **type='rigid'**: Weld joint; no relative motion. Use to attach base to gantry.\n- **type='slider'**: Prismatic joint; linear motion along axis. Use for vertical lift. Kwargs: `axis=(0,-1)` (positive translation = down), `lower_translation`, `upper_translation` (m), `enable_motor`, `motor_speed` (m/s), `max_motor_force` (N).\n- **type='pivot'**: Revolute joint; rotation. Use for fingers. Kwargs: `enable_motor`, `motor_speed` (rad/s), `max_motor_torque` (N\u00b7m), optional `lower_limit`, `upper_limit` (radians).\n- **Returns**: Joint object. Store the returned slider and finger joints in the dictionary returned by `build_agent` for later motor control.",
"SET_FIXED_ROTATION": "### Set Fixed Rotation\n```python\nsandbox.set_fixed_rotation(body, fixed=True)\n```\n- `body`: Box2D body (e.g. slider) to lock or unlock rotation.\n- `fixed`: True to prevent rotation; False to allow it. Use True for the vertical slider so it only translates.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2, friction=None)\n```\n- `body`: Box2D body (agent-created beam). Apply only to bodies returned by sandbox.add_beam.\n- `restitution`: Bounciness 0.0--1.0 (default 0.2). Lower values reduce bounce.\n- `friction`: Optional. Friction coefficient; if omitted, fixture friction is unchanged. Use higher friction on finger beams to improve grip.",
"JOINTS_LIST": "### Joints List\n- `sandbox.joints`: List of all joints created by the agent. Iterate and filter by `type(j).__name__` (e.g. 'b2PrismaticJoint' for slider, 'b2RevoluteJoint' for pivot) to obtain references for sandbox.set_slider_motor and sandbox.set_motor.",
"AGENT_STATE": "### Agent State\n- `build_agent` may return a dictionary containing the primary body and the slider/finger joints returned by `add_joint`; that same dictionary is passed as `agent_body` to `agent_action`. This keeps controller state separate from the sandbox.",
"SET_SLIDER_MOTOR": "### Set Slider Motor\n```python\nsandbox.set_slider_motor(joint, speed, max_force)\n```\n- `joint`: Prismatic joint returned by `add_joint(..., type='slider')`.\n- `speed`: Target linear velocity in m/s. Positive = extend downward; negative = retract upward.\n- `max_force`: Maximum motor force in Newtons (N).",
"SET_MOTOR": "### Set Motor\n```python\nsandbox.set_motor(joint, motor_speed, max_torque)\n```\n- `joint`: Revolute (pivot) joint from add_joint type='pivot' (e.g. finger joints).\n- `motor_speed`: Target angular velocity in rad/s. Sign determines closing vs opening direction.\n- `max_torque`: Maximum motor torque in N\u00b7m."
},
"K_04": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x, y`: Center position in meters (m).\n- `width, height`: Full dimensions in m. **Constraint**: 0.05 <= width, height <= 3.0.\n- `angle`: Initial rotation in radians (default 0).\n- `density`: Material density in kg/m\u00b3; mass = width * height * density.\n- **Returns**: Box2D body object. Use returned body for add_joint and for control (e.g. body.linearVelocity in agent_action).",
"SET_FIXED_ROTATION": "### Set Fixed Rotation\n```python\nsandbox.set_fixed_rotation(body, fixed: bool)\n```\n- `body`: Box2D body from add_beam or add_wheel.\n- `fixed`: True to lock rotation (e.g. chassis); False to allow rotation.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid'|'pivot', lower_limit=None, upper_limit=None)\n```\n- `body_a, body_b`: Bodies from add_beam or add_wheel.\n- `anchor_point`: (x, y) world coordinates of the joint anchor.\n- `type`: `'rigid'` = weld (no relative rotation); `'pivot'` = revolute (for wheels; use with set_motor).\n- `lower_limit`, `upper_limit`: Optional angle limits in radians for pivot joints; range [-\u03c0, \u03c0].",
"ADD_WHEEL": "### Add Wheel\n```python\nwheel = sandbox.add_wheel(x, y, radius=0.2, density=1.0)\n```\n- `x, y`: Center position in meters.\n- `radius`: Wheel radius in m; **constraint**: 0.05 <= radius <= 0.8.\n- `density`: Material density (default 0.6) in kg/m\u00b3.\n- **Returns**: Circular Box2D body. Attach to chassis with add_joint(..., type='pivot') and drive with set_motor.",
"SET_MOTOR": "### Set Motor\n```python\nsandbox.set_motor(joint, motor_speed, max_torque=100.0)\n```\n- `joint`: Revolute (pivot) joint returned by add_joint(..., type='pivot').\n- `motor_speed`: Target angular velocity in rad/s; positive = counterclockwise.\n- `max_torque`: Maximum motor torque in N\u00b7m (default 100.0).\n- **Function**: Drives a wheel or other pivot joint; call each step in agent_action for continuous motion.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: Total mass (kg) of all bodies created by add_beam and add_wheel.\n- **Use**: Ensure total stays below the task mass budget (e.g. < 40 kg).",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2, friction=None)\n```\n- `body`: Box2D body from add_beam or add_wheel.\n- `restitution`: Bounciness (0.0 = no bounce, 1.0 = elastic).\n- `friction`: Optional surface friction coefficient.",
"BODY_STATE_AND_CONTROL": "### Body State and Control (agent-created bodies only)\n- Bodies returned by add_beam and add_wheel may be read and modified for control in agent_action.\n- **Read**: `body.position`, `body.linearVelocity`, `body.angle`, `body.angularVelocity` (e.g. to check speed or orientation).\n- **Write**: `body.linearVelocity = (vx, vy)` or `body.angularVelocity = omega` to drive the vehicle. Only modify bodies you created; do not modify terrain or the payload object.",
"GET_OBJECT_POSITION": "### Get Object Position\n```python\n(x, y) = sandbox.get_object_position()\n```\n- **Returns**: (x, y) world position of the object to push (payload block). Use in agent_action to avoid running past the object and falling off the platform (e.g. limit pusher velocity when chassis is ahead of object)."
},
"K_05": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x`, `y`: Center position in meters (m). Must lie within the build zone x=[0, 8], y=[1, 12].\n- `width`, `height`: Full width and height in meters. **Constraints (enforced by environment)**: 0.05 <= width, height <= 4.0; values outside this range are clamped.\n- `angle`: Initial rotation in radians (default 0).\n- `density`: Material density in kg/m\u00b3 (default 1.0). Mass = width \u00d7 height \u00d7 density.\n- **Function**: Creates a dynamic rectangular body for the lifter structure. Responds to gravity and collisions.\n- **Returns**: Box2D body object.",
"WELD_TO_GROUND": "### Weld to Ground\n```python\nsandbox.weld_to_ground(body, anchor_point)\n```\n- `body`: Body to fix to the ground (e.g. base beam from add_beam).\n- `anchor_point`: (x, y) world position where the weld is attached. Must be within the build zone.\n- **Function**: Creates a rigid (Weld) connection between the body and the static ground so the body cannot move at that point.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid')\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='pivot', lower_limit=None, upper_limit=None)\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='slider', axis=(0,1), lower_translation=-10.0, upper_translation=10.0)\n```\n- `body_a`, `body_b`: Bodies to connect (from add_beam). `body_a` cannot be None. If `body_b` is None, it defaults to the ground.\n- `anchor_point`: (x, y) world coordinates of the connection point.\n- **type='rigid'**: Weld joint; no relative motion. Use to attach beams rigidly (e.g. platform to walls).\n- **type='pivot'**: Revolute joint; rotation about the anchor. Use for motor-driven scissor joints. Optional `lower_limit`, `upper_limit`: angle limits in radians (clamped to [-\u03c0, \u03c0]). Control with `sandbox.set_motor(joint, motor_speed, max_torque)`.\n- **type='slider'**: Prismatic joint; linear motion. Use for vertical lift. `axis`: (dx, dy) direction (default (0,1) for vertical). `lower_translation`, `upper_translation`: limits in meters. Control with `sandbox.set_slider_motor(joint, motor_speed, max_force)`.\n- **Returns**: Box2D joint object.",
"SET_MOTOR": "### Set Motor\n```python\nsandbox.set_motor(joint, motor_speed, max_torque=100.0)\n```\n- `joint`: A Revolute (pivot) joint from add_joint(..., type='pivot').\n- `motor_speed`: Target angular velocity in rad/s (positive = counterclockwise).\n- `max_torque`: Maximum motor torque in N\u00b7m (default 100.0).\n- **Function**: Drives a pivot joint; use in agent_action to control scissor or rotational parts of the lift.",
"SET_SLIDER_MOTOR": "### Set Slider Motor\n```python\nsandbox.set_slider_motor(joint, motor_speed, max_force=5000.0)\n```\n- `joint`: A Prismatic (slider) joint from add_joint(..., type='slider').\n- `motor_speed`: Target linear velocity in m/s. Sign determines direction along the joint axis.\n- `max_force`: Maximum motor force in Newtons (N) (default 5000.0).\n- **Function**: Drives a slider joint; use in agent_action to extend or retract the lift vertically.",
"SET_FIXED_ROTATION": "### Set Fixed Rotation\n```python\nsandbox.set_fixed_rotation(body, fixed=True)\n```\n- `body`: Box2D body (e.g. platform from add_beam) to lock or unlock rotation.\n- `fixed`: If True, the body will not rotate under torques; use for a horizontal platform that must stay level.",
"AGENT_STATE": "### Agent State\n- `build_agent` may return a dictionary containing the primary body and platform body; that same dictionary is passed as `agent_body` to `agent_action`. This keeps controller state separate from the sandbox.",
"APPLY_FORCE": "### Apply Force\n```python\nsandbox.apply_force(body, (fx, fy))\n```\n- `body`: Target body (e.g. platform from add_beam). Must be an agent-created body.\n- `(fx, fy)`: Force vector in Newtons (world-space). Use to push the platform up or stabilize it.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2, friction=None)\n```\n- `body`: Target Box2D body (agent-created, e.g. from add_beam). Apply only to bodies you created.\n- `restitution`: Bounciness 0.0\u20131.0 (default 0.2).\n- `friction`: Optional friction coefficient; if omitted, only restitution is set. Higher friction helps the payload not slide on the platform.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: Total mass (kg) of all bodies created by the agent (add_beam).\n- **Function**: Use to stay within the task mass budget; compare with sandbox.MAX_STRUCTURE_MASS (60 kg).",
"MAX_STRUCTURE_MASS": "### Max Structure Mass\n- `sandbox.MAX_STRUCTURE_MASS`: float. Maximum allowed total mass (kg) for the lifter structure (default 60.0). get_structure_mass() must return a value less than this."
},
"K_06": {
"ADD_BEAM": "### Add Beam\n```python\nbeam = sandbox.add_beam(x, y, width, height, angle=0, density=1.0)\n```\n- `x`, `y`: Center position in meters. Must lie within build zone x=[0, 12], y=[2, 10].\n- `width`, `height`: Size in meters. **Constraints (enforced)**: 0.05 <= width, height <= 2.0; values outside are clamped.\n- `angle`: Initial rotation in radians (default 0).\n- `density`: Material density in kg/m\u00b3 (default 1.0). Mass = width \u00d7 height \u00d7 density.\n- **Returns**: Box2D body object (agent-created). You may read body.position.x, body.position.y, and body.angle.",
"SET_MATERIAL_PROPERTIES": "### Set Material Properties\n```python\nsandbox.set_material_properties(body, restitution=0.2, friction=None)\n```\n- `body`: Box2D body from sandbox.add_beam. Apply only to agent-created bodies.\n- `restitution`: Bounciness 0.0\u20131.0 (default 0.2). Use 0.0 for non-bouncing wiper contact.\n- `friction`: Optional friction coefficient; if omitted, only restitution is set. Higher friction improves particle pushing.",
"ADD_JOINT": "### Add Joint\n```python\njoint = sandbox.add_joint(body_a, body_b, anchor_point, type='rigid'|'pivot', lower_limit=None, upper_limit=None)\n```\n- `body_a`, `body_b`: Bodies from sandbox.add_beam; neither may be None.\n- `anchor_point`: (x, y) world coordinates of the joint anchor.\n- `type='rigid'`: Weld (no relative rotation). Use to link beams into a rigid segment.\n- `type='pivot'`: Revolute joint; use for motor-driven joints. Drive with sandbox.set_motor in agent_action.\n- `lower_limit`, `upper_limit`: Angle limits in radians for pivot joints (optional); range [-\u03c0, \u03c0].\n- **Returns**: Joint object. Store returned motor joints in the dictionary returned by `build_agent` for later motor control.",
"WELD_TO_GLASS": "### Weld to Glass\n```python\nsandbox.weld_to_glass(body, anchor_point)\n```\n- `body`: Agent-created body (e.g. base from add_beam) to fix to the glass.\n- `anchor_point`: (x, y) on the glass surface (e.g. (6.0, 2.0) for center at glass y=2.0m).\n- **Function**: Anchors the body to the static glass so the wiper base does not move.",
"AGENT_STATE": "### Agent State\n- `build_agent` may return a dictionary containing the primary body and pivot-joint references; that same dictionary is passed as `agent_body` to `agent_action`. This keeps controller state separate from the sandbox.",
"GET_STRUCTURE_MASS": "### Get Structure Mass\n```python\ntotal_mass = sandbox.get_structure_mass()\n```\n- **Returns**: Total mass (kg) of all bodies created by add_beam.\n- **Use**: Ensure total stays below the task mass budget (see prompt; sandbox.MAX_STRUCTURE_MASS may apply).",
"BODIES_LIST": "### Bodies List\n- `sandbox.bodies`: List of all bodies created by the agent (add_beam). Iterate to pass each body to sandbox.set_awake(body, True). Each element is a Box2D body with **read-only** state: body.position.x, body.position.y, body.angle (e.g. for computing joint anchors).",
"BODY_STATE_READ": "### Body State (read-only)\n- Bodies returned by sandbox.add_beam support **read-only** attributes: body.position (body.position.x, body.position.y), body.angle. Use for computing anchor positions (e.g. joint at (x, body.position.y - 1.0)). Do not assign to these.",
"SET_AWAKE": "### Set Awake\n```python\nsandbox.set_awake(body, True)\n```\n- `body`: A body from sandbox.bodies. Keeps the body active in the physics simulation.",
"SET_MOTOR": "### Set Motor\n```python\nsandbox.set_motor(joint, motor_speed, max_torque=100.0)\n```\n- Or keyword: sandbox.set_motor(joint, motor_speed=speed, max_torque=torque).\n- `joint`: Pivot (revolute) joint from add_joint(..., type='pivot').\n- `motor_speed`: Target angular velocity in rad/s; sign sets direction.\n- `max_torque`: Maximum motor torque in N\u00b7m. In some environments this may be capped by the sandbox; use in agent_action each step for continuous motion."
}
}