122A8056 Assignment1
122A8056 Assignment1
PRN 122A8056
Batch B3
Branch AI-DS
Introduction
Improvements Made
1. Goal-Based Agent:
2. Improvement in Visualization:
1. Cleaning Action:
- If it currently is over a dirty cell, it will clean the cell, making the value 2.
3. Random Move:
This heuristics enables the vacuum cleaner to clean the grid effectively by
first cleaning up the nearest dirt from its vicinity.
Features of Animation
1. Visualization of Grid:
2. Action Visualization:
- It would display the live vacuum cleaner's location along with its action
of cleaning and how it moves on the grid.
Code:
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from matplotlib import colors
plot_grid(grid, vacuum_pos)
# Define actions
ACTIONS = {
"UP": (-1, 0),
"DOWN": (1, 0),
"LEFT": (0, -1),
"RIGHT": (0, 1),
"CLEAN": (0, 0)
}
Snapshots
Conclusion