/*
 * Java Genetic Algorithm Library (@__identifier__@).
 * Copyright (c) @__year__@ Franz Wilhelmstötter
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 * Author:
 *    Franz Wilhelmstötter (franz.wilhelmstoetter@gmx.at)
 */
package org.jenetics.optimizer;

/**
 * @author <a href="mailto:franz.wilhelmstoetter@gmx.at">Franz Wilhelmstötter</a>
 * @version !__version__!
 * @since !__version__!
 */
public class CtorCodec {
}

@@ -771,171 +771,1260 @@
 r;%0A%0A
-/**%0A * @author %3Ca href=%22mailto:franz.wilhelmstoetter@gmx.at%22%3EFranz Wilhelmst%C3%B6tter%3C/a%3E%0A * @version !__version__!%0A * @since !__version__!%0A */%0Apublic class CtorCodec %7B
+import java.util.function.DoubleFunction;%0Aimport java.util.function.Function;%0A%0Aimport org.jenetics.DoubleChromosome;%0Aimport org.jenetics.DoubleGene;%0Aimport org.jenetics.Genotype;%0Aimport org.jenetics.engine.Codec;%0Aimport org.jenetics.util.DoubleRange;%0Aimport org.jenetics.util.Factory;%0Aimport org.jenetics.util.ISeq;%0A%0A/**%0A * @author %3Ca href=%22mailto:franz.wilhelmstoetter@gmx.at%22%3EFranz Wilhelmst%C3%B6tter%3C/a%3E%0A * @version !__version__!%0A * @since !__version__!%0A */%0Apublic class CtorCodec%3CT%3E implements Codec%3CT, DoubleGene%3E %7B%0A%0A%09private final Factory%3CGenotype%3CDoubleGene%3E%3E _encoding;%0A%09private final Function%3CGenotype%3CDoubleGene%3E, T%3E _decoder;%0A%0A%09public CtorCodec(%0A%09%09final Class%3CT%3E type,%0A%09%09final ISeq%3CDoubleRange%3E ranges,%0A%09%09final ISeq%3CDoubleFunction%3CObject%3E%3E parameters%0A%09) %7B%0A%09%09_encoding = Genotype.of(DoubleChromosome.of(%0A%09%09%09ranges.stream()%0A%09%09%09%09.map(DoubleGene::of)%0A%09%09%09%09.toArray(DoubleGene%5B%5D::new)%0A%09%09));%0A%0A%09%09final Ctor%3CT%3E ctor = Ctor.of(%0A%09%09%09type,%0A%09%09%09parameters%0A%09%09);%0A%0A%09%09_decoder = gt -%3E ctor.cons(%0A%09%09%09gt.toSeq().stream()%0A%09%09%09%09.mapToDouble(c -%3E c.getGene().doubleValue())%0A%09%09%09%09.toArray()%0A%09%09);%0A%09%7D%0A%0A%09@Override%0A%09public Factory%3CGenotype%3CDoubleGene%3E%3E encoding() %7B%0A%09%09return _encoding;%0A%09%7D%0A%0A%09@Override%0A%09public Function%3CGenotype%3CDoubleGene%3E, T%3E decoder() %7B%0A%09%09return _decoder;%0A%09%7D%0A
 %0A%7D%0A

Add Ctor constructable codec.