namespace SpriteCompiler.Problem { using SpriteCompiler.AI; public sealed class SpriteGeneratorSearchProblem { public static ISearchProblem CreateSearchProblem() { var goalTest = new SpriteGeneratorGoalTest(); var stepCost = new SpriteGeneratorStepCost(); var successors = new SpriteGeneratorSuccessorFunction(); var heuristic = new SpriteGeneratorHeuristicFunction(); return new SearchProblem(goalTest, stepCost, successors, heuristic); } public static ISearch Create() { var expander = new SpriteGeneratorNodeExpander(); var strategy = new TreeSearch(expander); var queue = new Adapters.QueueAdapter(); return new AStarSearch(strategy, queue); } public static ISearch Create(int maxCycles) { var expander = new SpriteGeneratorNodeExpander(); var strategy = new TreeSearch(expander); var queue = new Adapters.QueueAdapter(); var maxCost = (IntegerCost)maxCycles; return new IterativeDeepeningAStarSearch(strategy, maxCost); } } }