| 218 | |
| 219 | |
| 220 | std::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 | |
| 252 | std::string TopMove( |
no test coverage detected