Sharks & Fish

Here is a brief description of all six Sharks and Fish problems. For assignment 3, only the first and second problems are relevant.
  • Sharks and Fish 1. Fish alone move continuously subject to an external current and Newton's laws.
  • Sharks and Fish 2. Fish alone move continuously subject to gravitational attraction and Newton's laws.
  • Sharks and Fish 3. Fish alone play the "Game of Life" on a square grid.
  • Sharks and Fish 4. Fish alone move randomly on a square grid, with at most one fish per grid point.
  • Sharks and Fish 5. Sharks and Fish both move randomly on a square grid, with at most one fish or shark per grid point, including rules for fish attracting sharks, eating, breeding and dying.
  • Sharks and Fish 6. Like Sharks and Fish 5, but continuous, subject to Newton's laws.
  • The following software for these problems exists. Each can be seen by clicking on the x's below. In each case you will see a directory of source code for each problem. In the case of the Matlab code, the routine fishXinit.m is an initialization program, to be run first to set up the problem (where X varies from 1 to 5), and fishX.m is the main Matlab solution routine.

      Language		     Problem number
    		1       2       3       4       5       6
      Matlab	x	x	x	x	x
      HPF		x	x
      MPI		x	x	x
      Split-C	x	x
      Sun Threads	x	x
    

    Because the display code can be rather complicated and because you don't need to worry about it for this assignment, we also have versions of some of the codes with the functions for displaying fish in a separate file from the main code.
      Language		     Problem number
    		1       2       3       4       5       6
      Matlab
      HPF	
      MPI		x	x
      Split-C	x	x
      Sun Threads
    

    HPF code for fish1 that includes timers is here
    An optimized version of the split-c code is here