API V2.1

repast.simphony.relogo
[Java] Class AbstractTurtle

java.lang.Object
  repast.simphony.relogo.AbstractTurtle
All Implemented Interfaces:
Turtle

public abstract class AbstractTurtle

Field Summary
boolean hiddenQ

 
Method Summary
void addToFixedLeaves(Turtle t)

void addToFreeLeaves(Turtle o)

AgentSet allLinks()

AgentSet allMyInLinks()

{@inheritDoc}

AgentSet allMyLinks()

{@inheritDoc}

AgentSet allMyOutLinks()

{@inheritDoc}

boolean allQ(Collection a, Closure closure)

void ask(AgentSet a, Closure askBlock)

Executes a set of commands for an agentset in random order.

void ask(Collection c, Closure askBlock)

Executes a set of commands for a collection of agents.

void ask(Turtle t, Closure askBlock)

Executes a set of commands for a turtle.

void ask(Patch p, Closure askBlock)

Executes a set of commands for a patch.

void ask(Link l, Closure askBlock)

Executes a set of commands for a link.

void askCollection(Collection l, Closure cl)

void askTurtle(Closure cl)

@exclude

void back(Number num)

void bk(Number num)

boolean canMoveQ(Number nDist)

int compareTo(Turtle t)

Link createLinkFrom(Turtle t)

Link createLinkFrom(Turtle t, Closure closure)

Makes a directed link from the caller to a turtle.

Link createLinkTo(Turtle t)

Makes a directed link from the caller to a turtle then executes a set of commands on the created link.

Link createLinkTo(Turtle t, Closure closure)

Makes a undirected link between the caller and a turtle.

Link createLinkWith(Turtle t)

Makes an undirected link between the caller and a turtle then executes a set of commands on the created link.

Link createLinkWith(Turtle t, Closure closure)

Makes directed links from a collection of agents to the caller.

AgentSet createLinksFrom(Collection a)

Makes directed links from a collection of turtles to the caller then executes a set of commands on the created links.

AgentSet createLinksFrom(Collection a, Closure closure)

Makes directed links from the caller to a collection of agents.

AgentSet createLinksTo(Collection a)

Makes directed links from the caller to a collection of agents then executes a set of commands on the created links.

AgentSet createLinksTo(Collection a, Closure closure)

Makes undirected links between the caller and a collection of agents.

AgentSet createLinksWith(Collection a)

Makes undirected links between the caller and a collection of agents then executes a set of commands on the created links.

AgentSet createLinksWith(Collection a, Closure closure)

Queries if there is a directed link from a turtle to the caller.

void die()

Removes the turtle.

double distance(Turtle t)

Returns the distance from the caller to a patch.

double distance(Patch p)

Returns the distance from the caller to a point.

double distancexy(Number nX, Number nY)

Returns the direction to turtle t.

double dx()

double dy()

void face(Turtle t)

Faces the caller towards a patch.

void face(Patch p)

Faces the caller towards a point.

void facexy(Number nX, Number nY)

Queries if turtle can move a distance.

void fd(Number num)

void fileShow(Object value)

boolean fixedLeavesContains(Turtle t)

void forward(Number num)

boolean freeLeavesContains(Object o)

double getColor()

Returns the color of a turtle.

double getHeading()

Returns the heading of the turtle.

double getHeadingInRads()

Object getLabel()

Returns the label.

double getLabelColor()

Returns the label color for a turtle or link.

int getMaxPxcor()

Returns the maximum y coordinate for all patches.

int getMaxPycor()

Returns a random y coordinate for patches.

int getMinPxcor()

Returns the minimum y coordinate for all patches.

int getMinPycor()

Returns a random x coordinate for patches.

Observer getMyObserver()

TurtleFactory getMyTurtleFactory()

double getPcolor()

Returns the color of patch here.

int getPenMode()

Returns the pen setting of a turtle.

int getPenSize()

Returns the pen width of a turtle.

int getPxcor()

Returns the x coordinate of patch here.

int getPycor()

Returns the y coordinate of patch here.

String getShape()

double getSize()

Returns the size of a turtle.

NdPoint getTurtleLocation()

String getTurtleType()

int getWho()

static int getWhoCounter()

double getXcor()

Returns the x coordinate of a turtle.

double getYcor()

Returns the y coordinate of a turtle.

