MCPcopy Create free account
hub / github.com/dhbloo/rapfi / selfplay

Method selfplay

Rapfi/command/selfplay.cpp:88–465  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

86using namespace Tuning;
87
88void Command::selfplay(int argc, char *argv[])
89{
90 size_t numGames;
91 size_t numThreads;
92 size_t hashSizeMb;
93 int boardSizeMin, boardSizeMax;
94 Rule rule;
95 int multipv, multipvDecaySteps;
96 double meanNodes, varNodes, nodesDecay;
97 int maxDecaySteps;
98 uint64_t minNodes;
99 int matePly;
100 int drawValue, drawCount, minDrawPly;
101 int forceDrawPly, forceDrawPlyLeft;
102 Time reportInterval;
103 bool noMateMultiPV;
104 bool generateOpening;
105 bool silence;
106 std::vector<std::vector<Pos>> openings;
107 Opening::OpeningGenConfig opengenCfg;
108 DataWriterType dataWriterType;
109 std::string outputPath;
110 std::unique_ptr<DataWriter> dataWriter;
111
112 cxxopts::Options options("rapfi selfplay");
113 options.add_options() //
114 ("o,output",
115 "Save data entries of played games to a binary file",
116 cxxopts::value<std::string>()) //
117 ("output-type",
118 "Output dataset type, one of [txt, bin, bin_lz4, binpack, binpack_lz4]",
119 cxxopts::value<std::string>()->default_value("binpack_lz4")) //
120 ("n,number", "Number of games to play", cxxopts::value<size_t>()) //
121 ("boardsize-min", "Minimal board size in [5,22]", cxxopts::value<int>()) //
122 ("boardsize-max", "Maximal board size in [5,22]", cxxopts::value<int>()) //
123 ("opening",
124 "Path to the opening book file. If not specified, auto generated openings are used",
125 cxxopts::value<std::string>()) //
126 ("multipv",
127 "The maximum number of multipv to record (must be at least 1)",
128 cxxopts::value<int>()->default_value("1")) //
129 ("multipv-decay-steps",
130 "The number of steps to decrease multipv by 1 (0 for not enabled)",
131 cxxopts::value<int>()->default_value("0")) //
132 ("no-multipv-after-mate",
133 "Disable multipv after mate has been found") //
134 ("mean-nodes",
135 "Mean of a normal distribution of num search nodes",
136 cxxopts::value<double>()->default_value("100000")) //
137 ("var-nodes",
138 "Variance of a normal distribution of num search nodes",
139 cxxopts::value<double>()->default_value("10000")) //
140 ("nodes-decay",
141 "The lambda to decay the number of search nodes",
142 cxxopts::value<double>()->default_value("1.0")) //
143 ("max-nodes-decay-steps",
144 "The maximum number of steps to decay the number of search nodes",
145 cxxopts::value<int>()->default_value("100")) //

Callers

nothing calls this directly

Calls 15

readOpeningsFunction · 0.85
setupSignalHandlerFunction · 0.85
nowFunction · 0.85
TransformTypeEnum · 0.85
applyTransformFunction · 0.85
mated_inFunction · 0.85
MoveDataTagEnum · 0.85
mate_inFunction · 0.85
ResultEnum · 0.85
add_optionsMethod · 0.80
default_valueMethod · 0.80
helpMethod · 0.80

Tested by

no test coverage detected