CS 2110 Homework Assignment 5
Due: Tuesday 11/30 11:59pm No extensions
Description
We have studied in depth the genetic makeup of a number of unusual and intriguing creatures. Now, we will travel back in time, to revisit the story of how these particular species were first discovered by science. In this assignment, you will write an artificial intelligence to guide "the naturalist", who boldly explores an uncharted tropical island and collects specimens of local wildlife.![The Naturalist](naturalist.png)
![The Ship](ship.png)
- Exploration:
- Moving to a node for the first time, 10 points.
- Retrieval:
- 100 points for each species dropped at the ship.
- Mission Accomplished:
- 1000 point bonus when all species have been collected.
- Movement:
- Each move costs 1 point + the number of animals being carried. E.g., moving with three animals costs four points.
Writing the Code
This assignment is a departure from previous assignments, in that you will not need any of your old code. In fact, you'll turn in only one Java file, a subclass of the Naturalist class. Use inner classes if you need additional classes. Start by reading the Javadocs to learn the API for the naturalist.The Naturalist Class
Your naturalist class will be instantiated by the simulator by calling the default constructor. To execute your program, the simulator then calls the run() method. This will be called by the simulator. Please refer to the Javadocs for cs2110.assignment5.Naturalist for documentation on the methods you will need to complete the assignmnt.
An example program:
The Simulator
In an attempt to re-create this historical voyage, we will provide you with a naturalist simulator. It is contained in a5.jar, a binary-only runnable JAR file. To use this JAR in Eclipse:
- Add a5.jar to your project's build path
- Run the main class, cs2110.assignment5.Simulator
- As the first command line argument, supply the fully-qualified name of your Naturalist class.
Notes
- Don't make assumptions about the number of nodes in the map, or the total number of animals on the island.
Competition
There will be three prizes awarded for outstanding solutions:
- Highest score
- Fastest clock time
- Most innovative strategy
The competition will be run on new maps, larger and with more animals. To enter the competition, please say so in your README.
Extra Credit
As usual, extra credit points will be available for substantive JUnit tests. Extra credit will also be awarded use of better algorithms for the task at hand (e.g., all-pairs shortest paths instead of single-source). Please mention extra credit in your README.