class_docstr: Wrapper for gym CartPole environment where reward is accumulated to the end.
class_docstr_tok: ["Wrapper","for","gym","CartPole","environment","where","reward","is","accumulated","to","the","end","."]
code: def __init__(self, config=None):
      self.env = gym.make("CartPole-v1")
      self.action_space = Discrete(2)
      self.observation_space = Dict(
          {
              "obs": self.env.observation_space,
              "action_mask": Box(
                  low=0,
                  high=1,
                  shape=(self.action_space.n,),
                  dtype=np.int8,
              ),
          }
      )
      self.running_reward = 0
  
file_path: ray/rllib/examples/env/cartpole_sparse_rewards.py
imports: from copy import deepcopy
  import gymnasium
  import numpy
  from gymnasium.spaces import Box, Dict, Discrete
label_desc: Use image node_id 1 to create a new CartPoleSparseRewards object from inherited base classes: gym with example: obj = CartPoleSparseRewards(config)