Exemplo n.º 1
0
 public Chromosome(Chromosome oldChromosome)
 {
     this.rd         = oldChromosome.rd;
     this._gene      = oldChromosome._gene;
     this.Fitness    = oldChromosome.Fitness;
     this.AbsFitness = oldChromosome.AbsFitness;
 }
Exemplo n.º 2
0
        public static Chromosome GetHigherChromosome(ResearchDefinitions rd)
        {
            var binGene = "";

            for (int i = 0; i < rd.chromosomeDefinition.ChromosomeLength; i++)
            {
                binGene += '1';
            }
            return(new Chromosome(rd).SetGene(binGene));
        }
Exemplo n.º 3
0
        public static List <Chromosome> NewRandomPopulation(ResearchDefinitions rd, int chromosomeCount)
        {
            var list = new List <Chromosome>();

            for (var i = 0; i < chromosomeCount; i++)
            {
                list.Add(Chromosome.NewRandomChromosome(rd));
            }
            return(list);
        }
Exemplo n.º 4
0
 public static Chromosome GetLowestChromosome(ResearchDefinitions rd) => new Chromosome(rd).SetGene("0");
Exemplo n.º 5
0
 public Chromosome(ResearchDefinitions rd)
 {
     this.rd = rd;
 }
Exemplo n.º 6
0
 public static Chromosome NewRandomChromosome(ResearchDefinitions rd)
 => new Chromosome(rd)
 {
     Gene = Utils.LongRandom(rd.chromosomeDefinition.GenesCount)
 };