title: Scheduling random subset of agents to run task in NetLogo
body: <p>I have been developing a procedure for 'human' agents to move south into a
  forest from hours 0600 to 1200 and then leaving the forest from 1200 to 1800. 
  Currently all of the human agents start walking in at 0600. This creates a wave
  effect, but instead I'd like a continuous stream of humans. One option I
  thought of was to have a random subset of them begin moving at 0600, another
  subset begin at 0700, etc, until 1200 when all of them turn around and go back
  out. Alternatively, it may be nice to generate a new set of 'humans' at each of
  the morning times (i.e., 0600,0700,0800,0900,1000,1100) to move in, instead of
  selecting a random subset. I've been stuck on this for awhile and any help
  would be much appreciated. I have the code below.
  --Neil</p>
  
  <pre><code>to setup
  ca
  clear-all-plots
  clear-output
  set typeAgro 1 ;this is Agricultural land outside forest
  set typeTrop 2 ;this is tropical forest
  ask patches
  [ set habitat typeAgro ]
  ask patches with [pycor &lt;= 300] ;all patches south of y-coord 300 is tropical
  forest
  [ set habitat typeTrop]
  create-humans number-humans ;on a slider from 100 to 200
  [ setxy random-xcor 310 ; start humans in agricultural land just north of
  tropical forest
  if any? turtles-on patch-here
  [ setxy random-xcor 310 ]
  set morning 6
  set midday 12
  set afternoon 18
  set midnight 24
  set step-size 50
  set color white
  set size 10
  set shape "person" ]
  reset-ticks
  end
  
  to go
  tick
  ask humans [move-humans] ; humans moving into the forest
  end
  
  to move-humans
  let hour ticks mod midnight ; sets the ticks on 24 hour day
  
  if morning &lt;= hour and hour &lt; midday [ ; from 0600 to 1200 people move into
  forest
  set heading (random-normal 180 30)
  fd random-normal step-size 4
  ]
  if midday &lt;= hour and ycor &lt; 310 [ ; from 1200 to 1800 people move out of the
  forest
  set heading (random-normal 360 30)
  fd random-normal step-size 1
  ]
  end
  </code></pre>