00001
00002
00003
00004 #define COMPILE_DEPRECATED_FUNCTIONS
00005
00006 #define UNIFORM 1
00007 #define POINT 2
00008 #define TWOPOINT 3
00009
00010 #define DIE 1
00011 #define SURVIVE 2
00012 #define RESCORE 3
00013
00014 #define BESTOF 1
00015 #define BESTOF2 2
00016 #define RANK 3
00017 #define ROULETTE 4
00018
00019
00024 typedef struct {
00028 int *word;
00032 int *type;
00033 } validPart;
00034
00049 void getSynonym(validPart *validInput,
00050 int _validCount,
00051 keyword *cb,
00052 int cbSize,
00053 int tbSize,
00054 char **original,
00055 int originalSize,
00056 char **_smallCB,
00057 int _smallCBSize);
00058
00065 bool calcFitness(population *pop, entity *entity);
00066
00075 int equalByBMU(int *compare, float *result, int n,float breakVal);
00076
00086 float getFitness(validPart *validInput, int validCount, outputPart *testInput, int testCount, char **inputWords, int inputWordCount);
00087
00097 void getWordsByChromosome(entity *item, int chromoLength, char ***words, int *count);
00098
00106 int getIndexOfWord(char **smallCB, int smallCBSize, char *word);
00107
00115 char* getWordOfIndex(char **smallCB, int smallCBSize, int index);
00116
00126 float calcOrderness(char **sortWords, int sortWordsCount, char ** compareWords, int compareWordsCount);
00127
00135 int hasPeak(float threshold, float *vector, int size);
00136
00148 void setParams(int populationSize_,
00149 int maxGenerations_,
00150 float crossoverRate_,
00151 float mutationRate_,
00152 int crossoverMethod_,
00153 int selectionMethod_,
00154 int eliteMethod_);
00155
00161 void setOrderPhrase(char **orderPhrase_, int orderPhraseSize_);
00162
00168 void printPhraseByChromo(entity *et,population *pop);
00169
00176 void setSpecialSeed(int seed, float chance);
00177
00178 GAULFUNC boolean mySeed(population *pop, entity *adam);