-
Notifications
You must be signed in to change notification settings - Fork 1
/
PetriDish.h
68 lines (48 loc) · 2.05 KB
/
PetriDish.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
//
// PetriDish.h
// PetriDish v0.91
//
// Updated by Glenn Sugden on 2016.04.01 : Fixed #ifdef, switched back to GASimpleGA default.
// Replaced by Glenn Sugden on 2012.05.10.
// Created by Glenn Sugden on 2012.05.05.
// This source is licensed under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
// To view a copy of this license, visit http://creativecommons.org/licenses/by-nc-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
//
#ifndef GALib_PetriDish_h
#define GALib_PetriDish_h
//================================================================================
#pragma mark Definitions
//================================================================================
#define GA_CLASS GASimpleGA
#define USING_GASIMPLEGA
//#define GA_CLASS GASteadyStateGA
//#define GA_CLASS GAIncrementalGA
//#define GA_CLASS GADemeGA
#define USE_BOOST 0 // Turn use of boost libraries on or off
//================================================================================
#pragma mark Headers
//================================================================================
#include <ga/ga.h>
//================================================================================
#pragma mark Classes
//================================================================================
class PetriDish : public GA_CLASS
{
public:
// CONSTRUCTOR
PetriDish(const GAGenome& genomeToClone);
// EVALUATOR
static void GAPDEvaluator( GAPopulation& pop );
// TERMINATOR (interrupt)
static GABoolean InterruptTerminator(GAGeneticAlgorithm & ga);
// DESTRUCTOR
~PetriDish();
// UTILITY
void interrupt() { _interrupt = true; }
private:
bool _interrupt; // A flag indicating we need to bail on the Evaluation
#ifdef USING_GASIMPLEGA
bool _oldPopInitialized; // A flag for a GASimpleGA workaround (see GAPDEvaluator)
#endif//USING_GASIMPLEGA
};
#endif