class_docstr: A SA class, inherited from Optimizer.
  
  This is the designed class to define SA-related
  variables and methods.
  
  References:
      A. Khachaturyan, S. Semenovsovskaya and B. Vainshtein.
      The thermodynamic approach to the structure analysis of crystals.
      Acta Crystallographica (1981).
class_docstr_tok: ["A","SA","class",",","inherited","from","Optimizer",".","This","is","the","designed","class","to","define","SA-related","variables","and","methods",".","References",":","A.","Khachaturyan",",","S.","Semenovsovskaya","and","B.","Vainshtein",".","The","thermodynamic","approach","to","the","structure","analysis","of","crystals",".","Acta","Crystallographica","(","1981",")","."]
docstr: Wraps Simulated Annealing over all agents and variables.
  
  Args:
      space: Space containing agents and update-related information.
      function: A function object.
docstr_tok: ["Wraps","Simulated","Annealing","over","all","agents","and","variables",".","Args",":","space",":","Space","containing","agents","and","update-related","information",".","function",":","A","function","object","."]
code: def update(self, space: Space, function: Function) -> None:
      """Wraps Simulated Annealing over all agents and variables.
  
      Args:
          space: Space containing agents and update-related information.
          function: A function object.
  
      """
  
      for agent in space.agents:
          a = copy.deepcopy(agent)
  
          noise = r.generate_gaussian_random_number(
              0, 0.1, size=((agent.n_variables, agent.n_dimensions))
          )
  
          a.position += noise
          a.clip_by_bound()
  
          r1 = r.generate_uniform_random_number()
          a.fit = function(a.position)
          if a.fit < agent.fit:
              agent.position = copy.deepcopy(a.position)
              agent.fit = copy.deepcopy(a.fit)
          elif r1 < np.exp(-(a.fit - agent.fit) / self.T):
              agent.position = copy.deepcopy(a.position)
              agent.fit = copy.deepcopy(a.fit)
  
      self.T *= self.beta
  
file_path: opytimizer/opytimizer/optimizers/science/sa.py
imports: import copy
  from typing import Any, Dict, Optional
  import numpy
  import opytimizer.math.random
  import opytimizer.utils.exception
  from opytimizer.core import Optimizer
  from opytimizer.core.function import Function
  from opytimizer.core.space import Space
  from opytimizer.utils import logging
label_desc: Use image node_id 6 for calling the SA obj's underlying member method code with example usage: obj.update(space, function) without return types