def on_click(): ''' This function defines the action of the 'Next' button. ''' global algo, counter, next_button, romania_problem, start, goal romania_problem = GraphProblem(start.get(), goal.get(), romania_map) if "Breadth-First Tree Search" == algo.get(): node = breadth_first_tree_search(romania_problem) if node is not None: final_path = bfts(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Depth-First Tree Search" == algo.get(): node = depth_first_tree_search(romania_problem) if node is not None: final_path = dfts(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Breadth-First Search" == algo.get(): node = breadth_first_search(romania_problem) if node is not None: final_path = bfs(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Depth-First Graph Search" == algo.get(): node = depth_first_graph_search(romania_problem) if node is not None: final_path = dfgs(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Uniform Cost Search" == algo.get(): node = uniform_cost_search(romania_problem) if node is not None: final_path = ucs(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "A* - Search" == algo.get(): node = astar_search(romania_problem) if node is not None: final_path = asts(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1
def on_click(): """ This function defines the action of the 'Next' button. """ global algo, counter, next_button, romania_problem, start, goal romania_problem = GraphProblem(start.get(), goal.get(), romania_map) if "Breadth-First Tree Search" == algo.get(): node = breadth_first_tree_search(romania_problem) if node is not None: final_path = bfts(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Depth-First Tree Search" == algo.get(): node = depth_first_tree_search(romania_problem) if node is not None: final_path = dfts(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Breadth-First Graph Search" == algo.get(): node = breadth_first_graph_search(romania_problem) if node is not None: final_path = bfs(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Depth-First Graph Search" == algo.get(): node = depth_first_graph_search(romania_problem) if node is not None: final_path = dfgs(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "Uniform Cost Search" == algo.get(): node = uniform_cost_search(romania_problem) if node is not None: final_path = ucs(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1 elif "A* - Search" == algo.get(): node = astar_search(romania_problem) if node is not None: final_path = asts(romania_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1
def on_click(): """ This function defines the action of the 'Next' button. """ global algo, counter, next_button, region_problem, start, goal region_problem = GraphProblem(start.get(), goal.get(), map_region) if "A* - Search" == algo.get(): node = astar_search(region_problem) if node is not None: final_path = asts(region_problem).solution() final_path.append(start.get()) display_final(final_path) next_button.config(state="disabled") counter += 1