Академический Документы
Профессиональный Документы
Культура Документы
ARTIFICIAL INTELLIGENCE ASSIGNMENT 2 Planning - The Monkey and the locked cabinet
I. Introduction
In a room, there is a Monkey who wants to get some bananas from the cabinet. However, the cabinet is on high place and is locked. The key to open cabinet is hanged on another place. He is trying his best to get the key and open the cabinet (Figure 1). The Monkey is not tall enough to take the key or to open the cabinet from the floor, but there are some cubic boxes that he can use as the assistant. There are three kinds of cubic box with the edge length of 20, 40 or 80 cm. The Monkey can push any box around, but he can bring only one 20 cm or 40 cm boxes in his hand. He can also climb on a box, but the maximum height that he can climb (up or down) is just 20 cm. So he may place boxes near each other, so that he can create some kind of ladder. The Monkey can lay one box on another box with the condition that only the smaller box can be on the surface of the other. In addition, the bottom of the smaller box must be completely on the top of the bigger one (not any part of smaller boxs bottom is outside). When the Monkey is moving (go on floor, climb up or climb down), he may or may not bring one thing (box or key) in his hand. The Monkey can only holding one thing in his hand each time.
II.
Requirement
You are required to help that poor Monkey by implementing a planner of which solution will be used to guide the Monkey to get bananas. If you need nonlinear planning knowledge to solve the problem, you must use nonlinear planning by posting constrains to do this task. Actions that the Monkey can do: goto(X,Y) The Monkey moves to the location (X, Y) on the same height coordinate Z. goNear(B) The Monkey moves to the location near box (or key) B (the distance from the Monkey to one side of B is 0). He can do this action only if he and B on the same surface S (floor, box or boxes) or the box B is closed to the boundary of the surface S.
goNear(b1)
goNear(Bigbox)
Figure 2b: The box B is closed to the boundary of the surface S push(B,X,Y) The Monkey pushes the box B to the location (X, Y) on the same height Z. In this case, he must be at the location where is near the box B, and the top surface of B must be cleared. When the action is finished, the Monkey is still near B. pickup(B) The Monkey picks the box (or key) B up from the surface (floor, box or boxes) and holds it in hands. He can do this action only if he is at a location where is near B and if B is a box, its top surface must be cleared.
Putdown(B,X,Y)
X1,Y1
X,Y
Figure 2a: Example when putting down on floor Figure 2b gives detailed example when putting down the box on the top of one box. The Monkey is on the big box and he is holding a smaller box B. He can put the box B down on the top of the big box. When the action is finished, the box B is on the big box and its location is at (X, Y, Z). Besides, the Monkey is near the box B. Putdown(B,X,Y)
X1,Y1,Z
X,Y,Z
Figure 2b: Example when putting down on the top of one box 3
X1,Y1,Z
X,Y,Z
Figure 2c: Example of putting down on two boxes stack(B,C) The Monkey puts the box B that he is holding on top of the box C. He can do this action only if B and C have same size and he is currently near C. Besides, the difference between his height coordinate and the top of C must be in the range of [0 20] cm. When this action is finished, the Monkey is still near the box C. See Figure 3 for some detailed examples. unstack(B,C) The Monkey picks the box B that is currently on box C and holds it on hands. He can do this action only if B and C have same size and he is currently near C. Besides, the difference between his height coordinate and the top of C must be in the range of [0 - 20] cm. climbup(B) The Monkey climbs up on top of the box B. He can do this action only if he is currently near B and the difference between his height coordinate and the top of B must be in the range of (0 - 20] cm. After this action is finished, the Monkey is on the box B. Figure 4 gives example of climbup action. At first time, he is on the small box b1 and near the big box b2. He can climb up on b2. When he is on b2, he can apply action goNear(b3) because he and the box b3 are on the same surface. After that, he climbs up on b3.
<= 20cm
Figure 4: Example of climbup action climbdown(B) The Monkey climbs down on top of the box B. He can do this action only if his height coordinate Z is higher than the top of box B at most 20 cm. When this action is finished, the Monkey will be on the box B. climb2floor 5
Notes on the output data: You are required to print out the action chain that will lead the Monkey open the cabinet. Actions are separated by commas. No newline at the start and end of action chain. Example: go(30,30),pickup(b1),go(50,50),putdown(b1),climbup(b1),getkey,open
III.
Predicates which are used to describe the plan space: on(A,B): A is completely on the top of B where: + A can be a Monkey, a key or a box. + B can be the floor or a box Example: on(Monkey,b1) or on(key,floor) or on(Monkey,floor) near(B): the Monkey is near B (the distance from the Monkey to one side of B is 0, where B is a key or a box. The Monkey is either not near anything or near only one thing each time. room(Width,Length,Height) : The rooms size in cm. Example: room(100,500,400): the room have 100cm in width, 500cm in length and 400cm in height. at(loc(X,Y,Z),T): T is at the location (X,Y,Z) in the coordinate system. T is the name of object in the room. object(M): M is the object in room (Monkey, key, cabinet or box). If M is a box, M have the format box(N,S) where N is the name of box and S is the edge size of box in cm. open: The cabinet is opened At a time, the location of the Monkey can be on a box, near a box or at a specific location (X, Y, Z). The location of a box or a key B can be on one box, on Monkeys hands, on floor or a specific location (X, Y, Z).
IV.
Submission
a. Report of plan space definition, action specification and detail algorithm (heuristics on nonlinear planning by posting constrains). The file must be report.doc.
V.
Grading
The room size will very large and the number of boxes will be enough for you to create ladders. + Inputs have all boxes that have edge length of 20cm. (60 testcases) + Inputs have boxes with edge length of 20, 40 or 80cm with the maximum height of key and cabinet less than or equal 160cm. (30 testcases). + Inputs have boxes with edge length of 20, 40 or 80cm and there is no limit on height of key and cabinet. (20 testcases)
VI.