This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: CS51 Project 2a: Dont Drop the Ball Due: Tuesday, March 7th 2009 at 11:59 PM Total Points: 45 (including 10 style points) This is the first part of your second long-term project for the semester. These projects are intended to get you thinking about issues of large-scale design and iteration of code through multiple versions and stages, as well as what complications and benefits arise as a result of working with a partner. 1 Project Overview This project will focus on building parts of a simulation engine and artificial intelligence agents within it that interact and compete with one another. In this particular assignment you will subclass and override methods of an existing agent interface. Your agent will use Dijkstras algorithm to calculate the shortest path to its goal in order to catch a ball agent before it lands. 2 Introduction to the World We have provided a class containing the game rules for this simulation (called ball-catch% ), and a simulation engine ( engine-2d% 1 ). To see it run, we just need to create a graph, create a new engine, and send the engine the start command. ; ; make a graph ( define graph ( graph-add-edge a b ( graph-add-edge b a graph-new ))) ( define engine ( make-object engine-2d % graph ball-catch %)) ( send engine init-engine ) Alone, this isnt too interesting. We can also add some agents to the graph. We have given you two agents already. 1 Hopefully with a 3d version coming soon! 1 3 AGENTS CS51 Project 2a: Dont Drop the Ball ( define ball ( make-object ball-agent %)) ( define a1 ( make-object graph-agent %)) ( send engine add-agent-at-node ball a ) ( send engine add-agent-at-node a1 a ) ( send engine draw ) With the above code you will see agents appear on the graph. If you step the simulation forwards, you will see that the ball agent will fly from off the graph onto a node. If no other agent is there, it will sit there until it is caught. The graph-agent doesnt move. Your goal will be to construct an agent that will be able to catch the ball each time before it lands at a particular node....
View Full Document
This note was uploaded on 07/26/2009 for the course COMPUTERSC CS51 taught by Professor Gregmorrisett during the Spring '09 term at Harvard.
- Spring '09