- for(i = 0; i < 15; i++) {
- pos.from_fen(BenchmarkPositions[i]);
- think(pos, true, false, 0, 0, 0, 0, 0, 60000, moves);
+ csVal >> secsPerPos;
+ csVal >> fileName;
+
+ std::vector<std::string> positions;
+
+ if (fileName != "default")
+ {
+ std::ifstream fenFile(fileName.c_str());
+ if (!fenFile.is_open())
+ {
+ std::cerr << "Unable to open positions file " << fileName
+ << std::endl;
+ exit(EXIT_FAILURE);
+ }
+ std::string pos;
+ while (fenFile.good())
+ {
+ std::getline(fenFile, pos);
+ if (!pos.empty())
+ positions.push_back(pos);
+ }
+ fenFile.close();
+ } else
+ for (int i = 0; i < 16; i++)
+ positions.push_back(std::string(BenchmarkPositions[i]));
+
+ std::vector<std::string>::iterator it;
+ for (it = positions.begin(); it != positions.end(); ++it)\r
+ {
+ Move moves[1] = {MOVE_NONE};\r
+ int dummy[2] = {0, 0};\r
+ Position pos(*it);
+ think(pos, true, false, 0, dummy, dummy, 0, 0, 0, secsPerPos * 1000, moves);\r