code: def _unitary_actions_simulate(self):
      self.simulate_times += 1
      best_action = None
  
      (
          obs_simulate,
          reward_simulate,
          done_simulate,
          info_simulate,
      ) = self.observation.simulate(self.do_nothing_action)
      self.observation._obs_env._reset_to_orig_state()
  
      least_overflow = 2.0
      if obs_simulate is not None and not any(
          np.isnan(obs_simulate.rho)
      ):
          least_overflow = float(np.max(obs_simulate.rho))
  
      predicted_rho = self._predict_unitary_action_rho(self.observation)
      sorted_idx = np.argsort(predicted_rho).tolist()
      top_idx = sorted_idx[:350]
      top_idx.sort()
  
      for idx in top_idx:
          action = self.unitary_actions[idx]
          sub_id = self.action_to_sub_id[idx]
          if sub_id != "redispatch":  # topology change action
              if self.observation.time_before_cooldown_sub[sub_id] != 0:
                  continue
  
              legal_action_vec = deepcopy(action.to_vect())
  
              sub_topo = self.sub_toop_dict[sub_id]
              if np.any(sub_topo == -1):  # line disconnected
                  start, end = self.action_to_sub_topo[sub_id]
  
                  action_topo = legal_action_vec[start:end].astype(
                      "int"
                  )  # reference
                  action_topo[
                      np.where(sub_topo == -1)[0]
                  ] = 0  # done't change bus=-1
  
                  legal_action_vec[start:end] = action_topo
  
              legal_action = self.action_space.from_vect(
                  legal_action_vec
              )
  
          else:
              legal_action = action
  
          (
              obs_simulate,
              reward_simulate,
              done_simulate,
              info_simulate,
          ) = self.observation.simulate(legal_action)
          self.observation._obs_env._reset_to_orig_state()
  
          assert (
              not info_simulate["is_illegal"]
              and not info_simulate["is_ambiguous"]
          )
  
          if obs_simulate is not None and not any(
              np.isnan(obs_simulate.rho)
          ):
              if not done_simulate:
                  overflow_value = float(np.max(obs_simulate.rho))
                  if overflow_value < least_overflow:
                      least_overflow = overflow_value
                      best_action = legal_action
  
      return best_action
  
imports: import torch
  import numpy
  import pickle
  import os
  from grid2op.Agent import BaseAgent
  from copy import deepcopy
  from powernet_model import CombinedActionModel, UnitaryActionModel
  from utils import FeatureProcessor, UnitaryFeatureProcessor
label_desc: Use image node_id 11 for calling the RLAgent obj's underlying member method code with example usage: obj._unitary_actions_simulate() and returns: best_action