From jecoliwiki
Jump to: navigation, search

The first step in solving a problem with JECoLi is to decide on how to represent a solution for the problem.

JECoLi has a number of options, namely:

  • Linear representations, where the genome is an ordered list of elements (genes) that can be accessed/ manipulated based on their position.

The elements can be of the classes: Boolean (binary representations), Integer, Double (real valued representations).

  • Permutations, the genome is a permutation of a pre-defined set of elements (in this case, integers between 0 and the size of the solution-1).
  • Sets - the genome is a sub-set of elements from a given domain (in this case, the domain is the set of integers between 0 and a maximum value).
  • Trees, mainly for Genetic Programming.

An individual is represented by a class that implements the interface ISolution. Each solution must be able to return its genome (representation) and its fitness.

Implementation of representations in JECoLi relies on 2 different classes (for each representation):

  • A class that keeps the genome (implementing an interface called IRepresentation).
  • A class that is used to create new solutions, aka solution factory (implementing an interface called ISolutionFactory).

Linear representations are implemented by a class that implements the interface ILinearRepresentation<G>, where G is the class of each gene (e.g. Double, Boolean or Integer).

Solution factories define the classes to create new genomes.

The class to use depends on the type of representation:

  • BinaryRepresentationFactory
  • IntegerRepresentationFactory
  • RealValueRepresentationFactory
  • PermutationRepresentationFactory
  • etc

Some parameters need to be provided to the factory, namely solution size, maximum value (integer representations), bounds/ limits of the genes (real valued representations), etc. These are normally passed through the constructors.

Personal tools