Project Phase #2 - COMP 303

Complete implementation of command-line simulator

The purpose of this milestone is to complete the implementation of the command-line simulator as outlined in Phase #1.

Your simulator should have the interface described in Phase #1.

To make it easier to mark, your default implementation should use the Java random number generator, with seed 12345. If you have already implemeted the specified random number generator, keep it in your code base and implement a switch -origrandom which will use that one instead. That way you can compare outputs from both the contest web site and our special purpose files.

When you run your simulator in -debug mode, it should produce a trace on stderr for the first 1000 iterations.

You can redirect stderr to a file using the appropriate shell command. In csh you can use >& to redirect both stdout and stderr to a file. In bash you can use 2> to redirect only stderr to a file.

For example, to capture your own copy of the dumpfile you could do:

java ant.Main -debug sample.ant sample.ant tiny.world myoutput.txt >& mydumpfile

Then you can compare against the expected output on the lab machines using:

diff mydumpfile ~hendren/public_html/303/AntTraceFiles/dumpfile
Professor de Moor developed another style of trace file that traces each ant's actions. You might find it useful to make an option on your simulator to produce an equivalent output in order to more easily debug your simulator. If you implement this, it should be enabled by a -trace flag and should sent its output to stderr. You should not allow both -debug and -trace to be enabled at the same time.

You can find a copy of this trace file at:

~hendren/public_html/303/AntTraceFiles/tracefile
Please note that this tracefile is very large, so don't make other copies on the lab machines, just diff directly against this copy.

You may find links to these files at: http://www.cs.mcgill.ca/~hendren/303/AntTraceFiles/

What to hand-in

  1. A discussion of any changes you made to your design.
  2. A discussion of any limitations or extra features of your simulator.
  3. A discussion of the sorts of JUnit tests you implemented.
  4. The html generated using javadoc for your implementation.
  5. The build.xml file needed for your project to date. This should support targets for init , clean , compile , build , javadoc and junit . You may refer to our example build.xml file in http://www.sable.mcgill.ca/~hendren/303/AntDemo .
  6. Your build target must generate a .jar file called simulator.jar that can be run using java -jar simulator.jar ... .
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.
YourLastName/
           README
           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.