code: def performAction(self, action):
          gs = [g for g in self.case.online_generators if g.bus.type !=REFERENCE]
          assert len(action) == len(gs)
          logger.info("Action: %s" % list(action))
          for i, g in enumerate(gs):
              g.p = action[i]
          NewtonPF(self.case, verbose=False).solve()
          self._Pg[:, self._step] = [g.p for g in self.case.online_generators]
          if self._step != len(self.profile) - 1:
              pq_buses = [b for b in self.case.buses if b.type == PQ]
              for i, b in enumerate(pq_buses):
                  b.p_demand = self._Pd0[i] * self.profile[self._step + 1]
          self._step += 1
          logger.info("Entering step %d." % self._step)