[{"data":1,"prerenderedAt":405},["ShallowReactive",2],{"/rnd/weighted-one-of":3,"/rnd/weighted-one-of-surround":394},{"id":4,"title":5,"body":6,"description":362,"extension":363,"meta":364,"navigation":381,"path":390,"seo":391,"stem":392,"__hash__":393},"content/rnd/weighted-one-of.md","Rnd Extension Dictionary: weighted-one-of",{"type":7,"value":8,"toc":351},"minimark",[9],[10,11,15,16,15,26,51,55,59,60,63,67,68,80,91],"div",{"className":12,"id":14},[13],"dict_entry","weighted-one-of","\n  ",[17,18,20,21,15],"h3",{"id":19},"rndweighted-one-of","\n    ",[22,23,25],"a",{"href":24},"#weighted-one-of","rnd:weighted-one-of",[27,28,32],"h4",{"id":29,"className":30},"rndweighted-one-of-agentset-reporter",[31],"section-heading",[22,33,20,37,15],{"className":34,"href":36},[35],"section-anchor","#----rndweighted-one-of-agentset-reporter--",[38,39,42,43,47,48],"span",{"className":40},[41],"prim_example","rnd:weighted-one-of ",[44,45,46],"i",{},"agentset"," ",[44,49,50],{},"reporter",[52,53,54],"p",{},"Reports a random agent from ",[10,56,57],{},[44,58,46],{},".",[52,61,62],{},"The probability of each agent being picked is proportional to the weight given by the ",[10,64,65],{},[44,66,50],{}," for that agent. The weights must not be negative.",[52,69,70,71,59],{},"If the agentset is empty, it reports ",[22,72,76],{"href":73,"rel":74},"http://ccl.northwestern.edu/netlogo/docs/dictionary.html#nobody",[75],"nofollow",[77,78,79],"code",{},"nobody",[52,81,82,83,87,88,90],{},"Here is a full rewrite of the ",[84,85,86],"strong",{},"Lottery Example"," model using the ",[77,89,25],{}," primitive:",[92,93,94],"pre",{},[77,95,96,102,103,108,109,112,47,118,122,124,125,130,124,132,137,124,139,47,143,47,147,102,151,47,155,47,159,47,164,47,168,47,172,47,176,47,180,47,183,47,186,47,189,192,193,195,196,47,200,204,205,207,208,47,212,47,216,47,220,47,224,47,228,47,232,236,207,238,47,241,47,245,248,249,253,207,255,47,258,47,262,47,265,47,269,272,273,277,279,280,282,283,124,285,289,295,297,47,302,306,124,308,47,311,47,314,102,318,192,321,195,323,47,326,47,329,47,332,47,335,338,282,340,124,342,346],{},[38,97,101],{"className":98},[99,100],"token","keyword","extensions"," [ ",[38,104,107],{"className":105},[99,106],"variable","rnd"," ]",[110,111],"br",{},[38,113,115,117],{"className":114},[99,100],[110,116],{},"to",[38,119,121],{"className":120},[99,106],"setup",[110,123],{},"  ",[38,126,129],{"className":127},[99,128],"command","clear-all",[110,131],{},[38,133,136],{"className":134},[99,135],"comment","; create a turtle on every fifth patch",[110,138],{},[38,140,142],{"className":141},[99,128],"ask",[38,144,146],{"className":145},[99,50],"patches",[38,148,150],{"className":149},[99,50],"with",[38,152,154],{"className":153},[99,50],"pxcor",[38,156,158],{"className":157},[99,50],"mod",[38,160,163],{"className":161},[99,162],"number","5",[38,165,167],{"className":166},[99,50],"=",[38,169,171],{"className":170},[99,162],"0",[38,173,175],{"className":174},[99,50],"and",[38,177,179],{"className":178},[99,50],"pycor",[38,181,158],{"className":182},[99,50],[38,184,163],{"className":185},[99,162],[38,187,167],{"className":188},[99,50],[38,190,171],{"className":191},[99,162]," ] [",[110,194],{},"    ",[38,197,199],{"className":198},[99,128],"sprout",[38,201,203],{"className":202},[99,162],"1"," [",[110,206],{},"      ",[38,209,211],{"className":210},[99,128],"set",[38,213,215],{"className":214},[99,50],"size",[38,217,219],{"className":218},[99,162],"2",[38,221,223],{"className":222},[99,50],"+",[38,225,227],{"className":226},[99,50],"random",[38,229,231],{"className":230},[99,162],"6",[38,233,235],{"className":234},[99,135],"; vary the size of the turtles",[110,237],{},[38,239,211],{"className":240},[99,128],[38,242,244],{"className":243},[99,50],"label",[38,246,171],{"className":247},[99,162],"           ",[38,250,252],{"className":251},[99,135],"; start them out with no wins",[110,254],{},[38,256,211],{"className":257},[99,128],[38,259,261],{"className":260},[99,50],"color",[38,263,261],{"className":264},[99,50],[38,266,268],{"className":267},[99,50],"-",[38,270,219],{"className":271},[99,162],"   ",[38,274,276],{"className":275},[99,135],"; make turtles darker so the labels stand out",[110,278],{},"    ]",[110,281],{},"  ]",[110,284],{},[38,286,288],{"className":287},[99,128],"reset-ticks",[38,290,292,294],{"className":291},[99,100],[110,293],{},"end",[110,296],{},[38,298,300,117],{"className":299},[99,100],[110,301],{},[38,303,305],{"className":304},[99,106],"go",[110,307],{},[38,309,142],{"className":310},[99,128],[38,312,25],{"className":313},[99,106],[38,315,317],{"className":316},[99,50],"turtles",[38,319,215],{"className":320},[99,50],[110,322],{},[38,324,211],{"className":325},[99,128],[38,327,244],{"className":328},[99,50],[38,330,244],{"className":331},[99,50],[38,333,223],{"className":334},[99,50],[38,336,203],{"className":337},[99,162],[110,339],{},[110,341],{},[38,343,345],{"className":344},[99,128],"tick",[38,347,349,294],{"className":348},[99,100],[110,350],{},{"title":352,"searchDepth":353,"depth":354,"links":355},"",5,3,[356],{"id":19,"depth":354,"text":357,"children":358},"\n    rnd:weighted-one-of\n  ",[359],{"id":29,"depth":360,"text":361},4,"\n    rnd:weighted-one-of agentset reporter\n  ","Documentation for the weighted-one-of primitive.","md",{"source":365,"metadataOutputPath":366,"projectConfig":367,"language":374,"inheritFrom":382,"output":381,"version":368,"layout":383,"dictionaryDisplayName":384,"dictionaryHomeDirectory":385,"indexFileURI":386,"currentItemId":14,"currentItemLabel":25,"primRoot":107,"icon":387,"extensionName":388,"assetsRoot":369},"../../external/extensions/rnd/rnd/weighted-one-of.md","content/rnd/weighted-one-of.metadata.yaml",{"version":368,"projectRoot":59,"scanRoot":369,"outputRoot":370,"defaults":371,"engine":377,"partials":378,"dedupeIdenticalDiskWrites":381},"7.0.4","/home/runner/work/Helio/Helio/external/extensions/rnd","content",{"inheritFrom":372,"language":374,"output":375,"extension":363,"title":376,"version":368},[373],0,"en",false,"NetLogo User Manual","mustache",{"directoryPaths":379,"extensions":380},[59],[377,363],true,[373],"catalog","Rnd Extension Dictionary","/rnd.html","/_index/extensions/rnd.txt","i-mingcute-random-line",{"shortName":107,"fullName":389},"Rnd","/rnd/weighted-one-of",{"title":5,"description":362},"rnd/weighted-one-of","xG_z5ToY1iCxdoUz2eU6IAtU2A3ezFjC1ZnrvtXzJb8",[395,400],{"title":396,"path":397,"stem":398,"description":399,"children":-1},"Rnd Extension Dictionary: weighted-n-of-with-repeats","/rnd/weighted-n-of-with-repeats","rnd/weighted-n-of-with-repeats","Documentation for the weighted-n-of-with-repeats primitive.",{"title":401,"path":402,"stem":403,"description":404,"children":-1},"Rnd Extension Dictionary: weighted-one-of-list","/rnd/weighted-one-of-list","rnd/weighted-one-of-list","Documentation for the weighted-one-of-list primitive.",1777657781905]