Exemplo n.º 1
0
 @Override
 public Model marshal(final DoubleGene value) {
   final Model m = new Model();
   m.min = value.getMin();
   m.max = value.getMax();
   m.value = value.getAllele();
   return m;
 }
Exemplo n.º 2
0
 @Override
 public DoubleGene unmarshal(final Model m) {
   return DoubleGene.of(m.value, m.min, m.max);
 }
Exemplo n.º 3
0
 public static Phenotype<DoubleGene, Double> newDoublePhenotype(final double value) {
   return Phenotype.of(Genotype.of(DoubleChromosome.of(DoubleGene.of(value, 0, 10))), 0, FF)
       .evaluate();
 }
 private static Phenotype<DoubleGene, Double> phenotype(final double value) {
   return Phenotype.of(
       Genotype.of(DoubleChromosome.of(DoubleGene.of(value, 0.0, 1000.0))),
       1,
       a -> a.getGene().getAllele());
 }