Ullsokk
Ullsokk

Reputation: 717

Netlogo how does time relate to ticks?

I noticed that my tick counter does not show the same as the time in my plots. It seems 1 tick is roughly equal to 2 units of time on my graphs.

I would have thought that the time in plots was related to ticks, but this doesnt seem to be the case.

How does these two relate?

Upvotes: 2

Views: 359

Answers (2)

Seth Tisue
Seth Tisue

Reputation: 30508

If you want absolute control over both coordinates of the points you are plotting, use plotxy instead of plot.

If you just use plot, then the x coordinate just ends up being "how many times I've called plot". If you always call plot exactly once per tick, that will equal the number of ticks.

Perhaps you are, without realizing it, calling plot either more or less frequently than that...? Note that it's possible (and recommended) to have all of your plotting code inside plots, but you might also (or instead) have plotting code in the Code tab.

Upvotes: 2

Marzy
Marzy

Reputation: 1894

If you can tell us more about how you define your time unit in your graph we might be able to help you more, but as far as I know a tick 's length is all dependent on computation and its the time taken to iterate through your Go (or whenever you defined tick from start to end once! )

But you can use timer for measuring time taken after resetting timer in milliseconds : http://ccl.northwestern.edu/netlogo/docs/dict/timer.html

In your problem, I think it's better to check interval in your plot, if it's anything other than 1 it means it does not update your plot every tick ,enter image description here

Upvotes: 1

Related Questions