Package org.jenetics

Examples of org.jenetics.BitChromosome


    this.size = size;
  }

  @Override
  public Double apply(final Genotype<BitGene> genotype) {
    final BitChromosome ch =
        (BitChromosome)genotype.getChromosome();
    double size = 0;
    double value = 0;
    for (int i = 0, n = ch.length(); i < n; ++i) {
      if (ch.get(i)) {
        size += items[i].size;
        value += items[i].value;
      }
    }
View Full Code Here


final class OneCounter
  implements Function<Genotype<BitGene>, Integer>
{
  @Override
  public Integer apply(final Genotype<BitGene> genotype) {
    final BitChromosome chromosome =
      (BitChromosome)genotype.getChromosome();
    return chromosome.bitCount();
  }
View Full Code Here

TOP

Related Classes of org.jenetics.BitChromosome

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.