Optimizing the f(x) = 1+ x sin(10 x) by means of genetic algorithms (binary encoding)
Problem description
The main objetive is the study of the operation of a simple genetic algorithm. Other objetive is the learning of the basic work lines of this software.
Problem solution
In this section, Optimizing the f(x) = 1+ x sin(10 x) by means of genetic algorithms (binary encoding) at interval [-1,2]. For this purpose we will use 22 bits encoding, reason why search space is splited in 22 points. The genotype is a bit string witch has its values between 0000000000000000000000 (value -1) and 1111111111111111111111 (value 2).
To obtain the phenotype, we have to convert the binary value of genotype to its corresponding real value, and after that we have to apply the function over the point. The obtained value may be used as fitness value.
FuncOptBinArrayIndividual class represents individuals with binary genotype and real genotype, witch are used for this kind of problems, and FuncOptBinArrayIndividualSpecies class represents the common features of this kind of individuals in the population. To define the individual configuration, we will indicate the range of values that the search space includes and the precision (number of bits) that we will use. These values are stored in SearchSpaceElement objects. FuncOptEvaluator object is the responsible of calculating the fitness of the individuals.
We will apply a simple SGA (Genetic Algorithm), with one point crossover and alelo mutation. The template to configure the software for this problem is here.
