ReLogo Patch interface.
Type | Name and description |
---|---|
double |
pcolor |
Object |
plabel |
double |
plabelColor |
Type Params | Return Type | Name and description |
---|---|---|
|
AgentSet<Link> |
allLinks() Returns the agentset of all links. |
|
boolean |
allQ(Collection a, Closure closure) Queries if all agents in a collection are true for a boolean closure. |
|
void |
ask(AgentSet<? extends ReLogoAgent> a, Closure askBlock) Executes a set of commands for an agentset in random order. |
|
void |
ask(Collection<? extends ReLogoAgent> 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 |
askPatch(Closure cl) @exclude |
|
double |
distance(Turtle t) Returns the distance from the caller to a turtle. |
|
double |
distance(Patch p) Returns the distance from the caller to a patch. |
|
double |
distancexy(Number nx, Number ny) Returns the distance from the caller to a point. |
|
void |
fileShow(Object value) Prints value with agent identifier to current file with a newline. |
|
GridPoint |
getGridLocation() |
|
NdPoint |
getGridLocationAsNdPoint() |
|
int |
getMaxPxcor() Returns the maximum x coordinate for all patches. |
|
int |
getMaxPycor() Returns the maximum y coordinate for all patches. |
|
int |
getMinPxcor() Returns the minimum x coordinate for all patches. |
|
int |
getMinPycor() Returns the minimum y coordinate for all patches. |
|
double |
getPcolor() Returns the color of a patch. |
|
Object |
getPlabel() Returns the patch label. |
|
double |
getPlabelColor() Returns the patch label color. |
|
int |
getPxcor() Returns the x coordinate of patch. |
|
int |
getPycor() Returns the y coordinate of patch. |
|
List |
getRowCol() |
|
AgentSet |
inRadius(Collection a, Number num) Returns an agentset within a distance of the caller. |
|
Link |
link(Number oneEnd, Number otherEnd) Returns the link between two turtles. |
|
Link |
link(Turtle oneEnd, Turtle otherEnd) Returns the link between two turtles. |
|
AgentSet<Link> |
links() Returns the agentset of all generic links. |
|
AgentSet |
maxNOf(int number, Collection<? extends ReLogoAgent> a, Closure closure) Returns an agentset consisting of a specified number of agents which have the greatest value when operated on by a set of commands. |
|
ReLogoAgent |
maxOneOf(Collection<? extends ReLogoAgent> a, Closure closure) Returns the ReLogoAgent with the largest value when operated on by a set of commands. |
|
AgentSet |
minNOf(int number, Collection<? extends ReLogoAgent> 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. |
|
ReLogoAgent |
minOneOf(Collection<? extends ReLogoAgent> a, Closure closure) Returns the ReLogoAgent with the smallest value when operated on by a set of commands. |
|
Object |
myself() The agent that initiated the asking. |
|
AgentSet<Patch> |
neighbors() Returns the agentset of the eight neighboring patches (Moore neighborhood). |
|
AgentSet<Patch> |
neighbors(int extent) Returns the agentset of patches making up the Moore neighborhood of this patch (excluding the calling patch) of extent. |
|
AgentSet<Patch> |
neighbors(int extentX, int extentY) Returns the agentset of patches making up the Moore neighborhood of this patch (excluding the calling patch) of extents. |
|
AgentSet<Patch> |
neighbors4() Returns the agentset of the four neighboring patches (von Neumann neighborhood). |
|
AgentSet<Patch> |
neighbors4(int extent) Returns the agentset of patches making up the von Neumann neighborhood of this patch (excluding the calling patch) of extent. |
|
AgentSet<Patch> |
neighbors4(int extentX, int extentY) Returns the agentset of patches making up the von Neumann neighborhood of this patch (excluding the calling patch) of extents. |
|
Stop |
oldStop() Stops a patch executing within a command closure. |
|
AgentSet |
other(Collection a) Returns an agentset minus the caller. |
|
Patch |
patch(Number nX, Number nY) Returns the patch containing a point. |
|
Patch |
patchAt(Number ndx, Number ndy) Returns the patch at a direction (ndx, ndy) from the caller. |
|
Patch |
patchAtHeadingAndDistance(Number heading, Number distance) Returns the patch that is at a direction and distance from the caller. |
|
AgentSet<Patch> |
patches() Returns an agentset containing all patches. |
|
int |
randomPxcor() Returns a random x coordinate for patches. |
|
int |
randomPycor() Returns a random y coordinate for patches. |
|
double |
randomXcor() Returns a random x coordinate for turtles. |
|
double |
randomYcor() Returns a random y coordinate for turtles. |
|
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. |
|
Patch |
self() Returns this turtle, patch, or link. |
|
void |
setPcolor(double pcolor) Sets the color of a patch to pcolor. |
|
void |
setPlabel(Object plabel) Sets the patch label. |
|
void |
setPlabelColor(Number plabelColor) Sets the patch label color. |
|
void |
setToDefault() Sets the standard patch variables to their default values. |
|
void |
show(Object value) Prints value with agent identifier to the console. |
|
AgentSet<Turtle> |
sprout(Number number) Makes a number of random new turtles. |
|
AgentSet<Turtle> |
sprout(Number number, Closure closure) Makes a number of random new turtles then executes a set of commands on the created turtles. |
|
AgentSet<Turtle> |
sprout(Number number, Closure closure, String turtleType) Makes a number of random new turtles of a specific type then executes a set of commands on the created turtles. |
|
AgentSet<Turtle> |
sprout(Number number, Closure closure, Class turtleType) Makes a number of random new turtles of a specific type then executes a set of commands on the created turtles. |
|
String |
toString() |
|
Turtle |
turtle(Number number) Returns the turtle of the given number. |
|
AgentSet<Turtle> |
turtles() Returns an agentset containing all turtles. |
|
AgentSet<Turtle> |
turtlesAt(Number ndx, Number ndy) Returns the agentset on the patch at the direction (ndx, ndy) from the caller. |
|
AgentSet<Turtle> |
turtlesHere() Returns an agentset of turtles from the patch of the caller. |
|
AgentSet<Turtle> |
turtlesOn(Patch p) Returns an agentset of turtles on a given patch. |
|
AgentSet<Turtle> |
turtlesOn(Turtle t) Returns an agentset of turtles on the same patch as a turtle. |
|
AgentSet<Turtle> |
turtlesOn(Collection a) Returns an agentset of turtles on the patches in a collection or on the patches that a collection of turtles are. |
|
void |
watchMe() Does nothing, included for translation compatibility. |
|
int |
worldHeight() Returns the height of the world. |
|
int |
worldWidth() Returns the width of the world. |
Methods inherited from class | Name |
---|---|
interface Comparable |
compareTo |
interface ReLogoAgent |
setMyself |
Queries if all agents in a collection are true for a boolean closure.
a
- a collection of ReLogoAgentsclosure
- a boolean closureExecutes a set of commands for an agentset in random order.
a
- an agentsetaskBlock
- a set of commandsExecutes a set of commands for a collection of agents.
c
- a collection of agentsaskBlock
- a set of commandsExecutes a set of commands for a turtle.
t
- a turtleaskBlock
- a set of commandsExecutes a set of commands for a patch.
p
- a patchaskBlock
- a set of commandsExecutes a set of commands for a link.
l
- a linkaskBlock
- a set of commandsReturns the distance from the caller to a turtle.
t
- a turtleReturns the distance from the caller to a patch.
p
- a patchReturns the distance from the caller to a point.
nx
- a numberny
- a numberPrints value with agent identifier to current file with a newline.
value
- any objectReturns the maximum x coordinate for all patches.
Returns the maximum y coordinate for all patches.
Returns the minimum x coordinate for all patches.
Returns the minimum y coordinate for all patches.
Returns the color of a patch.
Returns the patch label.
Returns the patch label color.
Returns the x coordinate of patch.
Returns the y coordinate of patch.
Returns an agentset within a distance of the caller.
c
- a collection of agentsnum
- a distanceReturns the link between two turtles.
oneEnd
- an integerotherEnd
- an integerReturns the link between two turtles.
oneEnd
- a turtleotherEnd
- a turtleReturns the agentset of all generic links.
Returns an agentset consisting of a specified number of agents which have the greatest value when operated on by a set of commands.
number
- an integera
- a collectionclosure
- a set of commandsReturns the ReLogoAgent with the largest value when operated on by a set of commands.
a
- a collectionclosure
- a set of commandsReturns an agentset consisting of a specified number of agents which have the lowest value when operated on by a set of commands.
number
- an integera
- a collectionclosure
- a set of commandsReturns the ReLogoAgent with the smallest value when operated on by a set of commands.
a
- a collectionclosure
- a set of commandsThe agent that initiated the asking.
Returns the agentset of the eight neighboring patches (Moore neighborhood).
Returns the agentset of patches making up the Moore neighborhood of this patch (excluding the calling patch) of extent.
extent
- the x and y Moore extentsReturns the agentset of patches making up the Moore neighborhood of this patch (excluding the calling patch) of extents.
extentX
- the x Moore extentextentY
- the y Moore extentReturns the agentset of the four neighboring patches (von Neumann neighborhood).
Returns the agentset of patches making up the von Neumann neighborhood of this patch (excluding the calling patch) of extent.
extent
- the x and y von Neumann extentsReturns the agentset of patches making up the von Neumann neighborhood of this patch (excluding the calling patch) of extents.
extentX
- the x von Neumann extentextentY
- the y von Neumann extentStops a patch executing within a command closure.
Returns an agentset minus the caller.
a
- an agentsetReturns the patch containing a point.
nX
- x coordinatenY
- y coordinateReturns the patch at a direction (ndx, ndy) from the caller.
ndx
- a numberndy
- a numberReturns the patch that is at a direction and distance from the caller.
heading
- a numberdistance
- a numberReturns an agentset containing all patches.
Returns a random x coordinate for patches.
Returns a random y coordinate for patches.
Returns a random x coordinate for turtles.
Returns a random y coordinate for turtles.
Interprets a string as commands then runs the commands.
string
- a stringInterprets a string as a command then returns the result.
string
- a stringReturns this turtle, patch, or link.
Sets the color of a patch to pcolor.
pcolor
- a number in range [0,140)Sets the patch label.
plabel
- a labelSets the patch label color.
plabelColor
- a numerical colorSets the standard patch variables to their default values. Called by clearPatches() and cp(). Override and call super.setToDefault() to reset other variables.
Prints value with agent identifier to the console.
value
- any objectMakes a number of random new turtles.
number
- a numberMakes a number of random new turtles then executes a set of commands on the created turtles.
number
- a numberclosure
- a set of commandsMakes a number of random new turtles of a specific type then executes a set of commands on the created turtles.
number
- a numberclosure
- a set of commandsturtleType
- a turtle typeMakes a number of random new turtles of a specific type then executes a set of commands on the created turtles.
number
- a numberclosure
- a set of commandsturtleType
- a turtle classReturns the turtle of the given number.
number
- a numberReturns an agentset containing all turtles.
Returns the agentset on the patch at the direction (ndx, ndy) from the caller.
ndx
- a numberndy
- a numberReturns an agentset of turtles from the patch of the caller.
Returns an agentset of turtles on a given patch.
p
- a patchReturns an agentset of turtles on the same patch as a turtle.
t
- a turtleReturns an agentset of turtles on the patches in a collection or on the patches that a collection of turtles are.
a
- a collectionDoes nothing, included for translation compatibility.
Returns the height of the world.
Returns the width of the world.