SE320 Assignment 3

Validating the STS using a GA-based Virtual Coach

Now that you have verified the Soccer Tournament Simulator (STS) against its specification, it is time to focus on the validation of the STS. We would like for you to validate whether good coaching strategies yield better results in tournaments. In order to do this, you are asked to design, develop, and test software to automatically create good coaching strategies (i.e., roaming region configurations).

The virtual coach must be designed and implemented as a Genetic Algorithm (GA). After implementing the virtual coach, test its strategy against random strategies and against your own (hand-crafted) strategies. Does the virtual coach beat the random strategies in a tournament? Does it beat your own hand-crafted strategy? Do your hand-crafted strategies beat the random strategies? Answering these questions in a document (that you should submit as part of your assignment deliverables) is part of the STS validation.

In this assignment you are asked to design, implement, and test (using unit testing and code coverage) a GA-based virtual coach. Two methods will be used to assess the quality of your virtual coach. This first method involves the grader (Spiros Mancoridis) looking at your code (design, algorithm design), your test suite (unit tests, system tests, code coverage, report), and comparing the effectiveness of your virtual coach against the virtual coach implemented by the instructor (you will not get a copy of this code) and against the instructor's hand-crafted solutions. This method will determine 100% of your grade for the assignment.

Moreover, the winner of the tournament will be given the opportunity to opt out of taking the final examination, if the winner chooses to do so. Specifically, the winner's final exam grade can be his average grade based on the 3 assignments and the midterm. So, if a student is averaging an 85% before the final examination, his/her final examination grade will be 85%. If the winner chooses not to exercise this option, his/her final examination grade will be whatever grade he/she receives in the final examination. If the winner actually takes the final examination, the instructor will interpret this action as being equivalent to the winner choosing not to opt out of the final examination. If the winner does not show up to take the final examination, his/her grade for the final will be his/her average grade before the final examination. Needless to say, all non-winners (2nd-9th place finishings in the final tournament) will have to take the final examination.

However, whoever makes it to the final 16 will get bonus points for the final examination. The winner of the tournament (if he/she decides to take the final exam) will get 16 bonus points, the second place winner will get a 15 bonus points, the third place winner will get 14 bonus points, and so on, and the 16th place student will get 1 bonus point toward the final exam.

The virtual coach must be implemented using a Genetic Algorithm (GA). You are not allowed to seed the GA with hand-crafted solutions. The idea is that your GA should evolve its solution from a population of random team configurations. The GA should output a team in the input file format for the STS. Your GA should assume a pitch size of width=60 and length=100, and that teams will have 11 players. After running each GA, the instructor will take the outputs and put them in a single file in preparation for the final tournament on December 3. Your GA should accept as inputs the following:

It is your responsibility to define an encoding scheme and a fitness function. In addition you should choose strategies for selection, crossover, and mutation. Use reasonable values for these parameters so that you GA converges in an order of minutes on your laptop. GAs that take over 1 hour to evolve their solution will be disqualified. Hint: you might want to build in a timer that outputs the best result it has found if it has not converged before 1 hour is over. Your GA should produce, as an output, a file containing a single team record with a custom strategy. Remember that there are restrictions on the maximum size of a player's roaming region. Goalkeepers should all have identical roaming regions that are equal to the penalty box. Your team name should be your last name, so you can be easily recognized in the final tournament. The team record should state that your team has 11 players.

Do not seed your initial population with anything but random teams. The GA will only run once (no tournaments of tournament winners). Your output should be one team in the STS syntax and your team name should be your first and last name.

The following are two resources to help you design your Genetic Algorithm:

As an optional extra credit deliverable (10% extra) you may install, learn, and use the FindBugs tool. It is available for free download from You are asked to subject your Virtual Coach code to FindBugs and submit the results of FindBug's analysis.