-
Notifications
You must be signed in to change notification settings - Fork 0
/
engine.h
executable file
·42 lines (32 loc) · 894 Bytes
/
engine.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*****************************************************************
** SGAL Simple Genetic Algorithm Library
**
** Copyright (c) 1995, Neal A. Sanche
*****************************************************************/
#ifndef ENGINE_H_
#define ENGINE_H_
#include "pool.h"
#include "chrom.h"
#include "operator.h"
extern CEvaluator &EV; // external fitness evaluator
class CEngine {
public:
CEngine(int poolsize,int chromlen,double scalefactor = 1.0);
virtual ~CEngine();
void Generation();
CPool &GetPool();
COperator &GetSelectionOp();
COperator &GetMutateOp();
COperator &GetCrossoverOp();
void SetSelectionOp(COpSelect &);
void SetMutateOp(COpMutate &);
void SetCrossoverOp(COpCrossover &);
int nGenerations;
int nChildren;
private:
COpSelect *opSel;
COpMutate *opMutate;
COpCrossover *opCross;
CPool *pool;
};
#endif // ENGINE_H_