class_docstr: Ant Environment that randomizes goals as tasks
  
  Goals are randomly sampled 2D positions
class_docstr_tok: ["Ant","Environment","that","randomizes","goals","as","tasks","Goals","are","randomly","sampled","2D","positions"]
code: def step(self, a):
      self.do_simulation(a, self.frame_skip)
      xposafter = self.get_body_com("torso")
      goal_reward = -np.sum(
          np.abs(xposafter[:2] - self.goal_pos)
      )  # make it happy, not suicidal
      ctrl_cost = 0.1 * np.square(a).sum()
      contact_cost = (
          0.5
          * 1e-3
          * np.sum(np.square(np.clip(self.sim.data.cfrc_ext, -1, 1)))
      )
      # survive_reward = 1.0
      survive_reward = 0.0
      reward = goal_reward - ctrl_cost - contact_cost + survive_reward
      # notdone = np.isfinite(state).all() and 1.0 >= state[2] >= 0.
      # done = not notdone
      done = False
      ob = self._get_obs()
      return (
          ob,
          reward,
          done,
          dict(
              reward_forward=goal_reward,
              reward_ctrl=-ctrl_cost,
              reward_contact=-contact_cost,
              reward_survive=survive_reward,
          ),
      )
  
file_path: ray/python/ray/rllib/examples/env/ant_rand_goal.py
imports: from gymnasium.envs.mujoco.mujoco_env import MujocoEnv
  from gymnasium.utils import EzPickle
  import numpy
  from ray.rllib.env.apis.task_settable_env import TaskSettableEnv
label_desc: Use image node_id 5 for calling the AntRandGoalEnv obj's underlying member method code with example usage: obj.step(a) and returns: ob,  reward,  done,  dict