Created
February 21, 2013 22:13
-
-
Save sofoklis/5008832 to your computer and use it in GitHub Desktop.
switching heuristic in Eight puzzle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Creating a different solution with exactly the same code but a different | |
// ordering in my queue, so one can easily add solutions with better | |
// heuristic functions | |
def bestSolution(ordering: Ordering[(State, List[Move])]) = | |
aStarSearch(PriorityQueue((initialState, List[Move]()))(ordering), Set()) | |
lazy val bestSolutionManhatan: Option[List[Move]] = | |
bestSolution(manhatanOrdering) | |
lazy val bestSolutionMisplaced: Option[List[Move]] = | |
bestSolution(misplacedOrdering) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment