fp-elevators
SatisfactionIndex.cpp
Overview
SatisfactionIndex
is a class declared in SatisfactionIndex.h
. The sole purpose of this class is to maintain data about how the elevators are performing throughout gameplay.
The entirety of this class has been implemented for you.
Satisfaction Benchmarks
sumIndex
keeps track of people’s satisfactionsumUpRequest
keeps track of the total up requests satisfiedsumDownRequest
keeps tracks of the total down requests satisfiedsumExploded
keeps track of exploded peoplesumIdle
keeps tracks of all idle elevators throughout gameplay
Note that “good” performance means trying to maximize
sumIndex
,sumUpRequest
, andsumDownRequest
, while trying to minimizesumExploded
andsumIdle
.
One function in particular will be important to you: SatisfactionIndex::printRawSatisfaction
This function will print the raw satisfactions scores in the same order as the list above. This function has also been overloaded for you with the << operator
. This provides useful functionality such as:
SatisfactionIndex benchmarks;
cout << "Result:" << endl;
cout << benchmarks << endl;
// Output:
Result:
0
0
0
0
0