Function to calculate N_total by the algorithm proposed by Sevin et al. (2004)
calcCost(
topolo,
gene_df1_sel,
gene_df2_sel,
recom_mat,
prob_total,
last_cross = FALSE,
last_selfing = FALSE
)`calCost` function returns the list of `n_plant_df`, `gene_df1_sel` and `gene_df2_sel`. `n_plant_df` contains the information about the number of progenies should be produced at each crossing (node in the tree).
Crossing scheme described by topology of tree
Parental set of crossing
Parental set of crossing
Matrix of recombination rate among genes.
Probability of success.
Whether or not to conduct the last cross to a cultivar without target alleles.
Whether or not to conduct the last selfing.