Diploid simulations taking too long
Opened this issue · 3 comments
Diploid simulations are taking too long; there is no reason that I can see why they should be taking orders of magnitude longer than haploid simulations. I need to figure out why this is and fix it as best as possible. There's just no reason that I can tell why add_sexual
, sire_genes
, or assign_sire
should be taking so long. The way that the traits are inserted, mutation occurs, or inbreeding coefficients are calculated also just shouldn't take that much time. Maybe calling is_in_range
so many times is the problem?
Long hanging fruit is to not call is_in_range
in any loop unless other criteria of opp_sex
, age
, min_age
, and max_age
are met. This might lower time a bit, though the need to loop through all individuals still remains. I don't think that there's a way to avoid this loop.
In the reproduction type, specifically, there is no need to even call mate_available
if the sex
, min_age
, or max_age
are not appropriate.
I've made some progress on this now with the above commits, but I'm going to leave this issue open just to keep it in mind. Even with the fixes, the diploid simulations are taking much more time, mainly to get the paternal genome integrated into the offspring; if there is a way to do this more quickly, then it would be good to find it!