oscar_colony.optimise.optimal_scheme_calculator.calculate_optimal_scheme#

oscar_colony.optimise.optimal_scheme_calculator.calculate_optimal_scheme(required_n_per_genotype, line_stats, default_litter_size, min_n_matings=3, min_n_offspring=10)[source]#

Calculate the optimal combination of breeding schemes to produce the required_n_per_genotype.

Parameters:
  • required_n_per_genotype (dict[tuple[Genotype, ...], int]) – Required number of individuals per genotype

  • line_stats (LineStatistics) – Statistics from historical data for the line

  • default_litter_size (int) – The default value used for average litter size if there isn’t enough historical data for the line. This should usually be set to the average litter size across all available data for all lines.

  • min_n_matings (int) – Minimum number of successful matings required to use the measured litter size from line_stats. If there aren’t enough matings for a specific breeding scheme, the average of the whole line will be used instead. If the whole line also doesn’t have enough matings, then default_litter_size is used.

  • min_n_offspring (int) – Minimum number of offspring required from a breeding scheme to use the measured proportion of each genotype from line_stats. If not met, the theoretical mendelian ratio will be used instead.

Returns:

Returns 2 items:
  • optimal number of matings per breeding scheme

  • a summary of the surplus numbers for this optimal scheme combination

Return type:

tuple[dict[BreedingScheme, int], SurplusSummary]