You're really close. count
counts the number of agents in an agent set. Since success
and total
are just numbers, you don't want that. The basic expression you're looking for is 100 * success / total
. Next, there's actually no need for the percentage
global variable. Instead, you can just make a reporter:
to-report percent-success
report 100 * success / total
end
Then, in the monitor's "reporter" field, you'd just put percent-success
. This field can actually even take reporter expressions, so you could put 100 * success / total
straight in there, though using the reporter procedure above is a bit cleaner. Also, you're probably going to want to set the "Decimal places" field to something smaller.