A General PEAS Agent: Maze Traversing Agent Performance: Number of moves it takes to solve the maze or find cheese Environment: Maze Actuators: performMovement function Sensors: examineEnvironment function
Rules A* with various h(x) From a starting point, find a path to another point Cannot walk through walls
A* Heuristics Implemented Euclidean Manhattan Number of Walls (Method 1) Number of Walls (Method 2) Last in List (f(x) = 0; udlr) Dijkstra’s (h(x) = 0) Random Numbers (0-15)
Number of Walls (Method 1) Take starting position x1 and y1, take ending position x2 and y2, set wall = 0 Repeat until x1 = x2 and y1 = y2 If x1 > x2, x1 – 1; if x1 y2, y1 – 1; if y1 < y2, y1 + 1; else y1 If a wall exists at the new (x1, y1), wall + 1
Number of Walls (Method 2) Take starting position x1 and y1, take ending position x2 and y2, set wall = 0 Repeat until x1 = x2 If x1 > x2, x1 – 1; if x1 y2, y1 – 1; if y1 < y2, y1 + 1; else y1 If a wall exists at the new (x1, y1), wall + 1
Last in List Chooses the last member of the closed set (most recently added) Results in a unique order – find the most recent expanded node with adjacent unexpanded nodes and select the top, bottom, left, right node to continue down in that order. Bizzare, efficient results in some cases. Similar to depth first search. Accidental mis-implementation of Dijkstra’s which occurs when f(x) = 0 instead of h(x) = 0.
Maze Conclusions Random Heuristics are useless in general Dijkstra’s fared even worse than random heuristics? Euclidian/Manhattan performance depended on maze, usually not well, many misleading paths in mazes Number of walls did relatively okay Depth first did well, but likely because of good random positioning of the starting location and the cheese