NetLogo 7.0.0-beta2:

rnd:weighted-n-of

rnd:weighted-n-of size agentset [ reporter ]

Reports an agentset of the given size randomly chosen from the agentset, with no repeats.

The probability of each agent being picked is proportional to the weight given by the reporter for that agent. The weights must be non-negative numbers.

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

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.

Take me to the full Rnd Extension Dictionary