Efficiency of the model: Turn by turn irrigate with who numbers

59 Views Asked by At

I have written NetLogo code to make turtles change value turn by turn. Turtles are the farmers placed along a water stream. They will have differences in spatial water availability based on their who numbers and they will withdraw water as per their turn based on who number. Codes are doing fine. Every tick is taking more than usual time. I am seeing that the complete model will take even more time to run. Can these codes be changed to make the model efficiently run as per the set pattern given in the attached picture? Thanks for the help

enter image description here

Codes are given below

Breed [farmers farmer]
Farmers-own [water irrigation-turn]
to setup
  clear-all
  create-farmers 30 [ set irrigation-turn [0]

     ask farmer 0 [ setxy min-pxcor + 1 0]
     ask farmer 1 [ setxy min-pxcor + 1 2]
     ask farmer 20 [ setxy min-pxcor + 1 4]
     ask farmer 2 [ setxy min-pxcor + 3 0]
    ask farmer 3 [ setxy min-pxcor + 3 2]
    ask farmer 21 [ setxy min-pxcor + 3 4]
    ask farmer 4 [ setxy min-pxcor + 5 0]
    ask farmer 5 [ setxy min-pxcor + 5 2]
    ask farmer 22 [ setxy min-pxcor + 5 4]
    ask farmer 6 [ setxy min-pxcor + 7 0]
    ask farmer 7 [ setxy min-pxcor + 7 2]
    ask farmer 23 [ setxy min-pxcor + 7 4]
    ask farmer 8 [ setxy min-pxcor + 9 0]
    ask farmer 9 [ setxy min-pxcor + 9 2]
    ask farmer 24 [ setxy min-pxcor + 9 4]
    ask farmer 10 [ setxy min-pxcor + 11 0]
    ask farmer 11 [ setxy min-pxcor + 11 2]
    ask farmer 25 [ setxy min-pxcor + 11 4]
    ask farmer 12 [ setxy min-pxcor + 13 0]
    ask farmer 13 [ setxy min-pxcor + 13 2]
    ask farmer 26 [ setxy min-pxcor + 13 4]
    ask farmer 14 [ setxy min-pxcor + 15 0]
    ask farmer 15 [ setxy min-pxcor + 15 2]
    ask farmer 27 [ setxy min-pxcor + 15 4]
    ask farmer 16 [ setxy min-pxcor + 17 0]
    ask farmer 17 [ setxy min-pxcor + 17 2]
    ask farmer 28 [ setxy min-pxcor + 17 4]
    ask farmer 18 [ setxy min-pxcor + 19 0]
    ask farmer 19 [ setxy min-pxcor + 19 2]
    ask farmer 29 [ setxy min-pxcor + 19 4]
    ask farmers [ set label who
     set size 2]
    ]





  reset-ticks

end
to go
   define-irrigation-turn
  irrigate
 tick


end

to define-irrigation-turn ; 11 turtle ; 24 hours irrigation policy

 ask farmers [set irrigation-turn [0]
  ask farmer 0 [
      repeat 235 [
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
         ]]
ask farmer 1 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
       ]]
  ask farmer 2 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
  ask farmer 3 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
  ask farmer 4 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
       ]]

  ask farmer 5 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
       set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
   ask farmer 6 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
         ]]
   ask farmer 7 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
       ]]
   ask farmer 8 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
    ask farmer 9 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
     ask farmer 10 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
     ask farmer 11 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
     ask farmer 12 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]
    ; Turtles 13-16 will follow the same pattern
]
   ask farmer 17 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
       ]]
     ask farmer 18 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]

   ask farmer 19 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
     ask farmer 20 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]

   ask farmer 21 [
        repeat 235 [
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 1 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        set irrigation-turn lput 0 irrigation-turn
        ]]
  
    ; farmers from 26-29 will follow the same pattern as of 20 t0 21
  ]

end
to irrigate
  foreach [0 1 2 3 4 5 6 7 8 9 10 12 14 16 18  11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30]
  [ ?1 ->
      ask farmers with [who = ?1] [
        if (item ticks irrigation-turn) = 1
          [ set color red
           set shape "person"
            
  ]]]
end
2

There are 2 best solutions below

0
On BEST ANSWER

Your speed issue is because you are creating a long list using :

set irrigation-turn lput 1 irrigation-turn

You'll need to make sure the list isn't growing linear with respect to ticks

1
On

You have a fundamental misunderstanding about how time works in these models. The command tick instructs the model to advance the clock. That is embedded in a go procedure and that go procedure (presumably) runs each tick. What you need in the go procedure is what happens during ONE time step. Instead, at the moment, you are appending another five years of schedule.

If you need to have a schedule because you want each turtle to take a turn and then move on to the next turtle in the next tick, construct the schedule during the setup procedure, not the go procedure. You should probably also use the mod operator since it's a cycle, so you don't need five years of schedule, you can just have one cycle stored. You also don't need to use lput to append each item individually, just provide the whole list at once.

Something like this (note I have abandoned the schedule entirely and just use mod to cycle):

breed [farmers farmer]
farmers-own [water irrigation-turn]

to setup
  clear-all
  create-farmers 30
  [ set label who
    set size 2
  ]
  ask farmer 0 [ setxy min-pxcor + 1 0 set irrigation-turn 0]
  ask farmer 1 [ setxy min-pxcor + 1 2 set irrigation-turn 1]
  ask farmer 20 [ setxy min-pxcor + 1 4 set irrigation-turn 2]
  ; and similarly for remaining farmers
  reset-ticks
end

to go
 irrigate
 tick
end

to irrigate
  ask turtles with [irrigation-turn = (ticks mod count farmers)]
  ; do whatever it is they do when it's their turn
  ask turtles with [irrigation-turn != (ticks mod count farmers)]
  ; do whatever it is they do when it's not their turn
end

Or if you want to keep a schedule (for example, because there are some weeks that don't fit a cycle), then construct one directly. For example, if you wanted week 3 of a 4 week cycle, you can simply do:

set irrigation-turn [ 0 0 1 0]

There are other techniques using reduce sentence n-values to do much longer lists, but I think your efficiency problem can be solved without them.