HOMEWORK 1
(9 Points)
Due: February 1, 2000
Background
(setf vw (make-vacuum-world))
(initialize vw)
(display-environment vw)
(run-environment vw)
(run-environment (make-vacuum-world))
(run-environment (make-vacuum-world :max-steps 10))
(run-environment (make-vacuum-world :stream nil))
(run-environment (make-vacuum-world :aspec '(random-vacuum-agent)))
(run-environment
(make-vacuum-world :aspec '(random-vacuum-agent) :max-steps 10))
(run-environment
(make-vacuum-world :aspec '(reactive-vacuum-agent) :max-steps 10))
(run-environment
(make-vacuum-world :cspec '((at all (P 0.9 dirt)))
:max-steps 10))
(agent-trials 'make-vacuum-world
'(reactive-vacuum-agent random-vacuum-agent)
:n 10)
Homework Exercises
(run-environment (make-vacuum-world :aspec '(ask-user-agent)))You will be asked to input the actions yourself. You should be able to determine what to enter by studying the code for random-vacuum-agent and reactive-vacuum-agent. Perform every action at least once, in an interesting variety of situations, and vacuum up at least some dirt.
Turn in a copy of the interaction.
``Implement an environment for a n x m rectangular room, where each square has a 5% chance of containing dirt, and n and m are chosen at random from the range of 8 to 15, inclusive.''Do this by writing a
[Exercise 2.7, p. 52, of the text]
defstructure based on and using the
structure vacuum-world from the file
agents/environments/vacuum.lisp but changing the
size and cspec slots. Turn in this
defstructure definition, and the printing of several
instances of the environment showing some random variations.
(defstructure (furniture (:include obstacle (name "@"))))Then, we need to define a vacuum world with furniture as well as dirt:
(defstructure
(vacuum-world-with-furniture
(:include vacuum-world
(cspec '((at all (P 0.25 dirt))
(at all (P 0.25 furniture)))))))
Repeat Exercise 2 above, but make each square in the rooms have a 10% chance of containing dirt and a 5% chance of containing furniture.
-------------------------------- cut here -------------------------------- ;;; CSE 4/572 Homework 1 ;;; Name: ;;; Course: ;;; Recitation: ;;; ;;; 1. (3 points) A transcript of the ask-user-agent in the vacuum world: ;;; 2. (3 points) The defstructure for the rectangular vacuum world: ;;; Several rectangular vacuum worlds are: ;;; 3. (3 points) The defstructure for the rectangular vacuum world ;;; with each room having a 10% chance of containing dirt and a 5% ;;; chance of containing furniture: ;;; Several rectangular vacuum worlds with furniture are: -------------------------------- cut here --------------------------------