(self, img, action, reward, terminal)
Add a time step record.

    Arguments:
      img -- observed image
      action -- action chosen by the agent
      reward -- reward received after taking the action
      terminal -- boolean indicating whether the episode ended
      after this time step
Add a time step record.
Add a time step record .
def add_sample(self, img, action, reward, terminal):
    """Add a time step record.

    Arguments:
      img -- observed image
      action -- action chosen by the agent
      reward -- reward received after taking the action
      terminal -- boolean indicating whether the episode ended
      after this time step
    """
    self.imgs[self.top] = img
    self.actions[self.top] = action
    self.rewards[self.top] = reward
    self.terminal[self.top] = terminal

    if self.size == self.max_steps:
      self.bottom = (self.bottom + 1) % self.max_steps
    else:
      self.size += 1
    self.top = (self.top + 1) % self.max_steps
def add_sample ( self , img , action , reward , terminal ) : self . imgs [ self . top ] = img self . actions [ self . top ] = action self . rewards [ self . top ] = reward self . terminal [ self . top ] = terminal if self . size == self . max_steps : self . bottom = ( self . bottom + 1 ) % self . max_steps else : self . size += 1 self . top = ( self . top + 1 ) % self . max_steps