Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.mrd.models.cagn
Class Agent  view Agent download Agent.java

java.lang.Object
  extended byorg.mrd.models.cagn.Agent
Direct Known Subclasses:
Pair

public abstract class Agent
extends java.lang.Object

Used to supply "standard" methods to Agents that use the Landscape object.


Field Summary
static int ALIVE
          Constant representing an alive Agent in the model.
static int DEAD
          Constant representing a dead Agent in the landscape.
protected  Landscape landscape
          Holds value of property landscape.
protected  int stage
          Holds value of property stage.
protected  int x
          Holds value of property x (the agents location).
protected  int y
          Holds value of property y (the agents location).
 
Constructor Summary
Agent()
           
 
Method Summary
abstract  void draw(SimGraphics g)
          Abstract draw() method must be overridden in Agents that extend this class
 Landscape getLandscape()
          Getter for property landscape.
 int getStage()
          Getter for property stage.
 int getX()
          Getter for property x.
 int getY()
          Getter for property y.
 void setLandscape(Landscape landscape)
          Setter for property landscape.
 void setStage(int stage)
          Setter for property stage.
 void setX(int x)
          Setter for property x.
 void setY(int y)
          Setter for property y.
abstract  void step()
          Abstract step() method must be overridden in Agents that extend this class
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ALIVE

public static final int ALIVE
Constant representing an alive Agent in the model. Is used to identify live agents on the landscape

See Also:
Constant Field Values

DEAD

public static final int DEAD
Constant representing a dead Agent in the landscape. Is used to reap dead agents from the landscape

See Also:
Constant Field Values

x

protected int x
Holds value of property x (the agents location).


y

protected int y
Holds value of property y (the agents location).


stage

protected int stage
Holds value of property stage.


landscape

protected Landscape landscape
Holds value of property landscape.

Constructor Detail

Agent

public Agent()
Method Detail

step

public abstract void step()
Abstract step() method must be overridden in Agents that extend this class


draw

public abstract void draw(SimGraphics g)
Abstract draw() method must be overridden in Agents that extend this class


setStage

public void setStage(int stage)
Setter for property stage.


getStage

public int getStage()
Getter for property stage.


getX

public int getX()
Getter for property x.


getY

public int getY()
Getter for property y.


setX

public void setX(int x)
Setter for property x.


setY

public void setY(int y)
Setter for property y.


getLandscape

public Landscape getLandscape()
Getter for property landscape.


setLandscape

public void setLandscape(Landscape landscape)
Setter for property landscape.