Introduction to Artificial Intelligence

Assignment 2


Adversarial games for agents in the Harassed Citizen Problem

In the second exercise you will be using the environment simulator from the first assignment, the Harassed Citizen problem, as a platform for implementing intelligent adversarial agents. The environment is the same as before, except that now we will assume exactly one opposing agent who seeks to get to its goal first, and prevent the first agent from reaching it goal.

Game Environment

Each agent has a start location and a goal location. As before, the environment consists of an undirected weighted graph. An agent can apply 2 types of action: traverse and no-op. Semantics of the action are as in assignment 1, repeated below. The no-op action does nothing. The traverse action always succeeds if the target vertex is unblocked (or becomes unblocked due to having the correct key(s)), and fails otherwise. For a failed action, the agent stays at the same location. In this game, time is the only important thing, so we will assume that all edge weights are 1.

Note that in this assignment the agents can be completely adversarial, or semi-cooperating, as discussed below. We will also assume that a user defined horizon L exists, the game always stops after L moves by each agent, or when all agents reach their goal, whichever comes first.

Implementation Steps

The simulator should query the user about the parameters, the type of game (see below) as well as other initialization parameters for each agent (L, position, goals).

After the above initialization, the simulator should run each agent in turn, performing the actions returned by the agents, and update the world accordingly. Additionally, the simulator should be capable of displaying the world status after each step, with the appropriate state of the agents and their score. Here there are two types of agent programs: human (i.e. read input from keyboard) and game tree search agent.

Each agent program (a function) works as follows. The agent is called by the simulator, together with a set of observations. The agent returns a move to be carried out in the current world state. The agent is allowed to keep an internal state if needed. In this assignment, the agents can observe the entire state of the world. You should support the following types of games:

  1. A zero sum game: be the first to reach your goal, i.e. win for a score of 1, or lose for a score of -1. Here you should implement an "optimal" agent of both types, using mini-max, with alpha-beta pruning.
  2. A non zero-sum game: here the agent's score is minus the number of moves to reach its goal. Ties are broken cooperatively.
  3. A fully cooperative both agents aim to minimize the sum of the number of moves until both reach their goals.

Since the game tree will usually be too big to reach terminal positions in the search, you should also implement a cutoff, and a heuristic static evaluation function for each game. You may use the same heuristic for all games, if you think this is justified.

Deliverables

The program and code sent to the grader, by e-mail or otherwise as specified by the grader, a printout of the code and results. You need to show example scenarios where the optimal behavior differs for the 3 kinds of games (you will need to make the example scenarios very small in order to be able to reach terminal states in the search). A description of your heuristic evaluation functions and their rationale. Set up a time for frontal grading checking of the delivered assignment, in which both members of each team must demonstrate at least some familiarity with their program.

Due date: Thursday, December 8.