#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <string>
#include <time.h>
using namespace std;

int main(void)
{
  char **tstName=new char*[20];
  time_t _time_t1, _time_t2;

  tstName[0]="CBS_k3_n100_m403_b10_0.cnf";
  tstName[1]="CBS_k3_n100_m403_b10_999.cnf";

  tstName[2]="flat30-1.cnf";
  tstName[3]="flat30-99.cnf";

  tstName[4]="sw100-1.cnf";
  tstName[5]="sw100-70.cnf";

  tstName[6]="anomaly.cnf";
  tstName[7]="bw_large.a.cnf";

  tstName[8]="qg4-08.cnf";
  tstName[9]="qg7-09.cnf";

  tstName[10]="bmc-ibm-2.cnf";
  tstName[11]="bmc-ibm-5.cnf";

  tstName[12]="tst_v10_c100.cnf";
  tstName[13]="tst_v100_c160.cnf";
  tstName[14]="tst_v100_c400.cnf";
  tstName[15]="tst_v100_c425.cnf";
  tstName[16]="tst_v25_c100.cnf";
  tstName[17]="tst_v50_c500.cnf";
  tstName[18]="tst_v200_c210.cnf";
  tstName[19]="tst_v200_c220.cnf";

  cout << "-=satGen tester=-" << endl << endl;

  int tournamentsize=2;
  for(int fitness=0; fitness<1; fitness++)////
    for(int crossover=0; crossover<4; crossover++)
      for(int selection=1; selection<2; selection++)
//    int fitness=0, crossover=2, selection=2;
        for(int tournamentsize=4; tournamentsize<9; tournamentsize*=2)
          for(int problem=0; problem<8; problem++)
            for(int solve=0; solve<5; solve++)
            {
              if ((selection!=1 && tournamentsize!=2))// || (selection==0 && crossover==0) || (selection==1 && crossover==0) || (selection==2 && crossover==0) || (selection==0 && crossover==1) || (selection==1 && crossover==1) || (selection==2 && crossover==1) || (selection==0 && crossover==2) || (selection==1 && crossover==2) || (selection==2 && crossover==2))
              {
              }else{
                stringstream ss;
                ss << "satGen " << tstName[problem] << " 50 2 5000 70 5 " << selection << " " << crossover << " " << fitness << " 2000 " << tournamentsize;

//cout << "satGen " << tstName[problem] << " 50 2 5000 70 5 " << selection << " " << crossover << " " << fitness << " 2000 " << tournamentsize;
//                cout << endl;

                cout << ss.str().c_str() << endl;
                time(&_time_t1);
                system (ss.str().c_str());
                time(&_time_t2);
                cout << "time: " << difftime(_time_t2, _time_t1) << " seconds" << endl;
                Sleep(400);
              }
            }

  return 0;
}
