Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 7.0.0-internal1" snapToGrid="false">
<model version="NetLogo 7.0.0-internal1" snapToGrid="true">
<code><![CDATA[globals [
generators ;; agentset of two patches where the dice first appear
top-row ;; agentset of just the top row of patches
Expand Down Expand Up @@ -174,10 +174,8 @@ end
; Copyright 2005 Uri Wilensky.
; See Info tab for full copyright and license.]]></code>
<widgets>
<view x="177" maxPycor="51" updateMode="1" wrappingAllowedX="true" y="39" frameRate="30.0" minPycor="0" height="529" showTickCounter="true" patchSize="10.0" fontSize="10" wrappingAllowedY="true" width="378" tickCounterLabel="ticks" maxPxcor="26" minPxcor="-10"></view>
<button x="11" y="10" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="79" display="Setup">setup</button>
<button x="92" y="10" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="79" display="Go">go</button>
<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">
<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>
<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">
<setup></setup>
<update></update>
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
Expand All @@ -188,7 +186,7 @@ let maxrange length filter [ outcome -> outcome = item 0 maxbar ] single-outcome
set-plot-y-range 0 max list 51 maxrange]]></update>
</pen>
</plot>
<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">
<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">
<setup></setup>
<update></update>
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
Expand All @@ -199,7 +197,9 @@ let maxrange length filter [ outcome -> outcome = item 0 maxbar ] pair-outcomes
set-plot-y-range 0 max list 51 maxrange]]></update>
</pen>
</plot>
<switch x="374" y="4" height="33" on="false" variable="stop-at-top?" width="124" sizeVersion="0" display="stop-at-top?"></switch>
<button x="4" y="4" height="35" disableUntilTicks="false" forever="false" kind="Observer" width="100" display="Setup">setup</button>
<button x="108" y="4" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="95" display="Go">go</button>
<switch x="338" y="4" height="37" on="false" variable="stop-at-top?" width="124" display="stop-at-top?"></switch>
</widgets>
<info><![CDATA[## WHAT IS IT?

Expand Down
48 changes: 24 additions & 24 deletions Sample Models/Mathematics/Probability/ProbLab/Dice.nlogox
Original file line number Diff line number Diff line change
Expand Up @@ -173,19 +173,28 @@ end
; Copyright 2004 Uri Wilensky.
; See Info tab for full copyright and license.]]></code>
<widgets>
<view x="430" maxPycor="18" updateMode="1" wrappingAllowedX="false" y="65" frameRate="30.0" minPycor="-18" height="416" showTickCounter="true" patchSize="11.0" fontSize="12" wrappingAllowedY="false" width="371" tickCounterLabel="ticks" maxPxcor="16" minPxcor="-16"></view>
<monitor x="82" precision="3" y="196" height="45" fontSize="11" width="82" sizeVersion="0" display="+ # Rolls">count-steps</monitor>
<monitor x="230" precision="3" y="195" height="45" fontSize="11" width="92" sizeVersion="0" display="Combinations">count-combi-successes</monitor>
<switch x="275" y="75" height="33" on="false" variable="single-success?" width="145" sizeVersion="0" display="single-success?"></switch>
<monitor x="9" precision="0" y="196" height="45" fontSize="11" width="70" sizeVersion="0" display="#Samples">samples-counter</monitor>
<monitor x="325" precision="3" y="195" height="45" fontSize="11" width="93" sizeVersion="0" display="Permutations">count-permis-successes</monitor>
<note x="232" y="177" height="18" textColorLight="-16777216" fontSize="11" width="175">Successes in this sample:</note>
<button x="7" y="61" height="33" disableUntilTicks="false" forever="false" kind="Observer" width="110" display="Setup">setup</button>
<button x="7" y="96" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Pick Values">pick-values</button>
<button x="7" y="131" height="33" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Roll Dice">search</button>
<monitor x="7" precision="0" y="10" height="45" fontSize="11" width="795" sizeVersion="0" display="Instructions">instructions</monitor>
<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>
<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">
<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>
<button x="5" y="110" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Pick Values">pick-values</button>
<button x="5" y="150" height="35" disableUntilTicks="true" forever="true" kind="Observer" width="110" display="Roll Dice">search</button>
<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>
<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>
<chooser x="325" y="130" height="55" variable="analysis-type" current="0" width="165" display="analysis-type">
<choice type="string" value="Permutations"></choice>
<choice type="string" value="Combination"></choice>
<choice type="string" value="Both"></choice>
</chooser>
<switch x="325" y="70" height="55" on="true" variable="single-success?" width="165" display="single-success?"></switch>
<monitor x="7" precision="0" y="10" height="55" fontSize="11" width="830" display="Instructions">instructions</monitor>
<monitor x="500" precision="0" y="70" height="55" fontSize="11" width="100" display="#Samples">samples-counter</monitor>
<monitor x="500" precision="3" y="130" height="55" fontSize="11" width="100" display="+ # Rolls">count-steps</monitor>
<monitor x="730" precision="3" y="130" height="55" fontSize="11" width="105" display="Permutations">count-permis-successes</monitor>
<button x="5" y="70" height="35" disableUntilTicks="false" forever="false" kind="Observer" width="110" display="Setup">setup</button>
<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>
<monitor x="730" precision="3" y="70" height="55" fontSize="11" width="105" display="Combinations">count-combi-successes</monitor>
<monitor x="5" precision="2" y="510" height="55" fontSize="11" width="135" display="Mean-Combination">mean #combi-successes-per-sample-list</monitor>
<monitor x="145" precision="2" y="510" height="55" fontSize="11" width="145" display="Mean-Permutations">mean #permis-successes-per-sample-list</monitor>
<monitor x="295" precision="2" y="510" height="55" fontSize="11" width="195" display="Combinations : Permutations">ratio</monitor>
<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">
<setup></setup>
<update><![CDATA[if ticks > 0 [
ifelse analysis-type = "Both"
Expand Down Expand Up @@ -225,17 +234,8 @@ ifelse analysis-type = "Both"
]</update>
</pen>
</plot>
<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>
<monitor x="245" precision="2" y="440" height="45" fontSize="11" width="175" sizeVersion="0" display="Combinations : Permutations">ratio</monitor>
<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>
<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>
<chooser x="275" y="120" height="45" variable="analysis-type" current="0" width="145" sizeVersion="0" display="analysis-type">
<choice type="string" value="Permutations"></choice>
<choice type="string" value="Combination"></choice>
<choice type="string" value="Both"></choice>
</chooser>
<switch x="325" y="395" height="33" on="true" variable="bars?" width="91" sizeVersion="0" display="bars?"></switch>
<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>
<switch x="400" y="465" height="40" on="true" variable="bars?" width="90" display="bars?"></switch>
<note x="635" y="105" height="45" textColorDark="-1" backgroundDark="0" textColorLight="-16777216" backgroundLight="0" fontSize="14" width="110">Successes in the Sample:</note>
</widgets>
<info><![CDATA[## WHAT IS IT?

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<model version="NetLogo 7.0.0-internal1" snapToGrid="false">
<model version="NetLogo 7.0.0-internal1" snapToGrid="true">
<code><![CDATA[globals [
event
total-attempts
Expand Down Expand Up @@ -100,56 +100,56 @@ end
; Copyright 2004 Uri Wilensky.
; See Info tab for full copyright and license.]]></code>
<widgets>
<view x="243" maxPycor="0" updateMode="1" wrappingAllowedX="true" y="10" frameRate="30.0" minPycor="0" height="16" showTickCounter="true" patchSize="7.0" fontSize="10" wrappingAllowedY="true" width="253" tickCounterLabel="ticks" maxPxcor="17" minPxcor="-17"></view>
<button x="102" y="35" height="46" disableUntilTicks="true" forever="true" kind="Observer" width="79" display="Go">go</button>
<button x="7" y="35" height="46" disableUntilTicks="false" forever="false" kind="Observer" width="79" display="Setup">setup</button>
<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">
<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>
<note x="10" y="80" height="104" textColorDark="-1" backgroundDark="0" textColorLight="-16777216" backgroundLight="0" fontSize="11" width="139">The program will
record and plot the
random occurrence
of the event "1"
among other integers
in the sample space
of size...</note>
<monitor x="140" precision="3" y="100" height="55" fontSize="11" width="100">event</monitor>
<button x="5" y="7" height="46" disableUntilTicks="false" forever="false" kind="Observer" width="100" display="Setup">setup</button>
<button x="109" y="7" height="46" disableUntilTicks="true" forever="true" kind="Observer" width="130" display="Go">go</button>
<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>
<monitor x="479" precision="3" y="661" height="55" fontSize="11" width="105" display="max">max successes-per-sample-list</monitor>
<monitor x="364" precision="3" y="661" height="55" fontSize="11" width="110" display="mean">mean successes-per-sample-list</monitor>
<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">
<setup></setup>
<update></update>
<pen color="-16777216" legend="true" interval="1.0" mode="0" display="default">
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
<setup></setup>
<update></update>
</pen>
</plot>
<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">
<monitor x="589" precision="3" y="326" height="55" fontSize="11" width="149" display="mean">mean counter-list</monitor>
<monitor x="589" precision="3" y="266" height="55" fontSize="11" width="149">counter</monitor>
<monitor x="589" precision="3" y="456" height="55" fontSize="11" width="147">successes-this-sample</monitor>
<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">
<setup></setup>
<update></update>
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
<setup></setup>
<update></update>
</pen>
</plot>
<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>
<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">
<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">
<setup></setup>
<update></update>
<pen color="-16777216" legend="true" interval="1.0" mode="1" display="default">
<pen color="-16777216" legend="true" interval="1.0" mode="0" display="default">
<setup></setup>
<update></update>
</pen>
</plot>
<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>
<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>
<monitor x="550" precision="3" y="112" height="45" fontSize="11" width="99" sizeVersion="0">total-attempts</monitor>
<monitor x="705" precision="3" y="70" height="45" fontSize="11" width="57" sizeVersion="0" display="rate">total-successes / total-attempts</monitor>
<monitor x="550" precision="0" y="35" height="45" fontSize="11" width="99" sizeVersion="0" display="total-successes">total-successes</monitor>
<note x="551" y="89" height="18" textColorLight="-16777216" fontSize="11" width="143">________________ =</note>
<monitor x="549" precision="3" y="379" height="45" fontSize="11" width="147" sizeVersion="0">successes-this-sample</monitor>
<monitor x="12" precision="3" y="495" height="45" fontSize="11" width="172" sizeVersion="0">attempts-this-sample</monitor>
<monitor x="549" precision="3" y="219" height="45" fontSize="11" width="57" sizeVersion="0">counter</monitor>
<monitor x="11" precision="3" y="409" height="45" fontSize="11" width="173" sizeVersion="0">samples-counter</monitor>
<monitor x="445" precision="3" y="540" height="45" fontSize="11" width="101" sizeVersion="0" display="max">max successes-per-sample-list</monitor>
<monitor x="204" precision="3" y="540" height="45" fontSize="11" width="104" sizeVersion="0" display="min">min successes-per-sample-list</monitor>
<monitor x="325" precision="3" y="540" height="45" fontSize="11" width="104" sizeVersion="0" display="mean">mean successes-per-sample-list</monitor>
<note x="9" y="87" height="104" textColorLight="-16777216" fontSize="11" width="139">The program will
record and plot the
random occurrence
of the event "1"
among other integers
in the sample space
of size...</note>
<monitor x="549" precision="3" y="270" height="45" fontSize="11" width="57" sizeVersion="0" display="mean">mean counter-list</monitor>
<monitor x="142" precision="3" y="93" height="45" fontSize="11" width="50" sizeVersion="0">event</monitor>
<monitor x="245" precision="3" y="660" height="55" fontSize="11" width="115" display="min">min successes-per-sample-list</monitor>
<monitor x="5" precision="3" y="635" height="55" fontSize="11" width="235">attempts-this-sample</monitor>
<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>
<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>
<monitor x="5" precision="3" y="515" height="55" fontSize="11" width="235">samples-counter</monitor>
<monitor x="590" precision="0" y="20" height="55" fontSize="11" width="149" display="total-successes">total-successes</monitor>
<note x="591" y="84" height="18" textColorDark="-1" backgroundDark="0" textColorLight="-16777216" backgroundLight="0" fontSize="11" width="143">________________ =</note>
<monitor x="590" precision="3" y="107" height="55" fontSize="11" width="149">total-attempts</monitor>
<monitor x="745" precision="3" y="60" height="55" fontSize="11" width="100" display="rate">total-successes / total-attempts</monitor>
</widgets>
<info><![CDATA[## WHAT IS IT?

Expand Down
Loading
Loading