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

D:/Projekt/ECF_trunk/examples/FunctionMin/bbobStructures.h

00001 #ifndef _bbobStructures_H
00002 #define _bbobStructures_H
00003 
00004 /* some structures, to try to imitate that gorgious Matlab Code !!! 
00005 */
00006 
00007 /* sometimes, M_PI is not defined ????? */
00008 #ifndef M_PI
00009   #define M_PI        3.14159265358979323846
00010 #endif
00011 
00012 /* the return type of all benchmark functions: 2 doubles, the true value and the noisy value - are equal in case of non-noisy functions */
00013 struct twoDoubles {
00014 double Ftrue;
00015 double Fval;
00016 };
00017 
00018 typedef struct twoDoubles TwoDoubles;
00019 
00020 /* and now the type of the benchmark functions themselves */
00021 typedef struct twoDoubles (*bbobFunction)(double *);
00022 
00023 /* need to put all parameters into a single structure that 
00024 can be passed around 
00025 */
00026 /* all static char* (increase if your system uses huge file names) */
00027 #define DefaultStringLength 1024
00028 /* for not having to allocate the x in struct  lastEvalStruct */
00029 #define DIM_MAX 200
00030 /* These ones might be defined somewhere in the C headers, but in case it's system-dependent ... */
00031 /*#define MAX_FLOAT 1.0E308
00032 #define MIN_FLOAT 1.0E-308
00033 #define MAX_INT 32767*/
00034 
00035 struct paramStruct{
00036 /* all chars have a fixed length, to ease memory management */
00037 
00038 /* a string for the name of the optimiser (used in the post-processing)
00039    If not specified, PARAMS.algName = 'not-specified'; */
00040 char algName[DefaultStringLength];  
00041 
00042 /* a string that must not contain
00043    end-of-line characters that will appear as comment in the index
00044    file (preceded by '% ') and should be used to precise some
00045    differentiating parameters of the optimiser.
00046    If not specified, PARAMS.comments = ''; */ 
00047 char comments[DefaultStringLength]; 
00048 
00049 /* a string for the path of the index and data files files. */
00050 char dataPath[DefaultStringLength];
00051 
00052 /* a string for the prefix of the index and data files names.
00053   If not specified, PARAMS.filePrefix = 'bbobexp'; */
00054 char filePrefix[DefaultStringLength];
00055 
00056 /* The dimension: in C it has to be passed as an argument at init time */
00057 unsigned int DIM;
00058 
00059 /* the precision */
00060 double precision;
00061 
00062 /* the benchmark function ID */
00063 unsigned int funcId;
00064 
00065 /* the instance ID */
00066 unsigned int instanceId;
00067 
00068 /* the path to the index file */
00069 char indexFilePrefix[DefaultStringLength];
00070 
00071 /* index file name */
00072 char indexFile[DefaultStringLength]; /* will be  ('%s_f%d.info', indexFilePrefix, FUNC_ID); */
00073 
00074 /* prefixes for data files */
00075 char dataFilePrefix[DefaultStringLength]; 
00076 char dataFilePrefixNameOnly[DefaultStringLength]; 
00077 
00078 /* names of data file */
00079 char dataFile[DefaultStringLength]; 
00080 char dataFileNameOnly[DefaultStringLength]; 
00081 
00082 /* names of H-data file */
00083 char hdataFile[DefaultStringLength]; 
00084 char hdataFileNameOnly[DefaultStringLength]; 
00085 
00086 /* names of r-data file */
00087 char rdataFile[DefaultStringLength]; 
00088 char rdataFileNameOnly[DefaultStringLength]; 
00089 
00090 /* brute force suffix (no need to extract it from file name!) */
00091 unsigned int dataFileSuffix;
00092 
00093 /* counter for number of evaluations */
00094 unsigned int runCounter;
00095 
00096 } ;
00097 
00098 typedef struct paramStruct ParamStruct;
00099 
00100 /*********************************
00101 BestFEval 
00102 **********************************/
00103 struct lastEvalStruct {
00104 /* Number of evaluations : double to achieve larger precision */
00105 double num;
00106 
00107 /* fitness value */
00108 double F;
00109 
00110 /* Noisy fitness value */
00111 double Fnoisy;
00112 
00113 /* best noisy value up to now ??? */
00114 double bestFnoisy;
00115 
00116 /* value of vector x */
00117 double x[DIM_MAX];
00118 
00119 /* has it been written to file? */
00120 int isWritten;
00121 } ;
00122 
00123 typedef struct lastEvalStruct LastEvalStruct;
00124 
00125 /*********************************88
00126     The interface 
00127 ***********************************/
00128 #ifdef __cplusplus
00129 extern "C"{
00130 #endif
00131 double fgeneric_initialize(ParamStruct PARAMS);
00132 double fgeneric_finalize(void);
00133 double fgeneric_evaluate(double * X);
00134 double fgeneric_ftarget(void);
00135 double fgeneric_maxevals(unsigned int DIM);
00136 double fgeneric_evaluations(void);
00137 double fgeneric_best(void);
00138 void fgeneric_restart(char * restart_reason);
00139 int fgeneric_exist(unsigned int FUNC_ID);
00140 void fgeneric_noiseseed(unsigned long seed);
00141 ParamStruct fgeneric_getDefaultPARAMS(void);
00142 #ifdef __cplusplus
00143 }
00144 #endif
00145 
00146 
00147 #endif

Generated on Tue Nov 4 2014 13:04:31 for ECF by  doxygen 1.7.1