[{"data":1,"prerenderedAt":1595},["ShallowReactive",2],{"/rnd":3,"/rnd-surround":1585},{"id":4,"title":5,"body":6,"description":1559,"extension":1560,"meta":1561,"navigation":1578,"path":1582,"seo":1583,"stem":12,"__hash__":1584},"content/rnd.md","Rnd Extension",{"type":7,"value":8,"toc":1515},"minimark",[9,22,39,49,52,143,151,154,164,167,172,181,215,218,306,324,336,350,353,362,370,380,412,421,448,457,772,839,913,1220,1369],[10,11,15],"h1",{"id":12,"className":13},"rnd",[14],"section-heading",[16,17,21],"a",{"className":18,"href":20},[19],"section-anchor","#rnd","Rnd",[23,24,25,26,32,33,38],"p",{},"This extension adds the ability to do ",[16,27,31],{"href":28,"rel":29},"https://en.wikipedia.org/wiki/Fitness_proportionate_selection",[30],"nofollow","roulette wheel selection"," in NetLogo. It provides a simpler way to accomplish the same thing as the ",[16,34,37],{"href":35,"rel":36},"https://github.com/NetLogo/models/blob/master/Code%20Examples/Lottery%20Example.nlogo",[30],"Lottery Example"," from the NetLogo Models Library.",[40,41,44],"h2",{"id":42,"className":43},"usage",[14],[16,45,48],{"className":46,"href":47},[19],"#usage","Usage",[23,50,51],{},"Which primitive to use depends on whether you want to select an item from a list or from an agenset. It also depends on whether you want one or many items and, if you want many, if repeats are allowed or not. The following table summarizes the situation:",[53,54,57],"div",{"className":55},[56],"table-container",[58,59,60,75],"table",{},[61,62,63],"thead",{},[64,65,66,69,72],"tr",{},[67,68],"th",{},[67,70,71],{},"From an AgentSet",[67,73,74],{},"From a List",[76,77,78,101,122],"tbody",{},[64,79,80,84,93],{},[81,82,83],"td",{},"One item",[81,85,86],{},[16,87,89],{"href":88},"#rndweighted-one-of",[90,91,92],"code",{},"rnd:weighted-one-of",[81,94,95],{},[16,96,98],{"href":97},"#rndweighted-one-of-list",[90,99,100],{},"rnd:weighted-one-of-list",[64,102,103,106,114],{},[81,104,105],{},"Many items, without repeats",[81,107,108],{},[16,109,111],{"href":110},"#rndweighted-n-of",[90,112,113],{},"rnd:weighted-n-of",[81,115,116],{},[16,117,119],{"href":118},"#rndweighted-n-of-list",[90,120,121],{},"rnd:weighted-n-of-list",[64,123,124,127,135],{},[81,125,126],{},"Many items, with repeats",[81,128,129],{},[16,130,132],{"href":131},"#rndweighted-n-of-with-repeats",[90,133,134],{},"rnd:weighted-n-of-with-repeats",[81,136,137],{},[16,138,140],{"href":139},"#rndweighted-n-of-list-with-repeats",[90,141,142],{},"rnd:weighted-n-of-list-with-repeats",[23,144,145,146,150],{},"(",[147,148,149],"strong",{},"Note:"," the initial version of the extension had a single set of primitives for both lists and agentsets, but it turned out to be confusing, so we changed it. If you were using the old version of the extension, you will need to modify your code to use the new primitives.)",[23,152,153],{},"In all cases, you will need to provide two things to the primitive:",[155,156,157,161],"ul",{},[158,159,160],"li",{},"The “candidates”: the items that the primitive will select from.",[158,162,163],{},"The “weight”: how likely it is for each candidate to be selected.",[23,165,166],{},"If you want to select more than one items, you will also need to tell it:",[155,168,169],{},[158,170,171],{},"How many items to select.",[40,173,176],{"id":174,"className":175},"a-note-about-performance",[14],[16,177,180],{"className":178,"href":179},[19],"#a-note-about-performance","A note about performance",[23,182,183,184,189,190,194,195,198,199,202,203,206,207,210,211,214],{},"The extension uses Keith Schwarz’s implementation of Vose’s Alias Method (see Schwarz’s ",[16,185,188],{"href":186,"rel":187},"http://www.keithschwarz.com/darts-dice-coins/",[30],"Darts, Dice, and Coins"," page). Assuming you are choosing ",[191,192,193],"em",{},"n"," candidates for a collection of size ",[191,196,197],{},"m"," ",[147,200,201],{},"with repeats",", this method has an initialization cost of ",[191,204,205],{},"O(m)"," followed by a cost of ",[191,208,209],{},"O(1)"," for each item you pick, so ",[191,212,213],{},"O(m + n)"," overall.",[23,216,217],{},"For example, in the following code:",[219,220,221],"pre",{},[90,222,223,198,230,198,235,198,240,245,246,249,250,198,254,257,258,261,198,264,198,268,245,271,249,275,198,278,257,281,283,198,286,289,290,198,293,245,296,249,299,198,302,305],{},[224,225,229],"span",{"className":226},[227,228],"token","command","let",[224,231,234],{"className":232},[227,233],"variable","candidates",[224,236,239],{"className":237},[227,238],"reporter","n-values",[224,241,244],{"className":242},[227,243],"number","500"," [ [",[224,247,193],{"className":248},[227,233],"] ",[224,251,253],{"className":252},[227,238],"->",[224,255,193],{"className":256},[227,233]," ]",[259,260],"br",{},[224,262,142],{"className":263},[227,233],[224,265,267],{"className":266},[227,243],"100",[224,269,234],{"className":270},[227,233],[224,272,274],{"className":273},[227,233],"w",[224,276,253],{"className":277},[227,238],[224,279,274],{"className":280},[227,233],[259,282],{},[224,284,239],{"className":285},[227,238],[224,287,267],{"className":288},[227,243]," [ ",[224,291,100],{"className":292},[227,233],[224,294,234],{"className":295},[227,233],[224,297,274],{"className":298},[227,233],[224,300,253],{"className":301},[227,238],[224,303,274],{"className":304},[227,233]," ] ]",[23,307,308,309,311,312,314,315,317,318,320,321,323],{},"…the line using ",[90,310,142],{}," will likely run 100 times faster than the line using a combination of ",[90,313,239],{}," and ",[90,316,100],{},". This is because ",[90,319,142],{}," only initializes the algorithm once and ",[90,322,92],{}," does it each time it is called.",[23,325,326,327,329,330,332,333,335],{},"(Note that composing ",[90,328,239],{}," with ",[90,331,100],{}," does not preserve the order of the original candidate list, while ",[90,334,142],{}," does.)",[23,337,338,339,342,343,346,347,349],{},"Things are a bit more complicated if you are choosing ",[147,340,341],{},"without repeats",", however. In this case, the algorithm may have to discard some picks because the candidates have already been selected. When this starts happening too often (maybe because some weights are much bigger than others), the extension re-initializes the algorithm with the already-picked candidates excluded. This should not happen too often, however, so while picking without repeats has an upper bound of ",[191,344,345],{},"O(m * n)"," in theory, it should usually not be much more than ",[191,348,213],{}," in practice.",[23,351,352],{},"The previous remarks apply to agentset primitives as much as they apply to list primitives.",[40,354,357],{"id":355,"className":356},"primitives",[14],[16,358,361],{"className":359,"href":360},[19],"#primitives","Primitives",[23,363,364,365,369],{},"Looking for the primitive reference for the Rnd extension? You can find ",[16,366,368],{"href":367},"/rnd/dictionary","the full reference here",".",[371,372,375],"h3",{"id":373,"className":374},"agentset-primitives",[14],[16,376,379],{"className":377,"href":378},[19],"#agentset-primitives","AgentSet Primitives",[53,381,383,384,390,391,396,397,390,403,396,406],{"id":382},"agentset","\n  ",[16,385,388],{"className":386,"href":387},[90],"#weighted-one-of",[90,389,92],{},"\n   ",[224,392,395],{"className":393},[394],"font-bold"," · "," \n  ",[16,398,401],{"className":399,"href":400},[90],"#weighted-n-of",[90,402,113],{},[224,404,395],{"className":405},[394],[16,407,410],{"className":408,"href":409},[90],"#weighted-n-of-with-repeats",[90,411,134],{},[371,413,416],{"id":414,"className":415},"list-primitives",[14],[16,417,420],{"className":418,"href":419},[19],"#list-primitives","List Primitives",[53,422,383,424,390,430,396,433,390,439,396,442],{"id":423},"list",[16,425,428],{"className":426,"href":427},[90],"#weighted-one-of-list",[90,429,100],{},[224,431,395],{"className":432},[394],[16,434,437],{"className":435,"href":436},[90],"#weighted-n-of-list",[90,438,121],{},[224,440,395],{"className":441},[394],[16,443,446],{"className":444,"href":445},[90],"#weighted-n-of-list-with-repeats",[90,447,142],{},[371,449,452],{"id":450,"className":451},"all-primitives",[14],[16,453,456],{"className":454,"href":455},[19],"#all-primitives","All Primitives",[53,458,383,462,383,468,487,490,369,494,497,501,502,512,521],{"className":459,"id":461},[460],"dict_entry","weighted-one-of",[371,463,465,466,383],{"id":464},"rndweighted-one-of","\n    ",[16,467,92],{"href":387},[469,470,473],"h4",{"id":471,"className":472},"rndweighted-one-of-agentset-reporter",[14],[16,474,465,477,383],{"className":475,"href":476},[19],"#----rndweighted-one-of-agentset-reporter--",[224,478,481,482,198,485],{"className":479},[480],"prim_example","rnd:weighted-one-of ",[483,484,382],"i",{},[483,486,238],{},[23,488,489],{},"Reports a random agent from ",[53,491,492],{},[483,493,382],{},[23,495,496],{},"The probability of each agent being picked is proportional to the weight given by the ",[53,498,499],{},[483,500,238],{}," for that agent. The weights must not be negative.",[23,503,504,505,369],{},"If the agentset is empty, it reports ",[16,506,509],{"href":507,"rel":508},"http://ccl.northwestern.edu/netlogo/docs/dictionary.html#nobody",[30],[90,510,511],{},"nobody",[23,513,514,515,517,518,520],{},"Here is a full rewrite of the ",[147,516,37],{}," model using the ",[90,519,92],{}," primitive:",[219,522,523],{},[90,524,525,289,530,257,533,535,198,541,545,547,548,552,547,554,559,547,561,198,565,198,569,289,573,198,577,198,581,198,585,198,589,198,593,198,597,198,601,198,604,198,607,198,610,613,614,616,617,198,621,625,626,628,629,198,633,198,637,198,641,198,645,198,649,198,653,657,628,659,198,662,198,666,669,670,674,628,676,198,679,198,683,198,686,198,690,693,694,698,700,701,703,704,547,706,710,716,718,198,723,727,547,729,198,732,198,735,289,739,613,742,616,744,198,747,198,750,198,753,198,756,759,703,761,547,763,767],{},[224,526,529],{"className":527},[227,528],"keyword","extensions",[224,531,12],{"className":532},[227,233],[259,534],{},[224,536,538,540],{"className":537},[227,528],[259,539],{},"to",[224,542,544],{"className":543},[227,233],"setup",[259,546],{},"  ",[224,549,551],{"className":550},[227,228],"clear-all",[259,553],{},[224,555,558],{"className":556},[227,557],"comment","; create a turtle on every fifth patch",[259,560],{},[224,562,564],{"className":563},[227,228],"ask",[224,566,568],{"className":567},[227,238],"patches",[224,570,572],{"className":571},[227,238],"with",[224,574,576],{"className":575},[227,238],"pxcor",[224,578,580],{"className":579},[227,238],"mod",[224,582,584],{"className":583},[227,243],"5",[224,586,588],{"className":587},[227,238],"=",[224,590,592],{"className":591},[227,243],"0",[224,594,596],{"className":595},[227,238],"and",[224,598,600],{"className":599},[227,238],"pycor",[224,602,580],{"className":603},[227,238],[224,605,584],{"className":606},[227,243],[224,608,588],{"className":609},[227,238],[224,611,592],{"className":612},[227,243]," ] [",[259,615],{},"    ",[224,618,620],{"className":619},[227,228],"sprout",[224,622,624],{"className":623},[227,243],"1"," [",[259,627],{},"      ",[224,630,632],{"className":631},[227,228],"set",[224,634,636],{"className":635},[227,238],"size",[224,638,640],{"className":639},[227,243],"2",[224,642,644],{"className":643},[227,238],"+",[224,646,648],{"className":647},[227,238],"random",[224,650,652],{"className":651},[227,243],"6",[224,654,656],{"className":655},[227,557],"; vary the size of the turtles",[259,658],{},[224,660,632],{"className":661},[227,228],[224,663,665],{"className":664},[227,238],"label",[224,667,592],{"className":668},[227,243],"           ",[224,671,673],{"className":672},[227,557],"; start them out with no wins",[259,675],{},[224,677,632],{"className":678},[227,228],[224,680,682],{"className":681},[227,238],"color",[224,684,682],{"className":685},[227,238],[224,687,689],{"className":688},[227,238],"-",[224,691,640],{"className":692},[227,243],"   ",[224,695,697],{"className":696},[227,557],"; make turtles darker so the labels stand out",[259,699],{},"    ]",[259,702],{},"  ]",[259,705],{},[224,707,709],{"className":708},[227,228],"reset-ticks",[224,711,713,715],{"className":712},[227,528],[259,714],{},"end",[259,717],{},[224,719,721,540],{"className":720},[227,528],[259,722],{},[224,724,726],{"className":725},[227,233],"go",[259,728],{},[224,730,564],{"className":731},[227,228],[224,733,92],{"className":734},[227,233],[224,736,738],{"className":737},[227,238],"turtles",[224,740,636],{"className":741},[227,238],[259,743],{},[224,745,632],{"className":746},[227,228],[224,748,665],{"className":749},[227,238],[224,751,665],{"className":752},[227,238],[224,754,644],{"className":755},[227,238],[224,757,624],{"className":758},[227,243],[259,760],{},[259,762],{},[224,764,766],{"className":765},[227,228],"tick",[224,768,770,715],{"className":769},[227,528],[259,771],{},[53,773,383,776,383,781,800,803,807,808,812,813,815,819,820,823,827,828,369,832],{"className":774,"id":775},[460],"weighted-n-of",[371,777,465,779,383],{"id":778},"rndweighted-n-of",[16,780,113],{"href":400},[469,782,785],{"id":783,"className":784},"rndweighted-n-of-size-agentset-reporter",[14],[16,786,465,789,383],{"className":787,"href":788},[19],"#----rndweighted-n-of-size-agentset--reporter---",[224,790,792,793,198,795,198,797],{"className":791},[480],"rnd:weighted-n-of ",[483,794,636],{},[483,796,382],{},[483,798,799],{},"[ reporter ]",[23,801,802],{},"Reports an agentset of the given ",[53,804,805],{},[483,806,636],{}," randomly chosen from the ",[53,809,810],{},[483,811,382],{},", with no repeats.",[23,814,496],{},[53,816,817],{},[483,818,238],{}," for that agent. The weights must be non-negative numbers.",[23,821,822],{},"It is an error for ",[53,824,825],{},[483,826,636],{}," to be greater than the size of the ",[53,829,830],{},[483,831,382],{},[23,833,834,835,838],{},"If, at some point during the selection, there remains only candidates with a weight of ",[90,836,837],{},"0.0",", they all have an equal probability of getting picked.",[53,840,383,843,383,848,866,872,807,876,880,881,883,819,887,894,827,898,902,903,907],{"className":841,"id":842},[460],"weighted-n-of-with-repeats",[371,844,465,846,383],{"id":845},"rndweighted-n-of-with-repeats",[16,847,134],{"href":409},[469,849,852],{"id":850,"className":851},"rndweighted-n-of-with-repeats-size-agentset-reporter",[14],[16,853,465,856,383],{"className":854,"href":855},[19],"#----rndweighted-n-of-with-repeats-size-agentset--reporter---",[224,857,859,860,198,862,198,864],{"className":858},[480],"rnd:weighted-n-of-with-repeats ",[483,861,636],{},[483,863,382],{},[483,865,799],{},[23,867,868,869,871],{},"Reports a ",[147,870,423],{}," of the given ",[53,873,874],{},[483,875,636],{},[53,877,878],{},[483,879,382],{},", with repeats. (Why a list instead of an agentset? Because an agentset cannot contain the same agent more than once.)",[23,882,496],{},[53,884,885],{},[483,886,238],{},[23,888,889,890,893],{},"It is ",[147,891,892],{},"not"," an error for ",[53,895,896],{},[483,897,636],{},[53,899,900],{},[483,901,382],{},", but there has to be at least one candidate.",[23,904,834,905,838],{},[90,906,837],{},[23,908,909,910,912],{},"If all weights are ",[90,911,837],{},", each candidate has an equal probability of being picked.",[53,914,383,917,383,922,940,943,369,947,950,954,955,960,961,964,967,1051,1061,1078,1141],{"className":915,"id":916},[460],"weighted-one-of-list",[371,918,465,920,383],{"id":919},"rndweighted-one-of-list",[16,921,100],{"href":427},[469,923,926],{"id":924,"className":925},"rndweighted-one-of-list-netlogo-list-anonymous-reporter",[14],[16,927,465,930,383],{"className":928,"href":929},[19],"#----rndweighted-one-of-list-netlogo-list-anonymous-reporter--",[224,931,933,934,198,937],{"className":932},[480],"rnd:weighted-one-of-list ",[483,935,936],{},"netlogo-list",[483,938,939],{},"anonymous-reporter",[23,941,942],{},"Reports a random item from ",[53,944,945],{},[483,946,423],{},[23,948,949],{},"The probability of each item being picked is proportional to the weight given by the ",[53,951,952],{},[483,953,939],{}," for that item. The weights must not be negative. The first argument passed to the anonymous procedure refers to the list item. (See the ",[16,956,959],{"href":957,"rel":958},"https://ccl.northwestern.edu/netlogo/docs/programming.html#anonymous-procedures",[30],"Anonymous Procedures section"," of the Programming Guide for more details.)",[23,962,963],{},"It is an error for the list to be empty.",[23,965,966],{},"A common way to use the primitive is to have a list of lists, where the first item of each sublist is the thing you want to choose and the second item is the weight. Here is a short example:",[219,968,969],{},[90,970,971,198,974,978,979,198,984,988,989,198,993,305,997,999,198,1003,625,1007,547,1009,1013,547,1015,1019,547,1021,198,1025,198,1029,198,1032,245,1035,249,1038,198,1041,198,1045,257,1048,1050],{},[224,972,229],{"className":973},[227,228],[224,975,977],{"className":976},[227,233],"pairs"," [ [ ",[224,980,983],{"className":981},[227,982],"string","\"A\"",[224,985,987],{"className":986},[227,243],"0.2"," ] [ ",[224,990,992],{"className":991},[227,982],"\"B\"",[224,994,996],{"className":995},[227,243],"0.8",[259,998],{},[224,1000,1002],{"className":1001},[227,228],"repeat",[224,1004,1006],{"className":1005},[227,243],"25",[259,1008],{},[224,1010,1012],{"className":1011},[227,557],"; report the first item of the pair selected using",[259,1014],{},[224,1016,1018],{"className":1017},[227,557],"; the second item (i.e., `last p`) as the weight",[259,1020],{},[224,1022,1024],{"className":1023},[227,228],"type",[224,1026,1028],{"className":1027},[227,238],"first",[224,1030,100],{"className":1031},[227,233],[224,1033,977],{"className":1034},[227,233],[224,1036,23],{"className":1037},[227,233],[224,1039,253],{"className":1040},[227,238],[224,1042,1044],{"className":1043},[227,238],"last",[224,1046,23],{"className":1047},[227,233],[259,1049],{},"]",[23,1052,1053,1054,1057,1058,369],{},"This should print ",[90,1055,1056],{},"B"," roughly four times more often than it prints ",[90,1059,1060],{},"A",[23,1062,1063,1064,314,1071,1077],{},"If you happen to have your items and your weights in two separate lists, you can combine them into pairs by using a combination of ",[16,1065,1068],{"href":1066,"rel":1067},"http://ccl.northwestern.edu/netlogo/docs/dictionary.html#map",[30],[90,1069,1070],{},"map",[16,1072,1075],{"href":1073,"rel":1074},"http://ccl.northwestern.edu/netlogo/docs/dictionary.html#list",[30],[90,1076,423],{},":",[219,1079,1080],{},[90,1081,1082,198,1085,289,1089,198,1092,198,1095,257,1099,1101,198,1104,289,1108,198,1112,198,1115,257,1119,1121,198,1124,1127,1128,198,1131,198,1134,198,1137,1140],{},[224,1083,229],{"className":1084},[227,228],[224,1086,1088],{"className":1087},[227,233],"items",[224,1090,983],{"className":1091},[227,982],[224,1093,992],{"className":1094},[227,982],[224,1096,1098],{"className":1097},[227,982],"\"C\"",[259,1100],{},[224,1102,229],{"className":1103},[227,228],[224,1105,1107],{"className":1106},[227,233],"weights",[224,1109,1111],{"className":1110},[227,243],"0.1",[224,1113,987],{"className":1114},[227,243],[224,1116,1118],{"className":1117},[227,243],"0.7",[259,1120],{},[224,1122,229],{"className":1123},[227,228],[224,1125,977],{"className":1126},[227,233]," (",[224,1129,1070],{"className":1130},[227,238],[224,1132,423],{"className":1133},[227,238],[224,1135,1088],{"className":1136},[227,233],[224,1138,1107],{"className":1139},[227,233],")",[23,1142,1143,1144,1149,1150,1152,1153,1155,1156,1170,1171,1176,1177,1182,1183,1188,1189,369],{},"Since we apply ",[16,1145,1147],{"href":1066,"rel":1146},[30],[90,1148,1070],{}," to both the ",[90,1151,1088],{}," list and the ",[90,1154,1107],{}," list, the parentheses are needed in ",[90,1157,145,1158,198,1161,198,1164,198,1167,1140],{},[224,1159,1070],{"className":1160},[227,238],[224,1162,423],{"className":1163},[227,238],[224,1165,1088],{"className":1166},[227,233],[224,1168,1107],{"className":1169},[227,233],". We also use the concise anonymous procedure syntax (see the ",[16,1172,1175],{"href":1173,"rel":1174},"http://ccl.northwestern.edu/netlogo/docs/programming.html#anonymous-procedures",[30],"programming guide",") to pass ",[16,1178,1180],{"href":1073,"rel":1179},[30],[90,1181,423],{}," as the reporter for ",[16,1184,1186],{"href":1066,"rel":1185},[30],[90,1187,1070],{},". The same thing could have been written ",[90,1190,145,1191,245,1194,198,1197,249,1201,198,1204,198,1207,198,1210,1213,1214,198,1217,1140],{},[224,1192,1070],{"className":1193},[227,238],[224,1195,16],{"className":1196},[227,233],[224,1198,1200],{"className":1199},[227,233],"b",[224,1202,253],{"className":1203},[227,238],[224,1205,423],{"className":1206},[227,238],[224,1208,16],{"className":1209},[227,233],[224,1211,1200],{"className":1212},[227,233]," ] ",[224,1215,1088],{"className":1216},[227,233],[224,1218,1107],{"className":1219},[227,233],[53,1221,383,1224,383,1229,1247,1250,807,1254,1258,1259,1261,954,1265,960,1268,1270,827,1274,369,1279,1283,1294,1297,1366],{"className":1222,"id":1223},[460],"weighted-n-of-list",[371,1225,465,1227,383],{"id":1226},"rndweighted-n-of-list",[16,1228,121],{"href":436},[469,1230,1233],{"id":1231,"className":1232},"rndweighted-n-of-list-size-netlogo-list-anonymous-reporter",[14],[16,1234,465,1237,383],{"className":1235,"href":1236},[19],"#----rndweighted-n-of-list-size-netlogo-list-anonymous-reporter--",[224,1238,1240,1241,198,1243,198,1245],{"className":1239},[480],"rnd:weighted-n-of-list ",[483,1242,636],{},[483,1244,936],{},[483,1246,939],{},[23,1248,1249],{},"Reports a list of the given ",[53,1251,1252],{},[483,1253,636],{},[53,1255,1256],{},[483,1257,423],{}," of candidates, with no repeats.",[23,1260,949],{},[53,1262,1263],{},[483,1264,939],{},[16,1266,959],{"href":957,"rel":1267},[30],[23,1269,822],{},[53,1271,1272],{},[483,1273,636],{},[53,1275,1276,1278],{},[483,1277,423],{}," of candidates",[23,1280,834,1281,838],{},[90,1282,837],{},[23,1284,1285,1286,1293],{},"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 ",[16,1287,1290],{"href":1288,"rel":1289},"http://ccl.northwestern.edu/netlogo/docs/dictionary.html#shuffle",[30],[90,1291,1292],{},"shuffle"," on the result).",[23,1295,1296],{},"Example:",[219,1298,1299],{},[90,1300,1301,198,1304,198,1307,198,1310,245,1314,249,1317,198,1320,198,1323,1127,1327,198,1330,198,1333,1336,1337,1341,1343,198,1347,198,1350,198,1354,245,1357,249,1360,198,1363,257],{},[224,1302,229],{"className":1303},[227,228],[224,1305,234],{"className":1306},[227,233],[224,1308,239],{"className":1309},[227,238],[224,1311,1313],{"className":1312},[227,243],"8",[224,1315,193],{"className":1316},[227,233],[224,1318,253],{"className":1319},[227,238],[224,1321,640],{"className":1322},[227,243],[224,1324,1326],{"className":1325},[227,238],"^",[224,1328,193],{"className":1329},[227,233],[224,1331,644],{"className":1332},[227,238],[224,1334,624],{"className":1335},[227,243],") ] ",[224,1338,1340],{"className":1339},[227,557],"; make a list with the powers of two",[259,1342],{},[224,1344,1346],{"className":1345},[227,228],"print",[224,1348,121],{"className":1349},[227,233],[224,1351,1353],{"className":1352},[227,243],"4",[224,1355,234],{"className":1356},[227,233],[224,1358,274],{"className":1359},[227,233],[224,1361,253],{"className":1362},[227,238],[224,1364,274],{"className":1365},[227,233],[23,1367,1368],{},"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).",[53,1370,383,1373,383,1378,1396,1398,807,1402,1406,1407,1409,954,1413,960,1416,1420,827,1424,1428,1429,1433,1437,1444,1446,1500],{"className":1371,"id":1372},[460],"weighted-n-of-list-with-repeats",[371,1374,465,1376,383],{"id":1375},"rndweighted-n-of-list-with-repeats",[16,1377,142],{"href":445},[469,1379,1382],{"id":1380,"className":1381},"rndweighted-n-of-list-with-repeats-size-netlogo-list-anonymous-reporter",[14],[16,1383,465,1386,383],{"className":1384,"href":1385},[19],"#----rndweighted-n-of-list-with-repeats-size-netlogo-list-anonymous-reporter--",[224,1387,1389,1390,198,1392,198,1394],{"className":1388},[480],"rnd:weighted-n-of-list-with-repeats ",[483,1391,636],{},[483,1393,936],{},[483,1395,939],{},[23,1397,1249],{},[53,1399,1400],{},[483,1401,636],{},[53,1403,1404],{},[483,1405,423],{}," of candidates, with repeats.",[23,1408,949],{},[53,1410,1411],{},[483,1412,939],{},[16,1414,959],{"href":957,"rel":1415},[30],[23,1417,889,1418,893],{},[147,1419,892],{},[53,1421,1422],{},[483,1423,636],{},[53,1425,1426],{},[483,1427,423],{}," of candidates, but there has to be at least one candidate.",[23,1430,834,1431,838],{},[90,1432,837],{},[23,1434,909,1435,912],{},[90,1436,837],{},[23,1438,1285,1439,1293],{},[16,1440,1442],{"href":1288,"rel":1441},[30],[90,1443,1292],{},[23,1445,1296],{},[219,1447,1448],{},[90,1449,1450,198,1453,978,1456,198,1459,988,1462,198,1465,305,1468,1470,198,1473,198,1476,198,1479,198,1482,198,1485,245,1488,249,1491,198,1494,198,1497,257],{},[224,1451,229],{"className":1452},[227,228],[224,1454,977],{"className":1455},[227,233],[224,1457,983],{"className":1458},[227,982],[224,1460,987],{"className":1461},[227,243],[224,1463,992],{"className":1464},[227,982],[224,1466,996],{"className":1467},[227,243],[259,1469],{},[224,1471,1346],{"className":1472},[227,228],[224,1474,1070],{"className":1475},[227,238],[224,1477,1028],{"className":1478},[227,238],[224,1480,142],{"className":1481},[227,233],[224,1483,1006],{"className":1484},[227,243],[224,1486,977],{"className":1487},[227,233],[224,1489,23],{"className":1490},[227,233],[224,1492,253],{"className":1493},[227,238],[224,1495,1044],{"className":1496},[227,238],[224,1498,23],{"className":1499},[227,233],[23,1501,1502,1503,1505,1506,1508,1509,1511,1512,1514],{},"This should print a list of 25 ",[90,1504,1060],{},"s and ",[90,1507,1056],{},"s, with roughly four times as many ",[90,1510,1056],{},"s than ",[90,1513,1060],{},"s.",{"title":1516,"searchDepth":1517,"depth":1518,"links":1519},"",5,3,[1520,1522,1523],{"id":42,"depth":1521,"text":48},2,{"id":174,"depth":1521,"text":180},{"id":355,"depth":1521,"text":361,"children":1524},[1525,1526,1527,1528,1534,1539,1544,1549,1554],{"id":373,"depth":1518,"text":379},{"id":414,"depth":1518,"text":420},{"id":450,"depth":1518,"text":456},{"id":464,"depth":1518,"text":1529,"children":1530},"\n    rnd:weighted-one-of\n  ",[1531],{"id":471,"depth":1532,"text":1533},4,"\n    rnd:weighted-one-of agentset reporter\n  ",{"id":778,"depth":1518,"text":1535,"children":1536},"\n    rnd:weighted-n-of\n  ",[1537],{"id":783,"depth":1532,"text":1538},"\n    rnd:weighted-n-of size agentset [ reporter ]\n  ",{"id":845,"depth":1518,"text":1540,"children":1541},"\n    rnd:weighted-n-of-with-repeats\n  ",[1542],{"id":850,"depth":1532,"text":1543},"\n    rnd:weighted-n-of-with-repeats size agentset [ reporter ]\n  ",{"id":919,"depth":1518,"text":1545,"children":1546},"\n    rnd:weighted-one-of-list\n  ",[1547],{"id":924,"depth":1532,"text":1548},"\n    rnd:weighted-one-of-list netlogo-list anonymous-reporter\n  ",{"id":1226,"depth":1518,"text":1550,"children":1551},"\n    rnd:weighted-n-of-list\n  ",[1552],{"id":1231,"depth":1532,"text":1553},"\n    rnd:weighted-n-of-list size netlogo-list anonymous-reporter\n  ",{"id":1375,"depth":1518,"text":1555,"children":1556},"\n    rnd:weighted-n-of-list-with-repeats\n  ",[1557],{"id":1380,"depth":1532,"text":1558},"\n    rnd:weighted-n-of-list-with-repeats size netlogo-list anonymous-reporter\n  ","Documentation for the Rnd extension.","md",{"source":1562,"metadataOutputPath":1563,"projectConfig":1564,"language":1571,"inheritFrom":1579,"output":1578,"version":1565,"icon":1580,"extensionName":1581,"assetsRoot":1566},"../../external/extensions/rnd/rnd.md","content/rnd.metadata.yaml",{"version":1565,"projectRoot":369,"scanRoot":1566,"outputRoot":1567,"defaults":1568,"engine":1574,"partials":1575,"dedupeIdenticalDiskWrites":1578},"7.0.4","/home/runner/work/Helio/Helio/external/extensions/rnd","content",{"inheritFrom":1569,"language":1571,"output":1572,"extension":1560,"title":1573,"version":1565},[1570],0,"en",false,"NetLogo User Manual","mustache",{"directoryPaths":1576,"extensions":1577},[369],[1574,1560],true,[1570],"i-mingcute-random-line",{"shortName":12,"fullName":21},"/rnd",{"title":5,"description":1559},"ESXZN_Ga-5-PpzxGjVT6WOwnRILofvHBZFRTrSQR4ZA",[1586,1591],{"title":1587,"path":1588,"stem":1589,"description":1590},"Resource Manager","/resource-manager","resource-manager","Guide to managing resources and files in NetLogo models, including importing and organizing external files and data.",{"title":1592,"path":367,"stem":1593,"description":1594},"Rnd Extension Dictionary: dictionary","rnd/dictionary","Documentation for the dictionary primitive.",1777657790151]