class_docstr: A WWO class, inherited from Optimizer.
  
  This is the designed class to define WWO-related
  variables and methods.
  
  References:
      Y.-J. Zheng. Water wave optimization: A new nature-inspired metaheuristic.
      Computers & Operations Research (2015).
docstr: Refract wave into a new position (eq. 8-9).
  
  Args:
      agent: Agent to be refracted.
      best_agent: Global best agent.
      function: A function object.
      index: Index of wave length.
  
  Returns:
      (Tuple[float, float]): New height and length values.
docstr_tok: ["Refract","wave","into","a","new","position","(","eq",".","8-9",")",".","Args",":","agent",":","Agent","to","be","refracted",".","best_agent",":","Global","best","agent",".","function",":","A","function","object",".","index",":","Index","of","wave","length",".","Returns",":","(","Tuple","[","float",",","float","]",")",":","New","height","and","length","values","."]
code: def _refract_wave(
      self,
      agent: Agent,
      best_agent: Agent,
      function: Function,
      index: int,
  ) -> Tuple[float, float]:
      """Refract wave into a new position (eq. 8-9).
  
      Args:
          agent: Agent to be refracted.
          best_agent: Global best agent.
          function: A function object.
          index: Index of wave length.
  
      Returns:
          (Tuple[float, float]): New height and length values.
  
      """
  
      current_fit = agent.fit
  
      for j in range(agent.n_variables):
          mean = (best_agent.position[j] + agent.position[j]) / 2
          std = np.fabs(best_agent.position[j] - agent.position[j]) / 2
  
          # Generates a new position (eq. 8)
          agent.position[j] = r.generate_gaussian_random_number(
              mean, std
          )
      agent.clip_by_bound()
  
      agent.fit = function(agent.position)
  
      # Re-calculates the new length (eq. 9)
      # Updates the new height to maximum height value
      new_height = self.h_max
      new_length = self.length[index] * (
          current_fit / (agent.fit + c.EPSILON)
      )
  
      return new_height, new_length
  
imports: import copy
  from typing import Any, Dict, List, Optional, Tuple
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.constant
  import opytimizer.utils.exception
  from opytimizer.core import Optimizer
  from opytimizer.core.agent import Agent
  from opytimizer.core.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 16 for calling the WWO obj's underlying member method code with example usage: obj._refract_wave(agent, best_agent, function, index) and returns: new_height,  new_length