title: Netlogo: How to stop a turtle for a certain ticks with a specific patch in the middle of world?
body: <p>I am a beginner. I already checked the programming guidance dictionary.
  I am considering a two-lane road (eg, road 1, road 2) model. 
  And also I am considering a model in which the turtle specified by the specified patch((10 0) and (20 2)) stops for 10 ticks.
  However, I do not know how to write and specify the specific parameter for xcor and ycor for each road (Eg xcor and ycor on road 1, xcor and ycor on road 2). 
  And also I do not know how to write and controol the parameter "speed" within the set-speed syntax.
  The following is the sample small model. To avoid complication, this sample model has only one road. This sample model is failing and the turtle does not stop at patch(10 0). 
  Probably I need your advice. Thank you.</p>
  
  <pre><code>globals [ count-tick ]
  turtles-own [ speed flag-A ]
  
  to setup
    clear-all
    resize-world 0 50 min-pycor max-pycor
    ask patches [ setup-road ]
    reset-ticks
  end
  
  to setup-road
    if ( pycor &lt; 1 ) and ( pycor &gt; -1 ) [ set pcolor white ]
  end
  
  to create-car
    crt 1 [
      set color blue
      setxy min-pxcor 0
      set heading 90
      set speed 1
    ]
  end
  </code></pre>
  
  <p>This is the main body of the model.</p>
  
  <pre><code>to go
  
    if (count turtles-on patch 0 0 = 0) [
      create-car
      ask (turtles-on patch 0 0) [
        set flag-A FALSE
      ]
    ]
  
    ask (turtles-on patch 10 0) [
      set flag-A TRUE
      set count-tick 10
    ]
  
    if count-tick &gt; 0 [
      set count-tick count-tick - 1
      ask (turtles-on patch 10 0) with [flag-A = TRUE]
      [
        set color red
        set speed 0
      ]
    ]
  
    if count-tick = 0 [
      ask (turtles-on patch 10 0) with [flag-A = TRUE]
        [
          set speed 1
          set flag-A FALSE
      ]
    ]
  
    if (count turtles-on patch max-pxcor 0 &gt; 0) [
      ask min-one-of turtles [who][
        die
      ]
    ]
  
    set-speed
    tick
  end
  </code></pre>
  
  <p>This is the parallel update to control the speed.</p>
  
  <pre><code>to set-speed
    ask turtles with [ xcor &lt; 10 ] [
      let turtle-ahead one-of turtles-on patch-ahead 1
      ifelse turtle-ahead = nobody
        [ set speed 1
          fd speed
      ]
      [ set speed 0
      ]
    ]
      ask turtles with [ 10 &lt; max-pxcor ] [
      let turtle-ahead one-of turtles-on patch-ahead 1
      ifelse turtle-ahead = nobody
        [ set speed 1
          fd speed
      ]
      [ set speed 0
      ]
    ]
  end
  </code></pre>