Пример #1
0
 public GenomeSettings(int genomeSize)
 {
     this.elitism          = Math.Max(1, genomeSize / 10);
     this.mutationRate     = 0.01f;
     this.scalingType      = FitnessScalingType.SigmaTruncation;
     this.reproductionType = ReproductionType.Generational;
     this.selectionType    = SelectionType.RouletteWheel;
     this.mutationType     = MutationType.Exchange;
     this.crossoverType    = CrossoverType.SinglePoint;
 }
Пример #2
0
        public static void ScaleFitness(List <Gene <T> > genes, FitnessScalingType scalingType)
        {
            switch (scalingType)
            {
            case FitnessScalingType.SigmaTruncation:
                SigmaTruncation(genes);
                break;

            case FitnessScalingType.Rank:
                Rank(genes);
                break;

            case FitnessScalingType.None:
                return;
            }
        }
Пример #3
0
 public GenomeSettings
 (
     int elitism,
     float mutationRate,
     FitnessScalingType scalingType,
     ReproductionType reproductionType,
     SelectionType selectionType,
     MutationType mutationType,
     CrossoverType crossoverType
 )
 {
     this.elitism          = elitism;
     this.mutationRate     = mutationRate;
     this.scalingType      = scalingType;
     this.reproductionType = reproductionType;
     this.selectionType    = selectionType;
     this.mutationType     = mutationType;
     this.crossoverType    = crossoverType;
 }