• Main Page
  • Modules
  • Classes
  • Files
  • File List

D:/Projekt/ECF_trunk/examples/COCO/bbob/MY_OPTIMIZER.c

00001 
00002 #include <stdlib.h>
00003 #include <math.h>
00004 #include <stdio.h>
00005 #include <limits.h>
00006 
00007 void MY_OPTIMIZER(double(*fitnessfunction)(double*), unsigned int dim, double ftarget, double maxfunevals)
00008 {
00009     double * x = (double *)malloc(sizeof(double) * dim);
00010     double f;
00011     double iter;
00012     unsigned int j;
00013 
00014     if (maxfunevals > 1000000000. * dim)
00015         maxfunevals = 1000000000. * dim;
00016 
00017     for (iter = 0.; iter < maxfunevals; iter++)
00018     {
00019         /* Generate individual */
00020         for (j = 0; j < dim; j++)
00021              x[j] = 10. * ((double)rand() / RAND_MAX) - 5.;
00022 
00023         /* evaluate x on the objective function */
00024         f = fitnessfunction(x);
00025 
00026         if (f < ftarget)
00027             break;
00028     }
00029     free(x);
00030 }

Generated on Sat Jul 12 2014 07:29:32 for ECF by  doxygen 1.7.1