예제 #1
0
        public Tuple <IIndividual, IIndividual> crossover(IIndividual partner)
        {
            IIndividual child1 = new IndividualExample(this.x + ((IndividualExample)partner).x);
            IIndividual child2 = new IndividualExample(this.x - ((IndividualExample)partner).x);

            return(new Tuple <IIndividual, IIndividual>(child1, child2));
        }
예제 #2
0
 public Tuple<IIndividual, IIndividual> crossover(IIndividual partner)
 {
     IIndividual child1 = new IndividualExample(this.x+((IndividualExample)partner).x);
     IIndividual child2 = new IndividualExample(this.x-((IndividualExample)partner).x);
     return new Tuple<IIndividual,IIndividual>(child1,child2);
 }