cli
Command-Line Interface for the AlphaCube Solver.
This module provides the entry point for the command-line utility, allowing users to solve Rubik's Cubes directly from the terminal. It parses arguments for model selection, scramble input, search parameters, and verbosity, then invokes the core solver and prints the result.
main
def main()
Command-line utility for solving a Rubik's Cube using AlphaCube.
Arguments:
--model_id
/-m
(str): Choose a specific model for solving (default: 'small' on CPU, otherwiselarge
; another choice is `base``).--format
/-f
(str): Specify the input format ('moves' or 'stickers').--scramble
/-s
(str): Define the initial cube state using either a sequence of moves or a stringify JSON dictionary.--beam_width
/-bw
(int): Set the beam width for search (default: 1024).--extra_depths
/-ex
(int): Specify additional depths for exploration (default: 0).--verbose
/-v
: Enable verbose output for debugging and tracking progress.
Returns:
None
Example Usages:
Syntax
alphacube [--model_id MODEL_ID] [--format FORMAT] [--scramble SCRAMBLE]
[--beam_width BEAM_WIDTH] [--extra_depths EXTRA_DEPTHS]
1. Solve a cube using default settings
alphacube --scramble "R U R' U'"
2. Solve a cube with custom settings
alphacube --model_id large --beam_width 128 --extra_depths 2 \
--scramble "R U2 F' R2 B R' U' L B2 D' U2 R F L"
3. Solve a cube using a sticker representation
alphacube --format stickers \
--scramble '{ \
"U": [0, 0, 5, 5, 0, 5, 5, 4, 0], \
"D": [1, 3, 3, 4, 1, 1, 4, 1, 3], \
"L": [4, 5, 1, 0, 2, 2, 0, 1, 4], \
"R": [5, 2, 0, 2, 3, 3, 2, 0, 2], \
"F": [4, 3, 2, 4, 5, 1, 1, 4, 3], \
"B": [1, 5, 5, 0, 4, 3, 3, 2, 2] \
}' \
--beam_width 64