source

quick_haplo

 quick_haplo (key:<function PRNGKey>, n_ind:int, n_chr:int,
              n_loci_per_chr:int, max_pop_size:int, ploidy:int=2,
              inbred:bool=False, chr_len_cm:float=100.0)

*Creates a new, padded founder population with random haplotypes.

This function is designed to be run once at the beginning of a simulation on the host to generate the initial state. It produces arrays padded to max_pop_size to ensure fixed shapes for JIT compilation.

Args: key: A JAX random key. n_ind: Number of founder individuals to create. n_chr: Number of chromosomes. n_loci_per_chr: Number of loci on each chromosome. max_pop_size: The total size of the arrays to pre-allocate. ploidy: The ploidy level of the individuals. inbred: If True, creates fully inbred individuals (homozygous at all loci). chr_len_cm: The length of each chromosome in centiMorgans for the genetic map.

Returns: A tuple of (Population, genetic_map). The Population object will contain n_ind active individuals within arrays of size max_pop_size.*