aboutsummaryrefslogtreecommitdiff
path: root/src/solvers/h48/solve.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/solvers/h48/solve.h')
-rw-r--r--src/solvers/h48/solve.h21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/solvers/h48/solve.h b/src/solvers/h48/solve.h
index 78b4c97..0fd419d 100644
--- a/src/solvers/h48/solve.h
+++ b/src/solvers/h48/solve.h
@@ -162,7 +162,7 @@ solve_h48_dfs(dfsarg_solve_h48_t arg[static 1])
162 return 0; 162 return 0;
163 pthread_mutex_lock(arg->solutions_mutex); 163 pthread_mutex_lock(arg->solutions_mutex);
164 ret = appendsolution(arg->solution_moves, 164 ret = appendsolution(arg->solution_moves,
165 arg->solution_settings, arg->solution_list, true); 165 arg->solution_settings, arg->solution_list, true, "H48");
166 pthread_mutex_unlock(arg->solutions_mutex); 166 pthread_mutex_unlock(arg->solutions_mutex);
167 return ret; 167 return ret;
168 } 168 }
@@ -295,7 +295,7 @@ solve_h48_maketasks(
295 maketasks_arg->moves, maketasks_arg->nmoves); 295 maketasks_arg->moves, maketasks_arg->nmoves);
296 296
297 appret = appendsolution(&moves, solve_arg->solution_settings, 297 appret = appendsolution(&moves, solve_arg->solution_settings,
298 solve_arg->solution_list, true); 298 solve_arg->solution_list, true, "H48");
299 return appret < 0 ? appret : NISSY_OK; 299 return appret < 0 ? appret : NISSY_OK;
300 } 300 }
301 301
@@ -458,16 +458,17 @@ solve_h48(
458 arg[i].tasks = tasks; 458 arg[i].tasks = tasks;
459 } 459 }
460 460
461 LOG("Prepared %d tasks\n", ntasks); 461 LOG("[H48 solve] Prepared %d tasks\n", ntasks);
462 462
463 for ( 463 for (
464 d = MAX(minmoves, STARTING_MOVES + 1); 464 d = MAX(minmoves, STARTING_MOVES + 1);
465 !solutions_done(&sollist, &settings, d); 465 !solutions_done(&sollist, &settings, d);
466 d++ 466 d++
467 ) { 467 ) {
468 if (d >= 10) 468 if (d >= 15)
469 LOG("Found %" PRId64 " solutions, searching at depth %" 469 LOG("[H48 solve] Found %" PRId64 " solutions, "
470 PRId8 "\n", sollist.nsols, d); 470 "searching at depth %" PRId8 "\n",
471 sollist.nsols, d);
471 for (i = 0; i < threads; i++) { 472 for (i = 0; i < threads; i++) {
472 arg[i].target_depth = d; 473 arg[i].target_depth = d;
473 pthread_create( 474 pthread_create(
@@ -491,16 +492,16 @@ solve_h48_done:
491 lookups_per_node = table_lookups / (long double)nodes_visited; 492 lookups_per_node = table_lookups / (long double)nodes_visited;
492 fallback_rate = nodes_visited == 0 ? 0.0 : 493 fallback_rate = nodes_visited == 0 ? 0.0 :
493 (table_fallbacks * 100) / (long double)table_lookups; 494 (table_fallbacks * 100) / (long double)table_lookups;
494 LOG("Nodes visited: %" PRId64 "\n", nodes_visited); 495 LOG("[H48 solve] Nodes visited: %" PRId64 "\n", nodes_visited);
495 LOG("Lookups: %" PRId64 " (%.3Lf per node)\n", 496 LOG("[H48 solve] Lookups: %" PRId64 " (%.3Lf per node)\n",
496 table_lookups, lookups_per_node); 497 table_lookups, lookups_per_node);
497 LOG("Table fallbacks: %" PRId64 " (%.3Lf%%)\n", 498 LOG("[H48 solve] Table fallbacks: %" PRId64 " (%.3Lf%%)\n",
498 table_fallbacks, fallback_rate); 499 table_fallbacks, fallback_rate);
499 500
500 return sollist.nsols; 501 return sollist.nsols;
501 502
502solve_h48_error_data: 503solve_h48_error_data:
503 LOG("solve_h48: error reading table\n"); 504 LOG("[H48 solve] Error reading data table\n");
504 return NISSY_ERROR_DATA; 505 return NISSY_ERROR_DATA;
505 506
506solve_h48_error_solutions_buffer: 507solve_h48_error_solutions_buffer:

Generated with cgit - Back to sebastiano.tronto.net