eva2/src/eva2/optimization/individuals/InterfaceGAIndividual.java
2015-11-30 12:43:10 +01:00

39 lines
1.0 KiB
Java

package eva2.optimization.individuals;
import java.util.BitSet;
/**
* This interface gives access to a binary genotype and should
* only be used by mutation and crossover operators. Exceptions are
* data type specific optimization strategies like CHC or PBIL.
*/
public interface InterfaceGAIndividual {
/**
* This method will allow the user to read the GA genotype.
*
* @return BitSet
*/
BitSet getBGenotype();
/**
* This method will allow the user to set the current GA genotype.
* Use this method with care, since the object is returned when using
* getBinaryData() you can directly alter the genotype without using
* this method.
*
* @param b The new genotype of the Individual
*/
void setBGenotype(BitSet b);
/**
* This method allows the user to read the length of the genotype.
* This may be necessary since BitSet.lenght only returns the index
* of the last significat bit.
*
* @return The length of the genotype.
*/
int getGenotypeLength();
}