Assignment 3: Game Playing, Conversational Agents |
CSE 415: Introduction to Artificial Intelligence The University of Washington, Seattle, Autumn 2010 |
The reading for this assignment is
"Search".
|
Due Monday, Nov. 1 (was Friday, October 29) through
Catalyst CollectIt
at 2:00 PM.
(The alpha-beta pruning enhancement is due Friday, Nov. 5 at 2:00 PM.)
In this assignment we expand upon the game of Tic-Tac-Toe to a more interesting generalization of it: "K-in-Row with Forbidden Squares." At the same time, we put our agents into more serious competition, adding lookahead (with the Minimax technique) and pruning (with the alpha-beta method) to the search. In addition, we add an element of fun and creativity that could serve as an opportunity to beat the Turing Test; this takes place via an "utterance" feature. The assignment has two parts: creating your agent and engaging your agent in a first round of competition play.
|
Instructions.
Create a program (consisting of a
collection of specific functions and any additional helping functions
that you need) for playing games of "K in a
Row". We define a K-in-a-Row game as a kind of generalized
Tic-Tac-Toe with the following features:
Your program should have a well-defined "personality". Some examples of possible personalities are these: friendly; harmless joker; blunt joker; paranoid; wisecracker; sage; geek; wimp; competitive freak; fortune-teller (based on the state of the game). The personality will be revealed during games via the "utterances" made by the program. (For more details, see the description of the makeMoveAndTalk function below.) Your program must include the following functions, all defined in your main file. You can have helper functions if you like. Please keep all the functions required by your player either in just one Python file or a small number of files that use the following specific naming rules: Name your main (and what might be your only) file in this style: yourUWNetIDKINAROW.py. For example, my player would be in a file tanimotoKINAROW.py. This will facilitate your player's being part of the class tournament. Any other files may have any valid Python file name, provided that the name starts with your UWNetID. This will prevent naming conflicts between identifiers belonging to opposing players during matches.
An alpha cutoff will occur at an odd-numbered ply when at the root it is X's turn. A beta cutoff will occur at an even ply when at the root it is X's turn. "out of 6" here is saying that the overall search was to a depth of 6. The provisional value is the one in the MiniMax algorithm at the level where the cutoff is found. If the parameter "debugging" is False, then the utterance does not need to mention anything about alpha or beta cutoffs. The makeMoveAndTalk function should return its answer within maxMillisecPerMove. You can assume this will never be less than 50 and will usually be around 1000 or more for tournament play. The utterance you return from makeMoveAndTalk must reflect both the personality of your player and, usually, the state of the game in some way. For example, if your personality is geeky, an utterance might be something like "Oh gosh, I've searched to a depth of 4 but the static value of the board I'm giving you is -117. My chances of recovery seem very slight." A paranoid might utter, "What do you mean by going there? You now have 7 in a row and I think you are trying to do me in." Here's an example of a display after an agent of this sort made its move in a game of Five in a Row on a 7 by 7 Board with Corners Forbidden. Testing: We are providing two ways for you to test some of your code. One involves testing only your successors function. There are two files for this: The file moveTester.py will call your successors function (once you edit in the correct name of your Python file). It will compare it with the correct list of successors for the given state, and then it will tell you if your successors are the same as the correct ones. The compiled Python file GroundTruth26.pyc computes the correct set of successors for this comparison. It is compiled for Python 2.6. Here is GroundTruth27.pyc compiled for Python 2.7. The other way of testing your code is to upload your program to the tournament website and try competing. Here is the website: Grading Notes: Most of the functions above are essential for tournament play. These are all except successors (which you might need anyway for your implementation of makeMoveAndTalk), staticValue (same). In the event that your program does not compete, we may run this "stepping stone" function to give partial credit. staticValue, however, will be graded separately. The staff plans to grade your staticValue functions by importing your main file, calling your prepare() function, and then calling your staticValue() function on one more more legal states. This means that (a) both your prepare() and staticValue() functions should be defined in your main file, (b) neither of these functions should require importing other files, and (c) importing and running these functions should not cause anything to be printed out -- all results from the functions must be part of their legal return values. Although your makeMoveAndTalk function must produce a new state and an utterance, we will not be grading the utterances until after the Nov. 5 versions are due. That will allow you more time to work on coming up with appropriate utterances. The utterances for the Oct. 29 version of your program can be as simple as a constant "Now it's your move."
It will be important for your program to be able to play in the
tournament. We'll be looking for both imagination and "functionality"
in the personality and its reflection in the utterances. How the
utterances respond to questions or comments and how they
reflect both personality and game state will be
important. We plan to award some extra credit to the top few (five?)
programs in the tournament and the "best" use of utterances (possibly
via voting by the class).
|
Updates and Corrections If necessary, updates and corrections will be posted here and mentioned in class or on GoPost. (Updated with links to moveTester.py and GroundTruth26.pyc on Oct. 24. Updated on Oct. 27 with information about how the initial submissions, especially staticValue(), will be graded. Deadline extended to Nov. 1 on Oct 28, due to stopped queue on the game server.) |