CSE142 Critter Tournament

Students must submit their critter by 3 pm Thursday (6/2) to participate. The in-class tournament will be run as a series 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 during 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.

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 along with one prize for "most entertaining."

Twelve of the finalists will be picked through a precontest. 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.

We will also have a contest to pick four "entertaining" critters. A group of TAs will judge the entries. These critters will be included in the lecture tournament. If one of the winners of the entertaining contest is also among the top twelve critters in the precontest, then additional top winners from the precontest will be added to reach a total of sixteen finalists.

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 are restricted to the programming constructs described in chapters 1 through 10 of the textbook.

You are allowed to turn in a different critter for the contest than what you turn in for homework 8.

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 critter class compiles after you change the name (remember that the constructor name must match the class name). Submissions are due at 3 pm on Thursday.