NetLogo 7.0.0-beta2:

rnd:weighted-n-of-list

rnd:weighted-n-of-list size list anonymous-reporter

Reports a list of the given size randomly chosen from the list of candidates, with no repeats.

The probability of each item being picked is proportional to the weight given by the anonymous-reporter for that item. The weights must not be negative. The first argument passed to the anonymous procedure refers to the list item. (See the Anonymous Procedures section of the Programming Guide for more details.)

It is an error for size to be greater than the size of the list of candidates.

If, at some point during the selection, there remains only candidates with a weight of 0.0, they all have an equal probability of getting picked.

The items in the resulting list appear in the same order that they appeared in the list of candidates. (If you want them in random order, use shuffle on the result).

Example:

let candidates n-values 8 [ [n] -> 2 ^ (n + 1) ] ; make a list with the powers of two
print rnd:weighted-n-of-list 4 candidates [ [w] -> w ]

This should print a list of four numbers, where the bigger numbers (32, 64, 128, 256) have a much better chance to show up than the smaller ones (2, 4, 8, 16).

Take me to the full Rnd Extension Dictionary