org.nlogo.agent
Class Turtle3D

java.lang.Object
  extended by java.util.Observable
      extended by org.nlogo.agent.Agent
          extended by org.nlogo.agent.Turtle
              extended by org.nlogo.agent.Turtle3D
All Implemented Interfaces:
Comparable<Agent>, Agent3D, Agent, Turtle, Turtle3D

public final class Turtle3D
extends Turtle
implements Agent3D, Turtle3D


Field Summary
static int VAR_COLOR3D
           
static int VAR_HEADING3D
           
static int VAR_LABEL3D
           
static int VAR_PITCH3D
           
static int VAR_ROLL3D
           
static int VAR_WHO3D
           
static int VAR_XCOR3D
           
static int VAR_YCOR3D
           
static int VAR_ZCOR3D
           
 
Fields inherited from class org.nlogo.agent.Turtle
BIT, LAST_PREDEFINED_VAR, NUMBER_PREDEFINED_VARS, PEN_DOWN, PEN_ERASE, PEN_UP, VAR_COLOR, VAR_HEADING, VAR_LABEL, VAR_WHO, VAR_XCOR, VAR_YCOR
 
Fields inherited from class org.nlogo.agent.Agent
id, variables
 
Constructor Summary
Turtle3D(World3D world, AgentSet breed, Number xcor, Number ycor, Number zcor)
           
 
Method Summary
 double dx()
          Returns the x component of the forward vector
 double dy()
          Returns the y component of the forward vector
 double dz()
          Returns the z component of the forward vector
 void face(Agent agent, boolean wrap)
           
 void face(double x, double y, double z, boolean wrap)
           
 AgentSet getBreed()
          Returns the breed AgentSet of this turtle, all turtles if the turtle is unbreeded
 Patch getPatchAtHeadingAndDistance(double delta, double distance)
           
 Patch getPatchAtOffsets(double dx, double dy)
           
 Patch3D getPatchAtOffsets(double dx, double dy, double dz)
           
 Patch getPatchAtPoint(List<Double> point)
           
 Patch getPatchHere()
          Returns the patch that this turtle is on
 Object getTurtleVariable(int vn)
           
 double getTurtleVariableDouble(int vn)
           
 Turtle hatch()
           
 void headingPitchAndRoll(double heading, double pitch, double roll)
           
 boolean hidden()
          Returns the value of the hidden?
 void hidden(boolean hidden)
           
 void home()
           
 void jump(double distance)
          Moves the turtle forward distance as if the command jump were used
 Object label()
           
 void label(Object label)
           
 Object labelColor()
          Returns the value of the label-color variable
 void labelColor(double labelColor)
           
 String labelString()
          Returns the value of the label variable
 void moveTo(Agent otherAgent)
           
 void moveToPatchCenter()
           
 String penMode()
           
 void penMode(String penMode)
           
 double penSize()
           
 void penSize(double penSize)
           
 double pitch()
          Returns the value of the pitch variable
 void pitch(double pitch)
           
 double[] right(double delta)
           
 double roll()
          Returns the value of the roll variable
 void roll(double roll)
           
 void setBreed(AgentSet breed)
          This version of setBreed properly resets the global breed AgentSets Caller should ensure that the turtle isn't a link (links aren't allowed to change breed).
 void setTurtleVariable(int vn, double value)
           
 void setTurtleVariable(int vn, Object value)
           
 String shape()
          Returns the name of the current shape, empty string in the case of patches.
 void shape(String shape)
           
 double shortestPathZ(double z)
           
 double size()
          Returns the size of this agent
 void size(double size)
           
 void turnRight(double delta)
           
 void xandycor(double xcor, double ycor)
           
 void xandycor(Double xcor, Double ycor)
           
 void xcor(double xcor)
           
 void xcor(Double xcor)
           
 void xyandzcor(double xcor, double ycor, double zcor)
           
 void xyandzcor(Double xcor, Double ycor, Double zcor)
           
 void ycor(double ycor)
           
 void ycor(Double ycor)
           
 double zcor()
          Returns the value of the zcor variable
 void zcor(double zcor)
           
 void zcor(Double zcor)
           
 
