RecurrentSelectionBreedingProgram#

class pybrops.breed.arch.RecurrentSelectionBreedingProgram.RecurrentSelectionBreedingProgram(initop, pselop, mateop, evalop, sselop, t_max, start_genome=None, start_geno=None, start_pheno=None, start_bval=None, start_gmod=None, **kwargs)[source]#

Bases: BreedingProgram

Class implementing recurrent selection. This class is very generic and highly modular to facilitate rapid prototyping.

Constructor for the concrete class RecurrentSelectionBreedingProgram.

This class simulates a recurrent selection breeding program.

Parameters:

Methods

advance

Advance the breeding program by a specified number of generations.

evolve

Evolve the breeding program for a set number of replications and generations.

initialize

Initialize the breeding program with genotypes, phenotypes, and genomic models.

is_initialized

Return whether or not the BreedingProgram has been initialized with a starting set of conditions.

reset

Reset the evolution of the breeding program back to starting conditions.

Attributes

bval

Breeding values for individuals in the breeding program.

evalop

Evaluation operator.

geno

Genotypes for individuals in the breeding program.

genome

Genomes for individuals in the breeding program.

gmod

Genomic models for individuals in the breeding program.

initop

Initialization operator.

mateop

Mating operator.

pheno

Phenotypes for individuals in the breeding program.

pselop

Parent selection operator.

sselop

Survivor selection operator.

start_bval

Starting breeding values for individuals in the breeding program.

start_geno

Starting genotypes for individuals in the breeding program.

start_genome

Starting genomes for individuals in the breeding program.

start_gmod

Starting genomic models for individuals in the breeding program.

start_pheno

Starting phenotypes for individuals in the breeding program.

t_cur

Current time of the BreedingNode.

t_max

Maximum time of the BreedingNode.

advance(ngen, lbook, verbose=False, **kwargs)[source]#

Advance the breeding program by a specified number of generations.

Parameters:
  • ngen (int) – Number of generations to advance the BreedingProgram.

  • lbook (Logbook) – Logbook into which to write statistics.

  • kwargs (dict) – Additional keyword arguments.

property bval: object#

Breeding values for individuals in the breeding program.

property evalop: EvaluationOperator#

Evaluation operator.

evolve(nrep, ngen, lbook, loginit=True, verbose=False, **kwargs)[source]#

Evolve the breeding program for a set number of replications and generations. The BreedingProgram is restarted using the starting geno, bval, gmod containers.

Parameters:
  • nrep (int) – Number of evolution replicates.

  • ngen (int, None) – Number of generations to evolve the population for each replicate. If None, use ‘t_max’. Note: if specified this does not modify ‘t_max’ which may affect operators that utilize ‘t_max’.

  • lbook (Logbook) – Logbook into which to write statistics.

  • loginit (bool) – Whether to log the initial state before main loop.

  • verbose (bool) – Whether to print the rep number.

property geno: object#

Genotypes for individuals in the breeding program.

property genome: object#

Genomes for individuals in the breeding program.

property gmod: object#

Genomic models for individuals in the breeding program.

initialize(**kwargs)[source]#

Initialize the breeding program with genotypes, phenotypes, and genomic models.

property initop: InitializationOperator#

Initialization operator.

is_initialized(**kwargs)[source]#

Return whether or not the BreedingProgram has been initialized with a starting set of conditions.

Parameters:

kwargs (dict) – Additional keyword arguments.

Returns:

out – True if the BreedingProgram has been initialized. False if the BreedingProgram has not been initialized.

Return type:

boolean

property mateop: MatingOperator#

Mating operator.

property pheno: object#

Phenotypes for individuals in the breeding program.

property pselop: ParentSelectionOperator#

Parent selection operator.

reset(**kwargs)[source]#

Reset the evolution of the breeding program back to starting conditions.

Parameters:

kwargs (dict) – Additional keyword arguments.

property sselop: SurvivorSelectionOperator#

Survivor selection operator.

property start_bval: dict | None#

Starting breeding values for individuals in the breeding program.

property start_geno: dict | None#

Starting genotypes for individuals in the breeding program.

property start_genome: dict | None#

Starting genomes for individuals in the breeding program.

property start_gmod: dict | None#

Starting genomic models for individuals in the breeding program.

property start_pheno: dict | None#

Starting phenotypes for individuals in the breeding program.

property t_cur: int#

Current time of the BreedingNode.

property t_max: int#

Maximum time of the BreedingNode.