I finally implemented a function to randomly select available partners based on their sex and community.
It's probably far from optimal, but the maine problem for now is that in case of multiple availability priority should be given to closer communities.
I finally implemented a function to randomly select available partners based on their sex and community. It's probably far from optimal, but the maine problem for now is that in case of multiple availability priority should be given to closer communities.
Function doing that so far is : https://github.com/simoncarrignon/mixed-transmission/blob/fc836d2e616624e386dc489a430df76121eaa585/R/marriage.R#L7-L39