example 23

Anthony Liekens a.m.l.liekens at tue.nl
Tue Jan 14 05:36:22 EST 2003


The program runs fine with me. Experimenting with the command line
parameter 'mm' and setting it to 1 and -1 gives me the following outputs
in bog.dat:

[aliekens at PC-04 examples]$ ./ex23 mm -1 && cat bog.dat
Example 23

This program tries to maximize or minimize, depending on the
command line argument that you give it.  Use the command-line
argument 'mm -1' to minimize (the default for this example), or
'mm 1' to maximize.  The objective function is a simple
sinusoidal.

printing initial population to file...
printing final population to file...
printing function to file...
0       1.00454 1.99993 0.00178068      0.69606 -1
1       0.507366        1.99993 0.00178068      0.564711        -1
2       0.282595        1.49895 0.00178068      0.346887        -1
3       0.231311        1.37876 0.00178068      0.280695        -1
4       0.139033        0.951444        0.00178068      0.175994       
-1
5       0.120019        0.550767        0.00178068      0.104029       
-1
6       0.110012        0.35231 0.00178068      0.0929694       -1
7       0.0870333       0.254743        0.00178068      0.0695322      
-1
8       0.0592595       0.133143        0.00178068      0.0364209      
-1
9       0.0384559       0.0853625       0.00178068      0.0321185      
-1
10      0.0162554       0.0597426       0.00178068      0.0234892      
-1
11      0.00280754      0.0531237       0.00178068      0.00726099     
-1
12      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
13      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
14      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
15      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
16      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
17      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
18      0.0296747       1.39648 0.00178068      0.19724 -1
19      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
20      0.00178068      0.00178068      0.00178068      2.35194e-10    
-1
[aliekens at PC-04 examples]$ ./ex23 mm 1 && cat bog.dat
Example 23

This program tries to maximize or minimize, depending on the
command line argument that you give it.  Use the command-line
argument 'mm -1' to minimize (the default for this example), or
'mm 1' to maximize.  The objective function is a simple
sinusoidal.

printing initial population to file...
printing final population to file...
printing function to file...
0       1.02801 1.98515 0.000946453     0.762301        -1
1       1.50312 1.98515 0.273921        0.507439        -1
2       1.68624 1.98515 0.31047 0.358212        -1
3       1.75709 1.98515 1.05942 0.268239        -1
4       1.72639 1.98515 1.05942 0.300003        -1
5       1.78888 1.98515 1.18409 0.267131        -1
6       1.87151 1.98515 1.18409 0.186425        -1
7       1.88574 1.98515 1.18409 0.157915        -1
8       1.89817 1.98515 1.18409 0.153817        -1
9       1.89037 1.98515 1.53138 0.142485        -1
10      1.86321 1.98515 0.776472        0.21509 -1
11      1.86518 1.98515 1.53138 0.156791        -1
12      1.88339 1.98515 1.53138 0.142251        -1
13      1.87625 1.98515 1.53138 0.159417        -1
14      1.90304 1.98515 1.53138 0.133456        -1
15      1.89239 1.98515 1.53138 0.143743        -1
16      1.88523 1.98515 1.53138 0.152812        -1
17      1.88664 1.98515 1.53138 0.161725        -1
18      1.91387 1.98515 1.53138 0.135149        -1
19      1.93412 1.98515 1.53138 0.109425        -1
20      1.95523 1.98515 1.53138 0.0693347       -1

The first run goes to 0, the second run goes to 2.

Anthony Liekens,-

On Mon, 2003-01-13 at 17:20, Nicholas Cunliffe wrote:
> I have a question about example 23.
> 
> If the example is supposed to minimize the value of the objective 
> function why does it return a value of 2 (the maximum)?
> 
> If i change the minmax parameter to ga.maximise() I seem to get 
> exactly the same results as ga.minimize() i.e. a function value near 
> to 2? The only thing that changes is the actual genome value?
> Can anyone explain this?
> 
> thanks
> 
> Nicholas
> 
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://lancet.mit.edu/mailman/listinfo/galib
-- 
Anthony Liekens <a.m.l.liekens at tue.nl>
Technische Universiteit Eindhoven




More information about the galib mailing list