{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

proj2a.dist - CS51 Project 2a Don't Drop the Ball Due...

Info icon This preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
CS51 Project 2a: Don’t 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 Dijkstra’s 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 ( graph ( graph-add-edge a b ( graph-add-edge b a graph-new ) ) ) ( engine ( make-object engine-2d % graph ball-catch %)) ( send engine init-engine ) Alone, this isn’t 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
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
3 AGENTS CS51 Project 2a: Don’t Drop the Ball ( ball ( make-object ball-agent %)) ( 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 doesn’t 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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern