public interface ITurtle extends IXholon
NetLogo website http://ccl.northwestern.edu/netlogo/
TODO add (May 15 2007):
beep
downhill
downhill4
inCone
inRadius
patchAhead
patchAt
patchAtHeadingAndDistance
patchHere
patchLeftAndAhead
patchRightAndAhead
stamp
stampErase
turtlesAt
turtlesHere
turtlesOn
uphill
uphill4
with
Modifier and Type | Field and Description |
---|---|
static int |
COMMANDID_NONE |
static int |
FILTERID_NONE |
static int |
PENMODE_DOWN |
static int |
PENMODE_ERASE |
static int |
PENMODE_UP |
static int |
WHENMOVED_INIT |
DEFAULT_SIZE_MSG_Q, DEFAULT_SIZE_SYSTEM_MSG_Q, GETNAME_DEFAULT, GETNAME_LOCALPART_ID, GETNAME_NOROLENAME, GETNAME_ROLENAME_OR_CLASSNAME, GETNAME_ROLENAMESEP_, GETNAME_SIZE_TEMPLATE, NINCLUDE_PSC, NINCLUDE_PSx, NINCLUDE_PxC, NINCLUDE_Pxx, NINCLUDE_xSC, NINCLUDE_xSx, NINCLUDE_xxC, NINCLUDE_xxx, XHOLON_ID_DEFAULT, XHOLON_ID_NULL
Modifier and Type | Method and Description |
---|---|
void |
aggregate(double amount)
Aggregate by keeping a count of the number of individuals of a given "breed".
|
void |
back(double distance)
Move back a given distance.
|
void |
beep()
Make a single short beep sound.
|
void |
bk(double distance)
Move back a given distance.
|
boolean |
canMove(double distance)
Can this turtle legally move the specified distance, given its current heading?
|
void |
die()
Remove yourself permanently from the gene pool.
|
double |
distance(IXholon turtleOrPatch)
Return the distance between self and the specified turtle or patch.
|
double |
distancexy(double x,
double y)
Return the distance between yourself and the specified x, y coordinates.
|
double |
downhill()
"Return the turtle heading in the direction of the minimum value
of the variable patch-variable, of the patches in a one-patch radius of the turtle."
|
double |
downhill4()
"Return the turtle heading in the direction of the minimum value
of the variable patch-variable, of the patches in a one-patch radius of the turtle."
|
double |
dx()
Returns the delta in the x direction if the turtle moved one unit along its current heading.
|
double |
dy()
Returns the delta in the y direction if the turtle moved one unit along its current heading.
|
void |
face(IXholon turtleOrPatch)
Turn to face the specified turtle or patch.
|
void |
facexy(double x,
double y)
Turn to face the specified x, y coordinates.
|
void |
fd(double distance)
Move forward a given distance.
|
void |
forward(double distance)
Move forward a given distance.
|
int |
getBreed()
Get the turtle's breed id.
|
int |
getColor()
Get the turtle's color.
|
double |
getHeading()
Get the turtle's heading.
|
boolean |
getIsHidden()
Get the turtle's hide status.
|
java.lang.String |
getLabel()
Get the turtle's label, a String that helps to identify it.
|
int |
getMaxPxcor()
Return the maximum Patch x coordinate.
|
int |
getMaxPycor()
Return the maximum Patch y coordinate.
|
int |
getMinPxcor()
Return the minimum Patch x coordinate.
|
int |
getMinPycor()
Return the minimum Patch y coordinate.
|
int |
getPcolor()
Get the patch's pcolor.
|
int |
getPenMode()
Get the turtle's pen mode.
|
java.lang.String |
getPlabel()
Get the patch's label, a String that helps to identify it.
|
int |
getPxcor()
Get the patch's x coordinate.
|
int |
getPycor()
Get the patch's y coordinate.
|
int |
getWho()
Get the turtle's who id.
|
int |
getWorldHeight()
Return the height of the world (the grid height).
|
int |
getWorldWidth()
Return the width of the world (the grid width).
|
double |
getXcor()
Get the turtle's x coordinate.
|
double |
getYcor()
Get the turtle's y coordinate.
|
boolean |
hasAlreadyMoved()
Has this turtle already moved this time step?
This method is required to prevent turtles from moving multiple times in the same time step,
which would happen when a turtle moves to a patch that hasn't yet been reached
in the tree traversal this time step.
|
void |
hatch(int numTurtles,
int commandId)
Hatch a specified number of new turtles, each identical to this turtle.
|
void |
hideTurtle()
Hide from view.
|
void |
home()
Go home, by returning to the home coordinates.
|
void |
ht()
Hide from view.
|
IAgentSet |
inCone(double distance,
double angle)
Return agents that fall within a cone defined by the distance and angle .
|
void |
initWhenMoved(int when)
Initialize the whenMoved variable.
|
IAgentSet |
inRadius(int radius)
Return a list of all neighbors (turtles) within the specified radius.
|
IAgentSet |
inRadius(int radius,
int filterId)
Return a list of all neighbors (turtles) within the specified radius.
|
void |
jump(double distance)
Jump forward a given distance, without effecting any intervening patches or turtles.
|
void |
jump(IPatch aPatch)
Jump directly to the specified patch.
|
void |
jump(ITurtle aTurtle)
Jump directly to the patch that the specified turtle is currently in.
|
void |
left(double angle)
Turn left a given angle.
|
void |
lt(double angle)
Turn left a given angle.
|
IAgentSet |
neighbors()
Return the 8 surrounding neighbor patches.
|
IAgentSet |
neighbors4()
Return the 4 surrounding neighbor patches.
|
IAgentSet |
otherTurtlesHere()
Return all other turtles that are also currently located at this turtle's patch.
|
IPatch |
patchAhead(double distance)
Return the single patch that is the given distance along the turtle's current heading.
|
IPatch |
patchAt(int dx,
int dy)
Return the single patch at the specified x and y relative distance.
|
IPatch |
patchAtHeadingAndDistance(double heading,
double distance)
Return the single patch at the specified absolute heading and relative distance.
|
IPatch |
patchHere()
Return the patch that the turtle is currently on.
|
IPatch |
patchLeftAndAhead(double distance,
double angle)
Return the single patch that is the given distance from the turtle,
in the direction turned left the given angle from the turtle's current heading.
|
IPatch |
patchRightAndAhead(double distance,
double angle)
Return the single patch that is the given distance from the turtle,
in the direction turned right the given angle from the turtle's current heading.
|
void |
pd()
Set the pen down, so it is able to draw.
|
void |
pe()
Set the pen to erase.
|
void |
penDown()
Set the pen down, so it is able to draw.
|
void |
penErase()
Set the pen to erase.
|
void |
penUp()
Set the pen up, so it is unable to draw.
|
void |
pu()
Set the pen up, so it is unable to draw.
|
void |
right(double angle)
Turn right a given angle.
|
void |
rt(double angle)
Turn right a given angle.
|
void |
setBreed(int breed)
Set or change the turtle's breed id.
|
void |
setColor(int color)
Set the turtle's color.
|
void |
setHeading(double heading)
Set the turtle's heading.
|
void |
setIsHidden(boolean isHidden)
Set the turtle's hide status.
|
void |
setLabel(java.lang.String label)
Set or change the turtle's label.
|
void |
setPcolor(int pcolor)
Set the patch's pcolor.
|
void |
setPenMode(int penMode)
Set the turtle's pen mode.
|
void |
setPlabel(java.lang.String plabel)
Set or change the patch's label.
|
void |
setPxcor(int pxcor)
Set the patch's x coordinate.
|
void |
setPycor(int pycor)
Set the patch's y coordinate.
|
void |
setWho(int who)
Set the turtle's who id.
|
void |
setXcor(double xcor)
Set the turtle's x coordinate.
|
void |
setxy(double x,
double y)
Set the turtle's x and y coordinates, and move to that location.
|
void |
setYcor(double ycor)
Set the turtle's y coordinate.
|
void |
showTurtle()
Show in the viewer.
|
void |
st()
Show in the viewer.
|
void |
stamp()
Leave an inprint or stamp of self at the current patch.
|
void |
stampErase()
Erase any inprint or stamp at the current patch.
|
double |
towards(IXholon turtleOrPatch)
Return the heading between self and the specified turtle or patch.
|
double |
towardsxy(double x,
double y)
Return the heading between self and the specified x, y coordinates.
|
IAgentSet |
turtlesAt(int dx,
int dy)
Return the turtles located at the single patch at the specified x and y relative distance.
|
IAgentSet |
turtlesHere()
Return the turtles located at the current patch.
|
IAgentSet |
turtlesOn()
Return the turtles that are on the given patch or patches,
or standing on the same patch as the given turtle or turtles.
|
double |
uphill()
"Return the turtle heading in the direction of the maximum value
of the variable patch-variable, of the patches in a one-patch radius of the turtle."
|
double |
uphill4()
"Return the turtle heading in the direction of the maximum value
of the variable patch-variable, of the patches in a one-patch radius of the turtle."
|
IAgentSet |
with(IAgentSet vIn,
int filterId)
Filters the input vector to produce an output vector.
|
act, actNr, appendChild, appendChild, appendChild, appendsOwnChildren, bindPorts, cleanup, configure, configure, consoleLog, decVal, decVal, depth, doAction, findFirstChildWithXhClass, findFirstChildWithXhClass, forwardMessage, forwardSyncMessage, getActionList, getAllPorts, getAnnotation, getApp, getAttributeNodeXh, getAttributeXh, getChildNodes, getClassNode, getClassNode, getFirstChild, getFirstSibling, getId, getLastChild, getLastSibling, getName, getName, getNeighbors, getNextSibling, getNthChild, getNthSibling, getNumChildren, getNumLevels, getNumSiblings, getParentNode, getPort, getPort, getPreviousSibling, getRoleName, getRootNode, getSelfAndSiblings, getSelfAndSiblingsIndex, getService, getSiblings, getUid, getUri, getVal_boolean, getVal_byte, getVal_char, getVal_double, getVal_float, getVal_int, getVal_long, getVal_Object, getVal_short, getVal_String, getVal, getXhc, getXhcId, getXhcName, getXholon2Xml, getXhType, getXml2Xholon, handleNodeSelection, handleNodeSelection, hasAncestor, hasAnnotation, hasAttributeXh, hasChildNodes, hasChildOrSiblingNodes, hasNextSibling, hasParentNode, hasSiblingNodes, height, incVal, incVal, initialize, initStatics, inOrderPrint, insertAfter, insertAfter, insertAfter, insertBefore, insertBefore, insertBefore, insertFirstChild, isActiveObject, isAttributeHandler, isBound, isContainer, isExternal, isInternal, isLeaf, isPassiveObject, isRootNode, isUniqueSibling, isUniqueSiblingRoleName, performActivity, performActivity, performBooleanActivity, performBooleanActivity, performDoubleActivity, performGuard, performVoidActivity, postAct, postConfigure, postOrderPrint, postReconfigure, preAct, preConfigure, preOrderPrint, preReconfigure, print, println, processMessageQ, processReceivedMessage, processReceivedSyncMessage, processSystemMessageQ, reconfigure, registerMessageForwardee, remove, removeAttributeNodeXh, removeAttributeXh, removeChild, replaceNode, searchForReferencingNodes, sendMessage, sendMessage, sendMessage, sendSyncMessage, sendSyncMessage, sendSyncMessage, sendSystemMessage, sendSystemMessage, setActionList, setAnnotation, setApp, setAttributeNodeXh, setAttributeVal, setAttributeXh, setFirstChild, setId, setName, setNextSibling, setParentChildLinks, setParentNode, setParentSiblingLinks, setPort, setPort, setPorts, setRoleName, setUid, setUri, setVal_boolean, setVal_byte, setVal_char, setVal_double, setVal_float, setVal_int, setVal_long, setVal_Object, setVal_short, setVal_String, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setVal, setXhc, showAnnotation, swapNode, terminate, toXml, toXmlAttribute, toXmlAttributes, toXmlText, treeSize, visit
static final int PENMODE_UP
static final int PENMODE_DOWN
static final int PENMODE_ERASE
static final int WHENMOVED_INIT
static final int COMMANDID_NONE
static final int FILTERID_NONE
void back(double distance)
distance
- A distance measured in units.void bk(double distance)
distance
- A distance measured in units.void beep()
boolean canMove(double distance)
distance
- A distance measured in units.void die()
double distance(IXholon turtleOrPatch)
turtleOrPatch
- A turtle or patch object.double distancexy(double x, double y)
x
- A global x coordinate.y
- A global y coordinate.double downhill()
double downhill4()
double dx()
double dy()
void face(IXholon turtleOrPatch)
turtleOrPatch
- A turtle or patch object.void facexy(double x, double y)
x
- A global x coordinate.y
- A global y coordinate.void forward(double distance)
distance
- A distance measured in units.void fd(double distance)
distance
- A distance measured in units.void hatch(int numTurtles, int commandId)
numTurtles
- The number of new turtles to hatch.commandId
- The ID of a set of turtle commands that can be executed.
by calling performActivity(int commandId) on each new turtle.void hideTurtle()
void ht()
void home()
IAgentSet inCone(double distance, double angle)
distance
- A distance measured in units.angle
- An angle measured in degrees.IAgentSet inRadius(int radius)
radius
- Distance from the current patch. The current patch is a radius of 0 from itself.IAgentSet inRadius(int radius, int filterId)
radius
- Distance from the current patch. The current patch is a radius of 0 from itself.filterId
- An ID that can be used by performBooleanActivity() to select a specific filter.void jump(double distance)
distance
- A distance measured in units.void jump(IPatch aPatch)
aPatch
- A patch.void jump(ITurtle aTurtle)
aTurtle
- A turtle.void left(double angle)
angle
- An angle measured in degrees.void lt(double angle)
angle
- A relative angle measured in degrees.IAgentSet neighbors()
IAgentSet neighbors4()
IAgentSet otherTurtlesHere()
IPatch patchAhead(double distance)
distance
- A distance measured in units.IPatch patchAt(int dx, int dy)
dx
- A relative distance in the x direction, in patches.dy
- A relative distance in the y direction, in patches.IPatch patchAtHeadingAndDistance(double heading, double distance)
heading
- An absolute angle measured in degrees.distance
- A distance measured in units.IPatch patchHere()
IPatch patchLeftAndAhead(double distance, double angle)
distance
- A distance measured in units.angle
- An angle measured in degrees.IPatch patchRightAndAhead(double distance, double angle)
distance
- A distance measured in units.angle
- An angle measured in degrees.void penDown()
void pd()
void penErase()
void pe()
void penUp()
void pu()
void right(double angle)
angle
- An angle measured in degrees.void rt(double angle)
angle
- A relative angle measured in degrees.void setxy(double x, double y)
x
- New value for the turtle's x coordinate.y
- New value for the turtle's y coordinate.void showTurtle()
void st()
void stamp()
void stampErase()
double towards(IXholon turtleOrPatch)
turtleOrPatch
- A turtle or patch object.double towardsxy(double x, double y)
x
- A global x coordinate.y
- A global y coordinate.IAgentSet turtlesAt(int dx, int dy)
dx
- A relative distance in the x direction, in patches.dy
- A relative distance in the y direction, in patches.IAgentSet turtlesHere()
IAgentSet turtlesOn()
double uphill()
double uphill4()
IAgentSet with(IAgentSet vIn, int filterId)
vIn
- A collection of ITurtle instances.int getBreed()
void setBreed(int breed)
breed
- A breed id.int getColor()
void setColor(int color)
color
- A color value, as defined in ITurtlePatchColor.double getHeading()
void setHeading(double heading)
heading
- An absolute angle measured in degrees.boolean getIsHidden()
void setIsHidden(boolean isHidden)
isHidden
- hidden (true) or visible (false)java.lang.String getLabel()
void setLabel(java.lang.String label)
label
- int getPenMode()
void setPenMode(int penMode)
penMode
- A pen mode, one of PENMODE_UP, PENMODE_DOWN, or PENMODE_ERASE.int getWho()
void setWho(int who)
who
- A who id.double getXcor()
void setXcor(double xcor)
xcor
- An xcor value.double getYcor()
void setYcor(double ycor)
ycor
- An ycor value.int getPcolor()
void setPcolor(int pcolor)
pcolor
- A pcolor value, as defined in ITurtlePatchColor.java.lang.String getPlabel()
void setPlabel(java.lang.String plabel)
label
- int getPxcor()
void setPxcor(int pxcor)
xcor
- A pxcor value.int getPycor()
void setPycor(int pycor)
ycor
- A pycor value.int getMaxPxcor()
int getMaxPycor()
int getMinPxcor()
int getMinPycor()
int getWorldWidth()
int getWorldHeight()
boolean hasAlreadyMoved()
void initWhenMoved(int when)
when
- A time step, normally WHENMOVED_INIT (-1).void aggregate(double amount)
amount
- The amount to increment or decrement the current population count.
The amount can be a positive (increment) or negative (decrement) number.