Class ImmigrationAgent

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

public class ImmigrationAgent
extends Agent

Immigration -- using the Agent class


Field Summary
(package private)  int crowdedRadius
           
(package private)  boolean dead
           
(package private)  boolean inAmerica
           
(package private)  boolean inTransit
           
(package private)  boolean overcrowding
           
(package private)  boolean sick
           
(package private)  int timesovercrowding
           
(package private)  int timessick
           
 
Fields inherited from class Agent
MAXSPEED, myPict, PROB_OF_STAY, randNumGen, simulation, speed
 
Constructor Summary
ImmigrationAgent(int x, int y, ModelDisplay modelDisplayer, Simulation thisSim)
          Constructor that takes the x and y and a model display to draw it on
ImmigrationAgent(ModelDisplay modelDisplayer, Simulation thisSim)
          Constructor that takes the model display (the original position will be randomly assigned)
 
Method Summary
 void act()
          Method to act during a time step Default is to pick a random direction and move some random amount up to top speed
 void die()
          Method that handles when an Agent dies
 void immigrate()
           
 void init(Simulation thisSim)
          Method to initialize the new wolf object
 
Methods inherited from class Agent
act, countInRange, 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

sick

boolean sick

timessick

int timessick

timesovercrowding

int timesovercrowding

crowdedRadius

int crowdedRadius

inAmerica

boolean inAmerica

dead

boolean dead

overcrowding

boolean overcrowding

inTransit

boolean inTransit
Constructor Detail

ImmigrationAgent

public ImmigrationAgent(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

ImmigrationAgent

public ImmigrationAgent(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)
Description copied from class: Agent
Method to initialize the new wolf object

Overrides:
init in class Agent

die

public void die()
Description copied from class: Agent
Method that handles when an Agent dies

Overrides:
die in class Agent

immigrate

public void immigrate()

act

public void act()
Description copied from class: Agent
Method to act during a time step Default is to pick a random direction and move some random amount up to top speed

Overrides:
act in class Agent