Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef GEQO_RECOMBINATION_H
00025 #define GEQO_RECOMBINATION_H
00026
00027 #include "optimizer/geqo.h"
00028
00029
00030 extern void init_tour(PlannerInfo *root, Gene *tour, int num_gene);
00031
00032
00033
00034
00035 typedef struct Edge
00036 {
00037 Gene edge_list[4];
00038 int total_edges;
00039 int unused_edges;
00040 } Edge;
00041
00042 extern Edge *alloc_edge_table(PlannerInfo *root, int num_gene);
00043 extern void free_edge_table(PlannerInfo *root, Edge *edge_table);
00044
00045 extern float gimme_edge_table(PlannerInfo *root, Gene *tour1, Gene *tour2,
00046 int num_gene, Edge *edge_table);
00047
00048 extern int gimme_tour(PlannerInfo *root, Edge *edge_table, Gene *new_gene,
00049 int num_gene);
00050
00051
00052
00053
00054 #define DAD 1
00055 #define MOM 0
00056
00057 extern void pmx(PlannerInfo *root,
00058 Gene *tour1, Gene *tour2,
00059 Gene *offspring, int num_gene);
00060
00061
00062 typedef struct City
00063 {
00064 int tour2_position;
00065 int tour1_position;
00066 int used;
00067 int select_list;
00068 } City;
00069
00070 extern City *alloc_city_table(PlannerInfo *root, int num_gene);
00071 extern void free_city_table(PlannerInfo *root, City *city_table);
00072
00073
00074 extern int cx(PlannerInfo *root, Gene *tour1, Gene *tour2,
00075 Gene *offspring, int num_gene, City *city_table);
00076
00077
00078 extern void px(PlannerInfo *root, Gene *tour1, Gene *tour2, Gene *offspring,
00079 int num_gene, City *city_table);
00080
00081
00082 extern void ox1(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring,
00083 int num_gene, City *city_table);
00084
00085
00086 extern void ox2(PlannerInfo *root, Gene *mom, Gene *dad, Gene *offspring,
00087 int num_gene, City *city_table);
00088
00089 #endif