Resolving conflicts
[satune.git] / src / Test / runrandomtuner.cc
1 #include "csolver.h"
2 #include "randomtuner.h"
3 #include "searchtuner.h"
4
5 int main(int argc, char **argv) {
6         if (argc < 6) {
7                 printf("You should specify %s rounds timeout problemfilenames - tunerfilenames", argv[0]);
8                 exit(-1);
9         }
10         uint rounds;
11         uint timeout;
12         sscanf(argv[1], "%u", &rounds);
13         sscanf(argv[2], "%u", &timeout);
14
15         RandomTuner *randomTuner = new RandomTuner(rounds, timeout);
16         bool tunerfiles = false;
17         for (int i = 3; i < argc; i++) {
18                 if (!tunerfiles) {
19                         if (argv[i][0] == '-' && argv[i][1] == 0)
20                                 tunerfiles = true;
21                         else
22                                 randomTuner->addProblem(argv[i]);
23                 } else
24                         randomTuner->addTuner(new SearchTuner(argv[i]));
25         }
26
27         if (!tunerfiles) {
28                 printf("You should specify %s budget rounds timeout problemfilenames - tunerfilenames", argv[0]);
29                 exit(-1);
30         }
31
32         randomTuner->tune();
33         delete randomTuner;
34         return 0;
35 }