- for(i = 0; i < 15; i++) {
- pos.from_fen(BenchmarkPositions[i]);
- think(pos, true, false, 0, 0, 0, 0, 0, 60000, moves);
+ csVal >> val;
+ csVal >> fileName;
+ csVal >> limitType;
+
+ secsPerPos = maxDepth = maxNodes = 0;
+
+ if (limitType == "time")
+ secsPerPos = val * 1000;
+ else if (limitType == "depth")
+ maxDepth = val;
+ else
+ maxNodes = val;
+
+ 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]));
+
+ int startTime = get_system_time();
+ std::vector<std::string>::iterator it;
+ int cnt = 1;
+ int64_t totalNodes = 0;
+ for (it = positions.begin(); it != positions.end(); ++it, ++cnt)
+ {
+ Move moves[1] = {MOVE_NONE};
+ int dummy[2] = {0, 0};
+ Position pos(*it);
+ std::cout << "\nProcessing position " << cnt << '/' << positions.size() << std::endl << std::endl;
+ think(pos, true, false, 0, dummy, dummy, 0, maxDepth, maxNodes, secsPerPos, moves);
+ totalNodes += nodes_searched();