Students must submit their critter by 1 pm Friday (11/21) to participate. The tournament will be run as a series of of elimination rounds. Each elimination round will take place in a world that is 65 wide and 55 high and will start with:
There is a constant in the class CritterModel that is called HOP_ADVANTAGE that is set to 0.2 by default. For the contest, this constant should be reset to be 0.5. You should edit your copy of CritterModel to include this change so that you can test how well your critter performs. This higher value for the constant rewards critters that move versus critters like FlyTrap that do not move around.
The simulation will be run for 5000 steps. The critter with the highest count at that point will be declared the overall winner. That critter will then be removed from the simulation and it will be run again for 5000 steps to determine a second place winner. This process can be continued to determine a third place winner, fourth place winner, and so on.
We will run a qualifying contest in advance to pick 16 finalists. In the tournament we run after lecture, we will start with these finalists involved in four rounds. The eight winners will then compete in two rounds. This will lead to the final four who will compete in the final round.
The tournament will take place on Friday, 11/21, at 3:20 in our normal classroom. Contestants should pick a name for their critter that is likely to be unique (e.g., RegesHusky). Prizes will be given out to the top four winners.
We will run a pre-contest to narrow the field of contestants down to 16. We will generate all combinations of four contestants and put them in a world that matches the description above (including the Bear, Lion, Giant, FlyTrap, and Food critters listed above). For each combination of four contestants, we will run a simulation for 5000 steps and add the final critter counts to each critter's total score. The twelve critters with the highest totals will be included in the lecture contest.
Any submission that is found to be circumventing the spirit of the contest will be disqualified (e.g., trying to access the critter model or critter frame, trying to read or write files, trying to open a network connection, trying to exit the program, including offensive images or language, etc). Submissions will also be rejected if they take an inordinate amount of time to execute.
You can create interesting behavior by using static fields. When you add the "static" keyword to a field, there will be just one version of that field that is shared by all objects of the class. For example, you could make an ArrayList that is shared by all of your critters. But static fields pose a problem for running simulations repeatedly because you want to start with appropriate values for each new simulation. If you are going to use static fields, you should include a static method called initStatic that takes no arguments. You should also include a call on this method in what is known as a static initializer. You don't have to understand how it works, just be sure to include this code in your class:
static {
initStatic();
}
The static initializer will cause this to be called once before the
simulation begins. In addition, the simulator will call this method once
before the beginning of each simulation that it performs. You can find an
example of a critter class that uses a static field by looking at
Food2.java, a variation of the Food
critters that display themselves with text such as "7 of 9" to indicate that
this is the 7th such critter out of a total of 9 ever created.
Submit your critter class here:
critter submission
You must include your name in the comments for your husky class and you may not use the name "Husky" for your class. Make sure that your new version of the class properly compiles (e.g., if you have a constructor for Husky, you need to change its name). If your class is called Husky or if it does not compile, it may be disqualified from the competition. Submissions are due at 1 pm on Friday.