class_docstr: A WCA class, inherited from Optimizer.
  
  This is the designed class to define WCA-related
  variables and methods.
  
  References:
      H. Eskandar.
      Water cycle algorithm – A novel metaheuristic optimization method for
      solving constrained engineering optimization problems.
      Computers & Structures (2012).
class_docstr_tok: ["A","WCA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","WCA-related","variables","and","methods",".","References",":","H.","Eskandar",".","Water","cycle","algorithm","\u2013","A","novel","metaheuristic","optimization","method","for","solving","constrained","engineering","optimization","problems",".","Computers","&","Structures","(","2012",")","."]
docstr: Wraps Water Cycle Algorithm over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
      function: A Function object that will be used as the objective function.
      n_iterations: Maximum number of iterations.
docstr_tok: ["Wraps","Water","Cycle","Algorithm","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information",".","function",":","A","Function","object","that","will","be","used","as","the","objective","function",".","n_iterations",":","Maximum","number","of","iterations","."]
code: def update(
      self, space: Space, function: Function, n_iterations: int
  ) -> None:
      """Wraps Water Cycle Algorithm over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
          function: A Function object that will be used as the objective function.
          n_iterations: Maximum number of iterations.
  
      """
  
      self._flow_intensity(space.agents)
      self._update_stream(space.agents, function)
      self._update_river(space.agents, space.best_agent, function)
  
      for i in range(1, self.nsr):
          for j in range(self.nsr, len(space.agents)):
              if space.agents[j].fit < space.agents[i].fit:
                  space.agents[i], space.agents[j] = (
                      space.agents[j],
                      space.agents[i],
                  )
  
      for i in range(1, self.nsr):
          if space.agents[i].fit < space.agents[0].fit:
              space.agents[i], space.agents[0] = (
                  space.agents[0],
                  space.agents[i],
              )
  
      # Performs the raining process (eq. 12)
      self._raining_process(space.agents, space.best_agent)
  
      self.d_max -= self.d_max / n_iterations
  
imports: from typing import Any, Dict, List, Optional
  import numpy
  import opytimizer.math.random
  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 13 for calling the WCA obj's underlying member method code with example usage: obj.update(space, function, n_iterations) without return types