|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectm865.simulation.Statistician
public class Statistician
This is a Statistician class which performs all the necessary calculations based on the inputs taken from the passengers and and presents to the departmentStore a report on the day's events.
Field Summary | |
---|---|
protected double |
longestTravel
|
protected double |
longestWait
|
protected int |
numberBalked
|
protected double |
overallAvgTravelSum
|
protected double |
overallAvgWaitSum
|
protected int |
passengerCount
|
Constructor Summary | |
---|---|
Statistician()
Default constructor for the statistician class |
Method Summary | |
---|---|
double |
average(double sum,
int count)
This method calculates the average time |
void |
extremeValues(double travel1,
double travel2,
double travel3,
double wait1,
double wait2,
double wait3)
This method determines the longest wait and travel time encountered by a shopper |
void |
generateReport()
This method generates the report. |
static void |
main(java.lang.String[] args)
Statistician Main method |
protected void |
recordPassengerInfo(Passenger passenger)
This method receives the information from the each of the passengers and updates the number of passengers, the number of balking passengers, sum of the transit times, sum of the waiting times, etc. |
java.lang.String |
toString()
toString method |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int passengerCount
protected int numberBalked
protected double overallAvgWaitSum
protected double overallAvgTravelSum
protected double longestWait
protected double longestTravel
Constructor Detail |
---|
public Statistician()
Method Detail |
---|
protected void recordPassengerInfo(Passenger passenger)
passenger
- The passengerpublic double average(double sum, int count)
double
- totalTimeTraveledint
- numerOfTimesTraveledpublic void extremeValues(double travel1, double travel2, double travel3, double wait1, double wait2, double wait3)
double
- travel1 travel2 travel3double
- wait1 wait2 wait3public void generateReport()
public java.lang.String toString()
toString
in class java.lang.Object
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |