public Chromosome(Chromosome oldChromosome) { this.rd = oldChromosome.rd; this._gene = oldChromosome._gene; this.Fitness = oldChromosome.Fitness; this.AbsFitness = oldChromosome.AbsFitness; }
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)); }
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); }
public static Chromosome GetLowestChromosome(ResearchDefinitions rd) => new Chromosome(rd).SetGene("0");
public Chromosome(ResearchDefinitions rd) { this.rd = rd; }
public static Chromosome NewRandomChromosome(ResearchDefinitions rd) => new Chromosome(rd) { Gene = Utils.LongRandom(rd.chromosomeDefinition.GenesCount) };