aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorSebastiano Tronto <sebastiano@tronto.net>2024-10-18 16:35:17 +0200
committerSebastiano Tronto <sebastiano@tronto.net>2024-10-18 16:35:17 +0200
commit5216fb4be01e88f5b4928a69287e8f7ee3b3af5b (patch)
tree24aa57a0e34c49e0e6307caf8cf830f8dd26ed49 /tools
parent3d6c73c33276ecedba86cb871b4b5a089571629b (diff)
downloadnissy-core-5216fb4be01e88f5b4928a69287e8f7ee3b3af5b.tar.gz
nissy-core-5216fb4be01e88f5b4928a69287e8f7ee3b3af5b.zip
Add node and fallback benchmarking
Diffstat (limited to 'tools')
-rw-r--r--tools/200_stats_tables_h48/stats_tables_h48.c4
-rw-r--r--tools/300_solve_small/solve_small.c18
2 files changed, 15 insertions, 7 deletions
diff --git a/tools/200_stats_tables_h48/stats_tables_h48.c b/tools/200_stats_tables_h48/stats_tables_h48.c
index 8e80269..bdf6329 100644
--- a/tools/200_stats_tables_h48/stats_tables_h48.c
+++ b/tools/200_stats_tables_h48/stats_tables_h48.c
@@ -30,7 +30,7 @@ static void *
30run_thread(void *arg) 30run_thread(void *arg)
31{ 31{
32 char s[12], cube[22]; 32 char s[12], cube[22];
33 long long int ep, eo, cp, co; 33 long long int ep, eo, cp, co, stats[NISSY_SIZE_SOLVE_STATS];
34 int i, j; 34 int i, j;
35 35
36 thread_arg_t *a = (thread_arg_t *)arg; 36 thread_arg_t *a = (thread_arg_t *)arg;
@@ -42,7 +42,7 @@ run_thread(void *arg)
42 co = randll(); 42 co = randll();
43 nissy_getcube(ep, eo, cp, co, "fix", cube); 43 nissy_getcube(ep, eo, cp, co, "fix", cube);
44 nissy_solve(cube, "h48stats", NISSY_NISSFLAG_NORMAL, 44 nissy_solve(cube, "h48stats", NISSY_NISSFLAG_NORMAL,
45 0, MAXMOVES, 1, -1, size, buf, 12, s); 45 0, MAXMOVES, 1, -1, size, buf, 12, s, stats);
46 for (j = 0; j < 12; j++) 46 for (j = 0; j < 12; j++)
47 a->v[j][(int)s[j]]++; 47 a->v[j][(int)s[j]]++;
48 if ((i+1) % LOG_EVERY == 0) 48 if ((i+1) % LOG_EVERY == 0)
diff --git a/tools/300_solve_small/solve_small.c b/tools/300_solve_small/solve_small.c
index 60d1bd8..09ca85a 100644
--- a/tools/300_solve_small/solve_small.c
+++ b/tools/300_solve_small/solve_small.c
@@ -7,16 +7,24 @@ int64_t size = 0;
7char *buf; 7char *buf;
8 8
9char *scrambles[] = { 9char *scrambles[] = {
10 "R D' R2 D R U2 R' D' R U2 R D R'", /* 12 optimal */ 10 /* 12 optimal */
11 "RLUD RLUD RLUD", /* 12 optimal */ 11 "R D' R2 D R U2 R' D' R U2 R D R'",
12 "R' U' F D2 L2 F R2 U2 R2 B D2 L B2 D' B2 L' R' B D2 B U2 L U2 R' U' F", /* FMC2019 A1 - 16 optimal */ 12
13 // "R' U' F D R F2 D L F D2 F2 L' U R' L2 D' R2 F2 R2 D L2 U2 R' U' F", /* FMC2024 A1 - 19 optimal */ 13 /* 12 optimal */
14 "RLUD RLUD RLUD",
15
16 /* FMC2019 A1 - 16 optimal */
17 "R' U' F D2 L2 F R2 U2 R2 B D2 L B2 D' B2 L' R' B D2 B U2 L U2 R' U' F",
18
19 /* FMC2024 A1 - 19 optimal */
20 "R' U' F D R F2 D L F D2 F2 L' U R' L2 D' R2 F2 R2 D L2 U2 R' U' F",
14 NULL 21 NULL
15}; 22};
16 23
17void run(void) { 24void run(void) {
18 int i; 25 int i;
19 int64_t n; 26 int64_t n;
27 long long stats[NISSY_SIZE_SOLVE_STATS];
20 char sol[SOL_BUFFER_LEN], cube[22]; 28 char sol[SOL_BUFFER_LEN], cube[22];
21 29
22 printf("Solved the following scrambles:\n\n"); 30 printf("Solved the following scrambles:\n\n");
@@ -29,7 +37,7 @@ void run(void) {
29 continue; 37 continue;
30 } 38 }
31 n = nissy_solve(cube, solver, NISSY_NISSFLAG_NORMAL, 39 n = nissy_solve(cube, solver, NISSY_NISSFLAG_NORMAL,
32 0, 20, 1, -1, size, buf, SOL_BUFFER_LEN, sol); 40 0, 20, 1, -1, size, buf, SOL_BUFFER_LEN, sol, stats);
33 if (n == 0) 41 if (n == 0)
34 printf("No solution found\n"); 42 printf("No solution found\n");
35 else 43 else

Generated with cgit - Back to sebastiano.tronto.net