예제 #1
0
        public static Tuple <Organizm, Organizm> ProduceChildren(Graph graph, Organizm firstParent, Organizm secondParent)
        {
            int      cutLine            = RandomHelper.NextInt(firstParent.GenesCount);
            var      cuttedGenesParent1 = firstParent.SliceOrganizm(cutLine);
            var      cuttedGenesParent2 = secondParent.SliceOrganizm(cutLine);
            Organizm child1             = new Organizm(graph, cuttedGenesParent1.Item1, cuttedGenesParent2.Item2);
            Organizm child2             = new Organizm(graph, cuttedGenesParent2.Item1, cuttedGenesParent1.Item2);

            return(new Tuple <Organizm, Organizm>(child1, child2));
        }
예제 #2
0
 internal abstract Organizm ProduceMutant(Organizm organizm);
예제 #3
0
 internal abstract Tuple <Organizm, Organizm> ProduceChildren(Organizm parent1, Organizm parent2);
예제 #4
0
 public abstract double MeasureFitness(Organizm organizm);
 internal override Organizm ProduceMutant(Organizm organizm)
 {
     return(organizm.Mutate(_graph));
 }
 public override double MeasureFitness(Organizm organizm)
 {
     return(organizm.MeasureFitness(_graph));
 }
 internal override Tuple <Organizm, Organizm> ProduceChildren(Organizm parent1, Organizm parent2)
 {
     return(Organizm.ProduceChildren(_graph, parent1, parent2));
 }