1 Problem Statement
You have to design a framework of a Genetic Algorithm (GA) with basic functionality. The basic functionality includes representation, recombination operators, and fitness function and selection criteria. You can implement this framework in any language of your choice. You are not allowed to use any available libraries for GA.
1.1 Representation
The framework should have the ability to handle integer, float and binary representations. You can assume that the chromosome lengths will be fixed and will not change during the run.
1.2 Recombination Operators
You are required to implement one-point crossover and one-point mutation operators. These operators should be implemented for all the mentioned representations in the section 1.1.
1.3 Fitness Function
A fitness function should be defined for evaluating the individuals of the population. This function should return float/double value.
1.4 Selection Criteria
Different selection criteria should be defined. Three possibilities are fitness proportionate, random and worst selections.
2 Testing of the Framework
You have to test the framework by solving following problem.
Fourier Series: The figure shows the function p(x) = x2 over the interval [-∏, +∏]. In addition, the function from that limited interval is repeated over one subsequent and one preceding interval of width of 2∏
A function such as this can be represented by the infinite Fourier series. The first few terms of the Fourier series for this particular function x2 are
Suppose we want to use the genetic algorithm operating on a fixed-length character string to find the Fourier coefficients of the first nine terms of the Fourier series for the p(x) function. The p(x) function is a black box which you are free to interrogate to find its value for any value of the independent variable x. NOTE: You do not have foreknowledge that the function is even (i.e., the coefficients of the sine terms are all zero).