Class NBDAgent

java.lang.Object
  extended by SimpleTurtle
      extended by Turtle
          extended by Agent
              extended by NBDAgent

public class NBDAgent
extends Agent

NBD Agent

Author:
Cassy Romano, Barb Ericson

Field Summary
 
Fields inherited from class Agent
MAX_SPEED, PROB_OF_STAY, randNumGen
 
Constructor Summary
NBDAgent(int x, int y, ModelDisplay modelDisplayer, Simulation thisSim)
          Constructor that takes the x and y, a model display to draw it on, and a simulation
NBDAgent(ModelDisplay modelDisplayer, Simulation thisSim)
          Constructor that takes the model display (the original position will be randomly assigned) and a simulation
 
Method Summary
 void act(int t)
          Method that provides the act behavior
 void init(Simulation thisSim)
          To initialize the simulation
 
Methods inherited from class Agent
act, countInRange, die, getClosest, getPicture, getSimulation, getSpeed, setPicture, setSpeed
 
Methods inherited from class SimpleTurtle
backward, backward, clearPath, drawInfoString, drop, forward, forward, getBodyColor, getDistance, getHeading, getHeight, getInfoColor, getModelDisplay, getName, getPen, getPenColor, getPenWidth, getShellColor, getShowInfo, getWidth, getXPos, getYPos, hide, isPenDown, isVisible, moveTo, paintComponent, penDown, penUp, setBodyColor, setColor, setHeading, setHeight, setInfoColor, setModelDisplay, setName, setPen, setPenColor, setPenDown, setPenWidth, setShellColor, setShowInfo, setVisible, setWidth, 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
 

Constructor Detail

NBDAgent

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

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

NBDAgent

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

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)
To initialize the simulation

Overrides:
init in class Agent
Parameters:
thisSim - the simulation

act

public void act(int t)
Method that provides the act behavior

Overrides:
act in class Agent
Parameters:
t - the current timestep