org.nlogo.agent
Class Observer

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

public class Observer
extends Agent


Field Summary
static int BIT
           
static int FOLLOW
           
static int OBSERVE
           
static int RIDE
           
static int WATCH
           
 
Fields inherited from class org.nlogo.agent.Agent
id, variables
 
Constructor Summary
Observer(World world)
           
 
Method Summary
 void assertVariableConstraint(int vn, Object value)
           
 boolean atHome2D()
           
 boolean atHome3D()
           
 String classDisplayName()
           
 double dist()
           
 double distance(RenderableAgent agent)
           
 double distance(RenderableTurtle t)
           
 double dx()
           
 double dy()
           
 double dz()
           
 void face(Agent agent)
           
 void face(double x, double y)
           
 int followDistance()
           
 void followDistance(int followDistance)
           
 double followOffsetX()
           
 double followOffsetY()
           
 int getAgentBit()
           
 Class getAgentClass()
           
 Object getBreedVariable(String name)
           
static List getImplicitVariables()
           
 Object getLinkBreedVariable(String name)
           
 Object getLinkVariable(int vn)
           
 double getLinkVariableDouble(int vn)
           
 Object getObserverVariable(int vn)
           
 Patch getPatchAtOffsets(double dx, double dy)
           
 Object getPatchVariable(int vn)
           
 double getPatchVariableDouble(int vn)
           
 Object getTurtleOrLinkVariable(String varName)
           
 Object getTurtleVariable(int vn)
           
 double getTurtleVariableDouble(int vn)
           
 Object getVariable(int vn)
           
 double heading()
           
 void heading(double heading)
           
 void home()
           
 void moveto(Agent otherAgent)
           
 void orbitRight(double delta)
           
 void orbitUp(double delta)
           
 double oxcor()
           
 void oxcor(double oxcor)
           
 void oxyandzcor(double oxcor, double oycor, double ozcor)
           
 double oycor()
           
 void oycor(double oycor)
           
 double ozcor()
           
 void ozcor(double ozcor)
           
 int perspective()
           
 void perspective(int perspective)
           
 double pitch()
           
 void pitch(double pitch)
           
 void resetPerspective()
           
 double roll()
           
 void roll(double roll)
           
 void rotatePsi(double delta)
           
 org.nlogo.util.Vect rotationPoint()
           
 void setBreedVariable(String name, Object value)
           
 void setLinkBreedVariable(String name, Object value)
           
 void setLinkVariable(int vn, double value)
           
 void setLinkVariable(int vn, Object value)
           
 void setObserverVariable(int vn, Object value)
           
 void setOrientation(double heading, double pitch, double roll)
           
 void setPatchVariable(int vn, double value)
           
 void setPatchVariable(int vn, Object value)
           
 void setPerspective(int perspective)
           
 void setPerspective(int perspective, Agent agent)
           
 void setRotationPoint(Agent agent)
           
 void setRotationPoint(double x, double y, double z)
           
 void setRotationPoint(org.nlogo.util.Vect v)
           
 void setTurtleOrLinkVariable(String varName, Object value)
           
 void setTurtleVariable(int vn, double value)
           
 void setTurtleVariable(int vn, Object value)
           
 void setVariable(int vn, Object value)
           
 Agent targetAgent()
           
 void targetAgent(Agent agent)
           
 String toString()
           
 void translate(double thetaX, double thetaY)
           
 boolean updatePosition()
           
 
Methods inherited from class org.nlogo.agent.Agent
compareTo, getVariableCount, variableConstraint, variableConstraint, 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, wait, wait, wait
 

Field Detail

OBSERVE

public static final int OBSERVE
See Also:
Constant Field Values

RIDE

public static final int RIDE
See Also:
Constant Field Values

FOLLOW

public static final int FOLLOW
See Also:
Constant Field Values

WATCH

public static final int WATCH
See Also:
Constant Field Values

BIT

public static final int BIT
See Also:
Constant Field Values
Constructor Detail

Observer

public Observer(World world)
Method Detail

getImplicitVariables

public static List getImplicitVariables()

getVariable

public Object getVariable(int vn)
Specified by:
getVariable in class Agent

getObserverVariable

public Object getObserverVariable(int vn)
Specified by:
getObserverVariable in class Agent

getTurtleVariable

public Object getTurtleVariable(int vn)
                         throws AgentException
Specified by:
getTurtleVariable in class Agent
Throws:
AgentException

getTurtleVariableDouble

public double getTurtleVariableDouble(int vn)
                               throws AgentException
Specified by:
getTurtleVariableDouble in class Agent
Throws:
AgentException

getTurtleOrLinkVariable

public Object getTurtleOrLinkVariable(String varName)
                               throws AgentException
Specified by:
getTurtleOrLinkVariable in class Agent
Throws:
AgentException

getBreedVariable

public Object getBreedVariable(String name)
                        throws AgentException
Specified by:
getBreedVariable in class Agent
Throws:
AgentException

getLinkVariable

public Object getLinkVariable(int vn)
                       throws AgentException
Specified by:
getLinkVariable in class Agent
Throws:
AgentException

getLinkVariableDouble

public double getLinkVariableDouble(int vn)
                             throws AgentException