AgentSet hatch(Number number)

Makes a number of new turtles.

AgentSet hatch(Number number, Closure closure)

Makes a number of new turtles and then executes a set of commands on the created turtles.

AgentSet hatch(Number number, Closure closure, String childType)

Makes a number of new turtles of a specific type and then executes a set of commands on the created turtles.

AgentSet hatch(Number number, Closure closure, Class childType)

Makes a number of new turtles of a specific type and then executes a set of commands on the created turtles.

void hideTurtle()

Makes turtle visible.

void home()

void ht()

Makes turtle visible.

AgentSet inCone(Collection a, Number num, Number angle)

Link inLinkFrom(Turtle t)

boolean inLinkNeighborQ(Turtle t)

Queries if there is a directed link from the caller to the turtle.

AgentSet inLinkNeighbors()

Reports the agentset of all turtles found at the other end of undirected links connected to the calling turtle.

AgentSet inRadius(Collection a, Number num)

boolean isHiddenQ()

Queries if caller is hidden.

boolean isShapeChanged()

boolean isVisibilityChanged()

void jump(Number num)

void left(Number num)

Link link(Number oneEnd, Number otherEnd)

{@inheritDoc}

Link link(Turtle oneEnd, Turtle otherEnd)

{@inheritDoc}

boolean linkNeighborQ(Turtle t)

Returns the agentset of the caller's out link neighbor turtles.

AgentSet linkNeighbors()

Link linkWith(Turtle t)

AgentSet links()

Returns the width of the world.

void lt(Number num)

AgentSet maxNOf(int number, Collection a, Closure closure)

Queries if all agents in a collection are true for a boolean closure.

ReLogoAgent maxOneOf(Collection a, Closure closure)

AgentSet minNOf(int number, Collection a, Closure closure)

Returns the ReLogoAgent with the largest value when operated on by a set of commands.

ReLogoAgent minOneOf(Collection a, Closure closure)

Returns an agentset consisting of a specified number of agents which have the lowest value when operated on by a set of commands.

void move(Number nNumber)

void moveTo(Turtle t)

Moves a turtle to the same location as patch p.

void moveTo(Patch p)

void mv(Number nNumber)

AgentSet myInLinks()

{@inheritDoc}

AgentSet myLinks()

Returns the turtle opposite the asking link.

AgentSet myOutLinks()

{@inheritDoc}

Object myself()

The agent that initiated the asking.

AgentSet neighbors()

{@inheritDoc}

AgentSet neighbors(int extent)

{@inheritDoc}

AgentSet neighbors(int extentX, int extentY)

{@inheritDoc}

AgentSet neighbors4()

{@inheritDoc}

AgentSet neighbors4(int extent)

AgentSet neighbors4(int extentX, int extentY)

void notifySubscribers()

Stop oldStop()

AgentSet other(Collection a)

Returns an agentset minus the caller.

Turtle otherEnd()

Returns an agentset containing all turtles.

boolean outLinkNeighborQ(Turtle t)

Returns the agentset with directed links to the caller.

AgentSet outLinkNeighbors()

Link outLinkTo(Turtle t)

{@inheritDoc}

Patch patch(Number nX, Number nY)

Returns an agentset containing all patches.

Patch patchAhead(Number distance)

Patch patchAt(Number nX, Number nY)

Patch patchAtHeadingAndDistance(Number nHeading, Number nDistance)

Patch patchHere()

Returns the patch where the turtle is located.

Patch patchLeftAndAhead(Number nAngle, Number nDistance)

Patch patchRightAndAhead(Number nAngle, Number nDistance)

{@inheritDoc}

AgentSet patches()

void pd()

Sets the turtle's pen to draw lines.

void pe()

Does nothing, included for translation compatibility.

void penDown()

Sets the turtle's pen to draw lines.

void penErase()

Does nothing, included for translation compatibility.

void penUp()

Sets the turtle's pen to stop drawing lines.

void pu()

Sets the turtle's pen to stop drawing lines.

int randomPxcor()

int randomPycor()

double randomXcor()

Returns the minimum x coordinate for all patches.

double randomYcor()

Returns the maximum x coordinate for all patches.

void registerSubscriber(Turtle t)

void removeFromFixedLeaves(OutOfContextSubject t)

