code: def add_reward(self, reward):
      if len(self.buffer) < self.buffer_max_length:
          self.buffer.append(reward)
      else:
          self.buffer = self.buffer[1:] + [reward]
  
file_path: ray/rllib_contrib/alpha_zero/src/rllib_alpha_zero/alpha_zero/ranked_rewards.py
imports: from copy import deepcopy
  import numpy
label_desc: Use image node_id 2 for calling the RankedRewardsBuffer obj's underlying member method code with example usage: obj.add_reward(reward) without return types