Specified by:
getLinkVariableDouble in class Agent
Throws:
AgentException

getLinkBreedVariable

public Object getLinkBreedVariable(String name)
                            throws AgentException
Specified by:
getLinkBreedVariable in class Agent
Throws:
AgentException

getPatchVariable

public Object getPatchVariable(int vn)
                        throws AgentException
Specified by:
getPatchVariable in class Agent
Throws:
AgentException

getPatchVariableDouble

public double getPatchVariableDouble(int vn)
                              throws AgentException
Specified by:
getPatchVariableDouble in class Agent
Throws:
AgentException

setVariable

public void setVariable(int vn,
                        Object value)
                 throws AgentException,
                        LogoException
Specified by:
setVariable in class Agent
Throws:
AgentException
LogoException

assertVariableConstraint

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

setObserverVariable

public void setObserverVariable(int vn,
                                Object value)
                         throws AgentException,
                                LogoException
Specified by:
setObserverVariable in class Agent
Throws:
AgentException
LogoException

setTurtleVariable

public void setTurtleVariable(int vn,
                              Object value)
                       throws AgentException
Specified by:
setTurtleVariable in class Agent
Throws:
AgentException

setTurtleVariable

public void setTurtleVariable(int vn,
                              double value)
                       throws AgentException
Specified by:
setTurtleVariable in class Agent
Throws:
AgentException

setBreedVariable

public void setBreedVariable(String name,
                             Object value)
                      throws AgentException
Specified by:
setBreedVariable in class Agent
Throws:
AgentException

setPatchVariable

public void setPatchVariable(int vn,
                             Object value)
                      throws AgentException
Specified by:
setPatchVariable in class Agent
Throws:
AgentException

setPatchVariable

public void setPatchVariable(int vn,
                             double value)
                      throws AgentException
Specified by:
setPatchVariable in class Agent
Throws:
AgentException

setLinkVariable

public void setLinkVariable(int vn,
                            Object value)
                     throws AgentException
Specified by:
setLinkVariable in class Agent
Throws:
AgentException

setLinkVariable

public void setLinkVariable(int vn,
                            double value)
                     throws AgentException
Specified by:
setLinkVariable in class Agent
Throws:
AgentException

setLinkBreedVariable

public void setLinkBreedVariable(String name,
                                 Object value)
                          throws AgentException
Specified by:
setLinkBreedVariable in class Agent
Throws:
AgentException

setTurtleOrLinkVariable

public void setTurtleOrLinkVariable(String varName,
                                    Object value)
                             throws AgentException
Specified by:
setTurtleOrLinkVariable in class Agent
Throws:
AgentException

perspective

public int perspective()

perspective

public void perspective(int perspective)

targetAgent

public Agent targetAgent()

targetAgent

public void targetAgent(Agent agent)

oxcor

public double oxcor()

oxcor

public void oxcor(double oxcor)

oycor

public double oycor()

oycor

public void oycor(double oycor)

ozcor

public double ozcor()

ozcor

public void ozcor(double ozcor)

followOffsetX

public double followOffsetX()

followOffsetY

public double followOffsetY()

heading

public double heading()

heading

public void heading(double heading)

pitch

public double pitch()

pitch

public void pitch(double pitch)

roll

public double roll()

roll

public void roll(double roll)

dist

public double dist()

setRotationPoint

public void setRotationPoint(org.nlogo.util.Vect v)

setRotationPoint

public void setRotationPoint(double x,
                             double y,
                             double z)

setRotationPoint

public void setRotationPoint(Agent agent)

rotationPoint

public org.nlogo.util.Vect rotationPoint()

followDistance

public int followDistance()

followDistance

public void followDistance(int followDistance)

oxyandzcor

public void oxyandzcor(double oxcor,
                       double oycor,
                       double ozcor)

setOrientation

public void setOrientation(double heading,
                           double pitch,
                           double roll)

dx

public double dx()

dy

public double dy()

dz

public double dz()

face

public void face(Agent agent)

face

public void face(double x,
                 double y)

moveto

public void moveto(Agent otherAgent)
            throws AgentException
Throws:
AgentException

setPerspective

public void setPerspective(int perspective,
                           Agent agent)

setPerspective

public void setPerspective(int perspective)

updatePosition

public boolean updatePosition()

distance

public double distance(RenderableAgent agent)

distance

public double distance(RenderableTurtle t)

resetPerspective

public void resetPerspective()

home

public void home()

atHome2D

public boolean atHome2D()

atHome3D

public boolean atHome3D()

getPatchAtOffsets

public Patch getPatchAtOffsets(double dx,
                               double dy)
                        throws AgentException
Specified by:
getPatchAtOffsets in class Agent
Throws:
AgentException

toString

public String toString()
Overrides:
toString in class Object

classDisplayName

public String classDisplayName()
Specified by:
classDisplayName in class Agent

getAgentClass

public Class getAgentClass()
Specified by:
getAgentClass in class Agent

getAgentBit

public int getAgentBit()
Specified by:
getAgentBit in class Agent

orbitRight

public void orbitRight(double delta)

orbitUp

public void orbitUp(double delta)

rotatePsi

public void rotatePsi(double delta)

translate

public void translate(double thetaX,
                      double thetaY)