Welcome to the CSC Q&A, on our server named in honor of Ada Lovelace. Write great code! Get help and give help!
It is our choices... that show what we truly are, far more than our abilities.

Categories

+13 votes
asked in CSC 150 January201920 by (1 point)

2 Answers

+6 votes

Suppose you have a particles breed, and a separate stopped-particles breed. You could do something like this:

ask particles [
   if zcor < -14 or any? stopped-particles in-radius 1 [
       set breed stopped-particles
   ]
]

That way, once a turtle reaches the ground, OR gets too close to another particles that's already stopped, then it will change to being stopped.

(If you're doing it in NetLogo 2D, use ycor instead of zcor)

answered by (3.5k points)
+4

This was really good inspiration for part of my project, thank you.

+3 votes

Iris and Trang did it in one of their projects recently, they would know!

answered by (1 point)
...