Project Phase #4 - COMP 303
- Due at the beginning of class, Thursday, March 24.
Running a Competition
The purpose of this milestone is to design and implement a tournament for
ants. The input will be three directory names, a directory containing a
collection of worlds, a collection of ants and a directory to hold the
The tournament should simulate, for each each world, a competition for
each pairing of ants (for the two different mappings of ants to red/black).
An ant should not be paired with itself.
The total score for an ant will be the total of all food
collected over all worlds and all pairings.
Your program should be designed to that it could easily
support different output
kinds (for example, ordinary text, XML, HTML). You must implement at
least one of the output kinds, although more would be nice.
The common theme of the outputs is that there should be:
- A statement summarizing the results, with the name of the ant, and total
food collected, largest to smallest (i.e. the winning ant will be first on
- A set of tables, one table for each world, with all possible
red ants on the
x-axis and all possible black ants on the y-axis. The diagonal of the
table should be empty (an ant does not compete against itself). All other
entries, results[i][j], should show the difference between the amount of
food collected when the i'th red ant competed against the j'th black ant.
If the red ant collected more food the result will be positive, and if
the black ant collected more food the result will be negative.
You should be able to invoke your tournament using:
java ant.Tournament <WorldDir> <AntDir> <ResultDir>
where the arguments give the directory names for the worlds, the ants, and
where the results should be put.
What to hand-in
You should hand in a hardcopy for questions 1, 2 and 3.
In addition, you should e-mail to the TA a file YourLastname.jar
file which has the following directory structure.
- A discussion of the design for this milestone. In particular, what
kinds of outputs do you support and how did you design it so it was
easy to support several kinds of output. (hardcopy)
- A discussion of the sorts of JUnit tests you implemented. (hardcopy)
- An example of your output(s) running a tournament on all the worlds
and all the ants (these are the winning ants from the ICFP contest) in
tar.gz file of all the worlds and ants can be found at
can untar this using tar zxvf tournament.tar.gz .
- The html generated using javadoc for your implementation.
- The build.xml file needed for your project to date. This
should support targets for init , clean ,
compile , build , javadoc and junit .
- Your build target should now generate another .jar file,
tournament.jar . You should be able to run the tournament
using java -jar tournament.jar.
build.xml build file for ant
bin/ any scripts you have developed
classes/ where your generated classes go
design/ any online design documentation
doc/ where your generated javadoc html goes
lib/ where generated .jar files go
src/ java/aspectj/junit source files for your project
(organized into a good package structure)
You can create a clean directory (that does not have the hidden svn files) using:
svn export YourSVNWorkingDirectory YourLastName
to export a clean copy of your project to a directory called YourLastName.
You can create the jar file by using:
jar -cvf YourLastName.jar YourLastName
to create the jar file to send to the TA.