Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 2db0ce5446
Fetching contributors…

Cannot retrieve contributors at this time

34 lines (30 sloc) 1.16 kb
#include "internlib.h"
#include "extern.h"
#include "passenger.h"
using namespace std;
void Print() {
cout << "Number of elevator: " << nElevator << endl
<< "Total Passenger: " << Passenger::Total() << endl
<< "Average waiting time: " << Passenger::AverWaitTime() << endl
<< "Maximum waiting time: " << Passenger::MaxWaitTime() << endl
<< "Average duration: " << Passenger::AverDuration() << endl
<< "Maximum duration: " << Passenger::MaxDuration() << endl
<< "Minimum duration: " << Passenger::MinDuration() << endl
<< "Average Throughput: " << Elevator::AverThrput() << " pass/hour" << endl << endl;
cout << " Floor Passenger ";
for(int i = 0; i < nElevator; i++) {
cout << "elevator" << i << " ";
}
cout << endl;
for(int i = 0; i < K; i++) {
printf(" %2d %2d ", i+1, floors[i].Get_nPassenger());
FcfsEleIter iter;
for(iter = elevators.begin(); iter != elevators.end(); iter++) {
if(iter->Get_pos() == i)
printf(" [%2d]%c ", iter->Get_nPassenger(), iter->Get_dir());
else
printf(" ");
}
printf("\n");
}
}
Jump to Line
Something went wrong with that request. Please try again.