View this PageEdit this PageAttachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide

Extending the Marine Biology Case Study past Fish

Alyce's Changes to Allow Non Fish

You can extend the Marine Biology Case Study beyond using Fish (and subclasses of Fish). Everything you need is in this zip. JavaMBS-mouse.zip. I also include the source for the changed GUI and normal classes. When you unzip this file it will create a directory JavaMBS-Mouse.

After you unzip this file, change your classpath to use mbsguigt.jar in JavaMBS-Mouse/Code instead of mbsgui.jar (this is in the Code directory). And you are ready to go. Use this versino of the MBSGUI.java file: MBSGUI.java and compile it. Try creating a new environment with a Starfish or Orca in it and see what happens. Be sure to remove mbsgui.jar from your classpath.
Uploaded Image: screen.gif

I got the gifs for the Orca and Starfish from here: http://www.kidsdomain.com/brain/animals/clip.html. They also have other images in the image directory of the Code directory from the zip. To use these just move them up to the Code directory.

You can also add walls to the environment. I added a Wall class that extended my new AbstractDrawable class. I also added a WallDisplay that displays the Wall objects.

Uploaded Image: wall-screen-shot.gif

Since we have walls we can get rid of fish and do mice in a maze. The students can create different subclasses of mice that try to solve the maze in different ways. The current mice leave the environment when they reach the top right corner (the exit) and print out how many steps to took them to get there. To create mice use the Mouse class and SmartMouse class and the MBSGUI.java that came in the zip.

Uploaded Image: mice.gif

For more detailed information see:
How to extend the marine biology case study beyond the Fish class