org.nlogo.agent
Class Turtle3D
java.lang.Object
java.util.Observable
org.nlogo.agent.Agent
org.nlogo.agent.Turtle
org.nlogo.agent.Turtle3D
- All Implemented Interfaces:
- Comparable, Agent3D, RenderableAgent, RenderableTurtle, RenderableTurtle3D, Agent, Turtle
public final class Turtle3D
- extends Turtle
- implements Agent3D, RenderableTurtle3D
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 |
Constructor Summary |
Turtle3D(double color,
double heading,
Shape shape,
boolean hidden)
|
Turtle3D(Double color,
double heading,
String shape,
double size,
double xcor,
double ycor)
|
Turtle3D(World3D world,
AgentSet breed,
Number xcor,
Number ycor,
Number zcor)
|
Method Summary |
double |
dx()
|
double |
dy()
|
double |
dz()
|
void |
face(Agent agent,
boolean wrap)
|
void |
face(double x,
double y,
double z,
boolean wrap)
|
AgentSet |
getBreed()
|
static List |
getImplicitVariables()
|
Patch |
getPatchAtHeadingAndDistance(double delta,
double distance)
|
Patch |
getPatchAtOffsets(double dx,
double dy)
|
Patch3D |
getPatchAtOffsets(double dx,
double dy,
double dz)
|
Patch |
getPatchAtPoint(ArrayList point)
|
Patch |
getPatchHere()
|
Object |
getTurtleVariable(int vn)
|
double |
getTurtleVariableDouble(int vn)
|
Turtle |
hatch()
|
void |
headingPitchAndRoll(double heading,
double pitch,
double roll)
|
boolean |
hidden()
|
void |
hidden(boolean hidden)
|
void |
home()
|
static boolean |
isDoubleVariable(int vn)
|
void |
jump(double distance)
|
Object |
label()
|
void |
label(Object label)
|
Object |
labelColor()
|
void |
labelColor(double labelColor)
|
String |
labelString()
|
void |
moveTo(Agent otherAgent)
|
void |
moveToPatchCenter()
|
String |
penMode()
|
void |
penMode(String penMode)
|
double |
penSize()
|
void |
penSize(double penSize)
|
double |
pitch()
|
void |
pitch(double pitch)
|
double[] |
right(double delta)
|
double |
roll()
|
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()
|
void |
shape(String shape)
|
double |
shortestPathZ(double z)
|
double |
size()
|
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()
|
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, getLinkVariableDouble, getObserverVariable, getPatchVariable, getPatchVariableDouble, getTurtleOrLinkVariable, getVariable, getVariable, hasLabel, heading, heading, heading, heading, headingHelper, id, isDirectedLink, isSpecialVariable, labelColor, lineThickness, linkDestinationSize, ownsVariable, setBreedVariable, setLinkBreedVariable, setLinkVariable, setLinkVariable, setObserverVariable, setPatchVariable, setPatchVariable, setTurtleOrLinkVariable, setVariable, shortestPathX, shortestPathY, subtractHeadings, toString, xandycor, xandycorHelper, xcor, ycor |
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
Turtle3D
public Turtle3D(World3D world,
AgentSet breed,
Number xcor,
Number ycor,
Number zcor)
Turtle3D
public Turtle3D(double color,
double heading,
Shape shape,
boolean hidden)
Turtle3D
public Turtle3D(Double color,
double heading,
String shape,
double size,
double xcor,
double ycor)
hatch
public Turtle hatch()
- Overrides:
hatch
in class Turtle
getImplicitVariables
public static List getImplicitVariables()
isDoubleVariable
public static boolean isDoubleVariable(int vn)
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(ArrayList point)
throws AgentException
- Throws:
AgentException
jump
public void jump(double distance)
throws AgentException
- Overrides:
jump
in class Turtle
- Throws:
AgentException
getPatchHere
public Patch getPatchHere()
- 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()
- Specified by:
pitch
in interface RenderableTurtle3D
pitch
public void pitch(double pitch)
roll
public double roll()
- Specified by:
roll
in interface RenderableTurtle3D
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()
- Specified by:
zcor
in interface RenderableTurtle3D
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()
- Overrides:
dx
in class Turtle
dy
public double dy()
- Overrides:
dy
in class Turtle
dz
public double dz()
shape
public String shape()
- Specified by:
shape
in interface RenderableAgent
- 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()
- Specified by:
labelString
in interface RenderableAgent
- Overrides:
labelString
in class Turtle
label
public void label(Object label)
- Overrides:
label
in class Turtle
labelColor
public Object labelColor()
- Specified by:
labelColor
in interface RenderableAgent
- Overrides:
labelColor
in class Turtle
labelColor
public void labelColor(double labelColor)
- Overrides:
labelColor
in class Turtle
getBreed
public AgentSet getBreed()
- 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()
- Overrides:
hidden
in class Turtle
hidden
public void hidden(boolean hidden)
- Overrides:
hidden
in class Turtle
size
public double size()
- Specified by:
size
in interface RenderableAgent
- 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