/// <summary> /// スワップ系 /// </summary> public static List <T> SwapMutation <T>(List <T> chromosomes, float mutationRate) { if (!RandomProvider.DrawLots(mutationRate, 100)) { return(chromosomes); } var count = chromosomes.Count; var swapIndex = Enumerable.Range(0, count).Shuffle().Take(2).ToArray(); var temp = chromosomes[swapIndex[0]]; chromosomes[swapIndex[0]] = chromosomes[swapIndex[1]]; chromosomes[swapIndex[1]] = temp; return(chromosomes); }