public void Mutation(List <Chromosome> chromosomes, Environment Environment) { var rsmMutationList = new List <Chromosome>(); var psmMutationList = new List <Chromosome>(); foreach (var item in chromosomes) { if (Randomizer.Random.NextDouble() < 0.5) { rsmMutationList.Add(item); } else { psmMutationList.Add(item); } } var rsmMutation = new MutationOperatorRSM(); var psmMutation = new MutationOperatorPSM(); rsmMutation.Mutation(rsmMutationList, Environment); psmMutation.Mutation(psmMutationList, Environment); //var m = chromosomes.Count / 5; //var rsmMutation = new MutationOperatorRSM(); //var psmMutation = new MutationOperatorPSM(); //rsmMutation.Mutation(chromosomes.Take(m).ToList(), Environment); //psmMutation.Mutation(chromosomes.Skip(m).ToList(), Environment); }
public void Mutation(List <Chromosome> chromosomes, Environment Environment) { var m = chromosomes.Count / 2; var randomTwoPointsMutation = new MutationOperatorRandomTwoPoints(); var rsmMutation = new MutationOperatorRSM(); randomTwoPointsMutation.Mutation(chromosomes.Take(m).ToList(), Environment); rsmMutation.Mutation(chromosomes.Skip(m).ToList(), Environment); }
public void Mutation(List <Chromosome> chromosomes, Environment Environment) { var rsmMutationList = new List <Chromosome>(); var insertionsMutationList = new List <Chromosome>(); foreach (var item in chromosomes) { if (Randomizer.Random.NextDouble() < 0.5) { rsmMutationList.Add(item); } else { insertionsMutationList.Add(item); } } var rsmMutation = new MutationOperatorRSM(); var insertionMutation = new MutationOperatorInsertions(); rsmMutation.Mutation(rsmMutationList, Environment); insertionMutation.Mutation(insertionsMutationList, Environment); }