
So here is a little detail about Bluestacks before we start using them.īlueStacks is one of the earliest and most used emulators to run Android applications on your Windows PC. There are two simple provided utility functions for evaluating algorithm/heuristic performance: evaluate() and compare().In this first method, we will use BlueStacks Emulator to install and use the mobile apps. The lower the number, the closer the board is to the goal (lower = better). Just pass any function that accepts a board and returns a number.

(This includes the Manhattan, Last Moves, and Corner Tiles heuristics.) Roughly speaking, adds an additional 2 to each pair of inverted tiles that are already on their goal row/column. linear_conflict_distance - This is an augmented Manhattan distance.

See documentation and comments in code for details about interactions with other heuristics. Can add an additional 2 penalty if the neighbors of the neighbors are also out-of-place. last_moves_distance - Adds a penalty of 2 if the neighbors of the goal are not located in the goal and the board is unsolved.hamming_distance - Count of how many tiles are in the correct position.euclidean_distance - The straight line distance in Euclidean space between two tiles.Additional moves are needed to shuffle the corners out and the neighbors back. corner_tiles_heuristic - Adds additional distance penalty when corners are incorrect, but the neighbors are in goal position.May miss the goal, even thought the board is solvable. Of the provided algorithms, only beam search is incomplete by default. See the docs for individual algorithms linked above. The search() method accepts the enum values or the str name.Īll algorithms support behavior customization via kwargs.
