Skip to content
Merged
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
14 changes: 13 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@ jobs:
with:
python-version: '3.9'

- name: Install R for sr extension
uses: r-lib/actions/setup-r@v2
with:
r-version: 'latest'

- name: Install spatstat package in R
uses: r-lib/actions/setup-r-dependencies@v2
with:
packages: |
any::spatstat
cache-version: 2

- uses: sbt/setup-sbt@v1

- name: Install Dependencies
Expand All @@ -39,7 +51,7 @@ jobs:
- name: Build
# We even install the extensions we can't or won't test just to avoid compile errors with them.
# -Jeremy B May 2021
run: sbt -v update compile test:compile "test:runMain org.nlogo.workspace.ExtensionInstaller arduino array bitmap csv gis gogo ls matrix nw palette profiler py r rnd sound table time vid view2.5d"
run: sbt -v update compile test:compile "test:runMain org.nlogo.workspace.ExtensionInstaller arduino array bitmap csv gis gogo ls matrix nw palette profiler py r resource rnd sr sound table time vid view2.5d"

- name: Test 2D
run: sbt -v -Dorg.nlogo.onLocal=false test
Expand Down
9 changes: 5 additions & 4 deletions 3D/Sample Models/Maze 3D.nlogox3d
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,11 @@ end
<button x="415" y="175" height="40" disableUntilTicks="false" forever="false" kind="Observer" width="172" display="Return to 2D View">reset-perspective</button>
<button x="415" y="129" height="40" disableUntilTicks="true" forever="false" kind="Observer" width="174" display="Solve the Maze in 3D">follow one-of turtles with [shape = "circle"]</button>
<slider x="114" step="1" y="260" max="5" width="172" display="how-far-forward?" height="50" min="1" direction="Horizontal" default="1.0" variable="how-far-forward?"></slider>
<button x="24" actionKey="A" y="332" height="40" disableUntilTicks="false" forever="false" kind="Observer" width="98" display="Turn Left">turn-left</button>
<button x="24" actionKey="A" y="332" height="40" disableUntilTicks="true" forever="false" kind="Observer" width="98" display="Turn Left">turn-left</button>
<slider x="115" step="1" y="403" max="5" width="171" display="how-far-backward?" height="50" min="1" direction="Horizontal" default="1.0" variable="how-far-backward?"></slider>
<button x="136" actionKey="W" y="312" height="40" disableUntilTicks="true" forever="false" kind="Observer" width="128" display="Move Forward">move-forward</button>
<button x="270" actionKey="D" y="332" height="40" disableUntilTicks="false" forever="false" kind="Observer" width="105" display="Turn Right">turn-right</button>
<button x="136" actionKey="S" y="359" height="40" disableUntilTicks="false" forever="false" kind="Observer" width="128" display="Move Backward">move-backward</button>
<button x="270" actionKey="D" y="332" height="40" disableUntilTicks="true" forever="false" kind="Observer" width="105" display="Turn Right">turn-right</button>
<button x="136" actionKey="S" y="359" height="40" disableUntilTicks="true" forever="false" kind="Observer" width="128" display="Move Backward">move-backward</button>
<note x="144" y="237" backgroundDark="0" fontSize="14" width="104" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Move the Ball!</note>
</widgets>
<info><![CDATA[## WHAT IS IT?
Expand Down Expand Up @@ -935,5 +935,6 @@ To inquire about commercial licenses for either NetLogo or specific models from
</indicator>
</shape>
</linkShapes>
<previewCommands>need-to-manually-make-preview-for-this-model</previewCommands>
<previewCommands>setup
move-forward</previewCommands>
</model>
Binary file added 3D/Sample Models/Maze 3D.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions Code Examples/Extensions Examples/sr/Example 1.nlogox
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ to test-consistent
print-values
end


; Public Domain:
; To the extent possible under law, Uri Wilensky has waived all
; copyright and related or neighboring rights to this model.</code>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ end
; Copyright 2025 Uri Wilensky.
; See Info tab for full copyright and license.]]></code>
<widgets>
<view x="305" wrappingAllowedX="false" y="235" frameRate="30.0" minPycor="-200" height="2412" showTickCounter="true" patchSize="12.0" fontSize="10" wrappingAllowedY="true" width="492" tickCounterLabel="ticks" maxPycor="0" updateMode="1" maxPxcor="40" minPxcor="0"></view>
<view x="305" wrappingAllowedX="false" y="235" frameRate="30.0" minPycor="-200" height="2416" showTickCounter="true" patchSize="12.0" fontSize="10" wrappingAllowedY="true" width="496" tickCounterLabel="ticks" maxPycor="0" updateMode="1" maxPxcor="40" minPxcor="0"></view>
<slider x="10" step=".01" y="5" max="1" width="225" display="initial-bulk-concentration" height="50" min="0" direction="Horizontal" default="0.8" variable="initial-bulk-concentration"></slider>
<slider x="10" step="1" y="60" max="world-width - 1" width="225" display="initial-columns-populated" height="50" min="0" direction="Horizontal" default="10.0" variable="initial-columns-populated"></slider>
<button x="10" y="240" height="59" disableUntilTicks="true" forever="true" kind="Observer" width="107">go</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ end
; Copyright 2025 Uri Wilensky.
; See Info tab for full copyright and license.</code>
<widgets>
<view x="295" wrappingAllowedX="false" y="10" frameRate="30.0" minPycor="-16" height="429" showTickCounter="true" patchSize="13.0" fontSize="10" wrappingAllowedY="false" width="429" tickCounterLabel="ticks" maxPycor="16" updateMode="1" maxPxcor="16" minPxcor="-16"></view>
<view x="295" wrappingAllowedX="false" y="10" frameRate="30.0" minPycor="-16" height="433" showTickCounter="true" patchSize="13.0" fontSize="10" wrappingAllowedY="false" width="433" tickCounterLabel="ticks" maxPycor="16" updateMode="1" maxPxcor="16" minPxcor="-16"></view>
<slider x="10" step="100" y="10" max="10000" width="250" display="num-grains" height="55" min="100" direction="Horizontal" default="10000.0" variable="num-grains"></slider>
<slider x="10" step="1" y="75" max="8" width="250" display="num-nodes" height="55" min="1" direction="Horizontal" default="5.0" variable="num-nodes"></slider>
<button x="55" y="140" height="45" disableUntilTicks="false" forever="false" kind="Observer" width="75">setup</button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,10 @@ end
; Copyright 2025 Uri Wilensky.
; See Info tab for full copyright and license.]]></code>
<widgets>
<view x="285" wrappingAllowedX="true" y="10" frameRate="30.0" minPycor="-100" height="402" showTickCounter="true" patchSize="2.0" fontSize="10" wrappingAllowedY="true" width="402" tickCounterLabel="ticks" maxPycor="100" updateMode="1" maxPxcor="100" minPxcor="-100"></view>
<note x="15" y="5" backgroundDark="0" fontSize="9" width="190" markdown="false" height="25" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Choose preset parameter configurations.
<view x="285" wrappingAllowedX="true" y="10" frameRate="30.0" minPycor="-100" height="406" showTickCounter="true" patchSize="2.0" fontSize="10" wrappingAllowedY="true" width="406" tickCounterLabel="ticks" maxPycor="100" updateMode="1" maxPxcor="100" minPxcor="-100"></view>
<note x="15" y="5" backgroundDark="0" fontSize="9" width="250" markdown="false" height="35" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Choose preset parameter configurations.
Select "none" to vary parameter sliders.</note>
<chooser x="15" y="35" height="60" variable="preset-parameters" current="0" width="250" display="preset-parameters">
<chooser x="15" y="40" height="60" variable="preset-parameters" current="0" width="250" display="preset-parameters">
<choice type="string" value="none"></choice>
<choice type="string" value="133"></choice>
<choice type="string" value="3-color bootstrap"></choice>
Expand All @@ -235,15 +235,15 @@ Select "none" to vary parameter sliders.</note>
<choice type="string" value="stripes"></choice>
<choice type="string" value="turbulent phase"></choice>
</chooser>
<button x="45" y="330" height="40" disableUntilTicks="false" forever="false" kind="Observer" width="80">setup</button>
<button x="140" y="330" height="40" disableUntilTicks="true" forever="true" kind="Observer" width="80">go</button>
<slider x="15" step="1" y="275" max="num-neighbors-with-these-settings" width="250" display="threshold" height="50" min="1" direction="Horizontal" default="3.0" variable="threshold"></slider>
<slider x="15" step="1" y="220" max="14" width="250" display="num-states" height="50" min="2" direction="Horizontal" default="3.0" variable="num-states"></slider>
<slider x="15" step="1" y="165" max="6" width="250" display="radius" height="50" min="1" direction="Horizontal" default="3.0" variable="radius"></slider>
<chooser x="15" y="100" height="60" variable="neighborhood" current="1" width="250" display="neighborhood">
<chooser x="15" y="105" height="60" variable="neighborhood" current="1" width="250" display="neighborhood">
<choice type="string" value="von Neumann"></choice>
<choice type="string" value="Moore"></choice>
</chooser>
<slider x="15" step="1" y="170" max="6" width="250" display="radius" height="50" min="1" direction="Horizontal" default="3.0" variable="radius"></slider>
<slider x="15" step="1" y="225" max="14" width="250" display="num-states" height="50" min="2" direction="Horizontal" default="3.0" variable="num-states"></slider>
<slider x="15" step="1" y="280" max="num-neighbors-with-these-settings" width="250" display="threshold" height="50" min="1" direction="Horizontal" default="3.0" variable="threshold"></slider>
<button x="140" y="335" height="40" disableUntilTicks="true" forever="true" kind="Observer" width="80">go</button>
<button x="45" y="335" height="40" disableUntilTicks="false" forever="false" kind="Observer" width="80">setup</button>
</widgets>
<info><![CDATA[## WHAT IS IT?

Expand Down
4 changes: 2 additions & 2 deletions Sample Models/Social Science/Hockey.nlogox
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ end
; Copyright 2025 Uri Wilensky.
; See Info tab for full copyright and license.]]></code>
<widgets>
<view x="610" wrappingAllowedX="false" y="85" frameRate="30.0" minPycor="-9" height="247" showTickCounter="true" patchSize="13.0" fontSize="10" wrappingAllowedY="false" width="559" tickCounterLabel="ticks" maxPycor="9" updateMode="1" maxPxcor="21" minPxcor="-21"></view>
<view x="610" wrappingAllowedX="false" y="85" frameRate="30.0" minPycor="-9" height="251" showTickCounter="true" patchSize="13.0" fontSize="10" wrappingAllowedY="false" width="563" tickCounterLabel="ticks" maxPycor="9" updateMode="1" maxPxcor="21" minPxcor="-21"></view>
<note x="65" y="10" backgroundDark="0" fontSize="12" width="150" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Home team settings</note>
<chooser x="310" y="540" height="60" variable="away-defense-type" current="0" width="285" display="away-defense-type">
<choice type="string" value="man-to-man"></choice>
Expand Down Expand Up @@ -960,7 +960,6 @@ end
<note x="360" y="10" backgroundDark="0" fontSize="12" width="150" markdown="false" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Away team settings</note>
<button x="710" y="15" height="50" disableUntilTicks="true" forever="true" kind="Observer" width="85">go</button>
<button x="610" y="15" height="50" disableUntilTicks="false" forever="false" kind="Observer" width="85">setup</button>
<note x="800" y="15" backgroundDark="0" fontSize="12" width="135" markdown="true" height="56" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">This model runs fast. Slow down the speed slider to see it better. </note>
<switch x="945" y="15" height="40" on="true" variable="wait-between-goals?" width="155" display="wait-between-goals?"></switch>
<note x="945" y="55" backgroundDark="0" fontSize="12" width="200" markdown="true" height="18" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">Turn off for BehaviorSpace runs</note>
<monitor x="670" precision="17" y="345" height="60" fontSize="11" width="100">home-goals</monitor>
Expand All @@ -971,6 +970,7 @@ end
<monitor x="900" precision="17" y="415" height="60" fontSize="11" width="100">away-sog</monitor>
<monitor x="1010" precision="3" y="415" height="60" fontSize="11" width="100">away-xg</monitor>
<monitor x="1010" precision="3" y="345" height="60" fontSize="11" width="100">home-xg</monitor>
<note x="800" y="0" backgroundDark="0" fontSize="12" width="135" markdown="true" height="75" textColorDark="-1" textColorLight="-16777216" backgroundLight="0">This model runs fast. Slow down the speed slider to see it better. </note>
</widgets>
<info><![CDATA[## WHAT IS IT?

Expand Down
3 changes: 2 additions & 1 deletion src/test/scala/org/nlogo/models/InfoTabsTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ class InfoTabsTests extends TestModels {
}

val codeTestsExceptions = Set(
"Example HubNet" // because the code block in it uses procedure names that don't exist
"Example HubNet", // because the code block in it uses procedure names that don't exist
"Boxplot Example" // sr extension example that includes R code
)
testModels("Code blocks should only include NetLogo code") { model =>
val parser = {
Expand Down
1 change: 1 addition & 0 deletions src/test/scala/org/nlogo/models/ViewTests.scala
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class ViewTests extends TestModels {
.filterNot(_.view.frameRate == 30)
}


testModels("Saved view size must match size computed from the saved patch size and screen-edge-x/y") {
// finds models whose graphics windows' saved sizes don't match the size you should get if you
// compute from the saved patch size and screen-edge-x/y
Expand Down