- csStr >> ttSize;
- csVal >> val;
- if (val < 4 || val > 1024)
- {
- std::cerr << "The hash table size must be between 4 and 1024" << std::endl;
- exit(EXIT_FAILURE);
- }
- csStr >> threads;
- csVal >> val;
- if (val < 1 || val > THREAD_MAX)
- {
- std::cerr << "The number of threads must be between 1 and " << THREAD_MAX
- << std::endl;
- exit(EXIT_FAILURE);
- }
- set_option_value("Hash", ttSize);
- set_option_value("Threads", threads);
- set_option_value("OwnBook", "false");
- set_option_value("Use Search Log", "true");
- set_option_value("Search Log Filename", "bench.txt");
-
- csVal >> secsPerPos;
- csVal >> fileName;
-
- std::vector<std::string> positions;
-
- if (fileName != "default")
+ // Assign default values to missing arguments
+ string ttSize = (is >> token) ? token : "128";
+ string threads = (is >> token) ? token : "1";
+ string limit = (is >> token) ? token : "12";
+ string fenFile = (is >> token) ? token : "default";
+ string limitType = (is >> token) ? token : "depth";
+
+ Options["Hash"] = ttSize;
+ Options["Threads"] = threads;
+
+ if (limitType == "time")
+ limits.movetime = 1000 * atoi(limit.c_str()); // movetime is in ms
+
+ else if (limitType == "nodes")
+ limits.nodes = atoi(limit.c_str());
+
+ else
+ limits.depth = atoi(limit.c_str());
+
+ if (fenFile == "default")
+ fens.assign(Defaults, Defaults + 16);
+
+ else if (fenFile == "current")
+ fens.push_back(current.to_fen());
+
+ else