#include <cstdlib>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <queue>
|
| struct | Event |
| | This holds the information needed for an arrival or departure event. More...
|
| |
| struct | EventList |
| | holds arrival and departure events that haven't yet arrived at the bank More...
|
| |
Shorthand for how we represent the customers who have queued up at the bank.
| bool operator< |
( |
const Event & |
e0, |
|
|
const Event & |
e1 |
|
) |
| |
Less-than operator for Events.
This is somewhat counter-intuitive, since the first element of a priority_queue is the greatest element, rather than the smallest element.
- Parameters
-
- Returns
- true iff the arrival time for
e0 is later than that of e1
| istream& operator>> |
( |
istream & |
is, |
|
|
Event & |
e |
|
) |
| |
Input stream extraction operator for Events.
- Parameters
-
| is | the input stream |
| e | the Event to be extracted from is |
- Returns
- the "new"
is
process an arrival event
- Parameters
-
| e | the event |
| epq | the event list |
| bq | the queue of customers who are actually in line |
| tellerAvailable | is a teller available? |
process a departure event
- Parameters
-
| e | the event |
| epq | the event list |
| bq | the queue of customers who are actually in line |
| tellerAvailable | is a teller available? |
- Returns
- the waiting time for this departure Event