7/3/2023 0 Comments Prolog block world problem![]() This heuristic works the same way as heuristic 3, but adds 2 for each case of mutual prevention. ![]() Heuristic 5 - If blocks A and B are preventing each other from being moved to their goal positions, we call this a case of mutual prevention. A block that must be moved twice is a block that is currently on the block upon which it must be placed in the goal state, but that block is a block that must be moved or if there exists a block that must be moved twice somewhere below it (in the same pile). A block that must be moved once is a block that is currently on a block different to the block upon which it rests in the goal state or a block that has such a block somewhere below it in the same pile. Heuristic 4 - this heuristic is twice the number of blocks that must be moved once plus four times the number of blocks that must be moved twice. Heuristic 3 - This heuristic adds 2 for every block that is not currently directly on top of the block on which it has to be in the goal state or if there is such a block somewhere below it (in the same pile). ![]() If Block A in the goal state is supposed to be on top of Block B and under Block C and in the current state it is neither on top of B or under C, then we add 2 to the heuristic. It calculates the difference between the current state and the goal state, but looks at the details of each block. Heuristic 2 - this heuristic is similar to Heuristic 1. We do not count a block if it is currently in the arm of the crane. Heuristics description: Heuristic 1 - this heuristic calculates the number of blocks that are currently not in the correct 'position'. We used six different heuristics to solve the problem using A*. These include DFS, BFS, UCS, A* and simulated annealing. We used a number of algorithms to solve the problem. The blocks world is a NP-hard problem and we wanted to find smart solution to solve it. The program was created by Terry Winograd and is a limited-domain natural-language system that can understand typed commands and move blocks around on a surface. % write( "BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB\n"),įind_children(NodeList,TopList,HeuristicVal):-įind_children(NodeList,TopList,HeuristicVal):-!.The blocks world is one of the most famous planning domains in artificial intelligence. % retract(curr_db_list(NodeList,TopList,HeuristicVal)),įind_children(NodeList,TopList,HeuristicVal),īest_child(BestNodeList,BestTopList,BestHVal),Īssert(curr_db_list(BestNodeList,BestTopList,BestHVal)), ![]() Move_block(integer,nodetype_list,top_list)Ĭopy_on_top_to_db(nodetype_list,top_list)Īssert(curr_db_list(NodeList,TopList,HeuristicVal)),Ĭurr_db_list(NodeList,TopList,HeuristicVal),
0 Comments
Leave a Reply. |