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|SexSplit]) – Required number of individuals per genotype. Each value is either an int (where male / female isn’t requested), or a SexSplit of (n_males, n_females).line_stats (
LineStatistics) – Statistics from historical data for the linedefault_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 its measured proportion of each genotype / of males from line_stats. If not met, the mendelian ratio is used for all genotype proportions, and the proportion of males is set as the average across the whole line or, if the line also doesn’t meet min_n_offspring, as 0.5.
- 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]