class_docstr: Example of a custom env in which you have to walk down a corridor.
  
  You can configure the length of the corridor via the env config.
class_docstr_tok: ["Example","of","a","custom","env","in","which","you","have","to","walk","down","a","corridor",".","You","can","configure","the","length","of","the","corridor","via","the","env","config","."]
code: def step(self, action):
      assert action in [0, 1], action
      if action == 0 and self.cur_pos > 0:
          self.cur_pos -= 1
      elif action == 1:
          self.cur_pos += 1
      done = truncated = self.cur_pos >= self.end_pos
      # Produce a random reward when we reach the goal.
      return (
          [self.cur_pos],
          random.random() * 2 if done else -0.1,
          done,
          truncated,
          {},
      )
  
file_path: ray/rllib/examples/custom_env.py
imports: import argparse
  import gymnasium
  from gymnasium.spaces import Discrete, Box
  import numpy
  import os
  import random
  import ray
  from ray import air, tune
  from ray.rllib.env.env_context import EnvContext
  from ray.rllib.utils.framework import try_import_tf, try_import_torch
  from ray.rllib.utils.test_utils import check_learning_achieved
  from ray.tune.logger import pretty_print
  from ray.tune.registry import get_trainable_cls
label_desc: Use image node_id 3 for calling the SimpleCorridor obj's underlying member method code with example usage: obj.step(action) and returns: list,  unknown,  done,  truncated,  dict