user3188146
user3188146

Reputation: 133

How do I create a timer on netlogo?

For my maze project, I want to create a monitor button that keeps track of how long it takes for the turtle to get from start to finish. How would I code for the timer?

Upvotes: 0

Views: 716

Answers (2)

Marzy
Marzy

Reputation: 1894

If you mean how many patches passed in moving to the target, you can use following:

turtles-own [target move-counter]

 to Your-Move-Function
      let t target 
      face min-one-of all-possible-moves [distance t]
      fd 1
      set move-counter move-counter + 1
    end

Upvotes: 1

StephenGuerin
StephenGuerin

Reputation: 871

Check out reset-timer and timer and in the docs. During maze setup, do a reset-timer. During the running of maze you can check on elapsed time with timer

Upvotes: 2

Related Questions