summaryrefslogtreecommitdiff
path: root/src/include/optimizer/geqo.h
diff options
context:
space:
mode:
authorMarc G. Fournier <scrappy@hub.org>1997-02-19 12:59:07 +0000
committerMarc G. Fournier <scrappy@hub.org>1997-02-19 12:59:07 +0000
commit29138eeb3ca299d0fdc3d4ea2cbe523b759c9db0 (patch)
treebac9efe5ffc3619cd09d8b920e31209a0d5f9a75 /src/include/optimizer/geqo.h
parent34f35a4c19a92d7869e25cdd522366df74285729 (diff)
downloadpostgresql-29138eeb3ca299d0fdc3d4ea2cbe523b759c9db0.tar.gz
Merge in GEQO Optimizer
From: "Martin S. Utesch" <utesch@aut.tu-freiberg.de>
Diffstat (limited to 'src/include/optimizer/geqo.h')
-rw-r--r--src/include/optimizer/geqo.h78
1 files changed, 78 insertions, 0 deletions
diff --git a/src/include/optimizer/geqo.h b/src/include/optimizer/geqo.h
new file mode 100644
index 0000000000..b25d443be0
--- /dev/null
+++ b/src/include/optimizer/geqo.h
@@ -0,0 +1,78 @@
+/*-------------------------------------------------------------------------
+ *
+ * geqo.h--
+ * prototypes for various files in optimizer/geqo
+ *
+ * Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: geqo.h,v 1.1 1997/02/19 12:58:28 scrappy Exp $
+ *
+ *-------------------------------------------------------------------------
+ */
+
+/* contributed by:
+ =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
+ * Martin Utesch * Institute of Automatic Control *
+ = = University of Mining and Technology =
+ * utesch@aut.tu-freiberg.de * Freiberg, Germany *
+ =*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
+ */
+
+#ifndef GEQO_H
+#define GEQO_H
+
+
+/* GEQO debug flag */
+/*
+ #define GEQO_DEBUG
+*/
+
+/* recombination mechanism */
+/*
+ #define ERX
+ #define PMX
+ #define CX
+ #define PX
+ #define OX1
+ #define OX2
+ */
+#define ERX
+
+
+/* genetic algorithm parameters */
+
+#define GEQO_FILE "pg_geqo" /* Name of the ga config file */
+
+#define MIN_POOL 128 /* minimum number of individuals */
+#define MAX_POOL 1024 /* maximum number of individuals */
+
+#define LOW_EFFORT 1 /* optimization effort values */
+#define MEDIUM_EFFORT 40 /* are multipliers for computed */
+#define HIGH_EFFORT 80 /* number of generations */
+
+#define SELECTION_BIAS 2.0 /* selective pressure within population */
+ /* should be 1.5 <= SELECTION_BIAS <= 2.0 */
+
+ int PoolSize;
+ int Generations;
+
+ long RandomSeed; /* defaults to (long) time(NULL) in geqo_params.c */
+ double SelectionBias;
+
+/* logarithmic base for rel->size decrease in case of long
+ queries that cause an integer overflow; used in geqo_eval.c */
+
+#define GEQO_LOG_BASE 1.5 /* should be 1.0 < GEQO_LOG_BASE <= 2.0 */
+ /* ^^^ */
+
+/* geqo prototypes */
+extern Rel *geqo(Query *root);
+
+extern void geqo_params(int string_length);
+
+extern Cost geqo_eval (Query *root, Gene *tour, int num_gene);
+double geqo_log(double x, double b);
+extern Rel *gimme_tree(Query *root, Gene *tour, int rel_count, int num_gene, Rel *outer_rel);
+
+
+#endif /* GEQO_H */