Methods inherited from class org.nlogo.agent.Turtle
cachedShape, cachedShape, classDisplayName, color, color, colorDouble, colorDoubleUnchecked, die, face, getAgentBit, getAgentClass, getBreedIndex, getBreedVariable, getLinkBreedVariable, getLinkVariable, getObserverVariable, getPatchVariable, getTurtleOrLinkVariable, getVariable, getVariable, hasLabel, heading, heading, heading, heading, labelColor, lineThickness, ownsVariable, setBreedVariable, setLinkBreedVariable, setLinkVariable, setLinkVariable, setObserverVariable, setPatchVariable, setPatchVariable, setTurtleOrLinkVariable, setVariable, shortestPathX, shortestPathY, subtractHeadings, toString, xandycor, xandycorHelper, xcor, ycor
 
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.Turtle
cachedShape, cachedShape, color, getBreedIndex, hasLabel, heading, heading, lineThickness, xcor, ycor
 
Methods inherited from interface org.nlogo.api.Agent
classDisplayName, getVariable, id, setVariable, world
 

Field Detail

VAR_WHO3D

public static final int VAR_WHO3D
See Also:
Constant Field Values

VAR_COLOR3D

public static final int VAR_COLOR3D
See Also:
Constant Field Values

VAR_HEADING3D

public static final int VAR_HEADING3D
See Also:
Constant Field Values

VAR_PITCH3D

public static final int VAR_PITCH3D
See Also:
Constant Field Values

VAR_ROLL3D

public static final int VAR_ROLL3D
See Also:
Constant Field Values

VAR_XCOR3D

public static final int VAR_XCOR3D
See Also:
Constant Field Values

VAR_YCOR3D

public static final int VAR_YCOR3D
See Also:
Constant Field Values

VAR_ZCOR3D

public static final int VAR_ZCOR3D
See Also:
Constant Field Values

VAR_LABEL3D

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

Turtle3D

public Turtle3D(World3D world,
                AgentSet breed,
                Number xcor,
                Number ycor,
                Number zcor)
Method Detail

hatch

public Turtle hatch()
Overrides:
hatch in class Turtle

getPatchAtOffsets

public Patch getPatchAtOffsets(double dx,
                               double dy)
                        throws AgentException
Overrides:
getPatchAtOffsets in class Turtle
Throws:
AgentException

getPatchAtOffsets

public Patch3D getPatchAtOffsets(double dx,
                                 double dy,
                                 double dz)
                          throws AgentException
Specified by:
getPatchAtOffsets in interface Agent3D
Throws:
AgentException

getPatchAtPoint

public Patch getPatchAtPoint(List<Double> point)
                      throws AgentException
Throws:
AgentException

jump

public void jump(double distance)
Description copied from interface: Turtle
Moves the turtle forward distance as if the command jump were used

Specified by:
jump in interface Turtle
Overrides:
jump in class Turtle
Parameters:
distance - this amount to jump

getPatchHere

public Patch getPatchHere()
Description copied from interface: Turtle
Returns the patch that this turtle is on

Specified by:
getPatchHere in interface Turtle
Overrides:
getPatchHere in class Turtle

getTurtleVariable

public Object getTurtleVariable(int vn)
Overrides:
getTurtleVariable in class Turtle

getTurtleVariableDouble

public double getTurtleVariableDouble(int vn)
Overrides:
getTurtleVariableDouble in class Turtle

setTurtleVariable

public void setTurtleVariable(int vn,
                              double value)
                       throws AgentException
Overrides:
setTurtleVariable in class Turtle
Throws:
AgentException

setTurtleVariable

public void setTurtleVariable(int vn,
                              Object value)
                       throws AgentException
Overrides:
setTurtleVariable in class Turtle
Throws:
AgentException

pitch

public double pitch()
Description copied from interface: Turtle3D
Returns the value of the pitch variable

Specified by:
pitch in interface Turtle3D

pitch

public void pitch(double pitch)

roll

public double roll()
Description copied from interface: Turtle3D
Returns the value of the roll variable

Specified by:
roll in interface Turtle3D

roll

public void roll(double roll)

headingPitchAndRoll

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

shortestPathZ

public double shortestPathZ(double z)

moveTo

public void moveTo(Agent otherAgent)
            throws AgentException
Overrides:
moveTo in class Turtle
Throws:
AgentException

moveToPatchCenter

public void moveToPatchCenter()
Overrides:
moveToPatchCenter in class Turtle

xcor

public void xcor(double xcor)
          throws AgentException