void removeFromFreeLeaves(Turtle o)

void removeSubscriber(Turtle t)

void right(Number num)

void rt(Number num)

void run(String string)

Interprets a string as commands then runs the commands.

Object runresult(String string)

Interprets a string as a command then returns the result.

Turtle self()

Returns this turtle, patch, or link.

void setBaseTurtleProperties(Observer observer, TurtleFactory turtleFactory, String turtleShape, double heading, double color, NdPoint loc)

void setColor(Number color)

Sets the color of a turtle to the value color.

void setHeading(Number nNum)

Sets the heading of the turtle to nNum.

void setHiddenQ(boolean hidden)

Sets turtle visibility.

void setLabel(Object label)

Sets the label.

void setLabelColor(Number labelColor)

Sets the label color for a turtle to labelColor.

void setMyObserver(Observer myObserver)

void setMyTurtleFactory(TurtleFactory myTurtleFactory)

void setMyself(Object o)

Sets the agent that initiated the asking to the value o.

void setPcolor(Number color)

Sets the color of patch here to pcolor.

void setPenMode(Number penMode)

Sets the pen setting of a turtle to penMode.

void setPenSize(Number penSize)

void setShape(String shape)

void setShapeChanged(boolean shapeChanged)

void setSize(Number size)

void setUserDefinedVariables(Turtle parent)

void setVisibilityChanged(boolean visibilityChanged)

static void setWhoCounter(Number whoCounter)

void setXcor(Number number)

Sets the x coordinate of a turtle to number.

void setYcor(Number number)

Sets the y coordinate of a turtle to number.

void setxy(Number nX, Number nY)

Sets the x-y coordinates of a turtle to (nX, nY).

void show(Object value)

void showTurtle()

Returns the turtle's x increment for one step.

void st()

Turtle goes to (0,0).

String toString()

double towards(Turtle t)

Returns the direction to patch p.

double towards(Patch p)

Returns the direction from a turtle or patch to a point.

double towardsxy(Number nX, Number nY)

Faces the caller towards a turtle.

Turtle turtle(Number number)

Returns a random x coordinate for turtles.

AgentSet turtles()

Returns a random y coordinate for turtles.

AgentSet turtlesAt(Number nX, Number nY)

AgentSet turtlesHere()

Returns an agentset of turtles on a given patch.

AgentSet turtlesOn(Patch p)

Returns an agentset of turtles on the same patch as a turtle.

AgentSet turtlesOn(Turtle t)

AgentSet turtlesOn(Collection a)

void update(Turtle o)

void watchMe()

int worldHeight()

Does nothing, included for translation compatibility.

int worldWidth()

 
Methods inherited from class Object
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll
 

Field Detail

hiddenQ

public boolean hiddenQ


 
Method Detail

addToFixedLeaves

public void addToFixedLeaves(Turtle t)


addToFreeLeaves

public void addToFreeLeaves(Turtle o)


allLinks

public AgentSet allLinks()


allMyInLinks

public AgentSet allMyInLinks()
{@inheritDoc}


allMyLinks

public AgentSet allMyLinks()
{@inheritDoc}


allMyOutLinks

public AgentSet allMyOutLinks()
{@inheritDoc}


allQ

public boolean allQ(Collection a, Closure closure)


ask

public void ask(AgentSet a, Closure askBlock)
Executes a set of commands for an agentset in random order.
Parameters:
a - an agentset
askBlock - a set of commands


ask

public void ask(Collection c, Closure askBlock)
Executes a set of commands for a collection of agents.
Parameters:
c - a collection of agents
askBlock - a set of commands


ask

public void ask(Turtle t, Closure askBlock)
Executes a set of commands for a turtle.
Parameters:
t - a turtle
askBlock - a set of commands


ask

public void ask(Patch p, Closure askBlock)
Executes a set of commands for a patch.
Parameters:
p - a patch
askBlock - a set of commands


ask

public void ask(Link l, Closure askBlock)
Executes a set of commands for a link.
Parameters:
l - a link
askBlock - a set of commands


askCollection

public void askCollection(Collection l, Closure cl)


askTurtle

public void askTurtle(Closure cl)
exclude:


back

public void back(Number num)


bk

public void bk(Number num)


canMoveQ

public boolean canMoveQ(Number nDist)


compareTo

public int compareTo(Turtle t)


createLinkFrom

public Link createLinkFrom(Turtle t)


createLinkFrom

public Link createLinkFrom(Turtle t, Closure closure)
Makes a directed link from the caller to a turtle.
Parameters:
t - a turtle
Returns:
created link


createLinkTo

public Link createLinkTo(Turtle t)
Makes a directed link from the caller to a turtle then executes a set of commands on the created link.
Parameters:
t - a turtle
closure - a set of commands
Returns:
created link


createLinkTo

public Link createLinkTo(Turtle t, Closure closure)
Makes a undirected link between the caller and a turtle.
Parameters:
t - a turtle
Returns:
created link


createLinkWith

public Link createLinkWith(Turtle t)
Makes an undirected link between the caller and a turtle then executes a set of commands on the created link.
Parameters:
t - a turtle
closure - a set of commands
Returns:
created link


createLinkWith

public Link createLinkWith(Turtle t, Closure closure)
Makes directed links from a collection of agents to the caller.
Parameters:
a - a collection of agents
Returns:
created links


createLinksFrom

public AgentSet createLinksFrom(Collection a)
Makes directed links from a collection of turtles to the caller then executes a set of commands on the created links.
Parameters:
a - a collection of agents
closure - a set of commands
Returns:
created links


createLinksFrom

public AgentSet createLinksFrom(Collection a, Closure closure)
Makes directed links from the caller to a collection of agents.
Parameters:
a - a collection of agents
Returns:
created links


createLinksTo

public AgentSet createLinksTo(Collection a)
Makes directed links from the caller to a collection of agents then executes a set of commands on the created links.
Parameters:
a - a collection of agents
closure - a set of commands
Returns:
created links


createLinksTo

public AgentSet createLinksTo(Collection a, Closure closure)
Makes undirected links between the caller and a collection of agents.
Parameters:
a - an collection of agents
Returns:
created links


createLinksWith

public AgentSet createLinksWith(Collection a)
Makes undirected links between the caller and a collection of agents then executes a set of commands on the created links.
Parameters:
a - a collection of agents
closure - a set of commands
Returns:
created links


createLinksWith

public AgentSet createLinksWith(Collection a, Closure closure)
Queries if there is a directed link from a turtle to the caller.
Parameters:
t - a turtle
Returns:
true or false based on whether there is a directed link from turtle t to the caller


die

public void die()
Removes the turtle.


distance

public double distance(Turtle t)
Returns the distance from the caller to a patch.
returns:
distance from patch p to the caller
Parameters:
p - a patch


distance

public double distance(Patch p)
Returns the distance from the caller to a point.
returns:
distance from the caller to the point (nx,ny)
Parameters:
nx - a number
ny - a number


distancexy

public double distancexy(Number nX, Number nY)
Returns the direction to turtle t.
Parameters:
t - a turtle
Returns:
direction from this turtle to turtle t


dx

public double dx()


dy

public double dy()


face

public void face(Turtle t)
Faces the caller towards a patch.
Parameters:
p - a patch


face

public void face(Patch p)
Faces the caller towards a point.
Parameters:
nX - x coordinate
nY - y coordinate


facexy

public void facexy(Number nX, Number nY)
Queries if turtle can move a distance.
Parameters:
nDist - a distance
Returns:
true or false based on whether turtle can move distance


fd

public void fd(Number num)


fileShow

public void fileShow(Object value)


fixedLeavesContains

public boolean fixedLeavesContains(Turtle t)


forward

public void forward(Number num)


freeLeavesContains

public boolean freeLeavesContains(Object o)


getColor

public double getColor()
Returns the color of a turtle. @ returns color of a turtle in the range [0, 140)


getHeading

public double getHeading()
Returns the heading of the turtle. @ return heading of the turtle in the range [0, 360)


getHeadingInRads

public double getHeadingInRads()


getLabel

public Object getLabel()
Returns the label.
Returns:
the turtle label


getLabelColor

public double getLabelColor()
Returns the label color for a turtle or link. @ returns label color in the range [0, 140)


getMaxPxcor

public int getMaxPxcor()
Returns the maximum y coordinate for all patches.
Returns:
maximum y coordinate for all patches


getMaxPycor

public int getMaxPycor()
Returns a random y coordinate for patches.
Returns:
random y coordinate for patches


getMinPxcor

public int getMinPxcor()
Returns the minimum y coordinate for all patches.
Returns:
maximum y coordinate for patches


getMinPycor

public int getMinPycor()
Returns a random x coordinate for patches.
Returns:
random x coordinate for patches


getMyObserver

public Observer getMyObserver()


getMyTurtleFactory

public TurtleFactory getMyTurtleFactory()


getPcolor

public double getPcolor()
Returns the color of patch here.
Returns:
color of patch here in the range [0, 140)


getPenMode

public int getPenMode()
Returns the pen setting of a turtle.
Returns:
pen setting of a turtle, PEN_UP or PEN_DOWN


getPenSize

public int getPenSize()
Returns the pen width of a turtle.
Returns:
pen width of a turtle


getPxcor

public int getPxcor()
Returns the x coordinate of patch here.
Returns:
x coordinate of patch here


getPycor

public int getPycor()
Returns the y coordinate of patch here.
Returns:
y coordinate of patch here


getShape

public String getShape()


getSize

public double getSize()
Returns the size of a turtle.
Returns:
size of a turtle


getTurtleLocation

public NdPoint getTurtleLocation()


getTurtleType

public String getTurtleType()


getWho

public int getWho()


getWhoCounter

public static int getWhoCounter()


getXcor

public double getXcor()
Returns the x coordinate of a turtle.
Returns:
present x coordinate of the turtle


getYcor

public double getYcor()
Returns the y coordinate of a turtle.
Returns:
y coordinate of a turtle


hatch

public AgentSet hatch(Number number)
Makes a number of new turtles.
Parameters:
number - a number
Returns:
created turtles


hatch

public AgentSet hatch(Number number, Closure closure)
Makes a number of new turtles and then executes a set of commands on the created turtles.
Parameters:
number - a number
closure - a set of commands
Returns:
created turtles


hatch

public AgentSet hatch(Number number, Closure closure, String childType)
Makes a number of new turtles of a specific type and then executes a set of commands on the created turtles.
Parameters:
number - a number
closure - a set of commands
childType - a string
number
closure
childType
Returns:
created turtles


hatch

public AgentSet hatch(Number number, Closure closure, Class childType)
Makes a number of new turtles of a specific type and then executes a set of commands on the created turtles.
Parameters:
number - a number
closure - a set of commands
childType - a turtle class
number
closure
childType
Returns:
created turtles


hideTurtle

public void hideTurtle()
Makes turtle visible.


home

public void home()


ht

public void ht()
Makes turtle visible.


inCone

public AgentSet inCone(Collection a, Number num, Number angle)


inLinkFrom

public Link inLinkFrom(Turtle t)


inLinkNeighborQ

public boolean inLinkNeighborQ(Turtle t)
Queries if there is a directed link from the caller to the turtle.
Parameters:
t - a turtle
Returns:
true or false based on whether there is a directed link from the caller to the turtle.


inLinkNeighbors

public AgentSet inLinkNeighbors()
Reports the agentset of all turtles found at the other end of undirected links connected to the calling turtle.


inRadius

public AgentSet inRadius(Collection a, Number num)


isHiddenQ

public boolean isHiddenQ()
Queries if caller is hidden.
Returns:
true or false based on whether caller is hidden


isShapeChanged

public boolean isShapeChanged()


isVisibilityChanged

public boolean isVisibilityChanged()


jump

public void jump(Number num)


left

public void left(Number num)


link

public Link link(Number oneEnd, Number otherEnd)
{@inheritDoc}


link

public Link link(Turtle oneEnd, Turtle otherEnd)
{@inheritDoc}


linkNeighborQ

public boolean linkNeighborQ(Turtle t)
Returns the agentset of the caller's out link neighbor turtles.
Returns:
agentset of the caller's out link neighbor turtles


linkNeighbors

public AgentSet linkNeighbors()


linkWith

public Link linkWith(Turtle t)


links

public AgentSet links()
Returns the width of the world.
Returns:
width of the world


lt

public void lt(Number num)


maxNOf

public AgentSet maxNOf(int number, Collection a, Closure closure)
Queries if all agents in a collection are true for a boolean closure.
Parameters:
a - a collection of ReLogoAgents
closure - a boolean closure
Returns:
true or false based on whether all agents in a collection are true for closure


maxOneOf

public ReLogoAgent maxOneOf(Collection a, Closure closure)


minNOf

public AgentSet minNOf(int number, Collection a, Closure closure)
Returns the ReLogoAgent with the largest value when operated on by a set of commands.
Parameters:
a - a collection
closure - a set of commands
Returns:
ReLogoAgent with the largest value when operated on by closure


minOneOf

public ReLogoAgent minOneOf(Collection a, Closure closure)
Returns an agentset consisting of a specified number of agents which have the lowest value when operated on by a set of commands.
Parameters:
number - an integer
a - a collection
closure - a set of commands
Returns:
agentset containing number agents with smallest values when operated on by closure


move

public void move(Number nNumber)


moveTo

public void moveTo(Turtle t)
Moves a turtle to the same location as patch p.
Parameters:
p - a patch


moveTo

public void moveTo(Patch p)


mv

public void mv(Number nNumber)


myInLinks

public AgentSet myInLinks()
{@inheritDoc}


myLinks

public AgentSet myLinks()
Returns the turtle opposite the asking link.
Returns:
turtle opposite the asking link


myOutLinks

public AgentSet myOutLinks()
{@inheritDoc}


myself

public Object myself()
The agent that initiated the asking.
Returns:
the agent that initiated the asking


neighbors

public AgentSet neighbors()
{@inheritDoc}


neighbors

public AgentSet neighbors(int extent)
{@inheritDoc}


neighbors

public AgentSet neighbors(int extentX, int extentY)
{@inheritDoc}


neighbors4

public AgentSet neighbors4()
{@inheritDoc}


neighbors4

public AgentSet neighbors4(int extent)


neighbors4

public AgentSet neighbors4(int extentX, int extentY)


notifySubscribers

public void notifySubscribers()


oldStop

@Deprecated/**
public Stop oldStop()


other

public AgentSet other(Collection a)
Returns an agentset minus the caller.
Parameters:
a - an agentset
Returns:
agentset a minus the caller


otherEnd

public Turtle otherEnd()
Returns an agentset containing all turtles.
Returns:
agentset of all turtles


outLinkNeighborQ

public boolean outLinkNeighborQ(Turtle t)
Returns the agentset with directed links to the caller.
Returns:
agentset with directed links to the caller


outLinkNeighbors

public AgentSet outLinkNeighbors()


outLinkTo

public Link outLinkTo(Turtle t)
{@inheritDoc}


patch

public Patch patch(Number nX, Number nY)
Returns an agentset containing all patches.
Returns:
agentset containing all patches


patchAhead

public Patch patchAhead(Number distance)


patchAt

public Patch patchAt(Number nX, Number nY)


patchAtHeadingAndDistance

public Patch patchAtHeadingAndDistance(Number nHeading, Number nDistance)


patchHere

public Patch patchHere()
Returns the patch where the turtle is located.
Returns:
patch where the turtle is located


patchLeftAndAhead

public Patch patchLeftAndAhead(Number nAngle, Number nDistance)


patchRightAndAhead

public Patch patchRightAndAhead(Number nAngle, Number nDistance)
{@inheritDoc}


patches

public AgentSet patches()


pd

public void pd()
Sets the turtle's pen to draw lines.


pe

public void pe()
Does nothing, included for translation compatibility.


penDown

public void penDown()
Sets the turtle's pen to draw lines.


penErase

public void penErase()
Does nothing, included for translation compatibility.


penUp

public void penUp()
Sets the turtle's pen to stop drawing lines.


pu

public void pu()
Sets the turtle's pen to stop drawing lines.


randomPxcor

public int randomPxcor()


randomPycor

public int randomPycor()


randomXcor

public double randomXcor()
Returns the minimum x coordinate for all patches.
Returns:
maximum x coordinate for patches


randomYcor

public double randomYcor()
Returns the maximum x coordinate for all patches.
Returns:
maximum x coordinate for all patches


registerSubscriber

public void registerSubscriber(Turtle t)


removeFromFixedLeaves

public void removeFromFixedLeaves(OutOfContextSubject t)


removeFromFreeLeaves

public void removeFromFreeLeaves(Turtle o)


removeSubscriber

public void removeSubscriber(Turtle t)


right

public void right(Number num)


rt

public void rt(Number num)


run

public void run(String string)
Interprets a string as commands then runs the commands.
Parameters:
string - a string


runresult

public Object runresult(String string)
Interprets a string as a command then returns the result.
Parameters:
string - a string
Returns:
result of interpreting string


self

public Turtle self()
Returns this turtle, patch, or link.
Returns:
this turtle, patch, or link.


setBaseTurtleProperties

public void setBaseTurtleProperties(Observer observer, TurtleFactory turtleFactory, String turtleShape, double heading, double color, NdPoint loc)


setColor

public void setColor(Number color)
Sets the color of a turtle to the value color.
Parameters:
color - a number


setHeading

public void setHeading(Number nNum)
Sets the heading of the turtle to nNum.
Parameters:
nNum - a number in degrees


setHiddenQ

public void setHiddenQ(boolean hidden)
Sets turtle visibility.
Parameters:
hidden - boolean visibility


setLabel

public void setLabel(Object label)
Sets the label.
Parameters:
label - a label


setLabelColor

public void setLabelColor(Number labelColor)
Sets the label color for a turtle to labelColor.
Parameters:
labelColor - a number in range [0, 140)


setMyObserver

public void setMyObserver(Observer myObserver)


setMyTurtleFactory

public void setMyTurtleFactory(TurtleFactory myTurtleFactory)


setMyself

public void setMyself(Object o)
Sets the agent that initiated the asking to the value o.
exclude:
Parameters:
o - an object


setPcolor

public void setPcolor(Number color)
Sets the color of patch here to pcolor.
Parameters:
pcolor - a number in range [0,140)


setPenMode

public void setPenMode(Number penMode)
Sets the pen setting of a turtle to penMode.
Parameters:
penMode - a pen mode, PEN_UP or PEN_DOWN


setPenSize

public void setPenSize(Number penSize)


setShape

public void setShape(String shape)


setShapeChanged

public void setShapeChanged(boolean shapeChanged)


setSize

public void setSize(Number size)


setUserDefinedVariables

public void setUserDefinedVariables(Turtle parent)


setVisibilityChanged

public void setVisibilityChanged(boolean visibilityChanged)


setWhoCounter

public static void setWhoCounter(Number whoCounter)


setXcor

public void setXcor(Number number)
Sets the x coordinate of a turtle to number.
Parameters:
number - a number


setYcor

public void setYcor(Number number)
Sets the y coordinate of a turtle to number.
Parameters:
number - a number


setxy

public void setxy(Number nX, Number nY)
Sets the x-y coordinates of a turtle to (nX, nY).
Parameters:
nX - a number
nY - a number


show

public void show(Object value)


showTurtle

public void showTurtle()
Returns the turtle's x increment for one step.
returns:
turtle's x increment for one step


st

public void st()
Turtle goes to (0,0).


toString

public String toString()


towards

public double towards(Turtle t)
Returns the direction to patch p.
Parameters:
p - a patch
Returns:
direction from this patch to patch p


towards

public double towards(Patch p)
Returns the direction from a turtle or patch to a point.
Parameters:
nX - a number
nY - a number
Returns:
direction from a turtle or patch to the point (nX, nY)


towardsxy

public double towardsxy(Number nX, Number nY)
Faces the caller towards a turtle.
Parameters:
t - a turtle


turtle

public Turtle turtle(Number number)
Returns a random x coordinate for turtles.
Returns:
random x coordinate for turtles


turtles

public AgentSet turtles()
Returns a random y coordinate for turtles.
Returns:
random y coordinate for turtles


turtlesAt

public AgentSet turtlesAt(Number nX, Number nY)


turtlesHere

public AgentSet turtlesHere()
Returns an agentset of turtles on a given patch.
Parameters:
p - a patch
Returns:
agentset of turtles on patch p


turtlesOn

public AgentSet turtlesOn(Patch p)
Returns an agentset of turtles on the same patch as a turtle.
Parameters:
t - a turtle
Returns:
agentset of turtles on the same patch as turtle t


turtlesOn

public AgentSet turtlesOn(Turtle t)


turtlesOn

public AgentSet turtlesOn(Collection a)


update

public void update(Turtle o)


watchMe

public void watchMe()


worldHeight

public int worldHeight()
Does nothing, included for translation compatibility.


worldWidth

public int worldWidth()


 

ReLogo API V2.1