CSCI-561 –Foundations of Artificial Intelligence Homework 1a solved




In this exercise, you need to implement a simple reflex agent based on what you
learned. After that you need to upload your python file to the Vocareum to be graded.
The behavior of a simple reflex agent is as follows:
An illustrative Example
Sample input file (the input file should be named as “input.txt”):
Format: Lines of comma separate value tuples .
Sample Output File:
Your python script must call the output file “output.txt”.
Your homework submission will be tested as follows:
It should read a text file called “input.txt” in the current directory that contains a
problem definition. It should write a file “output.txt” with your solution. The formats
for files “input.txt” and “output.txt” are specified below. End-of-line convention is
Unix (because Vocareum is a Unix system).
Note that if your code does not compile, or somehow fails to load and parse input.txt,
or writes an incorrectly formatted output.txt, or no output.txt at all, or OuTpUt.TxT,
you will get zero points.
Sample Test Cases
You are provided with 1 sample test case and output. Please find them in the
Homework 1 folder.
Homework Rules
1. You must use Python 2.7 to implement your homework assignment. You are
allowed to use standard libraries only. You have to implement any other functions or
methods by yourself.
2. You need to create a file named “”. When you submit the
homework on, the following commands will be executed: python
3. Your code must create a file named “output.txt” and print its output there.
4. Homework should be submitted through Vocareum. Homework submitted through
email, in person during office hours, or through any channel other than Vocareum will
not be accepted. Please only upload your code to the “/work” directory. Don’t create
any subfolder or upload any other files. Please refer to to get started with
5. Your program should handle all test cases within a reasonable time. A maximum
runtime of 3 minutes per test case will be set on Vocareum.
6. You are strongly recommended to submit at least two hours ahead of the deadline,
as the submission system around the deadline might be slow and possibly cause late
submission. Late submissions will not be graded.