Created
April 14, 2023 21:41
-
-
Save machkouroke/b676cbdc5906dcbda6beacbb8ab84441 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 generate_solution(n::Int)::Chromosome | |
return [Queen(i, j) for (i, j) in enumerate(randperm(n))] |> Chromosome | |
end | |
function randpop(popsize::Int64, n::Int64)::Vector{Chromosome} | |
return [generate_solution(n) for _ in 1:popsize] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment