public interface IPatch extends IXholon, IGrid
NetLogo website http://ccl.northwestern.edu/netlogo/
TODO add (May 15 2007):
beep
inRadius
patch
patchAt
patchAtHeadingAndDistance
sprout
towards
towardsxy
turtlesAt
turtlesHere
turtlesOn
with
Modifier and Type | Field and Description |
---|---|
static int |
COMMANDID_NONE |
static int |
FILTERID_NONE |
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
BOUNDARY_GRID, BOUNDARY_TORUS, NEIGHBORHOOD_1DCA, NEIGHBORHOOD_HEXAGONAL, NEIGHBORHOOD_MOORE, NEIGHBORHOOD_SIBLING, NEIGHBORHOOD_VON_NEUMANN, P_CAFUTURESELF, P_CALEFTNEIGHBOR, P_CARIGHTNEIGHBOR, P_EAST, P_HEX0, P_HEX1, P_HEX2, P_HEX3, P_HEX4, P_HEX5, P_NORTH, P_NORTHEAST, P_NORTHWEST, P_SOUTH, P_SOUTHEAST, P_SOUTHWEST, P_STAYHERE, P_WEST, REGULAR_COMPLETE, REGULAR_COMPLETE_SELF, REGULAR_CYCLE, REGULAR_WHEEL
Modifier and Type | Method and Description |
---|---|
void |
aggregate(double amount)
Aggregate by keeping a count of the number of individuals of a given type of Patch.
|
void |
beep()
Make a single short beep sound.
|
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.
|
int |
getPcolor()
Get the patch's pcolor.
|
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.
|
IAgentSet |
inRadius(int radius)
Return a list of all neighbors (patches) within the specified radius.
|
IAgentSet |
inRadius(int radius,
int filterId)
Return a list of all neighbors (patches) within the specified radius.
|
IAgentSet |
neighbors()
Return the 8 surrounding neighbor patches.
|
IAgentSet |
neighbors4()
Return the 4 surrounding neighbor patches.
|
IPatch |
patch(int pxcor,
int pycor)
Return the patch with the specified absolute coordinates.
|
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.
|
void |
setPcolor(int pcolor)
Set the patch's pcolor.
|
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 |
sprout(IXholonClass xhClazz,
int numTurtles,
int commandId)
Create a specified number of new turtles on 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.
|
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
getNeighType, getNumNeighbors, moveXholonsToGrid, setCaFuture, setCaLeft, setCaRight, setEast, setHex0, setHex1, setHex2, setHex3, setHex4, setHex5, setNorth, setNorthEast, setNorthWest, setSiblingsComplete, setSiblingsCompleteSelf, setSiblingsCycle, setSiblingsWheel, setSouth, setSouthEast, setSouthWest, setWest
static final int COMMANDID_NONE
static final int FILTERID_NONE
void beep()
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.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.IAgentSet neighbors()
IAgentSet neighbors4()
IPatch patch(int pxcor, int pycor)
pxcor
- An x coordinate.pycor
- A y coordinate.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.void sprout(IXholonClass xhClazz, int numTurtles, int commandId)
xhClazz
- The XholonClass that the new turtles should be members of.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.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()
IAgentSet with(IAgentSet vIn, int filterId)
vIn
- A collection of ITurtle instances.filterId
- The ID of a turtle filter.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.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.