Skip navigation links

Package org.opt4j.core.genotype

Provides the classes for basic Genotypes.

See: Description

Package org.opt4j.core.genotype Description

Provides the classes for basic Genotypes.

The basic Genotype classes are the following:

Try to stick to the predefined genotype objects. Use the CompositeGenotype to assemble complex genotypes. If you define your own genotype, keep in mind that you also have to define the corresponding Operators.

The DoubleGenotype and IntegerGenotype both can be bounded by an upper and lower bound for each value. The corresponding bounds classes are the DoubleBounds and IntegerBounds. These bounds are passed in the constructor of the DoubleGenotype or IntegerGenotype, respectively.

By default, the BooleanGenotype, the DoubleGenotype, and the IntegerGenotype are pure lists. This means, one has to identify elements by their index. The classes BooleanMapGenotype, DoubleMapGenotype, and IntegerMapGenotype extend the basic genotype classes by a map functionality. Therefore, a list of the key elements has to be passed in the constructors. Internally, this list is used for a mapping of key to indices. Therefore, this list must be in the same order with the same elements for corresponding genotype instances.

A further extension of the IntegerGenotype is the SelectGenotype and SelectMapGenotype. Here, a specific set of elements is defined such that for each index or key one element is chosen. Internally, this is implemented as an IntegerGenotype such that the elements are encoded as integer values.

The classes BooleanMapGenotype, DoubleMapGenotype, IntegerMapGenotype, SelectGenotype, and SelectMapGenotype are extended from BooleanGenotype, DoubleGenotype, and IntegerGenotype, respectively. Therefore, the default operators (in package org.opt4j.operator) for the simple Genotype classes are applied on their MapGenotype and SelectGenotype classes.

Custom genotypes have to implement the Genotype interface. If these classes are not extended from existing Genotype classes, appropriate operators have to be implemented (see package org.opt4j.operator).

The initialization of the genotypes is done in the Creator. Each genotype class has an appropriate init method to simplify the initialization.

Skip navigation links