Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Artificial Intelligence: To implement a simple reflex agent for the vacuum envir

ID: 3742153 • Letter: A

Question

Artificial Intelligence:
To implement a simple reflex agent for the vacuum environment in Exercise 2.8 (Page 63
textbook). Run the environment with this agent for all possible initial dirt configuration
and agent locations. Record the performance score for each configuration and the overall
average score based on your design.
Alternatively, you may design a simple reflex agent for the application you have.
You may write your code in a contemporary language of your choice -- Java. A GUI interface is preferred.

Exercise 2.8 Implement a performance-measuring environment simulator for the vacuum-cleaner
world depicted in Figure 2.2 and specified on page 38. Your implementation should be modular
so that the sensors, actuators, and environment characteristics (size, shape, dirt placement,
etc.) can be changed easily. (Note: for some choices of programming language and operating
system there are already implementations in the online code repository.)

Explanation / Answer

""" Vacuum Cleaner Environment """ import numpy as np class VacuumEnvironment(object): def __init__(self, size, dirt): self.size = size self.dirt = dirt self.agent_x = np.random.randint(self.size[0]) self.agent_y = np.random.randint(self.size[1]) self.agent_facing = np.random.randint(4) # 0-up, 1-right, 2-down, 3-left # Layer 0: dirt, layer 1: objects/home self.room = np.zeros((2, self.size[0], self.size[1])) for row in range(self.size[0]): for col in range(self.size[1]): if np.random.uniform()
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote