Class BirdAgent

java.lang.Object
  extended bySimpleTurtle
      extended byTurtle
          extended byAgent
              extended byBirdAgent

public class BirdAgent
extends Agent

BirdAgents use the bird character JPEGs


Field Summary
static Picture bird1
           
static Picture bird2
           
static Picture bird3
           
static Picture bird4
           
static Picture bird5
           
static Picture bird6
           
 
Fields inherited from class Agent
MAXSPEED, myPict, PROB_OF_STAY, randNumGen, simulation, speed
 
Constructor Summary
BirdAgent(int x, int y, ModelDisplay modelDisplayer, Simulation thisSim)
          Constructor that takes the x and y and a model display to draw it on
BirdAgent(ModelDisplay modelDisplayer, Simulation thisSim)
          Constructor that takes the model display (the original position will be randomly assigned)
 
Method Summary
 void act(int t)
          act(t) For first 20 steps, walk toward the egg, +/- 30 degrees.
 void init(Simulation thisSim)
          Set up the birds
 
Methods inherited from class Agent
act, countInRange, die, getClosest, getSimulation, getSpeed, setSpeed
 
Methods inherited from class Turtle
square
 
Methods inherited from class SimpleTurtle
backward, drawInfoString, drop, forward, forward, getBodyColor, getDistance, getHeading, getInfoColor, getModelDisplay, getName, getPen, getPenColor, getPenWidth, getPicture, getShellColor, getShowInfo, getXPos, getYPos, hide, isPenDown, isVisible, moveTo, paintComponent, penDown, penUp, setBodyColor, setColor, setHeading, setInfoColor, setModelDisplay, setName, setPen, setPenColor, setPenDown, setPenWidth, setPicture, setShellColor, setShowInfo, setVisible, show, toString, turn, turnLeft, turnRight, turnToFace, turnToFace, updateDisplay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

bird1

public static Picture bird1

bird2

public static Picture bird2

bird3

public static Picture bird3

bird4

public static Picture bird4

bird5

public static Picture bird5

bird6

public static Picture bird6
Constructor Detail

BirdAgent

public BirdAgent(ModelDisplay modelDisplayer,
                 Simulation thisSim)
Constructor that takes the model display (the original position will be randomly assigned)

Parameters:
modelDisplayer - thing that displays the model
thisSim - my simulation

BirdAgent

public BirdAgent(int x,
                 int y,
                 ModelDisplay modelDisplayer,
                 Simulation thisSim)
Constructor that takes the x and y and a model display to draw it on

Parameters:
x - the starting x position
y - the starting y position
modelDisplayer - the thing that displays the model
thisSim - my simulation
Method Detail

init

public void init(Simulation thisSim)
Set up the birds

Overrides:
init in class Agent

act

public void act(int t)
act(t) For first 20 steps, walk toward the egg, +/- 30 degrees. Then walk AWAY from the egg, and with MORE wandering (panic).

Overrides:
act in class Agent