There will be no exams, so assignments will constitute 100% of your grade, and there will be approximately one assignment per week for most of the semester. Towards the end of the semester, instead of assignments we will expect teams to be working towards writing code to win the final competition. Extra-credit will be given to the winners of the midterm and final competitions.

Office Hours

  • Monday 4-5pm: Jenny Gillenwater, Levine 512
  • Wednesday 5-6pm: David Weiss, Location TBA
  • Friday 12:30-1:30pm: Ben Sapp, Levine 612

The Game

GreedyBot: an excursion into the codebase

  • Dissect GreedyBot in Eclipse using the PyDev add-on
  • Learn how to code and run a basic ant agent
  • See some of the basic debugging capabilities of Eclipse

TODO list

Before the next class (Tuesday, September 13) please complete the following:

  • Sign up for Piazza. Post questions about lecture notes and assignments here rather than sending emails to the instructors. Don't be shy about posting; probably more people than you would think have your same question.
    1. Click "Enroll Now".
    2. Enter "University of Pennsylvania".
    3. Click "Change Term" and set it to Fall 2011.
    4. In the "Find Your Class" search box enter "Intelligent Game Agents".
    5. Click "Enroll".
  • Read Chapters 1-3 in this Pro Git book ("Getting Started", "Git Basics", and "Git Branching") to get up to speed on basic Git. We'll be using Git to do version control for the code we write here.
    • Install git on your own computer if you want to be able to use it locally.
    • Git is already installed on the seas machines. To login to one of these machines, run the following command in a terminal:
      ssh username@seas.upenn.edu
    • Setup your .gitconfig file (on your computer and on seas) by running these commands.
    • Key commands you will read about:
      git status
      git add <filename>
      git diff (--cached)
      git commit (-a) (-m "Always leave a commit message.") (--amend)
      git rm (-f) (--cached) <filename>
      git mv <from location> <to location>
      git log (--pretty=format)
      git reset HEAD <filename>
      git checkout -- <filename>
      git fetch origin
      git push origin master (--tags)
      git tag -a <version number>
      git branch (-d) (<branch name>)
      git checkout (-b) <branch name>
      git merge <branch name>
    • After reading, create a git repository for your code on seas.
      username@home:~> ssh username@seas.upenn.edu
      username@ampersand:~> mkdir git-repos
      username@ampersand:~> cd git-repos/
      username@ampersand:~/git-repos> mkdir ants.git
      username@ampersand:~/git-repos> cd ants.git/
      username@ampersand:~/git-repos/ants.git> git --bare init
      Initialized empty Git repository in /mnt/castor/seas_home/u/username/git-repos/ants.git/
      username@ampersand:~/git-repos/ants.git> exit
    • Then create a local directory for editing on your computer (or in your home directory on seas if you don't have your own computer). The steps below add some basic ants code to your repository and along with a new file "hello-ants.txt".
      username@home:~> mkdir ants
      username@home:~> cd ants
      username@home:~/ants> git init
      Initialized empty Git repository in /home/username/ants/.git/
      username@home:~/ants> git remote add origin username@seas.upenn.edu:/home1/u/username/git-repos/ants.git
      username@home:~/ants> git clone https://github.com/djweiss/Google-Ants-Challenge-Course-Framework.git ./given
      Cloning into ./given...
      remote: Counting objects: 21, done.
      remote: Compressing objects: 100% (17/17), done.
      remote: Total 21 (delta 1), reused 21 (delta 1)
      Unpacking objects: 100% (21/21), done.
      username@home:~/ants> git add given/
      username@home:~/ants> emacs hello-ants.txt
      username@home:~/ants> git add hello-ants.txt
      username@home:~/ants> git commit -m "Said hello to some ants and added the given codebase."
      [master (root-commit) a797735] Said hello to some ants and added the given codebase.
       11 files changed, 2926 insertions(+), 0 deletions(-)
       create mode 100644 given/README
       create mode 100644 given/base/GreedyBot.py
       create mode 100644 given/base/antsbot.py
       create mode 100644 given/base/antsgame.py
       create mode 100644 given/base/debug_map.map
       create mode 100644 given/base/engine.py
       create mode 100644 given/base/game.py
       create mode 100644 given/base/localengine.py
       create mode 100644 given/base/logutil.py
       create mode 100644 given/base/worldstate.py
       create mode 100644 hello-ants.txt
      username@home:~/ants> git push origin master
      Counting objects: 15, done.
      Delta compression using up to 2 threads.
      Compressing objects: 100% (13/13), done.
      Writing objects: 100% (15/15), 29.49 KiB, done.
      Total 15 (delta 0), reused 0 (delta 0)
      To username@seas.upenn.edu:/home1/u/username/git-repos/ants.git
       * [new branch]      master -> master
    • Practice creating a new directory and pulling the exiting code.
      username@home:~/ants> cd
      username@home:~> mkdir ants2
      username@home:~> cd ants2
      username@home:~/ants2> git init
      Initialized empty Git repository in /home/username/ants2/.git/
      username@home:~/ants2> git remote add origin username@seas.upenn.edu:/home1/u/username/git-repos/ants.git
      username@home:~/ants2> git pull origin master
      remote: Counting objects: 15, done.
      remote: Compressing objects: 100% (13/13), done.
      remote: Total 15 (delta 0), reused 0 (delta 0)
      Unpacking objects: 100% (15/15), done.
      From seas.upenn.edu:/home1/u/username/git-repos/ants
       * branch            master     -> FETCH_HEAD
      username@home:~/ants2> ls
      given  hello-ants.txt
    • To get the main source code for the project, run another clone command:
      git clone https://github.com/aichallenge/aichallenge.git