Class: ABM.Link

Defined in: src/


Link connects two agent endpoints for graph modeling.

Variables Summary

id =

Unique ID, set by BreedSet create() factory method.

breed =

The BreedSet this agent belongs to.

from =

My two endpoints, using agents. The first one.

to =

The second endpoint.

color =

The links' color, an RGB array. Defaults to light gray.

thickness =

Thickness in pixels of the link.

hidden =

Whether or not to draw this link.

label =

A text label

labelColor =

The color of the label text.

labelOffset =
  x: 0,
  y: 0

The x, y offset of the label.

Instance Method Summary

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.

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: