SampledSelectionConfigurationMixin#

class pybrops.breed.prot.sel.cfg.SampledSelectionConfigurationMixin.SampledSelectionConfigurationMixin[source]#

Bases: object

A mixin class to provide functionality for selection configurations which require random samples to be drawn.

Methods

sample_xconfig

Sample a cross configuration from the decision vector and set it as the xconfig value.

Attributes

rng

A random number source.

xconfig_decn

Decision vector for calculating the cross configuration matrix.

property rng: Generator | RandomState#

A random number source.

abstract sample_xconfig(return_xconfig)[source]#

Sample a cross configuration from the decision vector and set it as the xconfig value.

Parameters:

return_xconfig (bool) – Whether to return the sampled xconfig matrix.

Returns:

out – The sampled xconfig matrix if return_xconfig is true, otherwise return nothing.

Return type:

numpy.ndarray, None

property xconfig_decn: ndarray#

Decision vector for calculating the cross configuration matrix.