Created
April 14, 2023 21:55
-
-
Save machkouroke/9f376a1691bf2ca5692a0af54057c827 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function make_mates(population::Vector{Chromosome}, n_parents::Int64, n_mates::Int64; method::String="random")::Tuple | |
mates::Tuple = () | |
for _ in 1:n_mates | |
indices::Vector{Int64} = select(size(population)[1], n_parents, population; method=method) | |
mates = (mates..., (population[indices[1]], population[indices[2]])) | |
end | |
return mates | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment