#include "optimizer/geqo_recombination.h"
#include "optimizer/geqo_random.h"
+#if defined(CX)
/* cx
*
return num_diffs;
}
+
+#endif /* defined(CX) */
#include "optimizer/geqo_recombination.h"
#include "optimizer/geqo_random.h"
+#if defined(ERX)
static int gimme_edge(PlannerInfo *root, Gene gene1, Gene gene2, Edge *edge_table);
static void remove_gene(PlannerInfo *root, Gene gene, Edge edge, Edge *edge_table);
elog(ERROR, "no edge found");
return 0; /* to keep the compiler quiet */
}
+
+#endif /* defined(ERX) */
static int gimme_pool_size(int nr_rel);
static int gimme_number_generations(int pool_size);
-/* define edge recombination crossover [ERX] per default */
+/* complain if no recombination mechanism is #define'd */
#if !defined(ERX) && \
!defined(PMX) && \
!defined(CX) && \
!defined(PX) && \
!defined(OX1) && \
!defined(OX2)
-#define ERX
+#error "must choose one GEQO recombination mechanism in geqo.h"
#endif
#include "optimizer/geqo_mutation.h"
#include "optimizer/geqo_random.h"
+#if defined(CX) /* currently used only in CX mode */
+
void
geqo_mutation(PlannerInfo *root, Gene *tour, int num_gene)
{
num_swaps -= 1;
}
}
+
+#endif /* defined(CX) */
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_recombination.h"
+#if defined(OX1)
/* ox1
*
}
}
+
+#endif /* defined(OX1) */
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_recombination.h"
+#if defined(OX2)
/* ox2
*
}
}
+
+#endif /* defined(OX2) */
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_recombination.h"
+#if defined(PMX)
/* pmx
*
pfree(indx);
pfree(check_list);
}
+
+#endif /* defined(PMX) */
#include "optimizer/geqo_random.h"
#include "optimizer/geqo_recombination.h"
+#if defined(PX)
/* px
*
}
}
+
+#endif /* defined(PX) */
}
}
+/* city table is used in these recombination methods: */
+#if defined(CX) || defined(PX) || defined(OX1) || defined(OX2)
+
/* alloc_city_table
*
* allocate memory for city table
{
pfree(city_table);
}
+
+#endif /* CX || PX || OX1 || OX2 */
#define GEQO_DEBUG
*/
-/* recombination mechanism */
+/* choose one recombination mechanism here */
/*
#define ERX
#define PMX