swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

suggestion/request for random sampling from a List (Collection)


From: Rick Riolo
Subject: suggestion/request for random sampling from a List (Collection)
Date: Tue, 2 Sep 1997 10:07:17 -0400 (EDT)

I very often find myself writing codes to pick an
agent out of a list (and sometimes other collections) 
at random (ie a uniform random sample with replacement). 
It would be nice if List (and perhaps other collections) had 
a method
  myA = [myList getRandom];
To support this, one would be required to tell the list
what generator to use, so that it would be under the user's control
(in particular, so seed/sequence would be replicable).

If there are others who would like this, perhaps it could
be put on some "To-Add" list for the core libs.

thanks.
 - r

ps maybe I should just do this with a C macro...
   still, for agent based models, it seems like a 
   pretty common action, so it would be generally useful in the core.

Rick Riolo                       address@hidden
Program for Study of Complex Systems (PSCS)
4068 Randall Lab     University of Michigan
Ann Arbor MI 48109-1120
http://pscs.physics.lsa.umich.edu/PEOPLE/rlr-home.html


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]