SE2811
Software Component Design

This is an old version of this course, from Winter 2014-2015. A newer version is avaliable here.

Lab 1: Making a Smarter Bee

The objective of this lab is to add an additional "AlphaBee" class to the game that implements a better strategy for accumulating points.

Assignment

Download the zipfile containing the base application from the course website. The class diagram representing this application's structure is as follows (the different colors indicate different packages):

You'll be adding your AlphaBee class in the game.characters.<yourname> package (Flower and Bee are in game.characters, while the other classes are in the game package). To help you understand the operation of the application, study the existing Bee class, particularly the planMove() method. Your AlphaBee class will be providing a completely different move-planning strategy vs. what you see there. The planMove() method is called whenever the game framework wants your AlphaBee to plan where to go during it's next turn. The framework provides a List of all other GameCharacters on the board, and you can examine them (i.e. determine their location on the board, and their current score) in formulating your move strategy. You can set any position as the target position — the Game's validateMove method will restrict the GameCharacter's motion. See the Bee class for an example implementation.

Implement a strategy so that the AlphaBee moves to the flower whos name is first in the alphabet and currently having at least four points. The AlphaBee should ignore other bees on the board.

To incorporate your bee into the Game, look at that class's createBees() method. You'll have to create one or more instances of your bee there. The following sequence diagram may also help you understand the entire operation of the program better:

Acknowledgement

This lab developed by Dr. Hornick.