class_docstr: HalfCheetah Environment with two diff tasks, moving forwards or backwards
  
  Direction is defined as a scalar: +1.0 (forwards) or -1.0 (backwards)
class_docstr_tok: ["HalfCheetah","Environment","with","two","diff","tasks",",","moving","forwards","or","backwards","Direction","is","defined","as","a","scalar",":","+1.0","(","forwards",")","or","-1.0","(","backwards",")"]
code: def step(self, action):
      xposbefore = self.sim.data.qpos[0]
      self.do_simulation(action, self.frame_skip)
      xposafter = self.sim.data.qpos[0]
      ob = self._get_obs()
      reward_ctrl = -0.5 * 0.1 * np.square(action).sum()
      reward_run = (
          self.goal_direction * (xposafter - xposbefore) / self.dt
      )
      reward = reward_ctrl + reward_run
      done = False
      return (
          ob,
          reward,
          done,
          dict(reward_run=reward_run, reward_ctrl=reward_ctrl),
      )
  
file_path: ray/python/ray/rllib/examples/env/halfcheetah_rand_direc.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 HalfCheetahRandDirecEnv obj's underlying member method code with example usage: obj.step(action) and returns: ob,  reward,  done,  dict