Skip to main content

Homework 2: Hunt the Wampa (10%)

Due October 10, 2023 at 11:59:00 PM on Blackboard.

Materials:

HW2-LogicalAgents.ipynb

Learning Objectives

In this assignment, you will:

  • Combine propositional logic rules to create an inference algorithm & knowledge base that can successfully guide the agent (the robot R2-D2) toward its goal
  • Analyze the consequences of propositional logic rules on the agent's decision-making process
  • Evaluate the effectiveness of your inference algorithm in guiding the agent's behavior in different Wampa World scenarios
  • Recognize logical agents in the wild
  • Compare logical agents to search algorithms

Part 1: Implement the agent

  1. [5 points] Implement the knowledgeBase() function in the Agent class.
  2. [10 points] Implement the inferenceAlgorithm() function in the Agent class.
  3. [10 points] For 1 successful path for each scenario, have your program print out the logic rule used at each step, what action the agent took, and what the percepts were. Report these values in your pdf.

Part 2: Analyze it (Answer in natural language)

These questions depend on Part 1, so be sure to finish Part 1 first.

  1. [2 points] Were there any steps where the agent could have used a different logic rule and have still succeeded? If so, select one step and explain whether it would change its path. If not, explain why not.
  2. [2 points] How efficient was your agent? Was there ever a shorter path available that it didn't take?
  3. [2 point] Were there any steps where the agent was navigating "blindly" (i.e., without any information about a particular square)? Where?

Part 3: Expand your thinking (Answer in natural language)

  1. [3 points] Where might you use a logical agent like this in the real world?
  2. [3 points] How does a logical agent like this compare to a search agent?
  3. [3 points] Could you integrate a search algorithm into this agent? If so, how? If not, why not?

Part 4: Feedback (Answer in natural language)

  1. [1 point] Approximately how long did you spend on this assignment?
  2. [1 point] Which aspects of this assignment did you find most challenging? Were there any significant stumbling blocks?
  3. [1 point] Which aspects of this assignment did you like? Is there anything you would have changed?

What to Submit

Create a zip with your ipynb file and a pdf with the answers to Questions 3-12 named with the first letter of your first name, your last name, and homework number (example: lmartin_hw2.zip) and submit it on Blackboard before the due date. If you are submitting as a pair, please label the file with both of your last names and the homework number (example: martin_ayanzadeh_hw2.zip).
Submission link

Grading Summary

  • Part 1 - 25 points
  • Part 2 - 6 points
  • Part 3 - 9 points
  • Part 4 - 3 points