Monday, September 28, 2009

BlackMagic Ver. 1.1.930

The first step that I did to create Ver. 1.1 of the BlackMagic robot was to use a build system (Ant) to run tests and error check it. I used the following commands to ensure my code was up to date and error free:

ant -f checkstyle.build.xml
ant -f pmd.build.xml
ant -f findbugs.build.xml

CheckStyle:

During my first run of CheckStyle I ran into the following errors:

Got an exception - java.lang.IllegalArgumentException: the name [date] is not a valid Javadoc tag name

Missing package-info.java file.

The 2nd error was easily fixed by copying and modifying the package.html into /src/smw from the DaCruzer package.

After fixing that error I ran CheckStyle again and encountered the following errors on multiple occasions:

'{' is not preceded with whitespace.
Missing a Javadoc comment.
'while' is not followed by whitespace.
First sentence should end with a period.
Unused @param tag for 'a'.
Expected @param tag for 'e'.

The spacing error and the Javadoc comment errors were easily taken care of. The @param errors were taken care of by adding in the input variable name to the @param comment. For example a method takes (onHitWall e) so the comment is too look like this @param e .... but my comments were formatted in the following way @param .... with out the variable name.

After fixing these errors I ran CheckStyle again and had the following error remaining:

Missing package-info.java file.

This was easily fixed by adding in the overview.html file to /src.

Upon running CheckStyle again I encountered no errors.

PMD:

Luckily PDM built with no errors.

FindBugs:

Just like PMD this target built with no errors.

Improved Performance:

After loosing in the 2nd round of the Robocode tournament to a walls based robot and seeing how many robots were based on the walls model, I realized that I needed to integrate an anti-walls section to my robot. However this was extremely hard to implement given BlackMagic's current movement scheme, so instead I added a method which increased my victory percentage against walls, but I was still unable to consistently beat walls. My hope is that BlackMagic Ver. 1.1 will be able to beat other non-wall based robots more effectively.

Distribution:

The latest version of BlackMagic can be found here.


0 comments:

Post a Comment