An image model for the block design test.
Run python main.py to get started.
Example:
python main.py --puzzle puzzle_b --face_search beeline_search --piece_search sequential_search --puzzle_memory_loss .5 --puzzle_memory_loss_counter_limit 5 --glance_factor 1 --csv stats.csv
...solves puzzle_b.png using the beeline face search and sequential puzzle piece search, with a memory loss of 50% of the puzzle every 5 puzzle piece attempts, recall of 100% of the puzzle image's width and height from some top left corner of the puzzle, and dump the solution list to stats.csv.
python main.py --analyze past_runs/puzzle_c_beeline_search_skip_unknown_search_0.1_3_1.0_1000.csv --output_file output.csv
... analyzes the designated file and outputs results to output.csv
The name of the puzzle image to solve
The search algorithm to find the destination pattern on a block
The search algorithm that returns the next piece of the puzzle to solve
The rate of memory loss (0-100% of entire puzzle)
Memory loss kicks every time this limit of puzzle piece attempts (resets every time the limit is achieved; sometimes, we get a puzzle piece of "UNKNOWN" and this constitutes an attempt)
Memory recall is will be refreshed from some top left point (row, col), extending to the bottom right point (puzzle_height * glance_factor, puzzle_width * glance_factor)
If provided, saves each state of a run into number coded .pngs to this designated path
Number of times to solve the puzzle using this configuration. Use in conjuction with the --csv flag.
Dumps the full list of solution actions to the specified file. If "default" is passed, use a name delineated by the configuration, e.g. {puzzle_input}{face_search_input}{puzzle_piece_search_input}{puzzle_memory_loss_factor_input}{puzzle_memory_loss_counter_limit_input}{glance_factor_input}{iterations_input}
If provided, analyzes the given csv file (must be produced through main.py with the --csv flag), returning statistics about those runs
If provided, prints output into this file instead of the terminal.
Represents block in sprawled-out 2D form using the underlying image:
- Traverse to neighboring faces by specifying the number
- Rotations rotate the entire 2D block
See enums.py
Forgetfulness is modeled as blotted out pixels
- Takes in a puzzle and search strategies to solve a block design test
- Converts the image to a puzzle model by sampling from four points per block
- Face search functions look for some face in a block
- Puzzle piece search functions look for the next puzzle piece to solve for
Test all modules
python -m unittest test
Test an individual module
python -m unittest test/test_search.py
- Provides raw information about a few solutions to problems
- Visualizes the puzzle state of a sample solution run
- The puzzles available to be solved
- The image representation of the various faces of the block
- The image representation of the entire block