-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmain.cpp
More file actions
29 lines (22 loc) · 864 Bytes
/
main.cpp
File metadata and controls
29 lines (22 loc) · 864 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
#include <ecf/ECF.h>
#include "Algorithms/GAIQM.h"
#include "Problems/FunctionMin/FunctionMinEvalOp.h"
#include "Problems/Knapsack/KnapsackEvalOp.h"
#include "Problems/NeuralNetwork/NeuralNetwork.h"
#include "Problems/NeuralNetwork/NNErrorEvalOp.h"
int main(int argc, char **argv) {
StateP state(new State);
// FunctionMinEvalOpP eval(new FunctionMinEvalOp);
KnapsackEvalOpP eval(new KnapsackEvalOp);
// NNErrorEvalOpP eval(new NNErrorEvalOp);
state->setEvalOp(eval);
NeuralNetworkP nn(new NeuralNetwork);
state->addGenotype(nn);
QuantumRegisterP qreg(new QuantumRegister);
state->addGenotype(qreg);
GAIQMP qga(new GAIQM);
state->addAlgorithm(qga);
state->initialize(argc, argv);
state->run();
cout << "Total evaluations: " << state->getStats()->getEvaluations() << endl;
}