/*
 * 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@gmail.com)
 */
package io.jenetics.engine;

import io.jenetics.Gene;
import io.jenetics.Phenotype;

/**
 * @author <a href="mailto:franz.wilhelmstoetter@gmail.com">Franz Wilhelmstötter</a>
 * @version !__version__!
 * @since !__version__!
 */
public interface Constraint<
	G extends Gene<?, G>,
	C extends Comparable<? super C>
> {

	public boolean test(final Phenotype<G, C> individual);

	public Phenotype<G, C> repair(final Phenotype<G, C> individual);

}

@@ -833,290 +833,1475 @@
 %0A * 
-@author %3Ca href=%22mailto:franz.wilhelmstoetter@gmail.com%22%3EFranz Wilhelmst%C3%B6tter%3C/a%3E%0A * @version !__version__!%0A * @since !__version__!%0A */%0Apublic interface Constraint%3C%0A%09G extends Gene%3C?, G%3E,%0A%09C extends Comparable%3C? super C%3E%0A%3E %7B%0A%0A%09public boolean test(final Phenotype%3CG, C%3E individual);%0A
+This interface allows you to define constraints on single phenotypes. In some%0A * sense it is a more advanced version of the %7B@link Phenotype#isValid()%7D%0A * method, which checks the validity of the underlying genotypes and/or%0A * chromosomes. Additionally it is possible to %3Cem%3Erepair%3C/em%3E invalid%0A * individuals.%0A *%0A * @see Engine.Builder#constraint(Constraint)%0A *%0A * @author %3Ca href=%22mailto:franz.wilhelmstoetter@gmail.com%22%3EFranz Wilhelmst%C3%B6tter%3C/a%3E%0A * @version !__version__!%0A * @since !__version__!%0A */%0Apublic interface Constraint%3C%0A%09G extends Gene%3C?, G%3E,%0A%09C extends Comparable%3C? super C%3E%0A%3E %7B%0A%0A%09/**%0A%09 * Checks the validity of the given %7B@code individual%7D.%0A%09 *%0A%09 * @param individual the phenotype to check%0A%09 * @return %7B@code true%7D if the given %7B@code individual%7D is valid,%0A%09 *         %7B@code false%7D otherwise%0A%09 * @throws NullPointerException if the given %7B@code individual%7D is%0A%09 *         %7B@code null%7D%0A%09 */%0A%09public boolean test(final Phenotype%3CG, C%3E individual);%0A%0A%09/**%0A%09 * Tries to repair the given phenotype. This method is called by the%0A%09 * evolution %7B@link Engine%7D if the %7B@link #test(Phenotype)%7D method returned%0A%09 * %7B@code false%7D.%0A%09 *%0A%09 * @param individual the phenotype to repair%0A%09 * @return a newly created, valid phenotype. The implementation is free to%0A%09 *         use the given invalid %7B@code individual%7D as a starting point for%0A%09 *         the created phenotype.%0A%09 * @throws NullPointerException if the given %7B@code individual%7D is%0A%09 *         %7B@code null%7D%0A%09 */
 %0A%09pu

Add Javadoc.