The first step in deciding which evolutionary algorithm is to use is a close look to the format/representation of your variables. The second step is the direct decision on which format the evolutionary algorithm should work. The representation determines the overall algorithm, that means, the used evolutionary operators.
In the GEATbx 3 different representations are supported:
When working with different representations, the toolbox provides functions for conversion between these representations:
Let's give an example: The variables of the objective function are in real value representation. Now it could be chosen between binary and real value representation for the evolutionary algorithm. Recommended is the real value representation (tbxmpga). It works much quicker than the binary one. However, if the decision comes to use the binary values inside the evolutionary algorithm, the population is initialized as if the variables would be binary (initbp), the evolutionary operators (mutbin and, for instance, xovsp) are applied, and before the evaluation of the objective function the binary values are converted to real values (bin2real).
One more example. In this case the variables are in integer representation. The evolutionary algorithm can work on integer values (mutint and recdis), however, there are no really specialized operators for integer variable representation. Thus, the best decision would be to work with binary values and convert them to integer (bin2int) before evaluation of the objective function.
The use of a representation and necessary conversion is controlled by parameter GOPTIONS(19) of the options structure.
Tab. 3-1: Combinations of variable representation and conversion
EA works on |
variable representation |
conversion |
real |
real |
- |
integer |
integer |
- |
binary |
real |
|
binary |
integer |
|
binary |
binary |
- |
In the end it can be stated:
Matlab Examples:
Real --- Real:
tbxmpga('objfun1',[],[-5,-5,-5],[5,5,5])
Binary --- Binary:
tbxdbin('objone1',[],repmat[0,[1 100]],repmat[1,[1 100]])
Real --- Binary:
GOPTIONS(19)=1; tbxdbin('objfun1', opt, [-5,-5,-5], [5,5,5])
Integer --- Binary:
GOPTIONS(19)=3; tbxdbin('objint2, opt, [0,0,0], [511,1023,255])