java.lang.Objectjava.util.Observable
org.nlogo.agent.Agent
org.nlogo.agent.Observer
public class Observer
| Field Summary | |
|---|---|
static int |
BIT
|
| 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()
Returns a displayable name of this type of agent (Turtle, Link, Patch, Observer) |
double |
dist()
|
double |
distance(Agent agent)
|
double |
distance(Turtle t)
|
double |
dx()
|
double |
dy()
|
double |
dz()
|
void |
face(Agent agent)
|
void |
face(double x,
double y)
|
int |
followDistance()
Returns the current distance behind the followed turtle the 3D view is displaying |
void |
followDistance(int followDistance)
|
double |
followOffsetX()
|
double |
followOffsetY()
|
int |
getAgentBit()
|
Class<Observer> |
getAgentClass()
|
Object |
getBreedVariable(String name)
|
Object |
getLinkBreedVariable(String name)
|
Object |
getLinkVariable(int vn)
|
Object |
getObserverVariable(int vn)
|
Patch |
getPatchAtOffsets(double dx,
double dy)
|
Object |
getPatchVariable(int vn)
|
Object |
getTurtleOrLinkVariable(String varName)
|
Object |
getTurtleVariable(int vn)
|
Object |
getVariable(int vn)
Returns the value of the variable in the given position of the agent variable array |
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)
|
Perspective |
perspective()
Returns the current perspective |
void |
perspective(Perspective perspective)
|
double |
pitch()
|
void |
pitch(double pitch)
|
void |
resetPerspective()
|
double |
roll()
|
void |
roll(double roll)
|
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(Perspective perspective)
|
void |
setPerspective(Perspective perspective,
Agent agent)
|
void |
setRotationPoint(Agent agent)
|
void |
setRotationPoint(double x,
double y,
double z)
|
void |
setRotationPoint(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)
Sets the variable in the position vn of the agent variable array to value |
String |
shape()
Returns the name of the current shape, empty string in the case of patches. |
double |
size()
Returns the size of this agent |
Agent |
targetAgent()
Returns the currently watched or followed agent (or nobody) |
void |
targetAgent(Agent agent)
|
String |
toString()
|
void |
translate(double thetaX,
double thetaY)
|
boolean |
updatePosition()
|
| Methods inherited from class org.nlogo.agent.Agent |
|---|
compareTo, getVariableCount, id, 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 |
| Methods inherited from interface org.nlogo.api.Agent |
|---|
id, world |
| Field Detail |
|---|
public static final int BIT
| Constructor Detail |
|---|
public Observer(World world)
| Method Detail |
|---|
public Object getVariable(int vn)
Agent
getVariable in interface AgentgetVariable in class Agentvn - the index into the agent variable arraypublic Object getObserverVariable(int vn)
getObserverVariable in class Agent
public Object getTurtleVariable(int vn)
throws AgentException
getTurtleVariable in class AgentAgentException
public Object getTurtleOrLinkVariable(String varName)
throws AgentException
getTurtleOrLinkVariable in class AgentAgentException
public Object getBreedVariable(String name)
throws AgentException
getBreedVariable in class AgentAgentException
public Object getLinkVariable(int vn)
throws AgentException
getLinkVariable in class AgentAgentException
public Object getLinkBreedVariable(String name)
throws AgentException
getLinkBreedVariable in class AgentAgentException
public Object getPatchVariable(int vn)
throws AgentException
getPatchVariable in class AgentAgentException
public void setVariable(int vn,
Object value)
throws AgentException,
LogoException
Agent
setVariable in interface AgentsetVariable in class Agentvn - the index into the agent variable arrayvalue - the new value for the variable
AgentException - If value is the wrong type for the given variable or if you try to change variables that cannot be changed
LogoException
public void assertVariableConstraint(int vn,
Object value)
throws AgentException,
LogoException
AgentException
LogoException
public void setObserverVariable(int vn,
Object value)
throws AgentException,
LogoException
setObserverVariable in class AgentAgentException
LogoException
public void setTurtleVariable(int vn,
Object value)
throws AgentException
setTurtleVariable in class AgentAgentException
public void setTurtleVariable(int vn,
double value)
throws AgentException
setTurtleVariable in class AgentAgentException
public void setBreedVariable(String name,
Object value)
throws AgentException
setBreedVariable in class AgentAgentException
public void setPatchVariable(int vn,
Object value)
throws AgentException
setPatchVariable in class AgentAgentException
public void setPatchVariable(int vn,
double value)
throws AgentException
setPatchVariable in class AgentAgentException
public void setLinkVariable(int vn,
Object value)
throws AgentException
setLinkVariable in class AgentAgentException
public void setLinkVariable(int vn,
double value)
throws AgentException
setLinkVariable in class AgentAgentException
public void setLinkBreedVariable(String name,
Object value)
throws AgentException
setLinkBreedVariable in class AgentAgentException
public void setTurtleOrLinkVariable(String varName,
Object value)
throws AgentException
setTurtleOrLinkVariable in class AgentAgentExceptionpublic Perspective perspective()
Observer
perspective in interface Observerpublic void perspective(Perspective perspective)
public Agent targetAgent()
Observer
targetAgent in interface Observerpublic void targetAgent(Agent agent)
public double oxcor()
oxcor in interface Observerpublic void oxcor(double oxcor)
public double oycor()
oycor in interface Observerpublic void oycor(double oycor)
public double ozcor()
ozcor in interface Observerpublic void ozcor(double ozcor)
public double followOffsetX()
public double followOffsetY()
public double heading()
heading in interface Observerpublic void heading(double heading)
public double pitch()
pitch in interface Observerpublic void pitch(double pitch)
public double roll()
roll in interface Observerpublic void roll(double roll)
public double dist()
dist in interface Observerpublic void setRotationPoint(Vect v)
public void setRotationPoint(double x,
double y,
double z)
public void setRotationPoint(Agent agent)
public Vect rotationPoint()
public int followDistance()
Observer
followDistance in interface Observerpublic void followDistance(int followDistance)
public void oxyandzcor(double oxcor,
double oycor,
double ozcor)
public void setOrientation(double heading,
double pitch,
double roll)
public double dx()
dx in interface Observerpublic double dy()
dy in interface Observerpublic double dz()
dz in interface Observerpublic void face(Agent agent)
public void face(double x,
double y)
public void moveto(Agent otherAgent)
throws AgentException
AgentException
public void setPerspective(Perspective perspective,
Agent agent)
setPerspective in interface Observerpublic void setPerspective(Perspective perspective)
public boolean updatePosition()
public double distance(Agent agent)
public double distance(Turtle t)
public void resetPerspective()
public void home()
public boolean atHome2D()
public boolean atHome3D()
public Patch getPatchAtOffsets(double dx,
double dy)
throws AgentException
getPatchAtOffsets in class AgentAgentExceptionpublic String toString()
toString in class Objectpublic String classDisplayName()
Agent
classDisplayName in interface AgentclassDisplayName in class Agentpublic Class<Observer> getAgentClass()
getAgentClass in class Agentpublic int getAgentBit()
getAgentBit in class Agentpublic String shape()
Agent
shape in interface Agentpublic double size()
Agent
size in interface Agentpublic void orbitRight(double delta)
public void orbitUp(double delta)
public void translate(double thetaX,
double thetaY)