class_docstr: An LOA class, inherited from Optimizer.
  
  This is the designed class to define LOA-related
  variables and methods.
  
  References:
      M. Yazdani and F. Jolai. Lion Optimization Algorithm (LOA): A nature-inspired metaheuristic algorithm.
      Journal of Computational Design and Engineering (2016).
class_docstr_tok: ["An","LOA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","LOA-related","variables","and","methods",".","References",":","M.","Yazdani","and","F.","Jolai",".","Lion","Optimization","Algorithm","(","LOA",")",":","A","nature-inspired","metaheuristic","algorithm",".","Journal","of","Computational","Design","and","Engineering","(","2016",")","."]
docstr: Performs the population's equilibrium procedure (s. 2.2.8).
  
  Args:
      nomads: Nomad lions.
      prides: List of prides holding their corresponding lions.
  
  Returns:
      (Tuple[List[Lion], List[List[Lion]]]): Both updated nomad and pride lions.
code: def _equilibrium(
      self,
      nomads: List[Lion],
      prides: List[List[Lion]],
      n_agents: List[Agent],
  ) -> Tuple[List[Lion], List[List[Lion]]]:
      """Performs the population's equilibrium procedure (s. 2.2.8).
  
      Args:
          nomads: Nomad lions.
          prides: List of prides holding their corresponding lions.
  
      Returns:
          (Tuple[List[Lion], List[List[Lion]]]): Both updated nomad and pride lions.
  
      """
  
      nomad_female = [agent for agent in nomads if agent.female]
      nomad_male = [agent for agent in nomads if not agent.female]
  
      nomad_female.sort(key=lambda x: x.fit)
      nomad_male.sort(key=lambda x: x.fit)
  
      correct_pride_size = int((1 - self.N) * n_agents / self.P)
  
      for i in range(self.P):
          while len(prides[i]) > correct_pride_size:
              del prides[i][-1]
  
          while len(prides[i]) < correct_pride_size:
              nomad_female[0].pride = i
              nomad_female[0].nomad = False
  
              prides[i].append(copy.deepcopy(nomad_female[0]))
  
              del nomad_female[0]
  
      nomads = nomad_female + nomad_male
      nomads.sort(key=lambda x: x.fit)
  
      return nomads, prides
  
imports: import copy
  import itertools
  from typing import Any, Dict, List, Optional, Tuple, Union
  import numpy
  import opytimizer.math.distribution
  import opytimizer.math.general
  import opytimizer.math.random
  import opytimizer.utils.constant
  import opytimizer.utils.exception
  from opytimizer.core import Agent, Optimizer
  from opytimizer.core.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 29 for calling the LOA obj's underlying member method code with example usage: obj._equilibrium(nomads, prides, n_agents) and returns: nomads,  prides