Package org.encog.ml.genetic.genome

Examples of org.encog.ml.genetic.genome.DoubleArrayGenome


   * {@inheritDoc}
   */
  @Override
  public void performOperation(Random rnd, Genome[] parents, int parentIndex,
      Genome[] offspring, int offspringIndex) {
    DoubleArrayGenome parent = (DoubleArrayGenome)parents[parentIndex];
    offspring[offspringIndex] = parent.getPopulation().getGenomeFactory().factor();
    DoubleArrayGenome child = (DoubleArrayGenome)offspring[offspringIndex];
   
    for(int i=0;i<parent.size();i++) {
      double value = parent.getData()[i];
      value += value * (perturbAmount - (rnd.nextDouble() * perturbAmount * 2));
      child.getData()[i] = value;
    }
  }
View Full Code Here

TOP

Related Classes of org.encog.ml.genetic.genome.DoubleArrayGenome

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.