What you are asking for is not an agentset. A set is usually defined to be
unique in terms of its members. Also a set has no order.

What you are asking for is an agentlist that would support for an "ask"
method similar to an agentset.

What you are getting by "weighted-n-of-with-repeats" is a list of agents.

There is documentation on how to call a list of agents here:
http://ccl.northwestern.edu/netlogo/docs/programming.html#lists

If "agentlist" is your list of agents simply do as follows

foreach agentlist [
  ask ? [
    ...
  ]
]

Thats not too bad I suppose. 

best regards
roman

On Fri, 6 Feb 2015 08:00:44 -0800 (PST), Marshall <[email protected]>
wrote:
> A model I'm working on includes a series of functions that implement a
> random choice of turtles that will send messages to another turtle.
> Recently, I decided it might be better to allow the selection of senders
> to be random with repeats. Nicolas Payette's rnd extension [1] provides
a
> convenient function that provides this functionality, returning a list
> that may contain repeats: weighted-n-of-with-repeats. (Thanks Nicolas!)
> 
> However, converting a list of turtles with repeats into a turtleset
loses
> the repeats; agentsets contain only unique elements. So if I want to
> allow repeats in the turtles that send messages, I have to rewrite a
> small but significant bit of code in different functions, replacing
ask's
> with loops, etc.
> 
> Question: Might it be useful to allow a new kind of agentset that allows
> repeats? It would be useful to me in this situation, but I know that the
> idea violates longstanding assumptions about agentsets, and I suspect
> that it would also require a lot of changes to the NetLogo source to
> implement.
> 
> I thought I'd raise it as a question, anyway, to see what others think.
> 
>  -- 
>  You received this message because you are subscribed to the Google
> Groups "netlogo-devel" group.
>  To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected] [2].
>  For more options, visit https://groups.google.com/d/optout [3].
> 
> 
> Links:
> ------
> [1] https://github.com/NetLogo/Rnd-Extension
> [2] mailto:[email protected]
> [3] https://groups.google.com/d/optout

-- 
You received this message because you are subscribed to the Google Groups 
"netlogo-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to