Problem 2: Describe reasonable heuristic algorithms or rules for the follow- ing
ID: 3824083 • Letter: P
Question
Problem 2: Describe reasonable heuristic algorithms or rules for the follow-
ing problems. For this problem, you do not need to give full implementation details: it is enough to describe the main idea behind the algorithm or rule in 1-2 sentences. Keep in mind that it is ok if a heuristic sometimes fails to find the best answer.
2. PacMan is a popular video game in which you control a character in a
maze. The maze contains golden tokens at various locations, and your
goal is to `eat' as many of these tokens as you can (in other words,
move the PacMan character over the tokens). The maze also contains
`ghosts', who move around the maze and try to eat PacMan. If a ghost
collides with PacMan, then the game is over. Design a reasonable
heuristic algorithm for maximizing the number of tokens collected. (See
https://www.google.com/#q=pacman&clb=clb to play.)
Explanation / Answer
We can choose any one of the random golden token and then calculate the distance between this token and rest other tokens. Likewise we can calculate the distances for all the golden tokens one by one changing the starting points.
After getting all the distances, we can choose that token as starting with which we get least distance because the less distance we travel the more is the cance of avoiding ghosts.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.