00001 #include "CecFunctions.h"
00002 #include "Function.h"
00003 #include <stdio.h>
00004 #include <stdlib.h>
00005 #include <math.h>
00006 #include <WINDOWS.H>
00007 #include <malloc.h>
00008
00009 extern void test_func(double *, double *,int,int,int);
00010 double *OShift,*M,*y,*z,*x_bound;
00011 int ini_flag=0,n_flag,func_flag;
00012
00013
00014 FitnessP evaluate(IndividualP individual){
00015
00016 FitnessP fitness (new FitnessMin);
00017 FloatingPoint::FloatingPoint* gen = (FloatingPoint::FloatingPoint*) individual->getGenotype().get();
00018
00020
00021 int func_num;
00022
00023
00025
00026
00027 double value;
00028 double *f = &value;
00029
00030 double* x = &gen->realValue[0];
00031 int n = gen->realValue.size();
00032
00033 test_func(x, f, n,1,func_num);
00034
00035 fitness->setValue(value);
00036 return fitness;
00037 }