trans_inbmax_penalty#

pybrops.breed.prot.sel.transfn.trans_inbmax_penalty(mat, inbmax, penalty_wt, **kwargs)[source]#

Transform a numpy.ndarray by applying a penalty for solutions exceeding a provided maximum inbreeding level. The penalty is of the form:

f*(x) = f(x) + w*max(0,(inb-inbmax)/abs(inbmax))

Parameters:
  • mat (numpy.ndarray) – A (1+d,) array to transform. The first element in this array must be the inbreeding level. Where d is the number of objectives.

  • inbmax (Real) – A maximum inbreeding level which must not be exceeded.

  • penalty_wt (Real) – A penalty multiplier.

Returns:

out – A (d,) array with a penalty applied if applicable.

Return type:

numpy.ndarray