Package org.opt4j.core.genotype

Provides the classes for basic Genotypes.

See:
          Description

Interface Summary
Bounds<E extends Number> The Bounds define bounds for Genotype objects that consist of lists of numbers.
ListGenotype<E> The ListGenotype is an interface for Genotypes that are derived from a List with basic objects.
MapGenotype<K,V> The MapGenotype extends a Genotype with Map functionalities.
 

Class Summary
BooleanGenotype The BooleanGenotype consists of Boolean values that can be used as a Genotype.
BooleanMapGenotype<K> The BooleanMapGenotype is a BooleanGenotype with the MapGenotype functionality.
CompositeGenotype<K,V extends Genotype> The CompositeGenotype is a base class for Genotype classes that consist of multiple Genotypes.
DoubleBounds The DoubleBounds is an implementation of the Bounds for the DoubleGenotype that accepts arrays as well as lists as bounds.
DoubleGenotype The DoubleGenotype consists of double values that can be used as a Genotype.
DoubleMapGenotype<K> The DoubleMapGenotype is a DoubleGenotype with the MapGenotype functionality.
IntegerBounds The IntegerBounds is an implementation of the Bounds for the IntegerGenotype that accepts arrays as well as lists for as bounds.
IntegerGenotype The IntegerGenotype is a Genotype that consists of integer values.
IntegerMapGenotype<K> The IntegerMapGenotype is a IntegerGenotype with the MapGenotype functionality.
PermutationGenotype<E> The PermutationGenotype can be used as a Genotype.
SelectGenotype<V> The SelectGenotype selects for each index an element from the given list.
SelectMapGenotype<K,V> The SelectGenotype selects for each key an element from a given list.
SelectMapGenotype.SelectBounds<O,P>  
 

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.