code: def addReward(self, r=None):
          
          r = self.getReward() if r is None else r
  
          # by default, the cumulative reward is just the sum over the episode
          if self.discount:
              self.cumulativeReward += power(self.discount, self.samples) * r
          else:
              self.cumulativeReward += r
docs: A filtered mapping towards performAction of the underlying
              environment.