org.nlogo.agent
Class Agent

java.lang.Object
  extended by java.util.Observable
      extended by org.nlogo.agent.Agent
All Implemented Interfaces:
Comparable, Agent
Direct Known Subclasses:
Link, Observer, Patch, Turtle

public abstract class Agent
extends Observable
implements Agent, Comparable


Field Summary
 long id
           
 Object[] variables
           
 
Constructor Summary
Agent(World world)
           
 
Method Summary
abstract  String classDisplayName()
           
 int compareTo(Object o)
           
abstract  int getAgentBit()
           
abstract  Class getAgentClass()
           
abstract  Object getBreedVariable(String name)
           
abstract  Object getLinkBreedVariable(String name)
           
abstract  Object getLinkVariable(int vn)
           
abstract  double getLinkVariableDouble(int vn)
           
abstract  Object getObserverVariable(int vn)
           
abstract  Patch getPatchAtOffsets(double dx, double dy)
           
abstract  Object getPatchVariable(int vn)
           
abstract  double getPatchVariableDouble(int vn)
           
abstract  Object getTurtleOrLinkVariable(String varName)
           
abstract  Object getTurtleVariable(int vn)
           
abstract  double getTurtleVariableDouble(int vn)
           
abstract  Object getVariable(int vn)
           
 int getVariableCount()
           
abstract  void setBreedVariable(String name, Object value)
           
abstract  void setLinkBreedVariable(String name, Object value)
           
abstract  void setLinkVariable(int vn, double value)
           
abstract  void setLinkVariable(int vn, Object value)
           
abstract  void setObserverVariable(int vn, Object value)
           
abstract  void setPatchVariable(int vn, double value)
           
abstract  void setPatchVariable(int vn, Object value)
           
abstract  void setTurtleOrLinkVariable(String varName, Object value)
           
abstract  void setTurtleVariable(int vn, double value)
           
abstract  void setTurtleVariable(int vn, Object value)
           
abstract  void setVariable(int vn, Object value)
           
 ValueConstraint variableConstraint(int vn)
           
 void variableConstraint(int vn, ValueConstraint con)
           
 World world()
           
 
Methods inherited from class java.util.Observable
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

id

public long id

variables

public Object[] variables
Constructor Detail

Agent

public Agent(World world)
Method Detail

world

public World world()

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

getVariableCount

public int getVariableCount()

getVariable

public abstract Object getVariable(int vn)

setVariable

public abstract void setVariable(int vn,
                                 Object value)
                          throws AgentException,
                                 LogoException
Throws:
AgentException
LogoException

variableConstraint

public ValueConstraint variableConstraint(int vn)

variableConstraint

public void variableConstraint(int vn,
                               ValueConstraint con)

getObserverVariable

public abstract Object getObserverVariable(int vn)

getTurtleVariable

public abstract Object getTurtleVariable(int vn)
                                  throws AgentException
Throws:
AgentException

getTurtleVariableDouble

public abstract double getTurtleVariableDouble(int vn)
                                        throws AgentException
Throws:
AgentException

getBreedVariable

public abstract Object getBreedVariable(String name)
                                 throws AgentException
Throws:
AgentException

getLinkBreedVariable

public abstract Object getLinkBreedVariable(String name)
                                     throws AgentException
Throws:
AgentException

getLinkVariable

public abstract Object getLinkVariable(int vn)
                                throws AgentException
Throws:
AgentException

getLinkVariableDouble

public abstract double getLinkVariableDouble(int vn)
                                      throws AgentException
Throws:
AgentException

getPatchVariable

public abstract Object getPatchVariable(int vn)
                                 throws AgentException
Throws:
AgentException

getPatchVariableDouble

public abstract double getPatchVariableDouble(int vn)
                                       throws AgentException
Throws:
AgentException

getTurtleOrLinkVariable

public abstract Object getTurtleOrLinkVariable(String varName)
                                        throws AgentException
Throws:
AgentException

setObserverVariable

public abstract void setObserverVariable(int vn,
                                         Object value)
                                  throws AgentException,
                                         LogoException
Throws:
AgentException
LogoException

setTurtleVariable

public abstract void setTurtleVariable(int vn,
                                       Object value)
                                throws AgentException
Throws:
AgentException

setTurtleVariable

public abstract void setTurtleVariable(int vn,
                                       double value)
                                throws AgentException
Throws:
AgentException

setLinkVariable

public abstract void setLinkVariable(int vn,
                                     Object value)
                              throws AgentException
Throws:
AgentException

setLinkVariable

public abstract void setLinkVariable(int vn,
                                     double value)
                              throws AgentException
Throws:
AgentException

setBreedVariable

public abstract void setBreedVariable(String name,
                                      Object value)
                               throws AgentException
Throws:
AgentException

setLinkBreedVariable

public abstract void setLinkBreedVariable(String name,
                                          Object value)
                                   throws AgentException
Throws:
AgentException

setPatchVariable

public abstract void setPatchVariable(int vn,
                                      Object value)
                               throws AgentException
Throws:
AgentException

setPatchVariable

public abstract void setPatchVariable(int vn,
                                      double value)
                               throws AgentException
Throws:
AgentException

setTurtleOrLinkVariable

public abstract void setTurtleOrLinkVariable(String varName,
                                             Object value)
                                      throws AgentException
Throws:
AgentException

getPatchAtOffsets

public abstract Patch getPatchAtOffsets(double dx,
                                        double dy)
                                 throws AgentException
Throws:
AgentException

classDisplayName

public abstract String classDisplayName()

getAgentClass

public abstract Class getAgentClass()

getAgentBit

public abstract int getAgentBit()