-void benchmark(const string& commandLine) {
-
- istringstream csVal(commandLine);
- istringstream csStr(commandLine);
- string ttSize, threads, fileName, limitType;
- int val, secsPerPos, maxDepth, maxNodes;
+void benchmark(int argc, char* argv[]) {
+
+ vector<string> fenList;
+ SearchLimits limits;
+ int64_t totalNodes;
+ int time;
+
+ // Load default positions
+ for (int i = 0; !Defaults[i].empty(); i++)
+ fenList.push_back(Defaults[i]);
+
+ // Assign default values to missing arguments
+ string ttSize = argc > 2 ? argv[2] : "128";
+ string threads = argc > 3 ? argv[3] : "1";
+ string valStr = argc > 4 ? argv[4] : "12";
+ string fenFile = argc > 5 ? argv[5] : "default";
+ string valType = argc > 6 ? argv[6] : "depth";
+
+ Options["Hash"].set_value(ttSize);
+ Options["Threads"].set_value(threads);
+ Options["OwnBook"].set_value("false");
+
+ // Search should be limited by nodes, time or depth ?
+ if (valType == "nodes")
+ limits.maxNodes = atoi(valStr.c_str());
+ else if (valType == "time")
+ limits.maxTime = 1000 * atoi(valStr.c_str()); // maxTime is in ms
+ else
+ limits.maxDepth = atoi(valStr.c_str());