Skip to content

Commit 0f5cb4b

Browse files
committed
update ProbLab models to NL7 GUI
1 parent d2195be commit 0f5cb4b

16 files changed

Lines changed: 350 additions & 350 deletions

Sample Models/Mathematics/Probability/ProbLab/Dice Stalagmite.nlogox

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<model version="NetLogo 7.0.0-internal1" snapToGrid="false">
2+
<model version="NetLogo 7.0.0-internal1" snapToGrid="true">
33
<code><![CDATA[globals [
44
generators ;; agentset of two patches where the dice first appear
55
top-row ;; agentset of just the top row of patches
@@ -174,10 +174,8 @@ end
174174
; Copyright 2005 Uri Wilensky.
175175
; See Info tab for full copyright and license.]]></code>
176176
<widgets>
177-
<view x="177" maxPycor="51" updateMode="1" wrappingAllowedX="true" y="39" frameRate="30.0" minPycor="0" height="524" showTickCounter="true" patchSize="10.0" fontSize="10" wrappingAllowedY="true" width="374" tickCounterLabel="ticks" maxPxcor="26" minPxcor="-10"></view>
178-
<button x="11" y="10" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="79" display="Setup">setup</button>
179-
<button x="92" y="10" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="79" display="Go">go</button>
180-
<plot x="11" yMax="51.0" yAxis="Count" y="48" xMin="1.0" height="542" legend="false" xMax="7.0" autoplot="true" yMin="0.0" width="160" sizeVersion="0" xAxis="Die Value" display="Single Dice">
177+
<view x="213" maxPycor="51" updateMode="1" wrappingAllowedX="true" y="45" frameRate="30.0" minPycor="0" height="526" showTickCounter="true" patchSize="10.0" fontSize="10" wrappingAllowedY="true" width="374" tickCounterLabel="ticks" maxPxcor="26" minPxcor="-10"></view>
178+
<plot x="5" yMax="51.0" yAxis="Count" y="45" xMin="1.0" height="526" legend="false" xMax="7.0" autoplot="true" yMin="0.0" width="200" xAxis="Die Value" display="Single Dice">
181179
<setup></setup>
182180
<update></update>
183181
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
@@ -188,7 +186,7 @@ let maxrange length filter [ outcome -> outcome = item 0 maxbar ] single-outcome
188186
set-plot-y-range 0 max list 51 maxrange]]></update>
189187
</pen>
190188
</plot>
191-
<plot x="562" yMax="51.0" yAxis="Count" y="49" xMin="2.0" height="544" legend="false" xMax="13.0" autoplot="true" yMin="0.0" width="221" sizeVersion="0" xAxis="Dice Total" display="Pair Sums">
189+
<plot x="595" yMax="51.0" yAxis="Count" y="45" xMin="2.0" height="526" legend="false" xMax="13.0" autoplot="true" yMin="0.0" width="221" xAxis="Dice Total" display="Pair Sums">
192190
<setup></setup>
193191
<update></update>
194192
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
@@ -199,7 +197,9 @@ let maxrange length filter [ outcome -> outcome = item 0 maxbar ] pair-outcomes
199197
set-plot-y-range 0 max list 51 maxrange]]></update>
200198
</pen>
201199
</plot>
202-
<switch x="374" y="4" height="33" on="false" variable="stop-at-top?" width="124" sizeVersion="0" display="stop-at-top?"></switch>
200+
<button x="4" y="4" height="35" disableUntilTicks="false" forever="false" kind="Observer" width="100" display="Setup">setup</button>
201+
<button x="108" y="4" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="95" display="Go">go</button>
202+
<switch x="338" y="4" height="37" on="false" variable="stop-at-top?" width="124" display="stop-at-top?"></switch>
203203
</widgets>
204204
<info><![CDATA[## WHAT IS IT?
205205

Sample Models/Mathematics/Probability/ProbLab/Dice.nlogox

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -173,19 +173,28 @@ end
173173
; Copyright 2004 Uri Wilensky.
174174
; See Info tab for full copyright and license.]]></code>
175175
<widgets>
176-
<view x="430" maxPycor="18" updateMode="1" wrappingAllowedX="false" y="65" frameRate="30.0" minPycor="-18" height="411" showTickCounter="true" patchSize="11.0" fontSize="12" wrappingAllowedY="false" width="367" tickCounterLabel="ticks" maxPxcor="16" minPxcor="-16"></view>
177-
<monitor x="82" precision="3" y="196" height="45" fontSize="11" width="82" sizeVersion="0" display="+ # Rolls">count-steps</monitor>
178-
<monitor x="230" precision="3" y="195" height="45" fontSize="11" width="92" sizeVersion="0" display="Combinations">count-combi-successes</monitor>
179-
<switch x="275" y="75" height="33" on="false" variable="single-success?" width="145" sizeVersion="0" display="single-success?"></switch>
180-
<monitor x="9" precision="0" y="196" height="45" fontSize="11" width="70" sizeVersion="0" display="#Samples">samples-counter</monitor>
181-
<monitor x="325" precision="3" y="195" height="45" fontSize="11" width="93" sizeVersion="0" display="Permutations">count-permis-successes</monitor>
182-
<note x="232" y="177" height="18" textColorLight="-16777216" fontSize="11" width="175">Successes in this sample:</note>
183-
<button x="7" y="61" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="110" display="Setup">setup</button>
184-
<button x="7" y="96" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Pick Values">pick-values</button>
185-
<button x="7" y="131" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Roll Dice">search</button>
186-
<monitor x="7" precision="0" y="10" height="45" fontSize="11" width="795" sizeVersion="0" display="Instructions">instructions</monitor>
187-
<monitor x="10" precision="2" y="440" height="45" fontSize="11" width="115" sizeVersion="0" display="Mean-Combination">mean #combi-successes-per-sample-list</monitor>
188-
<plot x="9" yMax="50.0" yAxis="count" y="246" xMin="0.0" height="185" legend="true" xMax="16.0" autoplot="true" yMin="0.0" width="410" sizeVersion="0" xAxis="successes per sample" display="Successes-per-Sample Distributions">
176+
<view x="500" maxPycor="18" updateMode="1" wrappingAllowedX="false" y="190" frameRate="30.0" minPycor="-18" height="374" showTickCounter="true" patchSize="10.0" fontSize="12" wrappingAllowedY="false" width="334" tickCounterLabel="ticks" maxPxcor="16" minPxcor="-16"></view>
177+
<button x="5" y="110" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Pick Values">pick-values</button>
178+
<button x="5" y="150" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Roll Dice">search</button>
179+
<slider x="120" step="10" y="130" height="55" min="0" direction="Horizontal" max="10000" default="5000.0" variable="total-samples" width="200" display="total-samples"></slider>
180+
<slider x="120" step="10" y="70" height="55" min="10" direction="Horizontal" max="1000" default="10.0" variable="sample-size" width="200" display="sample-size"></slider>
181+
<chooser x="325" y="130" height="55" variable="analysis-type" current="0" width="165" display="analysis-type">
182+
<choice type="string" value="Permutations"></choice>
183+
<choice type="string" value="Combination"></choice>
184+
<choice type="string" value="Both"></choice>
185+
</chooser>
186+
<switch x="325" y="70" height="55" on="true" variable="single-success?" width="165" display="single-success?"></switch>
187+
<monitor x="7" precision="0" y="10" height="55" fontSize="11" width="830" display="Instructions">instructions</monitor>
188+
<monitor x="500" precision="0" y="70" height="55" fontSize="11" width="100" display="#Samples">samples-counter</monitor>
189+
<monitor x="500" precision="3" y="130" height="55" fontSize="11" width="100" display="+ # Rolls">count-steps</monitor>
190+
<monitor x="730" precision="3" y="130" height="55" fontSize="11" width="105" display="Permutations">count-permis-successes</monitor>
191+
<button x="5" y="70" height="35" disableUntilTicks="false" forever="false" kind="Observer" width="110" display="Setup">setup</button>
192+
<button x="610" y="360" height="35" disableUntilTicks="true" forever="false" kind="Observer" width="111" display="Hide/Reveal">ask user-dice [ set hidden? (not hidden?) ]</button>
193+
<monitor x="730" precision="3" y="70" height="55" fontSize="11" width="105" display="Combinations">count-combi-successes</monitor>
194+
<monitor x="5" precision="2" y="510" height="55" fontSize="11" width="135" display="Mean-Combination">mean #combi-successes-per-sample-list</monitor>
195+
<monitor x="145" precision="2" y="510" height="55" fontSize="11" width="145" display="Mean-Permutations">mean #permis-successes-per-sample-list</monitor>
196+
<monitor x="295" precision="2" y="510" height="55" fontSize="11" width="195" display="Combinations : Permutations">ratio</monitor>
197+
<plot x="5" yMax="50.0" yAxis="count" y="190" xMin="0.0" height="315" legend="true" xMax="16.0" autoplot="true" yMin="0.0" width="485" xAxis="successes per sample" display="Successes-per-Sample Distributions">
189198
<setup></setup>
190199
<update><![CDATA[if ticks > 0 [
191200
ifelse analysis-type = "Both"
@@ -225,17 +234,8 @@ ifelse analysis-type = "Both"
225234
]</update>
226235
</pen>
227236
</plot>
228-
<monitor x="125" precision="2" y="440" height="45" fontSize="11" width="122" sizeVersion="0" display="Mean-Permutations">mean #permis-successes-per-sample-list</monitor>
229-
<monitor x="245" precision="2" y="440" height="45" fontSize="11" width="175" sizeVersion="0" display="Combinations : Permutations">ratio</monitor>
230-
<slider x="125" step="10" y="85" height="33" min="10" direction="Horizontal" max="1000" default="10.0" variable="sample-size" width="143" sizeVersion="0" display="sample-size"></slider>
231-
<slider x="125" step="10" y="120" height="33" min="0" direction="Horizontal" max="10000" default="5000.0" variable="total-samples" width="143" sizeVersion="0" display="total-samples"></slider>
232-
<chooser x="275" y="120" height="45" variable="analysis-type" current="0" width="145" sizeVersion="0" display="analysis-type">
233-
<choice type="string" value="Permutations"></choice>
234-
<choice type="string" value="Combination"></choice>
235-
<choice type="string" value="Both"></choice>
236-
</chooser>
237-
<switch x="325" y="395" height="33" on="true" variable="bars?" width="91" sizeVersion="0" display="bars?"></switch>
238-
<button x="565" y="275" height="34" disableUntilTicks="true" forever="false" kind="Observer" width="111" display="Hide/Reveal">ask user-dice [ set hidden? (not hidden?) ]</button>
237+
<switch x="400" y="465" height="40" on="true" variable="bars?" width="90" display="bars?"></switch>
238+
<note x="635" y="105" height="45" textColorDark="-1" backgroundDark="0" textColorLight="-16777216" backgroundLight="0" fontSize="14" width="110">Successes in the Sample:</note>
239239
</widgets>
240240
<info><![CDATA[## WHAT IS IT?
241241

Sample Models/Mathematics/Probability/ProbLab/Prob Graphs Basic.nlogox

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<?xml version="1.0" encoding="utf-8"?>
2-
<model version="NetLogo 7.0.0-internal1" snapToGrid="false">
2+
<model version="NetLogo 7.0.0-internal1" snapToGrid="true">
33
<code><![CDATA[globals [
44
event
55
total-attempts
@@ -100,56 +100,56 @@ end
100100
; Copyright 2004 Uri Wilensky.
101101
; See Info tab for full copyright and license.]]></code>
102102
<widgets>
103-
<view x="243" maxPycor="0" updateMode="1" wrappingAllowedX="true" y="10" frameRate="30.0" minPycor="0" height="11" showTickCounter="true" patchSize="7.0" fontSize="10" wrappingAllowedY="true" width="249" tickCounterLabel="ticks" maxPxcor="17" minPxcor="-17"></view>
104-
<button x="102" y="35" height="46" disableUntilTicks="true" forever="true" kind="Observer" width="79" display="Go">go</button>
105-
<button x="7" y="35" height="46" disableUntilTicks="false" forever="false" kind="Observer" width="79" display="Setup">setup</button>
106-
<plot x="204" yMax="1.0" yAxis="Successes per Attempts" y="35" xMin="0.0" height="183" legend="false" xMax="100.0" autoplot="true" yMin="0.0" width="342" sizeVersion="0" xAxis="Attempts" display="m/n convergence to limiting value">
103+
<view x="285" maxPycor="0" updateMode="1" wrappingAllowedX="true" y="7" frameRate="30.0" minPycor="0" height="11" showTickCounter="true" patchSize="7.0" fontSize="10" wrappingAllowedY="true" width="249" tickCounterLabel="ticks" maxPxcor="17" minPxcor="-17"></view>
104+
<note x="10" y="80" height="104" textColorDark="-1" backgroundDark="0" textColorLight="-16777216" backgroundLight="0" fontSize="11" width="139">The program will
105+
record and plot the
106+
random occurrence
107+
of the event "1"
108+
among other integers
109+
in the sample space
110+
of size...</note>
111+
<monitor x="140" precision="3" y="100" height="55" fontSize="11" width="100">event</monitor>
112+
<button x="5" y="7" height="46" disableUntilTicks="false" forever="false" kind="Observer" width="100" display="Setup">setup</button>
113+
<button x="109" y="7" height="46" disableUntilTicks="true" forever="true" kind="Observer" width="130" display="Go">go</button>
114+
<slider x="5" step="1" y="190" height="55" min="1" direction="Horizontal" max="10" default="2.0" variable="sample-space-size" width="235" display="sample-space-size"></slider>
115+
<monitor x="479" precision="3" y="661" height="55" fontSize="11" width="105" display="max">max successes-per-sample-list</monitor>
116+
<monitor x="364" precision="3" y="661" height="55" fontSize="11" width="110" display="mean">mean successes-per-sample-list</monitor>
117+
<plot x="244" yMax="25.0" yAxis="Frequency" y="456" xMin="0.0" height="200" legend="false" xMax="10.0" autoplot="true" yMin="0.0" width="342" xAxis="Successes" display="Successes-per-Sample Distribution">
107118
<setup></setup>
108119
<update></update>
109-
<pen color="-16777216" legend="true" interval="1.0" mode="0" display="default">
120+
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
110121
<setup></setup>
111122
<update></update>
112123
</pen>
113124
</plot>
114-
<plot x="204" yMax="10.0" yAxis="Frequency" y="219" xMin="1.0" height="160" legend="false" xMax="50.0" autoplot="true" yMin="0.0" width="342" sizeVersion="0" xAxis="Run Length" display="Attempts-until-Success Distribution">
125+
<monitor x="589" precision="3" y="326" height="55" fontSize="11" width="149" display="mean">mean counter-list</monitor>
126+
<monitor x="589" precision="3" y="266" height="55" fontSize="11" width="149">counter</monitor>
127+
<monitor x="589" precision="3" y="456" height="55" fontSize="11" width="147">successes-this-sample</monitor>
128+
<plot x="244" yMax="10.0" yAxis="Frequency" y="266" xMin="1.0" height="185" legend="false" xMax="50.0" autoplot="true" yMin="0.0" width="342" xAxis="Run Length" display="Attempts-until-Success Distribution">
115129
<setup></setup>
116130
<update></update>
117131
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
118132
<setup></setup>
119133
<update></update>
120134
</pen>
121135
</plot>
122-
<slider x="9" step="1" y="203" height="33" min="1" direction="Horizontal" max="10" default="2.0" variable="sample-space-size" width="175" sizeVersion="0" display="sample-space-size"></slider>
123-
<plot x="204" yMax="25.0" yAxis="Frequency" y="378" xMin="0.0" height="161" legend="false" xMax="10.0" autoplot="true" yMin="0.0" width="342" sizeVersion="0" xAxis="Successes" display="Successes-per-Sample Distribution">
136+
<plot x="244" yMax="1.0" yAxis="Successes per Att" y="21" xMin="0.0" height="240" legend="false" xMax="100.0" autoplot="true" yMin="0.0" width="342" xAxis="Attempts" display="m/n convergence to limiting value">
124137
<setup></setup>
125138
<update></update>
126-
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
139+
<pen color="-16777216" legend="true" interval="1.0" mode="0" display="default">
127140
<setup></setup>
128141
<update></update>
129142
</pen>
130143
</plot>
131-
<slider x="12" step="5" y="461" height="33" min="0" direction="Horizontal" max="100" default="10.0" variable="sample-size" width="172" sizeVersion="0" display="sample-size"></slider>
132-
<slider x="10" step="10" y="375" height="33" min="0" direction="Horizontal" max="1000" default="1000.0" variable="how-many-samples?" width="174" sizeVersion="0" display="how-many-samples?"></slider>
133-
<monitor x="550" precision="3" y="112" height="45" fontSize="11" width="99" sizeVersion="0">total-attempts</monitor>
134-
<monitor x="705" precision="3" y="70" height="45" fontSize="11" width="57" sizeVersion="0" display="rate">total-successes / total-attempts</monitor>
135-
<monitor x="550" precision="0" y="35" height="45" fontSize="11" width="99" sizeVersion="0" display="total-successes">total-successes</monitor>
136-
<note x="551" y="89" height="18" textColorLight="-16777216" fontSize="11" width="143">________________ =</note>
137-
<monitor x="549" precision="3" y="379" height="45" fontSize="11" width="147" sizeVersion="0">successes-this-sample</monitor>
138-
<monitor x="12" precision="3" y="495" height="45" fontSize="11" width="172" sizeVersion="0">attempts-this-sample</monitor>
139-
<monitor x="549" precision="3" y="219" height="45" fontSize="11" width="57" sizeVersion="0">counter</monitor>
140-
<monitor x="11" precision="3" y="409" height="45" fontSize="11" width="173" sizeVersion="0">samples-counter</monitor>
141-
<monitor x="445" precision="3" y="540" height="45" fontSize="11" width="101" sizeVersion="0" display="max">max successes-per-sample-list</monitor>
142-
<monitor x="204" precision="3" y="540" height="45" fontSize="11" width="104" sizeVersion="0" display="min">min successes-per-sample-list</monitor>
143-
<monitor x="325" precision="3" y="540" height="45" fontSize="11" width="104" sizeVersion="0" display="mean">mean successes-per-sample-list</monitor>
144-
<note x="9" y="87" height="104" textColorLight="-16777216" fontSize="11" width="139">The program will
145-
record and plot the
146-
random occurrence
147-
of the event "1"
148-
among other integers
149-
in the sample space
150-
of size...</note>
151-
<monitor x="549" precision="3" y="270" height="45" fontSize="11" width="57" sizeVersion="0" display="mean">mean counter-list</monitor>
152-
<monitor x="142" precision="3" y="93" height="45" fontSize="11" width="50" sizeVersion="0">event</monitor>
144+
<monitor x="245" precision="3" y="660" height="55" fontSize="11" width="115" display="min">min successes-per-sample-list</monitor>
145+
<monitor x="5" precision="3" y="635" height="55" fontSize="11" width="235">attempts-this-sample</monitor>
146+
<slider x="5" step="5" y="575" height="55" min="0" direction="Horizontal" max="100" default="10.0" variable="sample-size" width="235" display="sample-size"></slider>
147+
<slider x="5" step="10" y="455" height="55" min="0" direction="Horizontal" max="1000" default="1000.0" variable="how-many-samples?" width="235" display="how-many-samples?"></slider>
148+
<monitor x="5" precision="3" y="515" height="55" fontSize="11" width="235">samples-counter</monitor>
149+
<monitor x="590" precision="0" y="20" height="55" fontSize="11" width="149" display="total-successes">total-successes</monitor>
150+
<note x="591" y="84" height="18" textColorDark="-1" backgroundDark="0" textColorLight="-16777216" backgroundLight="0" fontSize="11" width="143">________________ =</note>
151+
<monitor x="590" precision="3" y="107" height="55" fontSize="11" width="149">total-attempts</monitor>
152+
<monitor x="745" precision="3" y="60" height="55" fontSize="11" width="100" display="rate">total-successes / total-attempts</monitor>
153153
</widgets>
154154
<info><![CDATA[## WHAT IS IT?
155155

0 commit comments

Comments
 (0)