-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGroupingChallenge.cpp
More file actions
36 lines (28 loc) · 934 Bytes
/
GroupingChallenge.cpp
File metadata and controls
36 lines (28 loc) · 934 Bytes
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
#include "GaussianGroupingEvaluatorFactory.h"
#include "GroupingEvaluator.h"
#include "GeneticAlgorithm.h"
#include <iostream>
using namespace NGroupingChallenge;
using namespace std;
int main()
{
CGaussianGroupingEvaluatorFactory c_evaluator_factory(5, 100, 5);
c_evaluator_factory
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0)
.cAddDimension(-100, 100, 1.0, 1.0);
CGroupingEvaluator* pc_evaluator = c_evaluator_factory.pcCreateEvaluator(0);
GeneticAlgorithm ga(11, 0.7, 0.1, *pc_evaluator);
ga.start(20);
cout << "Best fit overall : " << endl;
cout << ga.getOverallBestFit() << endl;
delete pc_evaluator;
return 0;
}