netlogo - Creating multiple plots on the same Graph? -


in code have variable called hops owned breed ants.

             ants-own              [                 hops                 distance-gone                 distance-to-go                 target-node                 current-node             ] 

i want plot hops against time ( ie when takes 1st hop , plots 1 against time n likewise) each ant. in doing so, should have n number of graph lines on same plot n number of ants).

i implemented using following code snippet, getting 1 line of graph.

     do-plot        set-current-plot "hop count"       let 0       ask ants         [          set-current-plot-pen (word who)          set-plot-pen-color + 15          plot  hops          ]       end 

it better if different ants graph gets plotted in diffrent color.

at setup, need create plot pen each ant using create-temporary-plot-pen (word who). doing this?

also, don't think color line going turn out how want it. in netlogo, main colors 5, 15, 25, 35, , forth. other numbers shades of colors. when i'm doing this, 10 * ( mod 14 ) + 5. there 14 different colors, who mod 14 keeps color number in range. can repeated colors way, it's not bad.


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -