ncore.fish
Class shark

java.lang.Object
  |
  +--ncore.fish.shark
All Implemented Interfaces:
uchicago.src.reflector.DescriptorContainer, uchicago.src.sim.gui.Drawable

public class shark
extends java.lang.Object
implements uchicago.src.sim.gui.Drawable, uchicago.src.reflector.DescriptorContainer

The Shark for the Wator simulation. It keeps track of its coordinates, world, birthTime, and hunger. Its step method allows it to move into a null cell around it and eat fishes that is near it. or just stay where it is. It has a reproduction function.


Constructor Summary
shark(uchicago.src.sim.space.Object2DTorus world, int x, int y, float randomMoveProb)
           
 
Method Summary
 void draw(uchicago.src.sim.gui.SimGraphics g)
           
 boolean getBDExample()
           
 int getBirthTime()
           
 int getHunger()
           
 java.util.Hashtable getParameterDescriptors()
           
 float getRandomMoveProb()
           
 int getX()
           
 int getY()
           
 int[] reproduce()
           
 void setBDExample(boolean val)
           
 void setBirthTime(int birthTime)
           
 void setHunger(int hunger)
           
 void setRandomMoveProb(float f)
           
 void setX(int x)
           
 void setXY(int x, int y)
           
 void setY(int y)
           
 void step()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

shark

public shark(uchicago.src.sim.space.Object2DTorus world,
             int x,
             int y,
             float randomMoveProb)
Method Detail

setXY

public void setXY(int x,
                  int y)

step

public void step()

reproduce

public int[] reproduce()

getX

public int getX()
Specified by:
getX in interface uchicago.src.sim.gui.Drawable

setX

public void setX(int x)

getY

public int getY()
Specified by:
getY in interface uchicago.src.sim.gui.Drawable

setY

public void setY(int y)

getBirthTime

public int getBirthTime()

setBirthTime

public void setBirthTime(int birthTime)

getHunger

public int getHunger()

setHunger

public void setHunger(int hunger)

getRandomMoveProb

public float getRandomMoveProb()

setRandomMoveProb

public void setRandomMoveProb(float f)

setBDExample

public void setBDExample(boolean val)

getBDExample

public boolean getBDExample()

getParameterDescriptors

public java.util.Hashtable getParameterDescriptors()
Specified by:
getParameterDescriptors in interface uchicago.src.reflector.DescriptorContainer

draw

public void draw(uchicago.src.sim.gui.SimGraphics g)
Specified by:
draw in interface uchicago.src.sim.gui.Drawable