EASEA defined sections

De
Aller à la navigation Aller à la recherche

Genome specific fields

Miscellaneous fields

Memetic specific field

Genome Optimiser

Desciption

The optimiser field is a Genome specific field. It is meant to contain the function defining the way an individual will be locally optimized n times. The function will hence be called sequentially as many times as the user desires for each individual.

EASEA gives the user two possibilities when designing their local optimization function :

  1. The user can choose to design the function that will enhance the genome of their individuals only in which case the rest of the local optimizer (i.e. creating the local optimizing loop, checking if an individual has improved or not, storing temporary individuals, calling of the evaluation function, etc ...) will be taken care of by the EASEA memetic algorithm. The function will have to be called as many times as specified by the Number of optimisation iterations parameter.
  2. The user can choose to write the complete local optimizer. This way, he will have the complete freedom to design a more complex and specific optimizer, but he will also have to deal with the creation of the local optimization loop, the management of temporary individuals, the calling of the evaluation function etc... The Number of optimisation iterations parameter will have to be set to 1 as the function desigend by the user will contain it's own optimization loop requiring it's own specific number of optimization iterations.


EASEA syntax

\GenomeClass::optimiser :
     ...
\end

Examples

The two following examples will expose the two different ways the optimizer field can be used. The first example will show a simple mutation function. The second example will show the design of a complete local optimizer. Both examples are GPU compatible.

Genome optimization only
\GenomeClass::optimiser :
 float pas = 0.001;
 Genome.x[currentIteration%SIZE]+=pas;
\end

This example shows a simple mutation function that will add a small variation to one of the genes of an individual. The call to this function will be followed by a call to the evaluation function, and a replacement process. If the modification of the genome has improved the individual, it will replace the original one. This is being taken care of by the EASEA memetic algorithm.

Complete local optimizer
\GenomeClass : : optimiser	:	//	Optimises	the	Genome 
 float pas=0.001;
 float fitnesstmp = Genome.fitness ; 
 float tmp[SIZE]; 
 int index = 0;
 for(int i=0; i<SIZE; i++) 
  tmp[ i ] = Genome.x[ i ];
 for(int i=0; i<100; i++){ 
  tmp[index] += pas;
  fitnesstmp = Weierstrass(tmp, SIZE);
  if(fitnesstmp < Genome.fitness){ 
   Genome. fitness = fitnesstmp ;
   Genome.x[ index ] = tmp[ index ];
  }
  else {
   fitnesstmp = Genome.fitness;
   tmp[ index ] = Genome.x[ index ];
  
   if( pas < 0 )
    index = ( index + 1)%SIZE;
    
   pas *= -1;
  }
 }
\ end

This example shows how to design a complete local optimization function. The genome is almost being changed in the same way as in the first example.