code: def _oneInteraction(self):
          
          if self.doOptimization:
              raise Exception('When using a black-box learning algorithm, only full episodes can be done.')
          else:
              self.stepid += 1
              self.agent.integrateObservation(self.task.getObservation())
              self.task.performAction(self.agent.getAction())
  
              # Save the cumulative sum of set-points for each period.
              for i, g in enumerate(self.task.env.case.online_generators):
                  self.Pg[i, self.stepid - 1] = self.Pg[i, self.stepid - 1] + g.p
  
              reward = self.task.getReward()
              self.agent.giveReward(reward)
              return reward
docs: Does one interaction between the task and the agent.