Netlogo: Assign variable using probabilities
问题 How to assign a string or integer variable to turtle, using probabilities of the variables in a group/list? For example it is 0.4 probability that one specific variable is used from specific group/list. The function selects randomly the variable based on probability. I need to use the same method afterwards to choose a variable (string) from a list according to probability. In python it should be: import random def random_value(probability_list, values): r = random.random() index = 0 while(r