class_docstr: A CEM class, inherited from Optimizer.
  
  This is the designed class to define CEM-related
  variables and methods.
  
  References:
      R. Y. Rubinstein. Optimization of Computer simulation Models with Rare Events.
      European Journal of Operations Research (1997).
docstr: Wraps Cross-Entropy Method 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.
docstr_tok: ["Wraps","Cross-Entropy","Method","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","."]
code: def update(self, space: Space, function: Function) -> None:
      """Wraps Cross-Entropy Method 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.
  
      """
  
      self._create_new_samples(space.agents, function)
  
      space.agents.sort(key=lambda x: x.fit)
  
      update_position = np.array(
          [agent.position for agent in space.agents[: self.n_updates]]
      )
  
      self.mean = self._update_mean(update_position)
      self.std = self._update_std(update_position)
  
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 14 for calling the CEM obj's underlying member method code with example usage: obj.update(space, function) without return types