Creating a new class: Fishing Boat

The New England biologists want to study the effect of fishing on fish populations in areas of the North Atlantic. They would like to adapt the MBCS model with the Aging, Breeding, Dying program to include fishing boats, so that they can study the carrying capacity of the population -- the number of fishing boats that will maximize the catch over time without causing the population to die out.

The biologists want to make the same assumptions about the fish as in the Aging, Breeding, Dying programming assignment, except that fishing boats are introduced into the model.

The display should be modified to show the positions of the boat(s).

The biologists would like to record both the fish population and the number of fish caught in each time period. The objective is to experiment with a given fish population (given probabilities) and different numbers of fishing boats to find how many boats maximize the total catch without killing off the fish population.

Assignment

Starting with the Aging, Breeding and Dying program, modified it to include multiple fishing boats. In our new model, the fishing boats will be static, remaining at one position.

  1. Create a new class, Boat to represent a fishing boat
  2. Modify the fish data file format for the fish simulation as follows
  3. Modify the Display class to display the boat. "XX" indicates a fish under the boat, "YY" indicates no fish under the boat.
  4. Modify the Environment constructor so that it reads the boats from the fish data file and records them, a vector of boats, then reads in the fish.
  5. Modify the Simulation Step function so that after the fish have moved, each boat catches fish in neighboring positions, according to its probability.
  6. Create some fish data files and test your new program. To begin with, work with small grids and small numbers of fish and use the debugging facility.
  7. Create a new class, FishLog, for recording the changes in the fish population and the number of fish caught over time
  8. Modify the main function in the fishsim.cpp file
  9. Test the operation of the recording function with small numbers of fish.
In your simulation, the number of fish caught and the number of fish left in the simulation should always equal the number of fish at the start of the simulation plus the number of fish born, minus the number of fish that have died. Test you program with FishBoat.dat.

When the program is complete and working, use it with the data file fish and boat data file, with fish population of 206 and 6 boats. Run your simulation for 2000 steps. Depending on which computer you use, this simulation could 20 minutes or more. Which boat catches the most fish?

What to turn in