|
Calculating per hour statistics
Hey all,
Ive got a relatively simple question, and i understand why it doesnt work, but i was wondering if anyone had any suggestions or ideas on how to get it to work.
I am creating a discrete event simulator that takes customers, adds them to a wait line, and then to a teller if the teller is not busy.
I am supposed to return statistics as customers leave, such as wait time, completion time and **Average wait per hour** that means that for every hour, i need to calculate what the current average wait time is.
My code for average wait per hour:
public int averageWaitPerHour(){
double a = 0;
a = Clock.currentTime();
if(a % 60 == 0)
System.out.println("Running average: " + averageTime());
}
the error i am getting is that im referenceing a non static method from a static context, which i understand, i cannot assign variable a to Clock.currentTime().
I was just wondering if anyone had any suggestions on how i could return this with a non-static variable.
Thanks
|