[{"data":1,"prerenderedAt":302},["ShallowReactive",2],{"/dict/with-local-randomness":3,"/dict/with-local-randomness-surround":291},{"id":4,"title":5,"body":6,"description":257,"extension":258,"meta":259,"navigation":278,"path":287,"seo":288,"stem":289,"__hash__":290},"content/dict/with-local-randomness.md","NetLogo Dictionary: with-local-randomness",{"type":7,"value":8,"toc":246},"minimark",[9],[10,11,16,35,61,64,67,157,166,179,182],"div",{"className":12,"id":14,"role":15},[13],"dict_entry","with-local-randomness","region",[17,18,20],"h3",{"id":19},"with-local-randomness40",[21,22,26,27],"a",{"href":23,"role":24,"ariaLabel":25},"#with-local-randomness","doc-noteref","Reference to with-local-randomness","\nwith-local-randomness\n",[28,29,34],"span",{"className":30,"role":32,"ariaLabel":33},[31],"since","note","Since version","\n4.0\n",[36,37,41],"h4",{"id":38,"className":39},"with-local-randomness-commands",[40],"section-heading",[21,42,46],{"className":43,"href":45},[44],"section-anchor","#with-local-randomness--commands",[28,47,50],{"className":48},[49],"prim_example",[51,52,53,54],"p",{},"with-local-randomness ",[28,55,56,57],{}," ",[58,59,60],"em",{},"commands",[51,62,63],{},"The commands are run without affecting subsequent random events.\nThis is useful for performing extra operations (such as output)\nwithout changing the outcome of a model.",[51,65,66],{},"Example:",[68,69,70],"pre",{},[71,72,73,79,82,56,87,56,92,56,97,56,101,105,106,110,111,113,117,119,56,122,56,125,128,130,105,133,56,137,56,142,110,146,148,56,151,105,154,110],"code",{},[28,74,78],{"className":75},[76,77],"token","comment",";; Run #1:",[80,81],"br",{},[28,83,86],{"className":84},[76,85],"command","random-seed",[28,88,91],{"className":89},[76,90],"number","50",[28,93,96],{"className":94},[76,95],"variable","setup",[28,98,100],{"className":99},[76,85],"repeat",[28,102,104],{"className":103},[76,90],"10"," [ ",[28,107,109],{"className":108},[76,95],"go"," ]",[80,112],{},[28,114,116],{"className":115},[76,77],";; Run #2:",[80,118],{},[28,120,86],{"className":121},[76,85],[28,123,91],{"className":124},[76,90],[28,126,96],{"className":127},[76,95],[80,129],{},[28,131,14],{"className":132},[76,85],[28,134,136],{"className":135},[76,85],"watch",[28,138,141],{"className":139},[76,140],"reporter","one-of",[28,143,145],{"className":144},[76,140],"turtles",[80,147],{},[28,149,100],{"className":150},[76,85],[28,152,104],{"className":153},[76,90],[28,155,109],{"className":156},[76,95],[51,158,159,160,162,163,165],{},"Since ",[71,161,141],{}," is used inside ",[71,164,14],{},", both runs will be identical.",[51,167,168,169,178],{},"Specifically how it works is, the state of the random number\ngenerator is remembered before the commands run, then restored\nafterwards. (If you want to run the commands with a fresh random\nstate instead of the same random state that will be restored later,\nyou can begin the commands with ",[71,170,171,56,174],{},[28,172,86],{"className":173},[76,85],[28,175,177],{"className":176},[76,140],"new-seed",".)",[51,180,181],{},"The following example demonstrates that the random number generator\nstate is the same both before the commands run and afterwards.",[68,183,184],{},[71,185,186,56,189,192,194,105,197,56,201,56,205,208,209,56,213,216,217,219,223,225,56,228,56,231,208,234,56,237,240,241,243],{},[28,187,86],{"className":188},[76,85],[28,190,104],{"className":191},[76,90],[80,193],{},[28,195,14],{"className":196},[76,85],[28,198,200],{"className":199},[76,85],"print",[28,202,204],{"className":203},[76,140],"n-values",[28,206,104],{"className":207},[76,90]," [",[28,210,212],{"className":211},[76,140],"random",[28,214,104],{"className":215},[76,90],"] ]",[80,218],{},[28,220,222],{"className":221},[76,77],";; prints [8 9 8 4 2 4 5 4 7 9]",[80,224],{},[28,226,200],{"className":227},[76,85],[28,229,204],{"className":230},[76,140],[28,232,104],{"className":233},[76,90],[28,235,212],{"className":236},[76,140],[28,238,104],{"className":239},[76,90],"]",[80,242],{},[28,244,222],{"className":245},[76,77],{"title":247,"searchDepth":248,"depth":249,"links":250},"",5,3,[251],{"id":19,"depth":249,"text":252,"children":253},"\nwith-local-randomness\n\n4.0\n",[254],{"id":38,"depth":255,"text":256},4,"with-local-randomness  commands","Documentation for the with-local-randomness primitive.","md",{"source":260,"metadataOutputPath":261,"projectConfig":262,"language":270,"inheritFrom":279,"output":278,"version":263,"layout":280,"dictionaryDisplayName":281,"dictionaryHomeDirectory":282,"indexFileURI":283,"currentItemId":14,"currentItemLabel":14,"primRoot":284,"icon":285,"assetsRoot":286},"autogen/dict/with-local-randomness.md","content/dict/with-local-randomness.metadata.yaml",{"version":263,"projectRoot":264,"scanRoot":265,"outputRoot":266,"defaults":267,"engine":273,"partials":274,"dedupeIdenticalDiskWrites":278},"7.0.4",".","autogen","content",{"inheritFrom":268,"language":270,"output":271,"extension":258,"title":272,"version":263},[269],0,"en",false,"NetLogo User Manual","handlebars",{"directoryPaths":275,"extensions":276},[264],[277,258],"mustache",true,[269],"catalog","NetLogo Dictionary","/dictionary.html","/_index/dict.txt","dict","i-lucide-square-code","/home/runner/work/Helio/Helio/apps/docs/autogen","/dict/with-local-randomness",{"title":5,"description":257},"dict/with-local-randomness","-XuQTzIsRFDLo7p0tRQFVnBiqNIX402TPr_ha2KRPko",[292,297],{"title":293,"path":294,"stem":295,"description":296},"NetLogo Dictionary: with","/dict/with","dict/with","Documentation for the with primitive.",{"title":298,"path":299,"stem":300,"description":301},"NetLogo Dictionary: with-max","/dict/with-max","dict/with-max","Documentation for the with-max primitive.",1777657848891]