rzshrote / pybrops

Python Breeding Optimizer and Simulator: A Python library for simulating and optimizing breeding pipelines.
https://rzshrote.github.io/pybrops/
MIT License
2 stars 1 forks source link

Potentially implement generic cross structures #57

Open rzshrote opened 2 years ago

rzshrote commented 2 years ago

It might be possible to implement an object structure to specify a cross configuration.

Rules: The structure is fundamentally a series of nested tuples with either integers or None as elements. An integer in the structure specifies the index. All integers from 0 to the maximum integer must be present. A None specifies a self-fertilization event. A tuple at a given level of nesting can only have two members. This applies to all tuples in the structure.

Rules illustration: (0,None) is legal ((0,1),2) is legal ((0,,1),3) is illegal

Examples: (A x B) x C -> ((0,1),2) F2 of (A x B) -> ((0,1),None) F3 of (A x B) -> (((0,1),None),None)

rzshrote commented 2 years ago

This feature could be implemented in a class structure too.

This feature could improve Mating Protocols and Genetic Variance Matrices.