Advertisement
claukiller

SI

Oct 27th, 2017
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.85 KB | None | 0 0
  1. /* ------------------------------------------ */
  2. /* Algoritmos recursivos (implementan Search) */
  3. /* ------------------------------------------ */
  4.  
  5. //eightPuzzleDepthLimitedSearchDemo(10); // Busqueda en profundidad limitada
  6. //eightPuzzleIterativeDeepeningSearchDemo(); // Busqueda en profundidad iterativa
  7.  
  8.  
  9. /* -------------------- */
  10. /* BUSQUEDA INTELIGENTE */
  11. /* -------------------- */
  12.  
  13. /* A* con busqueda en arboles */ //(mas complicada pero aun asi con h2 mas q en anchura)
  14. //eightPuzzleAStarDemo(new AStarSearch(new TreeSearch(),new NullHeuristicFunction()));
  15. //eightPuzzleAStarDemo(new AStarSearch(new TreeSearch(),new MisplacedT HeuristicFunction(goalState)));
  16. eightPuzzleAStarDemo(new AStarSearch(new TreeSearch(),new ManhattanHeuristicFunction(goalState)));
  17. //eightPuzzleAStarDemo(new AStarSearch(new TreeSearch(),new NoConsistentHeuristicFunction(goalState)));
  18.  
  19. //no va a llegar en muchos a solucion optima (mirar las instancias raras)
  20. /* A* con busqueda en grafos, sin rectificar ni reexpandir nodos ya expandidos */
  21. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearch(),new NullHeuristicFunction()));
  22. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearch(),new MisplacedTilleHeuristicFunction(goalState)));
  23. eightPuzzleAStarDemo(new AStarSearch(new GraphSearch(),new Heuristic12(goalState)));
  24. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearch(),new ManhattanHeuristicFunction(goalState)));
  25. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearch(),new NoConsistentHeuristicFunction(goalState)));
  26.  
  27.  
  28. //estos hasta el lunes nooooooooooooooooooooooo
  29.  
  30. /* A* con busqueda en grafos, con reexpansion de nodos ya expandidos */ //rectifica los nodos de abierta
  31. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchReinsertExpanded(),new NullHeuristicFunction()));
  32. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchReinsertExpanded(),new MisplacedTilleHeuristicFunction(goalState)));
  33. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchReinsertExpanded(),new ManhattanHeuristicFunction(goalState)));
  34. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchReinsertExpanded(),new NoConsistentHeuristicFunction(goalState)));
  35.  
  36. /* A* con busqueda en grafos, con rectificacion de nodos ya expandidos */ //algo general de busqueda, rectifica cascada
  37. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(),new NullHeuristicFunction()));
  38. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(),new MisplacedTilleHeuristicFunction(goalState)));
  39. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(),new ManhattanHeuristicFunction(goalState)));
  40. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(),new NoConsistentHeuristicFunction(goalState)));
  41.  
  42. /* A* con monitorizacion de los f-valores de los nodos expandidos */
  43. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(new NullHeuristicFunction()),new NullHeuristicFunction()));
  44. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(new MisplacedTilleHeuristicFunction(goalState)),new MisplacedTilleHeuristicFunction(goalState)));
  45. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(new ManhattanHeuristicFunction(goalState)),new ManhattanHeuristicFunction(goalState)));
  46. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchRectifyExpanded(new NoConsistentHeuristicFunction(goalState)),new NoConsistentHeuristicFunction(goalState)));
  47.  
  48. /* Greedy Best First Search */
  49. //eightPuzzleGreedyBestFirstDemo(new MisplacedTilleHeuristicFunction(goalState));
  50. //eightPuzzleGreedyBestFirstDemo(new ManhattanHeuristicFunction(goalState));
  51.  
  52. /* Algoritmo de Ponderacion Estatica, PEA*/
  53. //eightPuzzleAStarDemo(new AStarSearch(new GraphSearchReinsertExpanded(),new ManhattanHeuristicFunction(goalState, 0.2)));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement