Search code examples
netlogo

Net Logo tutorial #3 -- can't see turtles, only patches


I'm going through Tutorial #3 on the NetLogo user manual and for some reason when I assign the patches to be green and write the setup-patches and setup-turtles functions, all I can see are green patches and no turtles. When I remove the setup-patches function, I can see the turtles so I know they've been created. I've tried shifting the order of the code around but nothing's worked so far. Here's the code I have, if anyone has any ideas I'm all ears.

to setup
  clear-all
  setup-patches
  setup-turtles
  reset-ticks
end

to setup-patches
  ask patches [ set pcolor green ]
end

to setup-turtles
  create-turtles 100
  ask turtles [ setxy random-xcor random-ycor ]
end

to go
  move-turtles
  tick
end

to move-turtles
  ask turtles [
    right random 360
    forward 1
  ]
end

Solution

  • Is there any chance you are using NetLogo 3D instead of just NetLogo? That is the only way I can reproduce your problem. (It's a common beginner mistake.)

    (If you open NetLogo by clicking on a desktop icon, make sure it points to NetLogo.exe, not NetLogo 3D.exe)

    Steve R.