Examples of DoubleGene


Examples of org.encog.ml.genetic.genes.DoubleGene

    this.networkChromosome = new Chromosome();

    // create an array of "double genes"
    final int size = network.getStructure().calculateSize();
    for (int i = 0; i < size; i++) {
      final Gene gene = new DoubleGene();
      this.networkChromosome.getGenes().add(gene);
    }

    getChromosomes().add(this.networkChromosome);
View Full Code Here

Examples of org.encog.ml.genetic.genes.DoubleGene

   */
  public final void decode() {
    final double[] net = new double[this.networkChromosome.getGenes()
        .size()];
    for (int i = 0; i < net.length; i++) {
      final DoubleGene gene = (DoubleGene) this.networkChromosome
          .getGenes().get(i);
      net[i] = gene.getValue();

    }
    NetworkCODEC.arrayToNetwork(net, (BasicNetwork) getOrganism());

  }
View Full Code Here

Examples of org.encog.ml.genetic.genes.DoubleGene

   * @param chromosome The chromosome to mutate.
   */
  public final void performMutation(final Chromosome chromosome) {
    for (final Gene gene : chromosome.getGenes()) {
      if (gene instanceof DoubleGene) {
        final DoubleGene doubleGene = (DoubleGene) gene;
        double value = doubleGene.getValue();
        value += (perturbAmount - (Math.random() * perturbAmount * 2));
        doubleGene.setValue(value);
      }
    }
  }
 
View Full Code Here

Examples of org.jenetics.DoubleGene

  {
    private static final long serialVersionUID = 1L;

    @Override
    public Double apply(final Genotype<DoubleGene> genotype) {
      final DoubleGene gene = genotype.getChromosome().getGene(0);
      final double radians = toRadians(gene.doubleValue());
      return Math.log(sin(radians)*cos(radians));
    }
 
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.