public abstract class Link extends RepastEdge
ReLogo Link abstract class.
Fields inherited from class | Fields |
---|---|
class RepastEdge |
directed, source, target |
Constructor and description |
---|
protected Link
() |
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 |
askLink(Closure cl) |
|
AgentSet<Turtle> |
bothEnds() Returns two agents connected by link. |
|
void |
die() Removes the link. |
|
void |
fileShow(Object value) Prints value with agent identifier to current file with a newline. |
|
void |
free() Joins together two ends of a link and ties the movements of the ends, except for headings. |
|
double |
getColor() Returns the color of a link. |
|
T |
getEnd1() Returns the first turtle of a link. |
|
T |
getEnd2() Returns the second turtle of a link. |
|
double |
getLabelColor() Returns the label color for a turtle or link. @ returns label color in the range [0, 140) |
|
String |
getLinkType() |
|
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. |
|
void |
hideLink() Link appears hidden. |
|
boolean |
isHiddenQ() Queries if caller is hidden. |
|
Link |
link(Number oneEnd, Number otherEnd) Returns the link between two turtles. |
|
Link |
link(Turtle oneEnd, Turtle otherEnd) Returns the link between two turtles. |
|
double |
linkHeading() Returns the heading of a link. |
|
double |
linkLength() Returns the length of a link. |
|
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. |
|
Stop |
oldStop() Stops a link executing within a command closure. |
|
AgentSet |
other(Collection a) Returns an agentset minus the caller. |
|
Turtle |
otherEnd() Returns the turtle opposite the asking turtle. |
|
Patch |
patch(Number nX, Number nY) Returns the patch containing a point. |
|
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. |
|
Link |
self() Returns this turtle, patch, or link. |
|
void |
setColor(Number color) Sets the color of a link to the value color. |
|
void |
setDirected(boolean directed) |
|
void |
setEnd1(T end1) Sets the first turtle of a link to end1. |
|
void |
setEnd2(T end2) Sets the second turtle of a link to end2. |
|
void |
setHiddenQ(boolean hidden) Sets link visibility. |
|
void |
setLabelColor(Number labelColor) Sets the label color for a link to labelColor. |
|
void |
setSource(T source) |
|
void |
setTarget(T target) |
|
void |
setTieMode(String mode) Sets tie mode to "none", "fixed", or "free". |
|
void |
show(Object value) Prints value with agent identifier to the console. |
|
void |
showLink() Makes link visible. |
|
void |
tie() Joins together two ends of a link and ties the movements of the ends, including headings. |
|
Turtle |
turtle(Number number) Returns the turtle of the given number. |
|
AgentSet<Turtle> |
turtles() Returns an agentset containing all turtles. |
|
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. |
|
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. |
|
void |
untie() Unties two ends of a link. |
|
int |
worldHeight() Returns the height of the world. |
|
int |
worldWidth() Returns the width of the world. |
Methods inherited from class | Name |
---|---|
class RepastEdge |
getSource, getTarget, getWeight, isDirected, setDirected, setWeight |
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 two agents connected by link.
Removes the link.
Prints value with agent identifier to current file with a newline.
value
- any objectJoins together two ends of a link and ties the movements of the ends, except for headings.
Returns the color of a link. @ returns color of a link in the range [0, 140)
Returns the first turtle of a link.
Returns the second turtle of a link.
Returns the label color for a turtle or link. @ returns label color in the range [0, 140)
Returns 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.
Link appears hidden.
Queries if caller is hidden.
Returns the link between two turtles.
oneEnd
- an integerotherEnd
- an integerReturns the link between two turtles.
oneEnd
- a turtleotherEnd
- a turtleReturns the heading of a link.
Returns the length of a link.
Returns 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.
Stops a link executing within a command closure.
Returns an agentset minus the caller.
a
- an agentsetReturns the turtle opposite the asking turtle.
Returns the patch containing a point.
nX
- x coordinatenY
- y coordinateReturns 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 link to the value color.
color
- a numberSets the first turtle of a link to end1.
end1
- a turtleSets the second turtle of a link to end2.
end2
- a turtleSets link visibility.
hidden
- boolean visibilitySets the label color for a link to labelColor.
labelColor
- a number in range [0, 140)Sets tie mode to "none", "fixed", or "free".
mode
- one of ["none", "fixed", "free"]Prints value with agent identifier to the console.
value
- any objectMakes link visible.
Joins together two ends of a link and ties the movements of the ends, including headings.
Returns the turtle of the given number.
number
- a numberReturns an agentset containing all turtles.
Returns an agentset of turtles on the patches in a collection or on the patches that a collection of turtles are.
a
- a collectionReturns an agentset of turtles on a given patch.
p
- a patchReturns an agentset of turtles on the same patch as a turtle.
t
- a turtleUnties two ends of a link.
Returns the height of the world.
Returns the width of the world.
ReLogo API V2.11