0

I am trying to ask turtles to move along the path that I set please see pic below: enter image description here

I want people walking alone the pink path one by one (like in a queue). here's my piece of code:

    ;;set paths where people walk in a queue
  ask patches with [ pycor = -12 and pxcor >= 3 and pxcor <= 45 and pzcor = 0]
  [ set path 1
    set pcolor pink
  ]
  ask patches with [ pycor = -12 and pxcor >= -45 and pxcor <= -3 and pzcor = 0]
  [ set path 1
    set pcolor pink
  ]
  ask patches with [ pycor <= 12 and pycor >= -12 and pxcor = -45 and pzcor = 0]
  [ set path 1
    set pcolor pink
  ]

to go
  ask turtles [
    queue
  ]
  tick
end
to queue
  face one-of patches with [path = 1]
  ifelse [path] of patch-ahead 1 = 1
         [set heading heading - 180 fd 1] 
         [fd 1]
end

But this code won't give me the result as people only walking along the pink path one by one. Could anyone help me with this please? Thanks in advance!

desertnaut
  • 57,590
  • 26
  • 140
  • 166
DJJKZ
  • 175
  • 12
  • What have you tried? How did what you try not work like you wanted? Why do you think it isn't working? Posting some code might help. – Jasper May 13 '20 at 18:09
  • 1
    @Jasper Thanks for your reply. I have attached my piece of code. Hope this will help explain my question. Sorry I am quite new to Netlogo. I just want to get some ideas if Netlogo can make turtles to walk along the path one by one? Any ideas will be really appreaciated. Thanks! – DJJKZ May 13 '20 at 18:23

0 Answers0