MCPcopy Create free account
hub / github.com/dds-bridge/dds / DumpTopHeader

Function DumpTopHeader

library/src/dump.cpp:220–249  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

218
219
220std::string DumpTopHeader(
221 const std::shared_ptr<ThreadData>& thrp,
222 const int tricks,
223 const int lower,
224 const int upper,
225 const int printMode)
226{
227 // Use facade to read search-state safely (caller provides shared_ptr)
228 SolverContext ctx{ thrp };
229 std::string stext;
230 if (printMode == 0)
231 {
232 // Trying just one target.
233 stext = "Single target " + std::to_string(tricks) + ", " + "achieved";
234 }
235 else if (printMode == 1)
236 {
237 // Looking for best score.
238 stext = "Loop target " + std::to_string(tricks) + ", " +
239 "bounds " + std::to_string(lower) + " .. " + std::to_string(upper) + ", " +
240 TopMove(thrp->val, ctx.search().best_move(ctx.search().ini_depth())) + "";
241 }
242 else if (printMode == 2)
243 {
244 // Looking for other moves with best score.
245 stext = "Loop for cards with score " + std::to_string(tricks) + ", " +
246 TopMove(thrp->val, ctx.search().best_move(ctx.search().ini_depth()));
247 }
248 return stext + "\n" + std::string(stext.size(), '-') + "\n";
249}
250
251
252std::string TopMove(

Callers 1

DumpTopLevelFunction · 0.85

Calls 4

TopMoveFunction · 0.85
best_moveMethod · 0.80
searchMethod · 0.80
ini_depthMethod · 0.80

Tested by

no test coverage detected