Skip to content

Commit 02923fd

Browse files
committed
Add model dir to python path for local libs
Alsa tweak demos
1 parent 813c9c7 commit 02923fd

5 files changed

Lines changed: 15 additions & 1144 deletions

demos/Flocking Clusters.nlogo

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ to go
3535
let clusters py:runresult "cl.dbscan(np.array(coords), eps)"
3636
(foreach (sort turtles) (item 1 clusters) [ [t c] ->
3737
ask t [
38-
set color item ((c mod 13) + 1) base-colors
38+
ifelse c = -1 [
39+
set color grey
40+
][
41+
set color item ((c mod 13) + 1) base-colors
42+
]
3943
]
4044
])
4145
tick

demos/Traffic Basic - Reinforcement.nlogo

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,8 @@ to train
163163
end
164164

165165
to-report next-car
166+
let here min-one-of turtles-here with [ xcor > [ xcor ] of myself ] [ distance myself ]
167+
if here != nobody [ report here ]
166168
let i 1
167169
while [ not any? turtles-on patch-ahead i ] [
168170
set i i + 1
@@ -374,7 +376,7 @@ NIL
374376
20.0
375377
true
376378
false
377-
"" ""
379+
"set-plot-y-range 0 number-of-cars" ""
378380
PENS
379381
"default" 1.0 0 -2674135 true "" "plot count turtles with [ action = 0 ]"
380382
"pen-1" 1.0 0 -1184463 true "" "plot count turtles with [ action = 1 ]"
@@ -414,7 +416,7 @@ SLIDER
414416
memory-size
415417
memory-size
416418
0
417-
100000
419+
1000000
418420
10000.0
419421
1000
420422
1

demos/Wolf Sheep Predation - Real-time 3D Plot.nlogo

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ end
108108

109109
to update-pyplot
110110
every 0.25 [
111-
if pyplot-dirty? [ redraw-pyplot ]
111+
every 1 [
112+
if pyplot-dirty? [ redraw-pyplot ]
113+
]
112114
py:run "plt.pause(0.01)"
113115
]
114116
end

0 commit comments

Comments
 (0)