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: Move prides to safe locations (s. 2.2.3).
  
  Args:
      prides: List of prides holding their corresponding lions.
code: def _moving_safe_place(self, prides: List[Lion]) -> None:
      """Move prides to safe locations (s. 2.2.3).
  
      Args:
          prides: List of prides holding their corresponding lions.
  
      """
  
      for pride in prides:
          # Calculates the number of improved lions (eq. 7)
          n_improved = np.sum(
              [1 for agent in pride if agent.fit < agent.p_fit]
          )
  
          # Calculates the fitness of lions (eq. 8)
          fitnesses = [agent.fit for agent in pride]
  
          # Calculates the size of tournament (eq. 9)
          tournament_size = np.maximum(2, int(np.ceil(n_improved / 2)))
  
          for agent in pride:
              if agent.group == 0 and agent.female:
                  w = g.tournament_selection(
                      fitnesses, 1, tournament_size
                  )[0]
  
                  distance = g.euclidean_distance(
                      agent.position, pride[w].position
                  )
  
                  rand = r.generate_uniform_random_number()
                  u = r.generate_uniform_random_number(-1, 1)
                  theta = r.generate_uniform_random_number(
                      -np.pi / 6, np.pi / 6
                  )
  
                  R1 = pride[w].position - agent.position
                  R2 = np.random.randn(*R1.T.shape)
                  R2 = R2.T - R2.dot(R1) * R1 / (
                      np.linalg.norm(R1) ** 2 + c.EPSILON
                  )
  
                  # Updates agent's position (eq. 6)
                  agent.position += (
                      2 * distance * rand * R1
                      + u * np.tan(theta) * distance * R2
                  )
  
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 20 for calling the LOA obj's underlying member method code with example usage: obj._moving_safe_place(prides) without return types