org.nlogo.api
Interface Link

All Superinterfaces:
Agent
All Known Subinterfaces:
Link3D, LinkStamp3D
All Known Implementing Classes:
DummyLink, Link, Link3D, LinkStamp3D

public interface Link
extends Agent

Interface provides access to NetLogo links.


Method Summary
 Object color()
          Returns the value of the color variable
 Turtle end1()
          Returns the first end point of this link.
 Turtle end2()
          Returns the second end point of this link.
 AgentSet getBreed()
          Returns the breed AgentSet associated with this link, if the link is unbreeded returns the all links AgentSet
 int getBreedIndex()
          Returns the index of the breed of this link
 boolean hasLabel()
          Returns true if there is a value in the label variable
 double heading()
          Returns the heading towards end2 from end1
 boolean hidden()
          Returns the value of the hidden?
 boolean isDirectedLink()
          Returns true if this link is directed
 Object labelColor()
          Returns the value of the label-color variable
 String labelString()
          Returns the value of the label variable
 double lineThickness()
          Returns the value of the thinkness variable
 double linkDestinationSize()
          Returns the size of end2
 double midpointX()
          Returns the x-coordinate of the midpoint of this link taking wrapping in account.
 double midpointY()
          Returns the y-coordinate of the midpoint of this link taking wrapping in account.
 double x1()
          Returns the x-coordinate of end1
 double x2()
          Returns the x-coordinate of end2 this coordinate is "unwrapped" so it may actually be outside the bounds of the world
 double y1()
          Returns the y-coordinate of end1
 double y2()
          Returns the y-coordinate of end2 this coordinate is "unwrapped" so it may actually be outside the bounds of the world
 
Methods inherited from interface org.nlogo.api.Agent
classDisplayName, getVariable, id, setVariable, shape, size, world
 

Method Detail

end1

Turtle end1()
Returns the first end point of this link. If the link is directed this is the source turtle if the link is undirected it is the turtle with the lower who number.


end2

Turtle end2()
Returns the second end point of this link. If the link is directed this is the destination turtle if the link is undirected it is the turtle with the higher who number.


getBreed

AgentSet getBreed()
Returns the breed AgentSet associated with this link, if the link is unbreeded returns the all links AgentSet


midpointX

double midpointX()
Returns the x-coordinate of the midpoint of this link taking wrapping in account.


midpointY

double midpointY()
Returns the y-coordinate of the midpoint of this link taking wrapping in account.


x1

double x1()
Returns the x-coordinate of end1


y1

double y1()
Returns the y-coordinate of end1


x2

double x2()
Returns the x-coordinate of end2 this coordinate is "unwrapped" so it may actually be outside the bounds of the world


y2

double y2()
Returns the y-coordinate of end2 this coordinate is "unwrapped" so it may actually be outside the bounds of the world


isDirectedLink

boolean isDirectedLink()
Returns true if this link is directed


heading

double heading()
Returns the heading towards end2 from end1


linkDestinationSize

double linkDestinationSize()
Returns the size of end2


hidden

boolean hidden()
Returns the value of the hidden? variable


lineThickness

double lineThickness()
Returns the value of the thinkness variable


hasLabel

boolean hasLabel()
Returns true if there is a value in the label variable


color

Object color()
Returns the value of the color variable


labelString

String labelString()
Returns the value of the label variable


labelColor

Object labelColor()
Returns the value of the label-color variable


getBreedIndex

int getBreedIndex()
Returns the index of the breed of this link