예제 #1
0
파일: MutationTest.cs 프로젝트: bjutlgr/ga1
 public void InversionMutationTest()
 {
     IChromosome<int> a = new DigitalChromosome().GenerateFromArray(new int[] { 12, 13, 14, 15, 16, 17, 18, 19, 20 });
     Inversion<int> mutation = new Inversion<int>(3, 5);
     IChromosome<int> res = mutation.Mutate(a);
     IChromosome<int> exp = new DigitalChromosome().GenerateFromArray(new int[] { 12, 13, 14, 17, 16, 15, 18, 19, 20 });
     Assert.AreEqual(exp, res);
 }