Class: ABM.Link
Defined in: | src/link.coffee |
Overview
Link connects two agent endpoints for graph modeling.
Variables Summary
- id =
-
null
Unique ID, set by BreedSet create() factory method.
- breed =
-
null
The BreedSet this agent belongs to.
- from =
-
null
My two endpoints, using agents. The first one.
- to =
-
null
The second endpoint.
- color =
-
u
The links' color, an RGB array. Defaults to light gray.
- thickness =
-
2
Thickness in pixels of the link.
-
false
Whether or not to draw this link.
- label =
-
null
A text label
- labelColor =
-
u
The color of the label text.
- labelOffset =
-
{ x: 0, y: 0 }
The x, y offset of the label.
Instance Method Summary
- # (void) die() Remove this link from the agent set.
- # (void) bothEnds() Return the two endpoints of this link.
- # (void) length() Return the distance between the endpoints with the current topology.
- # (void) otherEnd(agent) Return the other end of the link, given an endpoint agent.
- # (void) draw(context) Draw a line between the two endpoints.
Constructor Details
#
(void)
constructor(from, to)
Initializes instance variables.
Instance Method Details
#
(void)
die()
Remove this link from the agent set.
#
(void)
bothEnds()
Return the two endpoints of this link.
#
(void)
length()
Return the distance between the endpoints with the current topology.
#
(void)
otherEnd(agent)
Return the other end of the link, given an endpoint agent.
Assumes the given input is one of the link endpoint pairs!
#
(void)
draw(context)
Draw a line between the two endpoints. Draws "around" the torus if appropriate using two lines. As with Agent.draw, is called with patch coordinate transform installed.