NetLogo, weighted random draw from a list: how to use rnd-extension?
问题 I have a list in NetLogo with values and a list of probabilities for each value. Now I want to draw a random value based on its probability (weighted random draw). I thought of using the Rnd extension, but I cant quite figure out how to get the weights right, please help set values [1 2 3] set probabilities [0.2 0.3 0.5] set state ( rnd:weighted-one-of agentset reporter-task ) 回答1: If you want/need to use two separate lists for your values and probabilities, the way to do it is to have the