1997-02-19 13:59:07 +01:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
1999-02-14 00:22:53 +01:00
|
|
|
* geqo.h
|
1997-09-07 07:04:48 +02:00
|
|
|
* prototypes for various files in optimizer/geqo
|
1997-02-19 13:59:07 +01:00
|
|
|
*
|
|
|
|
* Copyright (c) 1994, Regents of the University of California
|
|
|
|
*
|
1999-02-18 05:55:54 +01:00
|
|
|
* $Id: geqo.h,v 1.13 1999/02/18 04:55:54 momjian Exp $
|
1997-02-19 13:59:07 +01:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* contributed by:
|
|
|
|
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|
1997-09-07 07:04:48 +02:00
|
|
|
* Martin Utesch * Institute of Automatic Control *
|
|
|
|
= = University of Mining and Technology =
|
|
|
|
* utesch@aut.tu-freiberg.de * Freiberg, Germany *
|
1997-02-19 13:59:07 +01:00
|
|
|
=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=*=
|
|
|
|
*/
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#ifndef GEQO_H
|
|
|
|
#define GEQO_H
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-11-26 02:14:33 +01:00
|
|
|
#include "nodes/nodes.h"
|
|
|
|
#include "nodes/parsenodes.h"
|
|
|
|
#include "nodes/relation.h"
|
|
|
|
#include "optimizer/geqo_gene.h"
|
1997-02-19 13:59:07 +01:00
|
|
|
|
|
|
|
/* 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 */
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define GEQO_FILE "pg_geqo" /* Name of the ga config file */
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define MIN_POOL 128 /* minimum number of individuals */
|
|
|
|
#define MAX_POOL 1024 /* maximum number of individuals */
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define LOW_EFFORT 1 /* optimization effort values */
|
|
|
|
#define MEDIUM_EFFORT 40 /* are multipliers for computed */
|
|
|
|
#define HIGH_EFFORT 80 /* number of generations */
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define SELECTION_BIAS 2.0 /* selective pressure within population */
|
|
|
|
/* should be 1.5 <= SELECTION_BIAS <= 2.0 */
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
int PoolSize;
|
|
|
|
int Generations;
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
long RandomSeed; /* defaults to (long) time(NULL) in
|
1997-09-07 07:04:48 +02:00
|
|
|
* geqo_params.c */
|
1997-09-08 04:41:22 +02:00
|
|
|
double SelectionBias;
|
1997-02-19 13:59:07 +01:00
|
|
|
|
|
|
|
/* logarithmic base for rel->size decrease in case of long
|
|
|
|
queries that cause an integer overflow; used in geqo_eval.c */
|
|
|
|
|
1997-09-07 07:04:48 +02:00
|
|
|
#define GEQO_LOG_BASE 1.5 /* should be 1.0 < GEQO_LOG_BASE <= 2.0 */
|
|
|
|
/* ^^^ */
|
1997-02-19 13:59:07 +01:00
|
|
|
|
|
|
|
/* geqo prototypes */
|
1998-07-18 06:22:52 +02:00
|
|
|
extern RelOptInfo *geqo(Query *root);
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-09-08 04:41:22 +02:00
|
|
|
extern void geqo_params(int string_length);
|
1997-02-19 13:59:07 +01:00
|
|
|
|
1997-09-08 23:56:23 +02:00
|
|
|
extern Cost geqo_eval(Query *root, Gene *tour, int num_gene);
|
1999-02-18 05:55:54 +01:00
|
|
|
extern RelOptInfo *gimme_tree(Query *root, Gene *tour, int rel_count,
|
|
|
|
int num_gene, RelOptInfo *old_rel);
|
1997-02-19 13:59:07 +01:00
|
|
|
|
|
|
|
|
1998-09-01 06:40:42 +02:00
|
|
|
#endif /* GEQO_H */
|