Overrides:
xcor in class Turtle
Throws:
AgentException

xcor

public void xcor(Double xcor)
          throws AgentException
Overrides:
xcor in class Turtle
Throws:
AgentException

zcor

public double zcor()
Description copied from interface: Turtle3D
Returns the value of the zcor variable

Specified by:
zcor in interface Turtle3D

zcor

public void zcor(double zcor)

zcor

public void zcor(Double zcor)

ycor

public void ycor(double ycor)
          throws AgentException
Overrides:
ycor in class Turtle
Throws:
AgentException

ycor

public void ycor(Double ycor)
          throws AgentException
Overrides:
ycor in class Turtle
Throws:
AgentException

xandycor

public void xandycor(double xcor,
                     double ycor)
              throws AgentException
Overrides:
xandycor in class Turtle
Throws:
AgentException

xandycor

public void xandycor(Double xcor,
                     Double ycor)
              throws AgentException
Overrides:
xandycor in class Turtle
Throws:
AgentException

xyandzcor

public void xyandzcor(double xcor,
                      double ycor,
                      double zcor)

xyandzcor

public void xyandzcor(Double xcor,
                      Double ycor,
                      Double zcor)

home

public void home()
Overrides:
home in class Turtle

face

public void face(Agent agent,
                 boolean wrap)
Overrides:
face in class Turtle

face

public void face(double x,
                 double y,
                 double z,
                 boolean wrap)

dx

public double dx()
Description copied from interface: Turtle3D
Returns the x component of the forward vector

Specified by:
dx in interface Turtle3D
Overrides:
dx in class Turtle

dy

public double dy()
Description copied from interface: Turtle3D
Returns the y component of the forward vector

Specified by:
dy in interface Turtle3D
Overrides:
dy in class Turtle

dz

public double dz()
Description copied from interface: Turtle3D
Returns the z component of the forward vector

Specified by:
dz in interface Turtle3D

shape

public String shape()
Description copied from interface: Agent
Returns the name of the current shape, empty string in the case of patches.

Specified by:
shape in interface Agent
Overrides:
shape in class Turtle

shape

public void shape(String shape)
Overrides:
shape in class Turtle

label

public Object label()
Overrides:
label in class Turtle

labelString

public String labelString()
Description copied from interface: Turtle
Returns the value of the label variable

Specified by:
labelString in interface Turtle
Overrides:
labelString in class Turtle

label

public void label(Object label)
Overrides:
label in class Turtle

labelColor

public Object labelColor()
Description copied from interface: Turtle
Returns the value of the label-color variable

Specified by:
labelColor in interface Turtle
Overrides:
labelColor in class Turtle

labelColor

public void labelColor(double labelColor)
Overrides:
labelColor in class Turtle

getBreed

public AgentSet getBreed()
Description copied from interface: Turtle
Returns the breed AgentSet of this turtle, all turtles if the turtle is unbreeded

Specified by:
getBreed in interface Turtle
Overrides:
getBreed in class Turtle

setBreed

public void setBreed(AgentSet breed)
This version of setBreed properly resets the global breed AgentSets Caller should ensure that the turtle isn't a link (links aren't allowed to change breed).

Overrides:
setBreed in class Turtle

getPatchAtHeadingAndDistance

public Patch getPatchAtHeadingAndDistance(double delta,
                                          double distance)
                                   throws AgentException
Overrides:
getPatchAtHeadingAndDistance in class Turtle
Throws:
AgentException

turnRight

public void turnRight(double delta)
Overrides:
turnRight in class Turtle

right

public double[] right(double delta)

hidden

public boolean hidden()
Description copied from interface: Turtle
Returns the value of the hidden? variable

Specified by:
hidden in interface Turtle
Overrides:
hidden in class Turtle

hidden

public void hidden(boolean hidden)
Overrides:
hidden in class Turtle

size

public double size()
Description copied from interface: Agent
Returns the size of this agent

Specified by:
size in interface Agent
Overrides:
size in class Turtle

size

public void size(double size)
Overrides:
size in class Turtle

penSize

public double penSize()
Overrides:
penSize in class Turtle

penSize

public void penSize(double penSize)
Overrides:
penSize in class Turtle

penMode

public String penMode()
Overrides:
penMode in class Turtle

penMode

public void penMode(String penMode)
Overrides:
penMode in class Turtle