Package edu.columbia.cs.coms4701.agent.environments.pente

Assignment 2: Pente game-playing.

See:
          Description

Interface Summary
PenteAgentProgram Interface for your agent programs.
PentePercept A percept in the Pente environment.
 

Class Summary
PenteAction Describes a move in the Pente game.
PenteAgent A Pente game-playing agent.
PenteEnvironment The Pente game environment.
PenteEnvironmentObserver An EnvironmentObserver customized for the Pente game environment.
PenteGameLogObserver An EnvironmentObserver customized for the Pente game environment.
PenteGridCell GUI class representing a Pente intersection.
PenteGridPanel GUI class for showing the Pente grid; just a few tweaks from the normal GridPanel.
PentePerceptBoard A percept describing the complete state of the board.
PentePerceptEndgame A percept received at the end of the game, indicating the winner if any.
PentePerceptError A percept indicating that the player's previous move was invalid.
PentePerceptGame Percept received just once, at the beginning of the game, indicating the basic setup of this game instance -- the size of the board, the operating rules, how many players there are, and which turn # your agent is assigned.
PentePerceptRecentActions A percept containing an ordered list of the legal moves that have been performed (including *this* player's move) in the past round.
PenteRapidRunner Runs many iterations of a game, tallying wins and losses for each player.
PenteRules A description of the rules for the current game.
PenteRunner Runs a single round of the Pente game.
PenteScorekeeper Quaint little class for keeping track of who wins or loses, and why.
PenteTournamentRunner Runs a game without GUI, printing each event to a log.
Stone A playing stone.
 

Enum Summary
PenteGridCell.Highlight  
PentePerceptEndgame.GameResult Possible outcomes of a game.
PentePerceptError.ReasonForError Explains why an attempted move is invalid.
Stone.StoneColor  
 

Package edu.columbia.cs.coms4701.agent.environments.pente Description

Assignment 2: Pente game-playing.

Description

In this environment, your agent is a player of the board game Pente.

Rules of Pente are described on pente.net. Our default set of rules are the "Tournament Rules" described there.

Your agent will initially receive a PentePerceptGame indicating the rules of this particular instance of the game.

In subsequent rounds, your agent will receive two percepts: a PentePerceptBoard describing the location of all stones on the board, and a PentePerceptRecentActions that is an ordered list of the most recent actions (including your own agent's last move).

Note that you may need to consider both the stone positions and the list of actions to completely understand the state of the game; for example, if a capture is performed, the capturing player is closer to winning than before; it would be foolish to overlook this.

Setup

Once you've followed the directions in the overview page for setting up your Java development environment, the setup for this assignment is easy. You should be able to just decompress the assignment file, run an ant compile, and get started.

Platform Build environment Instructions
Unix, Mac, Windows Command-line tools

To clean the project for a fresh start, type

ant clean

To compile, type

ant compile

To run, type

ant run -Dplayer1=yourUNI.PenteAgentProgram

Eclipse IDE

Create a new project from an ant buildfile, selecting the build.xml file.

What else? Your feedback is appreciated.

Running the Game

To run an instance of the game, type

ant run
. By default this uses two players: the awh2101.PenteAgentProgram, which plays randomly, and the human.PenteAgentProgram, which allows you to control the player through a GUI interface.

The ant run task accepts a variety of parameters to customize the game environment. You may supply these parameters in any combination:

RapidRunner

Playing one game at a time is fine for debugging and early experimentation, but to do more methodical modification and improvement of your agent, you might want a way to compare two agents systematically. The RapidRunner class (and the associated ant task) allow you to run many game instances in a row, turning off the GUI and just collecting the final results.

To run multiple games between two players, type:

ant run.rapid -Drules=Standard -Diterations=10 -Dplayer1=yourUNI.PenteAgentProgram -Dplayer1.depth=2 -Dplayer2=yourUNI.OtherAgentProgram -Dplayer2.depth=2
If you create two different agents with slightly different parameters (such as heuristic weights), playing multiple games allows you to determine which is superior.

Development

Now you can get started on the coding! Please remember to:

Submission

Part 1: Specification

Before the deadline (11am on October 10th), prepare your submission as follows:

  1. Create a directory for submission:
    1. Create a container folder with your UNI:
      mkdir awh2101
      (if working in a pair, just submit under one person's UNI, and be sure to note the other's.)
    2. Place a file named Specification.txt, Specification.html, or Specification.pdf with the following into your awh2101 directory:
      • The algorithm for alpha beta cut-offs
      • A description of the evaluation function that you plan to use (which should include at least three features) and an algorithm that computes the values for each feature
      • The algorithm for your move generator.
      • In addition, you should provide two paragraphs of text that describe your approach.
      • All algorithms should be provided in pseudo code. The specification that you provide will count for 15% of your grade.
  2. Create a .zip or .tar.gz archive of the directory:
    tar czvf awh2101.tar.gz awh2101
  3. Submit via Courseworks:
    1. Log into Courseworks and go to the AI page.
    2. In the horizontal toolbar, click "Post File"
    3. Enter title "Assignment 2: Specification", select the yourUNI.tar.gz file, post file to "Harnly, Aaron", and send!

Part 2: Full Program

Before the deadline (11am on October 19th), prepare your submission as follows:

  1. Make sure I can read your extensive and clear documentation about your agent programs, the strategies you employed, and any additional classes you created (e.g. implementations of the HeuristicFunction interface).

    Test that your documentation is properly generated by typing

    ant docs
    and then loading docs/index.html into your web browser.

  2. Create a .zip or .tar.gz archive of your 'yourUNI' source directory:
    tar czvf awh2101.tar.gz awh2101
  3. Submit via Courseworks:
    1. Log into Courseworks and go to the AI page.
    2. In the horizontal toolbar, click "Post File"
    3. Enter title "Assignment 2: Full Program", select the yourUNI.tar.gz file, post file to "Harnly, Aaron", and send! Congratulations!

Related Documentation