Re: need a link to self

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: need a link to self

snezanacd
Thank you for your replies, I think I'll try the 'compromise'
solution and post about the results.

All best
Snezana

--- In [hidden email], "James Steiner"
<gregortroll@...> wrote:
>
> Hi all!
>
> I can think of a rather extreme solution to the problem of self-
links,
> and a rather simple workaround to use instead.
>
> You *could* abandon the entire built-in link support and the
wonderful
> convenience the link primitives offer and roll you own. Use a
breed of
> turtles as the links, with appropriate variables to handle things
like
> end1 and end2, and with no limitations on self-linking. Your
> home-grown link visualization code will have to know about the
> possibility of self-links, and use a different display method (e.g.
> instead of a line-shape placed half-way between the end-points, a
> self-link would be visualized as a circle, offset from the node by
the
> radius of the circle.
>
> But that would be awful.
>
> As a compromise, you could add a variable, like "self-link?" to the
> nodes. When this variable is true, you know that a self-link
exists on
> that node, and your code that deals with node-traversal or whatever
> would have to take that into account. For example:
>
> ;; construct this node's set of out-bound nodes, including this
node,
> if this node includes a self-link.
> let out-bound-nodes no-turtles
> ifelse self-link?
> [ set out-bound-nodes ( turtle-set out-link-neighbors self ) ]
> [ set out-bound-nodes out-link-neighbors ]
>
> Likewise, if self-link visualization is important, then you can do
> this: if a node has a self-link, apply a different shape to it,
that
> includes an appropriate circlular self-link shape.
>
> As a side-note, you can create turtle shapes that include elements
> that extend past the visible edges of the editing area, so you can
add
> a circle to your shape, then slide it so that the circle passes
> through the center of the shape, or perhaps clings to the edge of
the
> node shape you are using.
>
> I hope this helps!!
>
> ~~James
>
>
> On Sat, May 10, 2008 at 6:00 PM, Jim Lyons <teacherjim42@...>
wrote:
> > On May 10, 2008, at 12:36 PM, snezanacd wrote:
> >
> >>  I have a network of turtles with direct links between, and I
need some
> >>  of the turtles to be self-connected, e.g. link to connect the
sourced
> >>  turtle. It is not supported with default features, but if
someone have
> >>  an idea how I can model (upgrade) my network, I would
appreciate it
> >>  very much.
> >
> > Snezana,
> > There is a model at this group's website called generate-
network.nlogo which
> > creates a (simple) network from an input-output matrix of link
weights. To
> > solve the problem of self-connected nodes, I used two turtles to
make each
> > "node", one for its input and one for its output. Every link in
the network
> > goes from an output turtle to an input turtle.
> >
> > I did not solve the problem of showing the link that goes from
the output
> > back to the input of the same node.
> >
> > HTH,
> > Jim Lyons
> >
>