Spring2012.CSCI470Homework2 History

Show minor edits - Show changes to output

Changed line 46 from:
numStudents += 1 /* we have processed one more student */
to:
numStudents += 1 # we have processed one more student
Changed line 52 from:
numStudents += 1 /* increment numStudents by one */
to:
numStudents += 1 # increment numStudents by one
Changed line 2 from:
'''Due Date''': Thursday, Feb. 16, 2012\\
to:
'''Due Date''': Tuesday, Feb. 21, 2012\\
Changed lines 31-33 from:
!!Bonus

Your program could also:
to:
Your program should also:
Changed line 61 from:
(:source lang=C tabwidth=3 -trim :)
to:
(:source lang=python tabwidth=3 -trim :)
Deleted line 82:
*/
Changed lines 62-82 from:
/*
Author: <Your Name(s)>
Email: <Your email address(es)>
Class: CSCI 470, Section 1
Assignment: HMWK1
Due Date: <The assignment's due date>

Certification of Authenticity <remove one of the following>:

I certify that this lab is entirely my own work.

I certify that this lab is my own work, but I received
some assistance from: <Name(s)>

TASK: <Provide a simple, yet complete description of the task being
performed by this program. It may be several sentences long.>

INPUT: <Describe the input to this program. Be thorough.>

OUTPUT: <Describe the output to this program. Be thorough.>
to:
#
# Author: <Your Name(s)>
# Email: <Your email address(es)>
# Class: CSCI 470, Section 1
# Assignment: HMWK1
# Due Date: <The assignment's due date>
#
#
Certification of Authenticity <remove one of the following>:
#
#
I certify that this lab is entirely my own work.
#
#
I certify that this lab is my own work, but I received
# some assistance from: <Name(s)>
#
#
TASK: <Provide a simple, yet complete description of the task being
# performed by this program. It may be several sentences long.>
#
# INPUT: <Describe the input to this program. Be thorough.>
#
#
OUTPUT: <Describe the output to this program. Be thorough.>
#
Changed lines 9-15 from:
This assignment focuses on:

* To understand knowledge representation schemes and related issues.
* To understand the fundamental differences between symbolic, statistical, connectionist, and evolutionist approaches.
* To gain experience in programming with a programming language used in AI applications.
* To develop
working knowledge, in terms of understanding the theory and being able to design/implement working applications, of at least one AI area.
to:
This assignment's objectives are:

* Understand knowledge representation schemes and related issues.
* Gain experience in programming with a programming language used in AI applications.
* Develop working knowledge, in terms of understanding the theory and being able to design/implement working applications, of at least one AI area.
Changed lines 19-20 from:
Write a simple poem generator using Markov models and text available on the Internet.
to:
Write a Python poem generator using Markov models and text available on the Internet.
Changed lines 35-38 from:
# Have some way of evaluating its output (a crude way is fine). Let's call this its ''fitness function''. The fitness function should accept a string as input, and return a numeric value (the larger, the better).

# Loop enough times generating output and keeping only the best (as per your fitness function).
to:
# Have some way of evaluating its output (a crude way is fine). Let's call this its ''fitness function''. The fitness function should accept a string as input, and return a numeric value as output (the larger, the better).

# Loop enough times generating poems and keeping only the best (as per your fitness function).
Changed lines 90-94 from:
# Your python AI program, called '''poetGenerator.py''' .
to:
# Your Python AI program, called '''poemGenerator.py''' . Your program should run as follows:

-->@@python poemGenerator.py@@

-->(the @@data@@ subdirectory should be placed in the same directory as your program)
Added lines 1-109:
'''Assigned Date''': Tuesday, Feb. 7, 2012\\
'''Due Date''': Thursday, Feb. 16, 2012\\
'''Due Time''': 10:50am

Last modified on {$LastModified} (see [[http://www.cs.cofc.edu/~manaris/index.php/Spring2012.CSCI470Homework2?action=diff&source=n&minor=n | updates]])

!!Purpose

This assignment focuses on:

* To understand knowledge representation schemes and related issues.
* To understand the fundamental differences between symbolic, statistical, connectionist, and evolutionist approaches.
* To gain experience in programming with a programming language used in AI applications.
* To develop working knowledge, in terms of understanding the theory and being able to design/implement working applications, of at least one AI area.

This is a ''solo'' assignment (i.e., you must do it alone). '''You may discuss the assignment only with the instructor.'''

!!Assignment

Write a simple poem generator using Markov models and text available on the Internet.

!!Specifications

Your program should:

# Utilize one (or more) Markov model(s) to analyze text.

# Read a collection of text files (poems, books, etc.) from a subdirectory called @@data@@.

# Output a poem (in the "style" of the texts read in as input) to the standard output.

!!Bonus

Your program could also:

# Have some way of evaluating its output (a crude way is fine). Let's call this its ''fitness function''. The fitness function should accept a string as input, and return a numeric value (the larger, the better).

# Loop enough times generating output and keeping only the best (as per your fitness function).

!!Documentation

Follow the Golden Rule of Style: "A program should be as easy for a human being to read and understand as it is for a computer to execute." [1]

In general, you should comment any variable, obscure statement, block of code, etc. you create.

Also, you should comment '''why''' something is being done, e.g.,

(:source lang=python tabwidth=3 -trim :)
numStudents += 1 /* we have processed one more student */
(:sourcend:)

as opposed to '''how''' it is done, e.g.,

(:source lang=python tabwidth=3 -trim :)
numStudents += 1 /* increment numStudents by one */
(:sourcend:)

Finally, your code should always include opening comments as follows.

(''NOTE:'' Angle brackets signify information that needs to be filled out. '''Remove''' the angle brackets!)

(:source lang=C tabwidth=3 -trim :)
/*
Author: <Your Name(s)>
Email: <Your email address(es)>
Class: CSCI 470, Section 1
Assignment: HMWK1
Due Date: <The assignment's due date>

Certification of Authenticity <remove one of the following>:

I certify that this lab is entirely my own work.

I certify that this lab is my own work, but I received
some assistance from: <Name(s)>

TASK: <Provide a simple, yet complete description of the task being
performed by this program. It may be several sentences long.>

INPUT: <Describe the input to this program. Be thorough.>

OUTPUT: <Describe the output to this program. Be thorough.>

*/
(:sourcend:)

!!Submission

Submit your assignment on OAKS by the due date. Your submission must include:

# Your python AI program, called '''poetGenerator.py''' .

# Three poems generated from your program, called '''poem1.txt''', '''poem2.txt''', and '''poem3.txt''' that best demonstrate your programs poetic prowess. Note that '''these poems must be generated from the same input data'''.

# A '''README.txt''' file, which describes the data and explains how it was acquired (i.e., URLs).

# Your input data stored in a zip file, called '''data.zip'''.

!!Grading

Your grade will be based on the elegance of your design, the quality of your documentation, and how well you followed the above instructions. In particular, there are many ways to achieve the above functionality. '''Aim for simplicity and elegance.''' Design, design, design... before you implement.

!!Reference

# Cooper, D. and Clancy, M. (1985) "Oh! Pascal", 2nd ed., W.W. Norton & Company, New York, p. 42.

!!Relevant Quote

"Any amount of work can be done in any amount of time... only the quality varies." ~Joao Meidanis