model.fish
Class SlowFish

java.lang.Object
  extended by sysModel.fish.AFish
      extended by model.fish.GenericFish
          extended by model.fish.SlowFish
All Implemented Interfaces:
java.lang.Cloneable, java.util.Observer

public class SlowFish
extends GenericFish

Class for a slow fish.

Author:
Mathias G. Ricken

Field Summary
private  double _probOfMoving
          Probability that this slow fish moves.
 
Fields inherited from class sysModel.fish.AFish
_fishColor, _fishDisplay, _probOfBreeding, _probOfDying
 
Constructor Summary
SlowFish(java.awt.Color fishColor)
          Create a new slow fish.
 
Method Summary
 void move()
          Execute the movement part of a simulation step.
 void paint(java.awt.Graphics2D g, java.awt.Component comp)
          Draw the fish.
 
Methods inherited from class sysModel.fish.AFish
act, age, breed, clone, die, draw, getColor, setLocalEnvironment, setProbOfBreeding, setProbOfDying, toString, tryBreedFwd, tryMoveFwd, turnLeft, turnLeft, turnRight, turnRight, update
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_probOfMoving

private double _probOfMoving
Probability that this slow fish moves.

Constructor Detail

SlowFish

public SlowFish(java.awt.Color fishColor)
Create a new slow fish.

Parameters:
fishColor - color of the fish
Method Detail

move

public void move()
Execute the movement part of a simulation step.

Overrides:
move in class GenericFish

paint

public void paint(java.awt.Graphics2D g,
                  java.awt.Component comp)
Draw the fish. The Graphics2D object has been translated, rotated and scaled so that the origin is in the center of the fish. The fish should just be drawn from (-0.5, -0.5) to (0.5, 0.5).

Overrides:
paint in class AFish
Parameters:
g - graphics object to drawFish on.
comp - the component to drawFish on