Scope
The main purpose of OnePC is to create a parallel genetic algorithm for function minimization using the well known Island technique, where each machine denoted as client, runs a a local genetic algorithm with separate sub-population. The machine denoted as server gathers from clients periodically the best discovered minimum. The software is implemented in ANSI C++ using QT Library in order to be portable in any operating system.
Global optimization
The frequently arised problem of discovering the global minimum of a multi - dimensional function can be formulated as
x
S=
The above problem appears in a series of cases in physics, chemistry, economics etc.
Genetic algorithms
Genetic algorithms have been used in a many fields and they have many advantages such as:
1. Adaptation in every problem
2. Requirement for the objective function only and not for gradient functions
3. They can be parallelized easily
Although, genetic algorithms have many advantages they require many generations and a lot of function calls to finish. Hence, the parallelization of the process was mandatory.
During the past years many researches have published articles and software using parallel genetic algorithms in many cases such as aerodynamic optimization,
steel structure optimization, brain images etc. The most frequent model for parallel genetic algorithms is the server - client model, such as the so called Island model,
where clients run a a local genetic algorithm and the server collects information from the clients and occasionally distributes information to them,
such as the best discovered minimum.
The proposed software named OnePC implements a client - server model for parallel genetic algorithms with some advanced features such as:
1. An modified stopping rule. This termination rule is general enough to be adapted in any genetic algorithm.
2. A periodical application of a local search procedure.
3. Exchange of best chromosomes between clients.
Coding of the objective function
The method init
This function initializes the objective problem and it is not mandatory. In params parameter user stores some useful parameters for the problem. As an example consider the rastrigin function with one example parameter as show in figure Fig1.
double value1=0.0;
void init(QJsonObject obj)
{
if(obj.contains("value1"))
value1=obj["value1"].toDouble();
}
The method getdimension
The integer function getdimension should return the dimension of the objective function. This function will be called after the function init(). A typical example for the rastrigin function is show in figure Fig2.
int getdimension()
{
return 2;
}
The method done
This function should be called at the end of optimization. The double parameter x is the vector of global minimum discovered by the optimization process. This function could be omitted.
The method getleftmargin
This function setups the left bounds of the objective function. The results are stored in double precision array l.
This array should have the same dimension as the objective problem. A typical example for the Rastrigin function is shown in figure Fig3.
void getleftmargin(double *l)
{
l[0]=-1;
l[1]=-1;
}
The method getrightmargin
This function setups the right bounds of the objective function. The results are stored in double precision array r. This array should have the same dimension as the objective problem. A typical example for the Rastrigin function is shown in figure Fig4.
void getrightmargin(double *r)
{
r[0]= 1;
r[1]= 1;
}
The method funmin
This function is the most important function of the objective problem, as it sets the necessary objective problem. In fugure Fig5 the objective funmin is outlined for the Rastrigin function. The parameter x specifies the point where an evaluation of the objective function is required. The dimension of array x should be the same as the returning value of the function getdimension().
double funmin(double *x)
{
return x[0]*x[0]+x[1]*x[1]-cos(18.0*x[0])-cos(18.0*x[1]);
}