Print expects a reporter, by which NetLogo means that Print expects to
be followed by anything that reports a value, in other words, an
expression.
print "hello" ;; print the string "hello"
print heading ;; print the turtle's heading (assumes a turtle is
running this line
print count turtles ;; print the total number of turtles
You can always *ask* the fisherman to print things, like a variable.
You can also add a plot to the view and plot values on it.
For example:
;; assumes breed [ fishermen fisherman ]
;; assumes fishermen-own [ energy ]
ask fishermen
[ print energy ;; prints value of energy in the command center ]
output-print energy ;; prints value of energy in the output control,
or command center
plot energy ;; adds a mark for the value of energy to the current
plot (error if no plot)
]
If you want the observer to plot the total value of all fishermen's energy:
plot sum [ energy ] of fishermen ;; version 4.x syntax
plot sum values-from fishermen [ energy ] ;; version 3.x syntax
;; to break it down...
plot ;;; place in the plot a mark for
sum ;; the sum of the list
[ energy ] ;; made of the values of the energy variable
of fishermen ;; from all the fishermen
Hope this helps!
~~James
On Wed, Mar 12, 2008 at 5:25 AM, amarlantes < amarlantes%40yahoo.com">amarlantes
yahoo.com> wrote:
> Hey All! I have a program where a fisherman is collecting fish in a
> lake. He catches different breeds of turtles and gains energy from
> doing so. I want to plot his energy, but I can't figure out how to
> "show" "display" or "count" things that turtles own. Any ideas? How
> do I code for it. I've tried "energy of fisherman" and things like
> that but it expects a reporter. Any help would be much appreciated!
>
.