# CAP 6635 Artificial Intelligence; X. Zhu; 01/19/2022
# Code adopted from https://github.com/mawippel/python-vacuum. Changes are made to
reflect agent moves following predefined path
# Reflex Vacuum Cleaner Agent. Agent makes random move (-1 for each move, and +10
for clean a spot)
import matplotlib.pyplot as plt
import numpy as np
import random
# 0 -> clean
# 1 -> wall
# 2 -> dirt
# T
...[Show More]
# CAP 6635 Artificial Intelligence; X. Zhu; 01/19/2022
# Code adopted from https://github.com/mawippel/python-vacuum. Changes are made to
reflect agent moves following predefined path
# Reflex Vacuum Cleaner Agent. Agent makes random move (-1 for each move, and +10
for clean a spot)
import matplotlib.pyplot as plt
import numpy as np
import random
# 0 -> clean
# 1 -> wall
# 2 -> dirt
# The original matrix contains probablty values which will be used to generte the
environment.
# if you want to make a spot to have dirt for sure, set the value as 1.0
# if you do NOT want to make a spot to have dirt, set the value as 0
matrix = [
[1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0],
[1.0, 0.1, 0.1, 0.1, 0.4, 0.4, 1.0],
[1.0, 0.1, 0.1, 0.1, 0.6, 0.4, 1.0],
[1.0, 0.1, 0.4, 0.1, 0.1, 0.1, 1.0],
[1.0, 0.4, 0.6, 0.4, 0.1, 0.1, 1.0],
[1.0, 0.1, 0.4, 0.1, 0.1, 0.1, 1.0],
[1.0, 1.0, 1.0, 1.0
[Show Less]