pieca
pieca

Reputation: 2563

Update some plots in NetLogo

Is it possible to have plots that are updated at different time points?

My model looks like that (it is replicator dynamics):

to go
  repeat 10 [do-something]
  replicate
  tick
end

Then I would like to have one plot that is updated on tick, just like usual, and the second one that is updated at do-something and then reset at tick.

I tried to find a solution in documentation but update-plots command updates ALL plots which is not what i want.

Upvotes: 2

Views: 578

Answers (1)

JenB
JenB

Reputation: 17678

You can use the various manual plotting commands (eg plotxy, plot-pen-down, plot-pen-up) to explicitly plot things, see the plotting section of the user manual, but is often simpler to have the plot commands in the plot rather than the code.

To do it in the plot instead of code, you could change to a structure like this (if your full code is suitable):

to go
  do-something
  if ticks mod 10 = 0 [ replicate ]
  tick
end

and use the automatic update of plots with tick. You would also use the if ticks mod 10 = 0 trick in the update section of your plot.

Upvotes: 2

Related Questions