class_docstr: Class defining mutations, and holding a random state used for random generation.
class_docstr_tok: ["Class","defining","mutations",",","and","holding","a","random","state","used","for","random","generation","."]
docstr: This is the most classical discrete 1+1 mutation of the evolution literature.
docstr_tok: ["This","is","the","most","classical","discrete","1+1","mutation","of","the","evolution","literature","."]
code: def discrete_mutation(
      self, parent: tp.ArrayLike, arity: int = 2
  ) -> tp.ArrayLike:
      """This is the most classical discrete 1+1 mutation of the evolution literature."""
      dimension = len(parent)
      boolean_vector = np.ones(dimension, dtype=bool)
      while all(boolean_vector):
          boolean_vector = self.random_state.rand(dimension) > (
              1.0 / dimension
          )
      return [
          s if b else self.significantly_mutate(s, arity)
          for (b, s) in zip(boolean_vector, parent)
      ]
  
file_path: nevergrad/nevergrad/optimization/mutations.py
imports: import numpy
  import nevergrad.common.typing
  from nevergrad.parametrization import discretization
  from .None import utils
label_desc: Use image node_id 8 for calling the Mutator obj's underlying member method code with example usage: obj.discrete_mutation(parent, arity) and returns: unknown