public override IChromosome CreateNew() { gameChromosome nuevo = new gameChromosome(chromosomeGenerator, mutationMultiplierGenerator, mutationAdditionGenerator, Length); nuevo.Generate(); nuevo.cFitness = 0.0000000001; return nuevo; }
public override IChromosome CreateNew() { gameChromosome nuevo = new gameChromosome(chromosomeGenerator, mutationMultiplierGenerator, mutationAdditionGenerator, Length); nuevo.Generate(); nuevo.cFitness = 0.0000000001; return(nuevo); }
public static void ChromosomeToNetwork(gameChromosome chromosome, ActivationNetwork network) { double[] values = chromosome.Value; int l = 0; for (int i = 0; i < network.LayersCount; i++) for (int j = 0; j < network[i].NeuronsCount; j++) for (int k = 0; k <= network[i][j].InputsCount; k++) { if (k == 0) network[i][j].Threshold = values[l]; else network[i][j][k - 1] = values[l]; l++; } }
public static void ChromosomeToNetwork(gameChromosome chromosome, ActivationNetwork network) { double[] values = chromosome.Value; int l = 0; for (int i = 0; i < network.LayersCount; i++) { for (int j = 0; j < network[i].NeuronsCount; j++) { for (int k = 0; k <= network[i][j].InputsCount; k++) { if (k == 0) { network[i][j].Threshold = values[l]; } else { network[i][j][k - 1] = values[l]; } l++; } } } }
public gameChromosome(gameChromosome source) : base(source) { this.cFitness = source.cFitness; }