outcross_shuffle#

pybrops.core.random.sampling.outcross_shuffle(xconfig, rng=None)[source]#

Shuffle individuals between crosses to ensure that matings are (at least locally) maximally outcrossing. This function uses a stochastic descent hillclimber to alternate individuals between cross configurations to maximize the outcrossing (minimize identical individuals within a single cross configuration).

Parameters:
  • xconfig (numpy.ndarray) – Array of shape (ncross, nparent) containing indices of individuals to shuffle.

  • rng (numpy.random.Generator, numpy.random.RandomState, None) – A random number generator source. If None, then use the default global random number generator.

Return type:

None